Claude-skill-registry design-compare
Compare doc versions across git history. Use when reviewing changes, tracking evolution, or understanding modifications.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/design-compare" ~/.claude/skills/majiayu000-claude-skill-registry-design-compare && rm -rf "$T"
skills/data/design-compare/SKILL.mdDesign Documentation Version Comparison
Compares design document versions across git commits, branches, or tags to track evolution and understand changes over time.
Overview
This skill compares document versions by validating git references, loading document content from different versions, performing line-by-line or semantic diffs, analyzing changes for significance, and generating comprehensive comparison reports with metrics and highlights.
Quick Start
Compare with main branch:
/design-compare observability.md --ref=main
Compare two commits:
/design-compare doc.md --from=abc123 --to=def456
Semantic comparison:
/design-compare doc.md --ref=v1.0.0 --format=semantic
Parameters
Required
: Document filename to comparedoc
Optional
: Module name (default: inferred from current context)module
: Git reference to compare against (commit, branch, tag) (default: main)ref
: Starting git reference for two-point comparisonfrom
: Ending git reference for two-point comparisonto
: Comparison format - unified, side-by-side, semantic, summary (default: unified)format
Workflow
High-level comparison process:
- Parse parameters to determine document and comparison references
- Validate references to ensure git refs exist and are accessible
- Load document versions from current and historical git refs
- Perform comparison using diff (unified, side-by-side) or semantic analysis
- Analyze changes to extract metrics and categorize modifications
- Generate comparison report with summary, frontmatter changes, structural changes, and content diff
- Highlight significant changes (status changes, completeness jumps, major additions/removals)
- Format output according to requested format
- Provide navigation with git commands for further exploration
For detailed implementation steps, see supporting documentation below.
Supporting Documentation
When you need detailed information, load the appropriate supporting file:
For Detailed Workflow
See instructions.md for:
- Complete step-by-step comparison workflow
- Git reference validation methods
- Document version loading from git
- Diff execution (line-by-line, side-by-side, semantic)
- Change analysis and metrics calculation
- Comparison report generation
- Significant change highlighting
- Git navigation commands
- Comparison modes (single ref, two refs, branch, tag)
- Advanced features (whitespace, context, word-level, stats)
Load when: Performing comparisons or need implementation details
For Comparison Formats
See comparison-formats.md for:
- Unified diff format and syntax
- Side-by-side comparison layout
- Semantic diff structure
- Summary format
- Format selection guidelines
- Color coding and highlighting
Load when: Need format specifications or output structure details
For Usage Examples
See examples.md for:
- Compare with main branch
- Compare two commits
- Semantic comparison
- No changes scenario
- Document doesn't exist in reference
- Error scenarios
Load when: User needs examples or clarification
Error Handling
Invalid Git Reference
ERROR: Git reference not found: {ref} Valid references: - Commit hash: abc123 - Branch name: main, feature-branch - Tag name: v1.0.0 Check: git log or git branch -a
Document Not in Repository
ERROR: Document not tracked by git Document: {doc} Ensure document is committed before comparing versions.
No Changes Detected
INFO: No changes between versions Document: {module}/{doc} References: {from} → {to} The document is identical in both versions.
Integration
Works well with:
- Review documents before/after changes/design-review
- Validate both versions/design-validate
- Understand sync evolution over time/design-sync
- See update history/design-update
Success Criteria
A successful comparison:
- ✅ Git references validated
- ✅ Document versions loaded from both refs
- ✅ Diff performed successfully
- ✅ Changes analyzed and categorized
- ✅ Metrics calculated accurately
- ✅ Significant changes highlighted
- ✅ Clear comparison report generated
- ✅ Navigation commands provided