code-documentation · aj-geddes — скилл для Claude Code: JSDoc, докстринги
Скилл для написания документации прямо в коде: JSDoc, Python-докстринги, JavaDoc, комментарии и описания API. Пригодится, когда нужно задокументировать функции и классы, а не переписывать их вслепую.
npx skills add aj-geddes/useful-ai-prompts --skill code-documentation -a claude-codeЧто делает code-documentation
Скилл задаёт агенту стандарты оформления кода на разных языках. Он покрывает документацию функций и классов, JSDoc для JavaScript и TypeScript, Python-докстринги, JavaDoc, встроенные комментарии, описания типов и примеры использования внутри кода. Внутри — краткий стартовый пример на JavaScript и каталог references/ с подробными разборами: документация функций, классов, типов и модулей.
Правила простые и по делу. Документируй публичные API, добавляй примеры вызова, описывай параметры, возвращаемые значения и исключения. Комментарий объясняет «почему», а не «что» — очевидное писать не надо. Отдельно оговорено, чего делать нельзя: оставлять закомментированный код, писать вводящие в заблуждение комментарии, забывать обновить описание после правки кода.
Скилл ставится в шесть платформ, но структура файлов у каждой своя: в Claude это ~/.claude/skills/code-documentation/SKILL.md, в Cursor — .cursor/skills/code-documentation/SKILL.md. Если проект уже живёт на своём стиле комментариев, скилл будет тянуть код к описанным стандартам — это повод проверить, совпадают ли они.
Какие задачи решает
- задокументировать публичные функции и классы по стандарту языка
- написать JSDoc для модуля на JavaScript или TypeScript
- оформить Python-докстринги с параметрами и исключениями
- добавить примеры вызова к сложной функции
- описать типы и модуль целиком, а не отдельную функцию
Примеры запросов агенту
- задокументируй функции в
src/utils/price.jsпо стандарту JSDoc - добавь докстринги к классу в
models/user.pyс примерами вызова - пройдись по модулю и допиши комментарии там, где логика неочевидна
Как установить code-documentation
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill code-documentation -a claude-code2Вручную: положить файлы
~/.claude/skills/code-documentation/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/code-documentation/
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill code-documentation -a codex2Вручную: положить файлы
.agents/skills/code-documentation/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill code-documentation -a cursor2Вручную: положить файлы
.cursor/skills/code-documentation/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts code-documentation2Вручную: положить файлы
.github/skills/code-documentation/SKILL.md1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill code-documentation -a gemini-cli2Командой платформы
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/code-documentationВручную: положить файлы
.devin/skills/code-documentation/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill code-documentation -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о code-documentation
Как установить code-documentation в Claude?
Выполните npx skills add aj-geddes/useful-ai-prompts --skill code-documentation -a claude-code. Скилл окажется в ~/.claude/skills/code-documentation/SKILL.md.
Что делает code-documentation?
Помогает агенту писать документацию в коде: JSDoc, Python-докстринги, JavaDoc, встроенные комментарии и описания API. Опирается на стандарты конкретного языка.
Для каких языков подходит скилл?
В примерах и справочниках разобраны JavaScript и TypeScript через JSDoc, Python через докстринги и Java через JavaDoc. Общие правила про параметры, исключения и примеры применимы и к другим языкам.
Исходный текст
SKILL.md · MIT
---
name: code-documentation
description: >
Write comprehensive code documentation including JSDoc, Python docstrings,
inline comments, function documentation, and API comments. Use when
documenting code, writing docstrings, or creating inline documentation.
---
# Code Documentation
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Create clear, comprehensive code documentation using language-specific standards like JSDoc, Python docstrings, JavaDoc, and inline comments.
## When to Use
- Function and class documentation
- JSDoc for JavaScript/TypeScript
- Python docstrings
- JavaDoc for Java
- Inline code comments
- API documentation from code
- Type definitions
- Usage examples in code
## Quick Start
Minimal working example:
```javascript
/**
* Calculates the total price including tax and discount.
*
* @param {number} basePrice - The base price before tax and discount
* @param {number} taxRate - Tax rate as a decimal (e.g., 0.08 for 8%)
* @param {number} [discount=0] - Optional discount amount
* @returns {number} The final price after tax and discount
* @throws {Error} If basePrice or taxRate is negative
*
* @example
* const price = calculateTotalPrice(100, 0.08, 10);
* console.log(price); // 98
*
* @example
* // Without discount
* const price = calculateTotalPrice(100, 0.08);
* console.log(price); // 108
*/
function calculateTotalPrice(basePrice, taxRate, discount = 0) {
if (basePrice < 0 || taxRate < 0) {
throw new Error("Price and tax rate must be non-negative");
}
return basePrice * (1 + taxRate) - discount;
}
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [Function Documentation](references/function-documentation.md) | Function Documentation |
| [Class Documentation](references/class-documentation.md) | Class Documentation |
| [Type Definitions](references/type-definitions.md) | Type Definitions |
| [Function Documentation](references/function-documentation-2.md) | Function Documentation |
| [Class Documentation](references/class-documentation-2.md) | Class Documentation |
| [Module Documentation](references/module-documentation.md) | Module Documentation |
## Best Practices
### ✅ DO
- Document public APIs thoroughly
- Include usage examples
- Document parameters and return values
- Specify thrown exceptions/errors
- Use language-specific standards (JSDoc, docstrings, etc.)
- Keep comments up-to-date
- Document "why" not "what"
- Include edge cases and gotchas
- Add links to related functions
- Document type definitions
- Use consistent formatting
### ❌ DON'T
- State the obvious in comments
- Leave commented-out code
- Write misleading comments
- Skip examples for complex functions
- Use vague parameter descriptions
- Forget to update docs when code changes
- Over-comment simple code
© aj-geddes · MIT · aj-geddes/useful-ai-prompts
Похожие скиллы
Всё по теме «Тексты и документация» →Сначала — code-documentation от других авторов.