Agent skill
document
Use when the user wants to add documentation, JSDoc, docstrings, or API docs to existing code.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/document-huzaifa525-claude-code-optimize
SKILL.md
Document: $ARGUMENTS
Steps
-
Detect the language and doc style
- Check existing docs in the codebase for style
- TypeScript/JavaScript → JSDoc or TSDoc
- Python → Google-style docstrings
- Go → godoc comments
- Rust →
///doc comments - Match whatever style already exists
-
Read the code thoroughly — understand every function, class, and type
-
Add documentation for:
Element What to Document Functions Purpose, params, return value, throws, example Classes Purpose, usage pattern Interfaces/Types What it represents, field descriptions Constants Why this value Complex logic Step-by-step explanation Module/File Top-level description of what this file does -
Rules
- Document the WHY, not the WHAT (code already shows what)
- Keep descriptions concise — one line if possible
- Include
@examplefor non-obvious usage - Don't document getters/setters or trivial functions
- Match existing doc style in the codebase exactly
-
Verify — ensure no code was accidentally changed
git diff --stat
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?