Files
SuperClaude/.claude/commands/document.md
NomenAK 219ff3905a feat: Optimize all 18 command files using @include reference system
Major streamlining achievement:
- Eliminate 2,733 lines of duplicate content across commands
- Reduce individual command files by ~70% (130-150 → 35-60 lines)
- Leverage existing shared/*.yml reference patterns
- Maintain full Claude Code compliance

Benefits:
• Single source of truth for universal content
• Guaranteed consistency across all commands
• Dramatically reduced maintenance overhead
• Massive token efficiency improvements

Implementation:
- Universal Legend: @include shared/universal-constants.yml#Universal Legend
- Universal Flags: @include shared/flag-inheritance.yml#Universal_Always
- Command patterns: References to appropriate shared/*.yml files
- Template system: Enhanced command-patterns.yml

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-24 22:46:52 +02:00

2.3 KiB

/document - Generate comprehensive documentation

Legend

@include shared/universal-constants.yml#Universal_Legend

Purpose

Generate comprehensive documentation for code, APIs, or systems specified in $ARGUMENTS with various output formats and styles.

Syntax

/document [flags] [target]

@include shared/flag-inheritance.yml#Universal_Always

Core Flags

--type flag:

  • api: API documentation (OpenAPI/Swagger)
  • code: Code documentation (JSDoc/docstrings)
  • readme: Project README files
  • architecture: System architecture docs
  • user: End-user documentation
  • dev: Developer guides

--format flag:

  • markdown: Markdown format (default)
  • html: HTML documentation
  • pdf: PDF output
  • docusaurus: Docusaurus compatible
  • mkdocs: MkDocs compatible

--style flag:

  • concise: Brief, essential information only
  • detailed: Comprehensive with examples
  • tutorial: Step-by-step guide format
  • reference: API reference style

Documentation Types

API Documentation:

  • OpenAPI 3.0 specification
  • Request/response examples
  • Authentication details
  • Error codes & handling
  • Rate limiting information

Code Documentation:

  • Function/method descriptions
  • Parameter & return types
  • Usage examples
  • Edge cases & limitations
  • Related functions

Architecture Documentation:

  • System overview diagrams
  • Component interactions
  • Data flow documentation
  • Technology decisions
  • Scalability considerations

User Documentation:

  • Getting started guides
  • Feature explanations
  • Common use cases
  • Troubleshooting guides
  • FAQ sections

Best Practices

Structure:

  • Clear hierarchy & navigation
  • Consistent formatting
  • Search-friendly content
  • Version-specific docs
  • Cross-references

Content:

  • Examples for everything
  • Progressive disclosure
  • Visual aids when helpful
  • Keep updated with code
  • Test documentation

@include shared/docs-patterns.yml#Documentation_Standards

Examples

# Generate API documentation
/document --type api --format openapi

# Create comprehensive README
/document --type readme --style detailed

# Architecture documentation with diagrams
/document --type architecture --think

# User guide with tutorials
/document --type user --style tutorial

Deliverables

  • Documentation files in specified format
  • Table of contents & navigation
  • Code examples & snippets
  • Diagrams & visual aids
  • Search index if applicable