mirror of
https://github.com/SuperClaude-Org/SuperClaude_Framework.git
synced 2025-12-29 16:16:08 +00:00
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>
This commit is contained in:
@@ -1,38 +1,7 @@
|
||||
# /document - Generate comprehensive documentation
|
||||
|
||||
## Legend
|
||||
| Symbol | Meaning | | Abbrev | Meaning |
|
||||
|--------|---------|---|--------|---------|
|
||||
| → | leads to | | cfg | configuration |
|
||||
| & | and/with | | impl | implementation |
|
||||
| w/ | with | | perf | performance |
|
||||
| @ | at/located | | ops | operations |
|
||||
| > | greater than | | val | validation |
|
||||
| ∀ | for all/every | | req | requirements |
|
||||
| ∃ | exists/there is | | deps | dependencies |
|
||||
| ∴ | therefore | | env | environment |
|
||||
| ∵ | because | | db | database |
|
||||
| ≡ | equivalent | | api | interface |
|
||||
| ≈ | approximately | | docs | documentation |
|
||||
| 📁 | directory/path | | std | standard |
|
||||
| 🔢 | number/count | | def | default |
|
||||
| 📝 | text/string | | ctx | context |
|
||||
| ⚙ | setting/config | | err | error |
|
||||
| 🎛 | control/flags | | exec | execution |
|
||||
| 🔧 | configuration | | qual | quality |
|
||||
| 📋 | group/category | | rec | recovery |
|
||||
| 🚨 | critical/urgent | | sev | severity |
|
||||
| ⚠ | warning/caution | | resp | response |
|
||||
| 🔄 | retry/recovery | | esc | escalation |
|
||||
| ✅ | success/fixed | | tok | token |
|
||||
| ❌ | failure/error | | opt | optimization |
|
||||
| ℹ | information | | UX | user experience |
|
||||
| ⚡ | fast/quick | | UI | user interface |
|
||||
| 🐌 | slow/delayed | | C | critical |
|
||||
| ✨ | complete/done | | H | high |
|
||||
| 📖 | read operation | | M | medium |
|
||||
| ✏ | edit operation | | L | low |
|
||||
| 🗑 | delete operation | | |
|
||||
@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.
|
||||
@@ -40,187 +9,99 @@ Generate comprehensive documentation for code, APIs, or systems specified in $AR
|
||||
## Syntax
|
||||
`/document [flags] [target]`
|
||||
|
||||
## Universal Flags
|
||||
--plan: "Show execution plan before running"
|
||||
--uc: "UltraCompressed mode (~70% token reduction)"
|
||||
--ultracompressed: "Alias for --uc"
|
||||
--think: "Multi-file analysis w/ context (4K tokens)"
|
||||
--think-hard: "Deep architectural analysis (10K tokens)"
|
||||
--ultrathink: "Critical system redesign (32K tokens)"
|
||||
--c7: "Enable Context7→library documentation lookup"
|
||||
--seq: "Enable Sequential→complex analysis & thinking"
|
||||
--magic: "Enable Magic→UI component generation"
|
||||
--pup: "Enable Puppeteer→browser automation & testing"
|
||||
--all-mcp: "Enable all MCP servers"
|
||||
--no-mcp: "Disable all MCP servers (native tools only)"
|
||||
--no-c7: "Disable Context7 specifically"
|
||||
--no-seq: "Disable Sequential thinking specifically"
|
||||
--no-magic: "Disable Magic UI builder specifically"
|
||||
--no-pup: "Disable Puppeteer specifically"
|
||||
@include shared/flag-inheritance.yml#Universal_Always
|
||||
|
||||
## Command-Specific Flags
|
||||
## Core Flags
|
||||
|
||||
**Documentation Types:**
|
||||
- `--api`: Generate API documentation with endpoints, schemas, examples
|
||||
- `--user`: Create user-friendly guides with tutorials and walkthroughs
|
||||
- `--architecture`: System design documentation with diagrams
|
||||
- `--developer`: Developer guides with setup and implementation details
|
||||
- `--readme`: Project README with overview and quick start
|
||||
--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
|
||||
|
||||
**Output Format:**
|
||||
- `--visual`: Include diagrams, flowcharts, and visual aids
|
||||
- `--examples`: Generate practical code examples and snippets
|
||||
- `--interactive`: Create interactive documentation with live examples
|
||||
--format flag:
|
||||
- markdown: Markdown format (default)
|
||||
- html: HTML documentation
|
||||
- pdf: PDF output
|
||||
- docusaurus: Docusaurus compatible
|
||||
- mkdocs: MkDocs compatible
|
||||
|
||||
**Content Depth:**
|
||||
- `--depth`: Explanation depth (basic|intermediate|advanced|expert)
|
||||
- `--complete`: Comprehensive documentation covering all aspects
|
||||
- `--quick`: Essential documentation for rapid reference
|
||||
--style flag:
|
||||
- concise: Brief, essential information only
|
||||
- detailed: Comprehensive with examples
|
||||
- tutorial: Step-by-step guide format
|
||||
- reference: API reference style
|
||||
|
||||
## Documentation Types
|
||||
|
||||
**README Documentation:**
|
||||
- Project overview and purpose
|
||||
- Installation instructions and requirements
|
||||
- Quick start guide with examples
|
||||
- Configuration options and environment setup
|
||||
- Basic usage examples
|
||||
- Contributing guidelines and standards
|
||||
API Documentation:
|
||||
- OpenAPI 3.0 specification
|
||||
- Request/response examples
|
||||
- Authentication details
|
||||
- Error codes & handling
|
||||
- Rate limiting information
|
||||
|
||||
**API Documentation:**
|
||||
- Complete endpoint descriptions
|
||||
- HTTP methods and status codes
|
||||
- Request/response schemas with validation
|
||||
- Authentication and authorization methods
|
||||
- Rate limiting and quota information
|
||||
- Code examples in multiple languages
|
||||
- Error handling and troubleshooting
|
||||
Code Documentation:
|
||||
- Function/method descriptions
|
||||
- Parameter & return types
|
||||
- Usage examples
|
||||
- Edge cases & limitations
|
||||
- Related functions
|
||||
|
||||
**Architecture Documentation:**
|
||||
- System design overview and principles
|
||||
- Component relationships and dependencies
|
||||
- Data flow diagrams and sequence charts
|
||||
- Technology choices and rationale
|
||||
- Scalability considerations and patterns
|
||||
- Security architecture and threat model
|
||||
Architecture Documentation:
|
||||
- System overview diagrams
|
||||
- Component interactions
|
||||
- Data flow documentation
|
||||
- Technology decisions
|
||||
- Scalability considerations
|
||||
|
||||
**User Guides:**
|
||||
- Getting started tutorials
|
||||
- Feature walkthroughs with screenshots
|
||||
- Best practices and common patterns
|
||||
- Integration guides and examples
|
||||
- Migration guides and upgrade paths
|
||||
- FAQ and troubleshooting sections
|
||||
User Documentation:
|
||||
- Getting started guides
|
||||
- Feature explanations
|
||||
- Common use cases
|
||||
- Troubleshooting guides
|
||||
- FAQ sections
|
||||
|
||||
**Developer Documentation:**
|
||||
- Codebase structure and organization
|
||||
- Development environment setup
|
||||
- Testing guidelines and frameworks
|
||||
- Deployment processes and CI/CD
|
||||
- Debugging tips and tools
|
||||
- Performance optimization techniques
|
||||
## 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
|
||||
- `/document --api --examples --c7` → API docs with framework examples
|
||||
- `/document --user --visual --interactive` → Interactive user guides
|
||||
- `/document --architecture --complete --seq` → Comprehensive system docs
|
||||
- `/document --developer --depth advanced` → Advanced developer guides
|
||||
- `/document --readme --quick --uc` → Concise project README
|
||||
|
||||
## Documentation Standards
|
||||
```bash
|
||||
# Generate API documentation
|
||||
/document --type api --format openapi
|
||||
|
||||
**Content Quality:**
|
||||
- Use clear, concise language appropriate for audience
|
||||
- Include practical, tested examples
|
||||
- Add visual aids where helpful
|
||||
- Keep information current and accurate
|
||||
- Make content searchable and navigable
|
||||
- Version documentation with code changes
|
||||
# Create comprehensive README
|
||||
/document --type readme --style detailed
|
||||
|
||||
**Structure Guidelines:**
|
||||
- Logical organization with clear hierarchy
|
||||
- Progressive disclosure of complexity
|
||||
- Cross-references between related topics
|
||||
- Glossary for technical terms
|
||||
- Index for quick reference
|
||||
- Changelog maintenance
|
||||
# Architecture documentation with diagrams
|
||||
/document --type architecture --think
|
||||
|
||||
**UltraCompressed Mode (--uc):**
|
||||
- Apply token reduction rules (~70% savings)
|
||||
- Generate symbol/abbreviation legend
|
||||
- Use telegram-style formatting
|
||||
- Structure: YAML > tables > lists > prose
|
||||
- Compress headers and sentences
|
||||
- Focus on essential information only
|
||||
# User guide with tutorials
|
||||
/document --type user --style tutorial
|
||||
```
|
||||
|
||||
## Deliverables
|
||||
- **Documentation Files**: Complete docs in specified format
|
||||
- **Code Examples**: Working, tested code snippets
|
||||
- **Visual Aids**: Diagrams, charts, and illustrations
|
||||
- **Index Files**: Navigation and cross-reference guides
|
||||
- **Templates**: Reusable documentation templates
|
||||
|
||||
## Output Locations
|
||||
- **API Documentation**: `docs/api/`
|
||||
- **User Guides**: `docs/guides/`
|
||||
- **Architecture Docs**: `docs/architecture/`
|
||||
- **Developer Docs**: `docs/development/`
|
||||
- **README Files**: Project root and subdirectories
|
||||
- **Index**: `docs/index.md` with navigation links
|
||||
|
||||
## Research Requirements
|
||||
External_Library_Research:
|
||||
- Identify library/framework mentioned
|
||||
- Context7 lookup for official documentation
|
||||
- Verify API patterns and examples
|
||||
- Check version compatibility
|
||||
- Document findings in implementation
|
||||
Pattern_Research:
|
||||
- Search existing codebase for similar patterns
|
||||
- Magic component search if UI-related
|
||||
- WebSearch for official documentation
|
||||
- Validate approach with Sequential thinking
|
||||
- Document pattern choice rationale
|
||||
API_Integration_Research:
|
||||
- Official documentation lookup
|
||||
- Authentication requirements
|
||||
- Rate limiting and error handling
|
||||
- SDK availability and examples
|
||||
- Integration testing approach
|
||||
|
||||
## Report Notifications
|
||||
📄 Analysis report saved to: {path}
|
||||
📊 Metrics updated: {path}
|
||||
📋 Summary saved to: {path}
|
||||
💾 Checkpoint created: {path}
|
||||
📚 Documentation created: {path}
|
||||
📁 Created directory: {path}
|
||||
✅ {operation} completed successfully
|
||||
❌ {operation} failed: {reason}
|
||||
⚠ {operation} completed w/ warnings
|
||||
|
||||
## Integration & Best Practices
|
||||
|
||||
**Quality Assurance:**
|
||||
- Test all code examples
|
||||
- Verify links and references
|
||||
- Review for clarity and accuracy
|
||||
- Validate against actual implementation
|
||||
|
||||
**Maintenance Strategy:**
|
||||
- Update with code changes
|
||||
- Regular review and refresh
|
||||
- User feedback integration
|
||||
- Version control alignment
|
||||
|
||||
## Troubleshooting
|
||||
- **Large Codebases**: Use `--depth` to control scope
|
||||
- **Complex APIs**: Combine `--api --examples --c7` for comprehensive docs
|
||||
- **Technical Concepts**: Use `--visual --examples` for clarity
|
||||
- **Token Limits**: Apply `--uc` for compressed documentation
|
||||
|
||||
## Success Messages
|
||||
✅ {operation} completed successfully
|
||||
📝 Created: {file_path}
|
||||
✏ Updated: {file_path}
|
||||
✨ Task completed: {task_title}
|
||||
- Documentation files in specified format
|
||||
- Table of contents & navigation
|
||||
- Code examples & snippets
|
||||
- Diagrams & visual aids
|
||||
- Search index if applicable
|
||||
Reference in New Issue
Block a user