--- description: Documentation review system help - usage guide and command reference allowed-tools: Bash(cat:*) --- # πŸ“š Documentation Review System - Help Guide **Version:** Phase 3 (Modular Architecture) **Last Updated:** 2025-10-24 --- ## 🎯 What Is This? The `/ck:doc-review` system is a **modular documentation update toolkit** that helps you: βœ… Keep documentation in sync with code changes βœ… Update README, CLAUDE.md, CHANGELOG consistently βœ… Maintain SDD (Specification-Driven Development) artifacts βœ… Validate documentation quality before commits βœ… Save 88% tokens compared to manual updates --- ## πŸ—οΈ Architecture Overview ```text β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ /ck:doc-review (Orchestrator) β”‚ β”‚ β€’ Analyzes changes β”‚ β”‚ β€’ Asks what to update β”‚ β”‚ β€’ Delegates to sub-commands β”‚ β”‚ β€’ Shows summary β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β” β–Ό β–Ό β–Ό β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ └─────────┐ β”‚:analyzeβ”‚ β”‚:coreβ”‚ β”‚:sddβ”‚ β”‚:qaβ”‚ β”‚:help β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ 0 editsβ”‚ β”‚3 filesβ”‚β”‚SDD β”‚ β”‚Checkβ”‚β”‚This!β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜ ``` --- ## πŸ“‹ Command Reference ### `/ck:doc-review/help` (This Command) **Purpose:** Show help and usage guide **Token Cost:** ~200 tokens (one-time) **Files Modified:** None **Use When:** First time using system, or need reminder --- ### `/ck:doc-review/analyze` **Purpose:** Analyze documentation needs without making changes **Token Cost:** ~600-800 tokens **Files Modified:** None **Execution Time:** < 1 second **What It Does:** - βœ… Detects project documentation principles - βœ… Analyzes current documentation structure - βœ… Identifies what needs updating (from git history) - βœ… Provides actionable recommendations - ❌ Makes zero changes **When to Use:** - "What docs need updating?" - Before starting documentation work - Quick health check - Understanding project doc structure **Example:** ```bash /ck:doc-review/analyze β†’ Output: - 61 .md files found - Recent changes: 5 files in src/ - Recommendations: Update README, CLAUDE, specs/005/ - Execution: 0.8s ``` --- ### `/ck:doc-review/core` **Purpose:** Update core documentation files **Token Cost:** ~1,200-1,500 tokens **Files Modified:** README.md, CLAUDE.md, CHANGELOG.md **Execution Time:** 15-30 seconds **What It Does:** - βœ… Updates README.md (features, usage, installation) - βœ… Updates CLAUDE.md (AI context, module docs) - βœ… Updates CHANGELOG.md (version entry) - βœ… Uses professional templates - βœ… Validates changes **When to Use:** - Just added a new feature - Need to document new API/module - Quick documentation update - Before sharing project **Example:** ```bash /ck:doc-review/core "ApstraWorkModule implementation" β†’ Updates: - README.md: Added usage examples - CLAUDE.md: Added module context - CHANGELOG.md: Created v1.2.0 entry - Time: 18s ``` **Templates Provided:** - README feature section - CLAUDE module documentation - CHANGELOG version entry --- ### `/ck:doc-review/sdd` **Purpose:** Update SDD (Specification-Driven Development) artifacts **Token Cost:** ~1,500-1,800 tokens **Files Modified:** specs/_/spec.md, plan.md, tasks.md, contracts/_.md **Execution Time:** 30-60 seconds **What It Does:** - βœ… Marks requirements (FR-\*) as completed in spec.md - βœ… Updates implementation plan and phase status in plan.md - βœ… Marks tasks complete and adds notes in tasks.md - βœ… Updates design contracts and API specs - βœ… Validates SDD ↔ code consistency **When to Use:** - Completed an implementation phase - Need to sync specs with code - Mark requirements as done - Document architecture decisions **Example:** ```bash /ck:doc-review/sdd "Phase 2 completion" β†’ Updates: - spec.md: Marked FR-005-1, FR-005-2 complete - plan.md: Phase 2 status = βœ… Completed - tasks.md: 15 tasks marked done - Consistency: 100% - Time: 42s ``` **SDD Consistency Checks:** - Requirements β†’ Implementation alignment - Plan β†’ Tasks alignment - Contracts β†’ Code alignment - Traceability validation --- ### `/ck:doc-review/qa` **Purpose:** Quality assurance - validate documentation **Token Cost:** ~1,800-2,000 tokens **Files Modified:** None **Execution Time:** 10-20 seconds **What It Does:** - βœ… Validates markdown links (finds broken links) - βœ… Checks file:line references (path/to/file.py:123) - βœ… Checks terminology consistency - βœ… Validates version number consistency - βœ… Checks SDD requirement traceability - βœ… Basic code example syntax validation - βœ… Completeness check (required sections) - βœ… Generates scored report (0-100) **When to Use:** - Before committing documentation changes - After major documentation updates - Find and fix broken links - Ensure documentation quality **Example:** ```bash /ck:doc-review/qa β†’ Results: - Valid links: 156 - Broken links: 3 - Version mismatches: 1 - Overall score: 87/100 - Time: 12s β†’ Recommendations: 1. Fix broken link in README.md:45 2. Update version in pyproject.toml ``` **QA Categories:** 1. Link Validation (20 points) 2. Cross-Reference Validation (15 points) 3. Terminology Consistency (15 points) 4. Version Consistency (15 points) 5. SDD Consistency (15 points) 6. Code Example Quality (10 points) 7. Completeness (10 points) --- ### `/ck:doc-review` (Main Orchestrator) **Purpose:** Smart orchestration - analyze and delegate **Token Cost:** ~900-1,200 tokens (orchestrator only) + selected sub-commands **Files Modified:** Depends on user selection **Execution Time:** Variable (depends on selection) **What It Does:** - βœ… Runs comprehensive analysis (via doc-analyzer.sh) - βœ… Shows analysis summary - βœ… Asks user which areas to update - βœ… Invokes selected sub-commands automatically - βœ… Aggregates and shows summary **When to Use:** - Not sure what needs updating - Want guided workflow - Comprehensive documentation update - First time using the system **Example:** ```bash /ck:doc-review "feature 005 implementation" β†’ Analysis shown (principles, structure, changes, metrics) β†’ User asked: Which areas to update? β–‘ Core Files (README, CLAUDE, CHANGELOG) β–‘ SDD Artifacts (spec, plan, tasks) β–‘ Run QA Only β–‘ Full Update β†’ User selects "Full Update" β†’ Executes: 1. /ck:doc-review/core "feature 005" 2. /ck:doc-review/sdd "feature 005" 3. /ck:doc-review/qa β†’ Aggregated summary: - 8 files updated - QA score: 92/100 - Total time: 78s ``` --- ## πŸŽ“ Usage Patterns ### Pattern 1: Quick README Update (Most Common) ```bash # Scenario: Added new feature, need docs /ck:doc-review/core "new feature name" # Time: 20s # Token: 1.2K # Updates: README, CLAUDE, CHANGELOG ``` ### Pattern 2: Analysis First (Recommended for New Users) ```bash # Step 1: Understand what needs updating /ck:doc-review/analyze # Step 2: Update based on recommendations /ck:doc-review/core "feature X" # Time: 1s + 20s = 21s # Tokens: 600 + 1.2K = 1.8K ``` ### Pattern 3: Full Update After Major Work ```bash # Completed major implementation /ck:doc-review "Phase 2 complete" β†’ Select "Full Update" β†’ All docs updated + QA validated # Time: 60-90s # Tokens: 3-4K # Updates: Everything ``` ### Pattern 4: QA Before Commit (Best Practice) ```bash # Before git commit /ck:doc-review/qa β†’ Fix any issues found β†’ Re-run QA β†’ Commit with confidence # Time: 10-15s per run # Tokens: 1.8K ``` ### Pattern 5: SDD Update After Phase ```bash # Completed implementation phase /ck:doc-review/sdd "Phase 2" # Time: 40-50s # Tokens: 1.5K # Updates: All SDD artifacts ``` --- ## πŸ—‚οΈ File Structure Reference ### Command Files Location ```text ~/.claude/commands/ck/ β”œβ”€β”€ doc-review.md # Main orchestrator β”œβ”€β”€ doc-review:analyze.md # Analysis only β”œβ”€β”€ doc-review:core.md # Core files update β”œβ”€β”€ doc-review:sdd.md # SDD artifacts update β”œβ”€β”€ doc-review:qa.md # Quality validation β”œβ”€β”€ doc-review:help.md # This help file └── doc-categories.json # Pattern configuration ``` ### Supporting Tools ```text ~/.claude/tools/ └── doc-analyzer.sh # External analysis script β”œβ”€β”€ principles # Extract doc principles β”œβ”€β”€ structure # Analyze doc structure β”œβ”€β”€ categorize # Categorize files β”œβ”€β”€ impact # Assess change impact β”œβ”€β”€ metrics # Generate metrics └── all # Run all analyses ``` ### Documentation ```text docs/ β”œβ”€β”€ ck-doc-review-analysis.md # Architecture analysis β”œβ”€β”€ ck-doc-review-phase1-improvements.md # Phase 1 docs β”œβ”€β”€ ck-doc-review-phase2-improvements.md # Phase 2 docs └── ck-doc-review-phase3-improvements.md # Phase 3 docs (current) ``` --- ## πŸ“Š Token Budgeting ### Per-Command Token Costs | Command | Tokens | Use Case | | ------------ | ------------------------ | ------------------ | | `:help` | ~200 | One-time reference | | `:analyze` | ~600-800 | Analysis only | | `:core` | ~1.2-1.5K | Quick update | | `:sdd` | ~1.5-1.8K | SDD update | | `:qa` | ~1.8-2K | Quality check | | `doc-review` | ~900-1.2K + sub-commands | Full orchestration | ### Monthly Token Budget Examples **Light Usage (10 updates/month):** ```plaintext 10x :core updates: 12-15K tokens 2x :qa checks: 3.6-4K tokens 1x :help reference: 200 tokens Total: ~16-19K tokens/month ``` **Medium Usage (20 updates/month):** ```plaintext 15x :core updates: 18-22.5K tokens 4x :sdd updates: 6-7.2K tokens 4x :qa checks: 7.2-8K tokens 1x :help reference: 200 tokens Total: ~31-38K tokens/month ``` **Heavy Usage (40 updates/month):** ```plaintext 25x :core updates: 30-37.5K tokens 8x :sdd updates: 12-14.4K tokens 8x :qa checks: 14.4-16K tokens 4x orchestrated: 12-16K tokens 1x :help reference: 200 tokens Total: ~69-84K tokens/month ``` **Original System (Same Usage):** ``` 40x monolithic commands: 400-480K tokens/month Savings with Phase 3: 83-93% ``` --- ## πŸ”§ Troubleshooting ### "Command not found: /ck:doc-review/core" **Cause:** Sub-command file not installed **Solution:** ```bash # Check if files exist ls ~/.claude/commands/ck/doc-review*.md # Should see all sub-command files # If missing, reinstall from docs ``` --- ### "Analysis fails with error" **Cause:** doc-analyzer.sh not executable or not found **Solution:** ```bash # Check if tool exists ls -l ~/.claude/tools/doc-analyzer.sh # Make executable chmod +x ~/.claude/tools/doc-analyzer.sh # Test manually ~/.claude/tools/doc-analyzer.sh help ``` --- ### "QA reports many broken links" **Cause:** Links broken after file reorganization **Solution:** ```bash # Run QA to identify broken links /ck:doc-review/qa # Fix links in reported files # Re-run QA to verify /ck:doc-review/qa ``` --- ### "SDD consistency check fails" **Cause:** Requirements/tasks out of sync with code **Solution:** ```bash # Update SDD artifacts /ck:doc-review/sdd "current feature" # Manually review any remaining inconsistencies # Update as needed ``` --- ## πŸ’‘ Tips & Best Practices ### 1. Run `:analyze` First (New Projects) ```bash # When starting with a new project /ck:doc-review/analyze β†’ Understand doc structure β†’ Identify gaps β†’ Plan updates ``` ### 2. Use `:core` for Quick Updates ```bash # Daily workflow: added feature, need docs /ck:doc-review/core "feature name" β†’ Fast (20s) β†’ Low token cost (1.2K) β†’ Updates essentials ``` ### 3. Run `:qa` Before Commits ```bash # Git workflow git add . /ck:doc-review/qa # Check doc quality β†’ Fix any issues git commit -m "docs: ..." ``` ### 4. Use Orchestrator When Unsure ```bash # Not sure what needs updating? /ck:doc-review "what changed" β†’ Guided workflow β†’ Smart recommendations β†’ You choose scope ``` ### 5. Batch SDD Updates ```bash # Don't update SDD after every task # Batch at phase boundaries /ck:doc-review/sdd "Phase 2 complete" β†’ More efficient β†’ Better overview β†’ Cleaner commits ``` --- ## 🎯 Decision Tree: Which Command to Use? ```text Start β”‚ β”œβ”€ Need help? β†’ /ck:doc-review/help β”‚ β”œβ”€ Just want to see what needs updating? β”‚ └─ /ck:doc-review/analyze β”‚ β”œβ”€ Added new feature/module? β”‚ └─ /ck:doc-review/core "feature name" β”‚ β”œβ”€ Completed implementation phase? β”‚ └─ /ck:doc-review/sdd "phase name" β”‚ β”œβ”€ About to commit documentation? β”‚ └─ /ck:doc-review/qa β”‚ β”œβ”€ Not sure what to do? β”‚ └─ /ck:doc-review "what changed" β”‚ └─ Want comprehensive update? └─ /ck:doc-review "scope" β†’ Select "Full Update" ``` --- ## πŸ“š Further Reading **Architecture Deep Dive:** - `docs/ck-doc-review-analysis.md` - Initial architecture analysis - `docs/ck-doc-review-phase3-improvements.md` - Current system design **Phase Evolution:** - Phase 1: Progressive disclosure + patterns config - Phase 2: External tool architecture - Phase 3: Full modularization (current) **External Tools:** - `~/.claude/tools/doc-analyzer.sh help` - Tool documentation - Run `doc-analyzer.sh all` to see full analysis output --- ## πŸ†˜ Getting Help ### Within the System ```bash /ck:doc-review/help # This guide ~/.claude/tools/doc-analyzer.sh help # Tool help ``` ### Documentation Files ```bash cat docs/ck-doc-review-phase3-improvements.md # Full system docs ``` ### Quick Reference Card ```bash # Analysis /ck:doc-review/analyze # Updates /ck:doc-review/core "feature" # Quick /ck:doc-review/sdd "phase" # SDD /ck:doc-review "scope" # Full # Validation /ck:doc-review/qa # Help /ck:doc-review/help ``` --- ## ✨ Key Takeaways 1. **Modular = Efficient** - Use focused commands, not monolithic tool 2. **Analyze First** - Understand before updating 3. **Core for Speed** - Most common use case 4. **QA Before Commit** - Catch issues early 5. **Orchestrate When Unsure** - Guided workflow helps --- **Last Updated:** 2025-10-24 **Version:** Phase 3 (Modular Architecture) **System Status:** Production Ready βœ