anvil-dev-framework 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/README.md +719 -0
  2. package/VERSION +1 -0
  3. package/docs/ANVIL-REPO-IMPLEMENTATION-PLAN.md +441 -0
  4. package/docs/FIRST-SKILL-TUTORIAL.md +408 -0
  5. package/docs/INSTALLATION-RETRO-NOTES.md +458 -0
  6. package/docs/INSTALLATION.md +984 -0
  7. package/docs/anvil-hud.md +469 -0
  8. package/docs/anvil-init.md +255 -0
  9. package/docs/anvil-state.md +210 -0
  10. package/docs/boris-cherny-ralph-wiggum-insights.md +608 -0
  11. package/docs/command-reference.md +2022 -0
  12. package/docs/hooks-tts.md +368 -0
  13. package/docs/implementation-guide.md +810 -0
  14. package/docs/linear-github-integration.md +247 -0
  15. package/docs/local-issues.md +677 -0
  16. package/docs/patterns/README.md +419 -0
  17. package/docs/planning-responsibilities.md +139 -0
  18. package/docs/session-workflow.md +573 -0
  19. package/docs/simplification-plan-template.md +297 -0
  20. package/docs/simplification-principles.md +129 -0
  21. package/docs/specifications/CCS-RALPH-INTEGRATION-DESIGN.md +633 -0
  22. package/docs/specifications/CCS-RESEARCH-REPORT.md +169 -0
  23. package/docs/specifications/PLAN-ANV-verification-ralph-wiggum.md +403 -0
  24. package/docs/specifications/PLAN-parallel-tracks-anvil-memory-ccs.md +494 -0
  25. package/docs/specifications/SPEC-ANV-VRW/component-01-verify.md +208 -0
  26. package/docs/specifications/SPEC-ANV-VRW/component-02-stop-gate.md +226 -0
  27. package/docs/specifications/SPEC-ANV-VRW/component-03-posttooluse.md +209 -0
  28. package/docs/specifications/SPEC-ANV-VRW/component-04-ralph-wiggum.md +604 -0
  29. package/docs/specifications/SPEC-ANV-VRW/component-05-atomic-actions.md +311 -0
  30. package/docs/specifications/SPEC-ANV-VRW/component-06-verify-subagent.md +264 -0
  31. package/docs/specifications/SPEC-ANV-VRW/component-07-claude-md.md +363 -0
  32. package/docs/specifications/SPEC-ANV-VRW/index.md +182 -0
  33. package/docs/specifications/SPEC-ANV-anvil-memory.md +573 -0
  34. package/docs/specifications/SPEC-ANV-context-checkpoints.md +781 -0
  35. package/docs/specifications/SPEC-ANV-verification-ralph-wiggum.md +789 -0
  36. package/docs/sync.md +122 -0
  37. package/global/CLAUDE.md +140 -0
  38. package/global/agents/verify-app.md +164 -0
  39. package/global/commands/anvil-settings.md +527 -0
  40. package/global/commands/anvil-sync.md +121 -0
  41. package/global/commands/change.md +197 -0
  42. package/global/commands/clarify.md +252 -0
  43. package/global/commands/cleanup.md +292 -0
  44. package/global/commands/commit-push-pr.md +207 -0
  45. package/global/commands/decay-review.md +127 -0
  46. package/global/commands/discover.md +158 -0
  47. package/global/commands/doc-coverage.md +122 -0
  48. package/global/commands/evidence.md +307 -0
  49. package/global/commands/explore.md +121 -0
  50. package/global/commands/force-exit.md +135 -0
  51. package/global/commands/handoff.md +191 -0
  52. package/global/commands/healthcheck.md +302 -0
  53. package/global/commands/hud.md +84 -0
  54. package/global/commands/insights.md +319 -0
  55. package/global/commands/linear-setup.md +184 -0
  56. package/global/commands/lint-fix.md +198 -0
  57. package/global/commands/orient.md +510 -0
  58. package/global/commands/plan.md +228 -0
  59. package/global/commands/ralph.md +346 -0
  60. package/global/commands/ready.md +182 -0
  61. package/global/commands/release.md +305 -0
  62. package/global/commands/retro.md +96 -0
  63. package/global/commands/shard.md +166 -0
  64. package/global/commands/spec.md +227 -0
  65. package/global/commands/sprint.md +184 -0
  66. package/global/commands/tasks.md +228 -0
  67. package/global/commands/test-and-commit.md +151 -0
  68. package/global/commands/validate.md +132 -0
  69. package/global/commands/verify.md +251 -0
  70. package/global/commands/weekly-review.md +156 -0
  71. package/global/hooks/__pycache__/ralph_context_monitor.cpython-314.pyc +0 -0
  72. package/global/hooks/__pycache__/statusline_agent_sync.cpython-314.pyc +0 -0
  73. package/global/hooks/anvil_memory_observe.ts +322 -0
  74. package/global/hooks/anvil_memory_session.ts +166 -0
  75. package/global/hooks/anvil_memory_stop.ts +187 -0
  76. package/global/hooks/parse_transcript.py +116 -0
  77. package/global/hooks/post_merge_cleanup.sh +132 -0
  78. package/global/hooks/post_tool_format.sh +215 -0
  79. package/global/hooks/ralph_context_monitor.py +240 -0
  80. package/global/hooks/ralph_stop.sh +502 -0
  81. package/global/hooks/statusline.sh +1110 -0
  82. package/global/hooks/statusline_agent_sync.py +224 -0
  83. package/global/hooks/stop_gate.sh +250 -0
  84. package/global/lib/.claude/anvil-state.json +21 -0
  85. package/global/lib/__pycache__/agent_registry.cpython-314.pyc +0 -0
  86. package/global/lib/__pycache__/claim_service.cpython-314.pyc +0 -0
  87. package/global/lib/__pycache__/coderabbit_service.cpython-314.pyc +0 -0
  88. package/global/lib/__pycache__/config_service.cpython-314.pyc +0 -0
  89. package/global/lib/__pycache__/coordination_service.cpython-314.pyc +0 -0
  90. package/global/lib/__pycache__/doc_coverage_service.cpython-314.pyc +0 -0
  91. package/global/lib/__pycache__/gate_logger.cpython-314.pyc +0 -0
  92. package/global/lib/__pycache__/github_service.cpython-314.pyc +0 -0
  93. package/global/lib/__pycache__/hygiene_service.cpython-314.pyc +0 -0
  94. package/global/lib/__pycache__/issue_models.cpython-314.pyc +0 -0
  95. package/global/lib/__pycache__/issue_provider.cpython-314.pyc +0 -0
  96. package/global/lib/__pycache__/linear_data_service.cpython-314.pyc +0 -0
  97. package/global/lib/__pycache__/linear_provider.cpython-314.pyc +0 -0
  98. package/global/lib/__pycache__/local_provider.cpython-314.pyc +0 -0
  99. package/global/lib/__pycache__/quality_service.cpython-314.pyc +0 -0
  100. package/global/lib/__pycache__/ralph_state.cpython-314.pyc +0 -0
  101. package/global/lib/__pycache__/state_manager.cpython-314.pyc +0 -0
  102. package/global/lib/__pycache__/transcript_parser.cpython-314.pyc +0 -0
  103. package/global/lib/__pycache__/verification_runner.cpython-314.pyc +0 -0
  104. package/global/lib/__pycache__/verify_iteration.cpython-314.pyc +0 -0
  105. package/global/lib/__pycache__/verify_subagent.cpython-314.pyc +0 -0
  106. package/global/lib/agent_registry.py +995 -0
  107. package/global/lib/anvil-state.sh +435 -0
  108. package/global/lib/claim_service.py +515 -0
  109. package/global/lib/coderabbit_service.py +314 -0
  110. package/global/lib/config_service.py +423 -0
  111. package/global/lib/coordination_service.py +331 -0
  112. package/global/lib/doc_coverage_service.py +1305 -0
  113. package/global/lib/gate_logger.py +316 -0
  114. package/global/lib/github_service.py +310 -0
  115. package/global/lib/handoff_generator.py +775 -0
  116. package/global/lib/hygiene_service.py +712 -0
  117. package/global/lib/issue_models.py +257 -0
  118. package/global/lib/issue_provider.py +339 -0
  119. package/global/lib/linear_data_service.py +210 -0
  120. package/global/lib/linear_provider.py +987 -0
  121. package/global/lib/linear_provider.py.backup +671 -0
  122. package/global/lib/local_provider.py +486 -0
  123. package/global/lib/orient_fast.py +457 -0
  124. package/global/lib/quality_service.py +470 -0
  125. package/global/lib/ralph_prompt_generator.py +563 -0
  126. package/global/lib/ralph_state.py +1202 -0
  127. package/global/lib/state_manager.py +417 -0
  128. package/global/lib/transcript_parser.py +597 -0
  129. package/global/lib/verification_runner.py +557 -0
  130. package/global/lib/verify_iteration.py +490 -0
  131. package/global/lib/verify_subagent.py +250 -0
  132. package/global/skills/README.md +155 -0
  133. package/global/skills/quality-gates/SKILL.md +252 -0
  134. package/global/skills/skill-template/SKILL.md +109 -0
  135. package/global/skills/testing-strategies/SKILL.md +337 -0
  136. package/global/templates/CHANGE-template.md +105 -0
  137. package/global/templates/HANDOFF-template.md +63 -0
  138. package/global/templates/PLAN-template.md +111 -0
  139. package/global/templates/SPEC-template.md +93 -0
  140. package/global/templates/ralph/PROMPT.md.template +89 -0
  141. package/global/templates/ralph/fix_plan.md.template +31 -0
  142. package/global/templates/ralph/progress.txt.template +23 -0
  143. package/global/tests/__pycache__/test_doc_coverage.cpython-314.pyc +0 -0
  144. package/global/tests/test_doc_coverage.py +520 -0
  145. package/global/tests/test_issue_models.py +299 -0
  146. package/global/tests/test_local_provider.py +323 -0
  147. package/global/tools/README.md +178 -0
  148. package/global/tools/__pycache__/anvil-hud.cpython-314.pyc +0 -0
  149. package/global/tools/anvil-hud.py +3622 -0
  150. package/global/tools/anvil-hud.py.bak +3318 -0
  151. package/global/tools/anvil-issue.py +432 -0
  152. package/global/tools/anvil-memory/CLAUDE.md +49 -0
  153. package/global/tools/anvil-memory/README.md +42 -0
  154. package/global/tools/anvil-memory/bun.lock +25 -0
  155. package/global/tools/anvil-memory/bunfig.toml +9 -0
  156. package/global/tools/anvil-memory/package.json +23 -0
  157. package/global/tools/anvil-memory/src/__tests__/ccs/context-monitor.test.ts +535 -0
  158. package/global/tools/anvil-memory/src/__tests__/ccs/edge-cases.test.ts +645 -0
  159. package/global/tools/anvil-memory/src/__tests__/ccs/fixtures.ts +363 -0
  160. package/global/tools/anvil-memory/src/__tests__/ccs/index.ts +8 -0
  161. package/global/tools/anvil-memory/src/__tests__/ccs/integration.test.ts +417 -0
  162. package/global/tools/anvil-memory/src/__tests__/ccs/prompt-generator.test.ts +571 -0
  163. package/global/tools/anvil-memory/src/__tests__/ccs/ralph-stop.test.ts +440 -0
  164. package/global/tools/anvil-memory/src/__tests__/ccs/test-utils.ts +252 -0
  165. package/global/tools/anvil-memory/src/__tests__/commands.test.ts +657 -0
  166. package/global/tools/anvil-memory/src/__tests__/db.test.ts +641 -0
  167. package/global/tools/anvil-memory/src/__tests__/hooks.test.ts +272 -0
  168. package/global/tools/anvil-memory/src/__tests__/performance.test.ts +427 -0
  169. package/global/tools/anvil-memory/src/__tests__/test-utils.ts +113 -0
  170. package/global/tools/anvil-memory/src/commands/checkpoint.ts +197 -0
  171. package/global/tools/anvil-memory/src/commands/get.ts +115 -0
  172. package/global/tools/anvil-memory/src/commands/init.ts +94 -0
  173. package/global/tools/anvil-memory/src/commands/observe.ts +163 -0
  174. package/global/tools/anvil-memory/src/commands/search.ts +112 -0
  175. package/global/tools/anvil-memory/src/db.ts +638 -0
  176. package/global/tools/anvil-memory/src/index.ts +205 -0
  177. package/global/tools/anvil-memory/src/types.ts +122 -0
  178. package/global/tools/anvil-memory/tsconfig.json +29 -0
  179. package/global/tools/ralph-loop.sh +359 -0
  180. package/package.json +45 -0
  181. package/scripts/anvil +822 -0
  182. package/scripts/extract_patterns.py +222 -0
  183. package/scripts/init-project.sh +541 -0
  184. package/scripts/install.sh +229 -0
  185. package/scripts/postinstall.js +41 -0
  186. package/scripts/rollback.sh +188 -0
  187. package/scripts/sync.sh +623 -0
  188. package/scripts/test-statusline.sh +248 -0
  189. package/scripts/update_claude_md.py +224 -0
  190. package/scripts/verify.sh +255 -0
@@ -0,0 +1,182 @@
1
+ # /ready - Calculate Ready Work
2
+
3
+ > Query Linear and return issues that are unblocked and ready to start.
4
+
5
+ ## When to Use
6
+ - After `/orient` to see available work
7
+ - When deciding what to work on next
8
+ - To check if blockers have been resolved
9
+
10
+ ## Pre-Flight: Check Linear Configuration
11
+
12
+ **CRITICAL**: Before querying Linear, verify project configuration.
13
+
14
+ ```bash
15
+ if [ -f ".claude/linear.yaml" ]; then
16
+ TEAM_KEY=$(grep "team_key:" .claude/linear.yaml | cut -d'"' -f2)
17
+ echo "Checking ready work for team: $TEAM_KEY"
18
+ else
19
+ echo "⚠️ LINEAR NOT CONFIGURED"
20
+ echo "Run /linear-setup first"
21
+ exit 1
22
+ fi
23
+ ```
24
+
25
+ **If no linear.yaml**: Stop and prompt user to run `/linear-setup`. Do NOT query Linear.
26
+
27
+ ## Execution Steps
28
+
29
+ ### Step 1: Query Active Issues (Filtered by Team)
30
+
31
+ Query Linear for issues where:
32
+ - Team = [team_key from linear.yaml]
33
+ - Status in (Todo, Backlog)
34
+ - Limit 50
35
+
36
+ ### Step 2: Filter for Unblocked
37
+ For each issue, check:
38
+ - `blockedBy` relationships
39
+ - If any blocking issue is NOT in "Done" state → issue is blocked
40
+ - If ALL blocking issues are "Done" (or no blockers) → issue is ready
41
+
42
+ ### Step 3: Check for Claimed Issues (ANV-224)
43
+
44
+ Check if any ready issues have been claimed by other agents using the claim_service:
45
+
46
+ ```bash
47
+ # Query claims using the claim service
48
+ python3 -c "
49
+ import sys
50
+ sys.path.insert(0, 'global/lib')
51
+ from claim_service import get_all_claims
52
+ import json
53
+ print(json.dumps(get_all_claims()))
54
+ "
55
+ ```
56
+
57
+ Or use the CLI directly:
58
+ ```bash
59
+ python3 global/lib/claim_service.py list
60
+ ```
61
+
62
+ For each ready issue:
63
+ - Check if issue_id exists in claims registry
64
+ - If claimed by another agent → mark as claimed
65
+ - If claimed by current agent → mark as "Your claim"
66
+
67
+ The claims registry at `~/.anvil/claims.json` contains:
68
+ - `claimed_by`: Agent UUID holding the claim
69
+ - `codename`: Agent display name (A1, A2, etc.)
70
+ - `claimed_at`: When the claim was made
71
+ - `scope`: "global" for Linear issues, "project" for ad-hoc
72
+
73
+ ### Step 4: Sort Results
74
+ Sort ready issues by:
75
+ 1. Priority (P0 first, then P1, P2, P3)
76
+ 2. Age (older issues first within same priority)
77
+
78
+ ### Step 5: Present Ready Work
79
+
80
+ Output format:
81
+ ```
82
+ ## Ready Work — [team_key]
83
+
84
+ | Priority | Issue | Title | Age | Status |
85
+ |----------|-------|-------|-----|--------|
86
+ | P0 | [TEAM]-123 | [Title] | 3d | Available |
87
+ | P1 | [TEAM]-124 | [Title] | 5d | Claimed by A1 |
88
+ | P2 | [TEAM]-125 | [Title] | 1d | Available |
89
+
90
+ **Total ready**: X issues
91
+ **Blocked**: Y issues waiting on dependencies
92
+ **Claimed**: Z issues claimed by other agents
93
+
94
+ Recommend starting with: [Highest priority UNCLAIMED issue]
95
+ ```
96
+
97
+ ### Claim Warning Format (ANV-224)
98
+
99
+ When an issue is claimed by another agent:
100
+ - **Status column**: `Claimed by [codename]` (e.g., "Claimed by A1")
101
+ - **Recommendation**: Skip claimed issues, recommend next unclaimed
102
+ - **Not blocking**: User can still choose to work on claimed issue (collaboration)
103
+
104
+ Example with claims:
105
+ ```markdown
106
+ ## Ready Work — ANV
107
+
108
+ | Priority | Issue | Title | Age | Status |
109
+ |----------|-------|-------|-----|--------|
110
+ | P1 | ANV-22 | Statusline feature | 2d | Claimed by A1 |
111
+ | P1 | ANV-30 | Quality gates | 3d | Claimed by A2 |
112
+ | P2 | ANV-11 | Init command | 5d | Available |
113
+ | P2 | ANV-15 | Documentation | 4d | Available |
114
+
115
+ **Total ready**: 4 issues
116
+ **Blocked**: 2 issues waiting on dependencies
117
+ **Claimed**: 2 issues claimed by other agents
118
+
119
+ ANV-22 and ANV-30 are claimed. Recommend starting with: ANV-11 (Init command)
120
+ ```
121
+
122
+ ## Error: Linear Not Configured
123
+
124
+ If linear.yaml is missing, output:
125
+
126
+ ```
127
+ ## Ready Work — ⚠️ Linear Not Configured
128
+
129
+ This project is not mapped to a Linear team.
130
+
131
+ **To configure:**
132
+ 1. Run `/linear-setup` to select or create a team
133
+ 2. Then run `/ready` again
134
+
135
+ Cannot calculate ready work without team configuration.
136
+ ```
137
+
138
+ ## Key Behaviors
139
+ - **ALWAYS check linear.yaml first** — never query wrong team
140
+ - **Check claims registry for claimed issues** — warn about claims (ANV-224)
141
+ - Only show truly unblocked work from configured team
142
+ - Highlight if nothing is ready (all blocked)
143
+ - Include enough context for decision-making
144
+ - Don't start work—just report what's available
145
+ - Recommend unclaimed issues over claimed ones
146
+ - Claims are warnings, not blockers—user can override for collaboration
147
+
148
+ ## Blocked Issues Report (Optional)
149
+ If requested or if many issues are blocked:
150
+ ```
151
+ ## Blocked Issues — [team_key]
152
+
153
+ | Issue | Blocked By | Blocker Status |
154
+ |-------|------------|----------------|
155
+ | [TEAM]-126 | [TEAM]-120 | In Progress |
156
+ | [TEAM]-127 | [TEAM]-121, [TEAM]-122 | Todo, In Review |
157
+ ```
158
+
159
+ ## Relationship to /sprint
160
+
161
+ | Command | Purpose | Output |
162
+ |---------|---------|--------|
163
+ | `/ready` | List unblocked work | Data report (what's available) |
164
+ | `/sprint` | Prioritize session | Recommendations (what to work on) |
165
+
166
+ **How they relate:**
167
+ - `/ready` is the **foundation** — pure data query for unblocked work
168
+ - `/sprint` **builds on** `/ready` — adds broader context + recommendations
169
+ - Use `/ready` for quick "what's available?" checks
170
+ - Use `/sprint` for full session planning with reasoning
171
+
172
+ ```
173
+ /orient → /ready (quick check) → /sprint (full planning) → /validate → work
174
+ ```
175
+
176
+ ## Integration Points
177
+ - Requires: `.claude/linear.yaml` (team configuration)
178
+ - Uses: `global/lib/claim_service.py` (issue claiming - ANV-224)
179
+ - Uses: `~/.anvil/claims.json` (claims registry)
180
+ - Uses: Linear MCP (filtered by team)
181
+ - Used by: `/orient` command
182
+ - Used by: `/sprint` command (inherits unblocked detection + agent conflicts)
@@ -0,0 +1,305 @@
1
+ # /release - Version Coordination
2
+
3
+ > Consolidate [Unreleased] changes into a versioned release.
4
+
5
+ ## When to Use
6
+ - At end of sprint (batch all work)
7
+ - After major feature merges
8
+ - When ready to cut a release
9
+ - As coordination point for multi-agent work
10
+
11
+ ## Why This Command Exists
12
+
13
+ In multi-agent environments, version assignment is dangerous:
14
+ - Multiple agents working simultaneously can create version conflicts
15
+ - Agents assigning versions during development causes drift
16
+ - No single source of truth for "what's released"
17
+
18
+ **Solution**: Agents NEVER assign versions during development. All agents add entries to [Unreleased]. One agent or human runs `/release` at the coordination point.
19
+
20
+ ## Versioning Strategy
21
+
22
+ Anvil uses **four-part versioning**: `MILESTONE.MAJOR.MINOR.PATCH`
23
+
24
+ | Component | Meaning | Bump When |
25
+ |-----------|---------|-----------|
26
+ | **MILESTONE** | Production readiness | 0 = Alpha, 1 = Production-ready (manual decision only) |
27
+ | **MAJOR** | Significant feature sets | Breaking changes or major additions |
28
+ | **MINOR** | New features | New commands, integrations |
29
+ | **PATCH** | Bug fixes | Bug fixes, docs, small improvements |
30
+
31
+ **Current status**: `0.x.x.x` (Alpha — building toward 1.0.0.0)
32
+
33
+ **Important**: The MILESTONE component (0 → 1) is NEVER auto-bumped. Moving to 1.0.0.0 is a manual decision when all production-readiness criteria are met.
34
+
35
+ ## Execution Steps
36
+
37
+ ### Step 1: Parse Changelog
38
+
39
+ Read CHANGELOG.md and extract [Unreleased] section content:
40
+
41
+ ```bash
42
+ # Check for [Unreleased] section
43
+ grep -A 1000 "## \[Unreleased\]" CHANGELOG.md | grep -B 1000 -m 1 "^## \[" | head -n -1
44
+ ```
45
+
46
+ If [Unreleased] is empty or missing:
47
+ ```
48
+ ## Release Check
49
+
50
+ **Status**: Nothing to release
51
+
52
+ The [Unreleased] section is empty or contains no changes.
53
+
54
+ Add entries to [Unreleased] before running /release:
55
+ - ### Added — New features
56
+ - ### Changed — Changes to existing functionality
57
+ - ### Fixed — Bug fixes
58
+ - ### Removed — Removed features
59
+ ```
60
+
61
+ ### Step 2: Calculate Version Bump
62
+
63
+ Based on change types in [Unreleased]:
64
+
65
+ | Change Type | Version Bump | Example |
66
+ |-------------|--------------|---------|
67
+ | `BREAKING CHANGE` anywhere | MAJOR | 0.1.4.0 → 0.2.0.0 |
68
+ | `### Added` (new features) | MINOR | 0.1.4.0 → 0.1.5.0 |
69
+ | `### Changed/Fixed/Removed` only | PATCH | 0.1.4.0 → 0.1.4.1 |
70
+
71
+ **Note**: MILESTONE (first digit) is NEVER auto-bumped. Going from 0.x to 1.0 requires explicit user decision.
72
+
73
+ ```bash
74
+ # Read current version
75
+ CURRENT_VERSION=$(cat VERSION 2>/dev/null || echo "0.1.0.0")
76
+
77
+ # Parse version components (4-part: MILESTONE.MAJOR.MINOR.PATCH)
78
+ IFS='.' read -r MILESTONE MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
79
+
80
+ # Check for breaking changes (bumps MAJOR, not MILESTONE)
81
+ if grep -qi "BREAKING CHANGE" CHANGELOG.md; then
82
+ BUMP="major"
83
+ NEW_VERSION="$MILESTONE.$((MAJOR + 1)).0.0"
84
+ elif grep -q "### Added" CHANGELOG.md; then
85
+ BUMP="minor"
86
+ NEW_VERSION="$MILESTONE.$MAJOR.$((MINOR + 1)).0"
87
+ else
88
+ BUMP="patch"
89
+ NEW_VERSION="$MILESTONE.$MAJOR.$MINOR.$((PATCH + 1))"
90
+ fi
91
+ ```
92
+
93
+ ### Step 3: Preview Release
94
+
95
+ Show what will be released and require confirmation:
96
+
97
+ ```markdown
98
+ ## Release Preview
99
+
100
+ **Current version**: 0.1.4.0
101
+ **New version**: 0.1.5.0 (MINOR bump)
102
+ **Reason**: New features added (### Added section present)
103
+
104
+ ### Changes to include:
105
+
106
+ #### Added
107
+ - Enhanced `/evidence` Command — Additional quality gate checks
108
+ - Enhanced `/handoff` Command — Changelog confirmation
109
+
110
+ #### Fixed
111
+ - [Any fixed items]
112
+
113
+ ### Actions that will be performed:
114
+ 1. Transform CHANGELOG.md: [Unreleased] → [0.1.5.0] - 2026-01-02
115
+ 2. Add empty [Unreleased] section at top
116
+ 3. Update VERSION file to 0.1.5.0
117
+ 4. Update README.md: version in banner, title, and "Latest Changes" section
118
+ 5. Create commit: "chore(release): v0.1.5.0"
119
+ 6. Create annotated git tag: v0.1.5.0
120
+
121
+ **Proceed with release?** [Requires explicit confirmation]
122
+ ```
123
+
124
+ ### Step 4: Execute Release (After Confirmation)
125
+
126
+ Only proceed if user explicitly confirms.
127
+
128
+ #### 4.1: Transform CHANGELOG.md
129
+
130
+ ```bash
131
+ # Get today's date
132
+ TODAY=$(date +%Y-%m-%d)
133
+
134
+ # Replace [Unreleased] with version and date
135
+ sed -i '' "s/## \[Unreleased\]/## [Unreleased]\n\n---\n\n## [$NEW_VERSION] - $TODAY/" CHANGELOG.md
136
+ ```
137
+
138
+ The transformation:
139
+ - `## [Unreleased]` → `## [Unreleased]` (empty, at top)
140
+ - Previous unreleased content → `## [1.4.0] - 2026-01-02`
141
+
142
+ #### 4.2: Update VERSION File
143
+
144
+ ```bash
145
+ echo "$NEW_VERSION" > VERSION
146
+ ```
147
+
148
+ #### 4.3: Update README.md
149
+
150
+ Update three locations in README.md:
151
+
152
+ 1. **ASCII Banner Version** (line ~4):
153
+ ```bash
154
+ # Update version in ASCII art banner
155
+ sed -i '' "s/v[0-9]*\.[0-9]*\.[0-9]*/v$NEW_VERSION/" README.md
156
+ ```
157
+
158
+ 2. **Title Version** (line ~13):
159
+ ```bash
160
+ # Update <sup>vX.Y.Z</sup> in title
161
+ sed -i '' "s/<sup>v[0-9]*\.[0-9]*\.[0-9]*<\/sup>/<sup>v$NEW_VERSION<\/sup>/" README.md
162
+ ```
163
+
164
+ 3. **Latest Changes Section**:
165
+ Replace the existing "Latest Changes in vX.Y.Z" section with content from the new version's changelog entry:
166
+
167
+ ```markdown
168
+ ## 📦 Latest Changes in v[NEW_VERSION]
169
+
170
+ *Released: [TODAY]*
171
+
172
+ - **[Feature 1]** — [Description]
173
+ - **[Feature 2]** — [Description]
174
+ ...
175
+
176
+ See [CHANGELOG.md](CHANGELOG.md) for complete history.
177
+ ```
178
+
179
+ Extract bullet points from the versioned CHANGELOG section (Added, Changed, Fixed, Removed).
180
+ Keep entries concise—one line per major change.
181
+
182
+ 4. **Roadmap Section** (if applicable):
183
+ Add the new version to the roadmap as complete:
184
+ ```markdown
185
+ ### v[NEW_VERSION] (Complete)
186
+ - [x] [Major feature 1]
187
+ - [x] [Major feature 2]
188
+ ```
189
+
190
+ #### 4.4: Create Release Commit
191
+
192
+ ```bash
193
+ git add CHANGELOG.md VERSION README.md
194
+ git commit -m "chore(release): v$NEW_VERSION"
195
+ ```
196
+
197
+ #### 4.5: Create Annotated Tag
198
+
199
+ ```bash
200
+ git tag -a "v$NEW_VERSION" -m "Release v$NEW_VERSION
201
+
202
+ Changes in this release:
203
+ [Summary of changes from changelog]"
204
+ ```
205
+
206
+ ### Step 5: Output Summary
207
+
208
+ ```markdown
209
+ ## Release Complete
210
+
211
+ **Version**: 0.1.5.0
212
+ **Tag**: v0.1.5.0
213
+ **Commit**: abc1234
214
+
215
+ ### Included Changes
216
+ - Enhanced `/evidence` Command — Additional quality gate checks
217
+ - Enhanced `/handoff` Command — Changelog confirmation
218
+
219
+ ### Next Steps
220
+ 1. Push to remote: `git push origin main --tags`
221
+ 2. Create GitHub release (optional): `gh release create v0.1.5.0`
222
+ 3. Deploy if applicable
223
+
224
+ ### Verification
225
+ - [ ] CHANGELOG.md has new version section
226
+ - [ ] VERSION file updated
227
+ - [ ] README.md version updated (banner, title, Latest Changes)
228
+ - [ ] Git tag created
229
+ - [ ] [Unreleased] section is empty
230
+ ```
231
+
232
+ ## Multi-Agent Protocol
233
+
234
+ **Critical Rule**: Agents NEVER assign versions during development.
235
+
236
+ | Action | Allowed? | Why |
237
+ |--------|----------|-----|
238
+ | Add to [Unreleased] | ✅ Yes | Safe, no version conflicts |
239
+ | Run `/release` | ✅ Yes | Single coordination point |
240
+ | Edit version in CHANGELOG | ❌ No | Creates conflicts |
241
+ | Update VERSION file directly | ❌ No | Creates drift |
242
+ | Create version tags | ❌ No | Use `/release` only |
243
+
244
+ **Workflow**:
245
+ 1. Agent A adds feature → adds to [Unreleased]
246
+ 2. Agent B fixes bug → adds to [Unreleased]
247
+ 3. Agent C adds feature → adds to [Unreleased]
248
+ 4. Coordinator runs `/release` → versions all changes atomically
249
+
250
+ ## Edge Cases
251
+
252
+ ### Breaking Change Confirmation
253
+
254
+ If BREAKING CHANGE detected:
255
+ ```markdown
256
+ ⚠️ **BREAKING CHANGE Detected**
257
+
258
+ This release contains breaking changes and will bump the MAJOR version.
259
+
260
+ Current: 0.1.3.0 → New: 0.2.0.0
261
+
262
+ Breaking changes found:
263
+ - [List of breaking changes]
264
+
265
+ Are you sure you want to release a major version? [y/N]
266
+ ```
267
+
268
+ ### Empty [Unreleased]
269
+
270
+ ```markdown
271
+ ## Release Check
272
+
273
+ **Status**: Nothing to release
274
+
275
+ The [Unreleased] section contains no changes.
276
+ Run `/evidence` and `/handoff` to ensure work is documented.
277
+ ```
278
+
279
+ ### No VERSION File
280
+
281
+ If VERSION file doesn't exist:
282
+ ```markdown
283
+ ## Release Check
284
+
285
+ **Note**: No VERSION file found. Starting from 0.0.0.
286
+
287
+ Create VERSION file with initial version? [y/N]
288
+ ```
289
+
290
+ ## Key Behaviors
291
+
292
+ - Always require explicit confirmation before release
293
+ - Parse changelog strictly—don't guess at changes
294
+ - Create annotated tags with changelog summary
295
+ - Leave clean [Unreleased] section for next cycle
296
+ - Output clear next steps for deployment
297
+
298
+ ## Integration Points
299
+
300
+ - Requires: CHANGELOG.md with [Unreleased] section
301
+ - Requires: VERSION file (or creates one)
302
+ - Updates: README.md (version in banner, title, Latest Changes section, roadmap)
303
+ - Creates: Git commit and annotated tag
304
+ - Follows: `/evidence` quality gates
305
+ - Precedes: Deployment / `git push --tags`
@@ -0,0 +1,96 @@
1
+ # /retro - Write a Retrospective
2
+
3
+ > Capture learnings from completed work. Keep it simple.
4
+
5
+ ## When to Use
6
+ - After completing a significant feature
7
+ - After a bug that took >1 hour to diagnose
8
+ - After discovering unexpected complexity
9
+ - After any "I wish I had known..." moment
10
+
11
+ ## Execution Steps
12
+
13
+ ### Step 1: Identify the Topic
14
+
15
+ Usually the issue you just completed:
16
+ - Issue key (e.g., ENG-42)
17
+ - Brief descriptive title
18
+
19
+ If not tied to an issue, use descriptive title only.
20
+
21
+ ### Step 2: Assess Outcome
22
+
23
+ - **success** — Completed as expected
24
+ - **partial** — Completed with caveats or issues
25
+ - **failed** — Did not achieve goal
26
+
27
+ ### Step 3: Write the Narrative
28
+
29
+ Answer these questions in prose (not bullet points):
30
+ - What did you try?
31
+ - What worked?
32
+ - What didn't work?
33
+ - Why?
34
+
35
+ Be specific. Include file names, error messages, wrong assumptions.
36
+
37
+ ### Step 4: Extract Key Learning
38
+
39
+ One concrete, actionable thing you learned.
40
+
41
+ Not vague ("be more careful") but specific ("check RLS policies before INSERT").
42
+
43
+ ### Step 5: Define Next Time Action
44
+
45
+ One specific thing to do differently next time you encounter similar work.
46
+
47
+ ### Step 6: Save Retro
48
+
49
+ Create file: `.claude/retros/YYYY-MM/[ISSUE-ID]-[slug].md`
50
+
51
+ ```markdown
52
+ # [Issue ID]: [Brief descriptive title]
53
+
54
+ **Outcome:** success | partial | failed
55
+ **Date:** YYYY-MM-DD
56
+
57
+ ## What Happened
58
+ [Narrative]
59
+
60
+ ## Key Learning
61
+ [One concrete thing]
62
+
63
+ ## For Next Time
64
+ [One specific action]
65
+ ```
66
+
67
+ ### Step 7: Confirm
68
+
69
+ ```
70
+ ## Retro Saved
71
+
72
+ **File**: .claude/retros/2025-12/ENG-42-password-reset.md
73
+ **Outcome**: success
74
+ **Key learning**: [brief summary]
75
+
76
+ Run /insights weekly to synthesize patterns across retros.
77
+ ```
78
+
79
+ ## Key Behaviors
80
+
81
+ - Keep it narrative, not structured
82
+ - One learning, one action (not a list)
83
+ - Specific > generic
84
+ - Short is fine (3-5 paragraphs typical)
85
+
86
+ ## What This Command Does NOT Do
87
+
88
+ - Generate retros automatically
89
+ - Require complex metadata
90
+ - Create Linear issues from learnings
91
+ - Force a template
92
+
93
+ ## Integration Points
94
+
95
+ - Creates: `.claude/retros/YYYY-MM/*.md`
96
+ - Synthesized by: `/insights` command