Use when user wants to compare two autonomy branches to see different approaches, metrics, and outcomes
Compares two autonomy branches to show where they diverged and how their approaches differ. Used when you run `/compare-branches <branch-a> <branch-b>` to analyze different exploration strategies and outcomes.
/plugin marketplace add tilmon-engineering/claude-skills/plugin install autonomy@tilmon-eng-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Compare two autonomy branches to show where they diverged, how their approaches differ, and what outcomes each achieved.
Core principle: Use git merge-base to find divergence, then dispatch branch-analyzer for computational comparison.
Use this skill when:
/compare-branches commandDO NOT use for:
| Step | Action | Tool |
|---|---|---|
| 1. Parse and validate | Normalize branch names, check both exist | Bash |
| 2. Find divergence | Use git merge-base to find common ancestor | Bash |
| 3. Dispatch agent | Send both branches to branch-analyzer | Task |
| 4. Present comparison | Display comparative report | Direct output |
Extract and normalize both branch names:
Parse arguments:
args = "<branch-a> <branch-b>"
Split on whitespace:
branch_a = first word
branch_b = second word
If not exactly 2 words:
Error: "Usage: /compare-branches <branch-a> <branch-b>"
Normalize:
# Add autonomy/ prefix if missing
if [[ "$branch_a" != autonomy/* ]]; then
branch_a="autonomy/$branch_a"
fi
if [[ "$branch_b" != autonomy/* ]]; then
branch_b="autonomy/$branch_b"
fi
Validate both exist:
# Check branch A
if ! git branch -a | grep -q "$branch_a\$"; then
echo "Error: Branch '$branch_a' not found."
echo ""
echo "Available autonomy branches:"
git branch -a | grep 'autonomy/' | sed 's/^..//; s/ -> .*//'
exit 1
fi
# Check branch B
if ! git branch -a | grep -q "$branch_b\$"; then
echo "Error: Branch '$branch_b' not found."
echo ""
echo "Available autonomy branches:"
git branch -a | grep 'autonomy/' | sed 's/^..//; s/ -> .*//'
exit 1
fi
Validate both are autonomy branches:
for branch in "$branch_a" "$branch_b"; do
if [[ "$branch" != autonomy/* ]]; then
echo "Error: Branch '$branch' is not an autonomy branch."
echo ""
echo "These commands only operate on autonomy/* branches."
exit 1
fi
done
Use git to find where the branches diverged:
# Find common ancestor
merge_base=$(git merge-base "$branch_a" "$branch_b" 2>&1)
# Check if command succeeded
if [ $? -ne 0 ]; then
echo "Error: Cannot find common ancestor between '$branch_a' and '$branch_b'."
echo ""
echo "This may mean:"
echo "- Branches have completely independent histories"
echo "- Branch was rebased and history was rewritten"
echo ""
echo "Git error: $merge_base"
exit 1
fi
# Get divergence info
divergence_date=$(git log -1 --format='%ai' "$merge_base")
divergence_short=$(git rev-parse --short "$merge_base")
Find iteration at divergence (if it exists):
# Check if divergence point has an iteration tag
divergence_tag=$(git tag --points-at "$merge_base" | grep 'iteration-')
if [ -n "$divergence_tag" ]; then
divergence_iteration=$(echo "$divergence_tag" | sed 's/.*iteration-//')
else
divergence_iteration="(no iteration tag at divergence)"
fi
Dispatch the branch-analyzer agent with comparison instructions:
Task tool with subagent_type: "autonomy:branch-analyzer"
Model: haiku
Prompt: "Compare two autonomy branches and show differences in approaches and outcomes.
Branches:
- Branch A: $branch_a
- Branch B: $branch_b
Divergence point: $merge_base ($divergence_short)
Divergence date: $divergence_date
Divergence iteration: $divergence_iteration
Tasks:
1. Read all journal commits on branch A since divergence
2. Read all journal commits on branch B since divergence
3. Parse each commit message for: iteration, date, status, metrics, blockers, next steps
4. Generate Python script to compare:
- Iteration counts on each branch
- Status patterns (how often active/blocked/etc)
- Metrics trajectories (if metrics exist)
- Different decisions/approaches mentioned
- Outcomes on each branch
5. Execute Python script
6. Output comparative markdown report
Use computational methods (Python scripts), do not eyeball the comparison.
Report format:
- Divergence Information section
- Iteration Comparison section
- Metrics Comparison section (if metrics exist)
- Approach Differences section
- Outcomes and Status section
- Insights and Recommendations section"
Agent will:
Display agent's comparative report to user.
Example output format:
# Branch Comparison
**Branch A:** autonomy/experiment-a
**Branch B:** autonomy/experiment-b
---
## Divergence Information
**Common ancestor:** abc123f
**Divergence date:** 2025-12-15
**Divergence iteration:** 0015
Branches have been exploring different approaches for 18 days.
---
## Iteration Comparison
| Branch | Iterations Since Divergence | Current Iteration | Latest Update |
|--------|----------------------------|-------------------|---------------|
| experiment-a | 13 (0016-0028) | 0028 | 2026-01-02 |
| experiment-b | 8 (0016-0023) | 0023 | 2025-12-28 |
**Observation:** Branch A has progressed more iterations but is currently blocked. Branch B has fewer iterations but is active.
---
## Metrics Comparison
### MRR Trajectory
- **experiment-a:** $45k → $62k (+37.8%)
- Faster growth, reached $62k at iteration 0028
- **experiment-b:** $45k → $58k (+28.9%)
- Steady growth, reached $58k at iteration 0023
### Build Time
- **experiment-a:** 5.2min → 3.2min (-38.5%)
- Significant optimization focus
- **experiment-b:** 5.2min → 4.8min (-7.7%)
- Minor improvements only
---
## Approach Differences
### Branch A (experiment-a): Usage-based pricing
- Implemented tiered usage model
- Real-time usage tracking
- API rate limiting integration
- **Current status:** Blocked on Stripe API integration
### Branch B (experiment-b): Flat enterprise pricing
- Fixed pricing tiers (Startup/Growth/Enterprise)
- Annual commitment discounts
- Sales-assisted onboarding
- **Current status:** Active, implementing pricing page UI
---
## Outcomes and Status
| Branch | Current Status | Key Achievement | Main Blocker |
|--------|----------------|-----------------|--------------|
| experiment-a | blocked | Higher MRR growth (+37.8%) | Stripe webhook docs |
| experiment-b | active | Simpler implementation | None currently |
---
## Insights and Recommendations
**What worked well:**
- **experiment-a:** Usage-based model drove higher revenue but added complexity
- **experiment-b:** Flat pricing is simpler to implement and maintain
**What didn't work:**
- **experiment-a:** Dependency on external Stripe API caused blocking
- **experiment-b:** Slower revenue growth compared to usage model
**Cross-branch learning:**
- experiment-b could adopt experiment-a's build optimizations (-38.5% improvement)
- experiment-a could simplify by borrowing experiment-b's pricing page approach
- Consider hybrid: flat base + usage overage (best of both)
**Recommendations:**
1. If revenue growth is priority: Continue experiment-a, resolve Stripe blocker
2. If speed to market is priority: Continue experiment-b, ship simple version
3. If unsure: Fork new branch from divergence point implementing hybrid approach
This skill ONLY compares autonomy/* branches:
autonomy/ prefixDO NOT:
DO:
All comparison happens via git commands:
git log <branch> for eachDO NOT:
DO:
| Mistake | Reality |
|---|---|
| "I'll declare branch A is better" | NO. Present objective comparison, let user decide. |
| "I'll recommend merging branches" | NO. Autonomy branches never merge. Only cross-learning via /analyze-branch. |
| "Only 5 iterations different, I can compare manually" | NO. Always dispatch branch-analyzer for computational analysis. |
| "Branches have no common ancestor, I'll error" | CORRECT. This is a real error case - branches are independent. |
| "I'll checkout branches to compare journals" | NO. Read commit messages via git log. Never checkout. |
Once comparison is complete:
/fork-iteration <iteration> <strategy-name>/branch-status <branch-name>/analyze-branch to extract specific learnings from one branch for use in another