Compare versions, branches, phases, or specifications
Compares code versions, branches, or development phases to highlight changes and differences.
/plugin marketplace add cyberbloke9/pmp-gywd/plugin install pmp-gywd@pmp-gywd<source> <target> [--mode summary|detailed|diff]gywd/Use when:
Comparison Types:
# Check if source is a phase number
if [[ "$source" =~ ^[0-9]+$ ]]; then
# Phase comparison
type="phase"
else
# Git reference comparison
git rev-parse --verify "$source" 2>/dev/null && type="git"
fi
Resolve references:
git diff --name-status $source..$target
git log --oneline $source..$target
**For phase comparisons:**
```bash
# Read phase summaries
cat .planning/phases/${source}-*/SUMMARY.md
cat .planning/phases/${target}-*/SUMMARY.md
For spec comparisons:
# Compare PROJECT.md requirements vs actual code
cat .planning/PROJECT.md
</step>
<step name="render_summary">
**Summary Mode (default):**
```
## Comparison: $source → $target
| Category | Files | Changes |
|---|---|---|
| lib/ | X | +Y/-Z |
| tests/ | X | +Y/-Z |
| docs/ | X | +Y/-Z |
</step>
<step name="render_detailed">
**Detailed Mode:**
| SHA | Author | Message |
|---|---|---|
| abc123 | User | feat: ... |
| def456 | User | fix: ... |
[For each major module, show specific changes]
</step>
<step name="render_diff">
**Diff Mode:**
```bash
git diff $source..$target
With syntax highlighting if available. </step>
<step name="phase_comparison"> **For phase comparisons:** ``` ## Phase Comparison: Phase $source → Phase $targetGoal: [from ROADMAP.md] Completed: [date] Key deliverables:
Goal: [from ROADMAP.md] Completed: [date or "in progress"] Key deliverables:
</step>
</process>
<examples>
```bash
# Compare last two commits
/gywd:compare HEAD~1 HEAD
# Compare branches
/gywd:compare main feature-branch
# Compare phases
/gywd:compare 18 19
# Detailed file comparison
/gywd:compare v1.0 v2.0 --mode detailed --files "lib/**"
# Show raw diff
/gywd:compare abc123 def456 --mode diff
</examples>
<success_criteria>