Document
Add documentation comments to the current file or function.
What happens when you install it
You run the install command
mcp install-skill documentMCPHub CLI downloads this prompt from the registry.
Saved as a file in Claude Code
~/.claude/commands/document.mdClaude Code reads all .md files in this folder as slash commands.
Use it in any conversation
/documentin Claude Code (after restart)Claude runs the prompt against your current file or selection — no copy-paste needed.
Content
Document
Add documentation to the selected code. Documentation should reduce the time a new developer needs to understand the code.
Format
Use the documentation standard for the language:
- TypeScript/JavaScript — JSDoc (
/** */) - Python — docstrings (
""" """) - Go — godoc comments (
// FunctionName ...) - Rust — doc comments (
///)
What to document
- All public functions, methods, and classes
- Non-obvious logic — explain the why, not the what
- Parameters: name, type, what it represents, constraints, default
- Return value: type and what it means
- Errors/exceptions thrown and when
- Side effects (mutations, I/O, network calls)
What not to document
- The obvious:
// increment ifori++ - Implementation details that can be read from the code
- Unstable internal state
Quality bar
Each doc comment should answer: "What do I need to know to use this correctly?"
Output
Return the original code with documentation added. Don't change any logic.
Install
After install, restart Claude Code and type:
/documentRequires MCPHub CLI
Author

MCPHub
github.com/sallyhellerLooking for Agents?
Agents run with a full system prompt and persistent behavior — not just a one-off command.
Browse agents →