/document
Generate focused documentation for components, functions, APIs, and features
> /plugin marketplace add Galaxy-Dawn/claude-scholar > /plugin install claude-scholar@claude-scholar
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/document
Context preview
What this command does when you run it.
Generate focused documentation for components, functions, APIs, and features
Command definition
document.mdname: document
description: "Generate focused documentation for components, functions, APIs, and features"
category: utility
complexity: basic
mcp-servers: []
personas: []
/sc:document - Focused Documentation Generation
Triggers
- Documentation requests for specific components, functions, or features
- API documentation and reference material generation needs
- Code comment and inline documentation requirements
- User guide and technical documentation creation requests
Usage
/sc:document [target] [--type inline|external|api|guide] [--style brief|detailed]
Behavioral Flow
1. **Analyze**: Examine target component structure, interfaces, and functionality 2. **Identify**: Determine documentation requirements and target audience context 3. **Generate**: Create appropriate documentation content based on type and style 4. **Format**: Apply consistent structure and organizational patterns 5. **Integrate**: Ensure compatibility with existing project documentation ecosystem
Key behaviors:
- Code structure analysis with API extraction and usage pattern identification
- Multi-format documentation generation (inline, external, API reference, guides)
- Consistent formatting and cross-reference integration
- Language-specific documentation patterns and conventions
Tool Coordination
- **Read**: Component analysis and existing documentation review
- **Grep**: Reference extraction and pattern identification
- **Write**: Documentation file creation with proper formatting
- **Glob**: Multi-file documentation projects and organization
Key Patterns
- **Inline Documentation**: Code analysis → JSDoc/docstring generation → inline comments
- **API Documentation**: Interface extraction → reference material → usage examples
- **User Guides**: Feature analysis → tutorial content → implementation guidance
- **External Docs**: Component overview → detailed specifications → integration instructions
Examples
Inline Code Documentation
/sc:document src/auth/login.js --type inline
# Generates JSDoc comments with parameter and return descriptions
# Adds comprehensive inline documentation for functions and classes
API Reference Generation
/sc:document src/api --type api --style detailed
# Creates comprehensive API documentation with endpoints and schemas
# Generates usage examples and integration guidelines
User Guide Creation
/sc:document payment-module --type guide --style brief
# Creates user-focused documentation with practical examples
# Focuses on implementation patterns and common use cases
Component Documentation
/sc:document components/ --type external
# Generates external documentation files for component library
# Includes props, usage examples, and integration patterns
Boundaries
**Will:**
- Generate focused documentation for specific components and features
- Create multiple documentation formats based on target audience needs
- Integrate with existing documentation ecosystems and maintain consistency
**Will Not:**
- Generate documentation without proper code analysis and context understanding
- Override existing documentation standards or project-specific conventions
- Create documentation that exposes sensitive implementation details
Read more
name: document description: "Generate focused documentation for components, functions, APIs, and features" category: utility complexity: basic mcp-servers: [] personas: []
/sc:document - Focused Documentation Generation
Triggers
- Documentation requests for specific components, functions, or features
- API documentation and reference material generation needs
- Code comment and inline documentation requirements
- User guide and technical documentation creation requests
Usage
/sc:document [target] [--type inline|external|api|guide] [--style brief|detailed]
Behavioral Flow
1. **Analyze**: Examine target component structure, interfaces, and functionality 2. **Identify**: Determine documentation requirements and target audience context 3. **Generate**: Create appropriate documentation content based on type and style 4. **Format**: Apply consistent structure and organizational patterns 5. **Integrate**: Ensure compatibility with existing project documentation ecosystem
Key behaviors:
- Code structure analysis with API extraction and usage pattern identification
- Multi-format documentation generation (inline, external, API reference, guides)
- Consistent formatting and cross-reference integration
- Language-specific documentation patterns and conventions
Tool Coordination
- **Read**: Component analysis and existing documentation review
- **Grep**: Reference extraction and pattern identification
- **Write**: Documentation file creation with proper formatting
- **Glob**: Multi-file documentation projects and organization
Key Patterns
- **Inline Documentation**: Code analysis → JSDoc/docstring generation → inline comments
- **API Documentation**: Interface extraction → reference material → usage examples
- **User Guides**: Feature analysis → tutorial content → implementation guidance
- **External Docs**: Component overview → detailed specifications → integration instructions
Examples
Inline Code Documentation
/sc:document src/auth/login.js --type inline # Generates JSDoc comments with parameter and return descriptions # Adds comprehensive inline documentation for functions and classes
API Reference Generation
/sc:document src/api --type api --style detailed # Creates comprehensive API documentation with endpoints and schemas # Generates usage examples and integration guidelines
User Guide Creation
/sc:document payment-module --type guide --style brief # Creates user-focused documentation with practical examples # Focuses on implementation patterns and common use cases
Component Documentation
/sc:document components/ --type external # Generates external documentation files for component library # Includes props, usage examples, and integration patterns
Boundaries
**Will:**
- Generate focused documentation for specific components and features
- Create multiple documentation formats based on target audience needs
- Integrate with existing documentation ecosystems and maintain consistency
**Will Not:**
- Generate documentation without proper code analysis and context understanding
- Override existing documentation standards or project-specific conventions
- Create documentation that exposes sensitive implementation details
Semi-automated research assistant for academic research and software development. Supports Claude Code, Codex CLI, Kimi Code CLI, and OpenCode across ideation, coding, experiments, writing, and publication.
Repo: Galaxy-Dawn/claude-scholar
Other commands on claude-scholar.
- /analyze-results
Optional experiment line slug for report naming
Open command - /build-fix
Incrementally fix Python type and lint errors:
Open command - /checkpoint
Create or verify a checkpoint in your workflow.
Open command - /code-review
Comprehensive security and quality review of uncommitted changes:
Open command - /commit
Commit changes following Conventional Commits format (local only, no push).
Open command - /create_project
使用本地模板 ~/Code/template 而非 GitHub(覆盖 template_repo)
Open command

