@nlaprell/shipit 1.0.0

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 (160) hide show
  1. package/.cursor/commands/create_intent_from_issue.md +28 -0
  2. package/.cursor/commands/create_pr.md +28 -0
  3. package/.cursor/commands/dashboard.md +39 -0
  4. package/.cursor/commands/deploy.md +152 -0
  5. package/.cursor/commands/drift_check.md +36 -0
  6. package/.cursor/commands/fix.md +39 -0
  7. package/.cursor/commands/generate_release_plan.md +31 -0
  8. package/.cursor/commands/generate_roadmap.md +38 -0
  9. package/.cursor/commands/help.md +37 -0
  10. package/.cursor/commands/init_project.md +26 -0
  11. package/.cursor/commands/kill.md +72 -0
  12. package/.cursor/commands/new_intent.md +68 -0
  13. package/.cursor/commands/pr.md +77 -0
  14. package/.cursor/commands/revert-plan.md +58 -0
  15. package/.cursor/commands/risk.md +64 -0
  16. package/.cursor/commands/rollback.md +43 -0
  17. package/.cursor/commands/scope_project.md +53 -0
  18. package/.cursor/commands/ship.md +345 -0
  19. package/.cursor/commands/status.md +71 -0
  20. package/.cursor/commands/suggest.md +44 -0
  21. package/.cursor/commands/test_shipit.md +197 -0
  22. package/.cursor/commands/verify.md +50 -0
  23. package/.cursor/rules/architect.mdc +84 -0
  24. package/.cursor/rules/assumption-extractor.mdc +95 -0
  25. package/.cursor/rules/docs.mdc +66 -0
  26. package/.cursor/rules/implementer.mdc +112 -0
  27. package/.cursor/rules/pm.mdc +136 -0
  28. package/.cursor/rules/qa.mdc +97 -0
  29. package/.cursor/rules/security.mdc +90 -0
  30. package/.cursor/rules/steward.mdc +99 -0
  31. package/.cursor/rules/test-runner.mdc +196 -0
  32. package/AGENTS.md +121 -0
  33. package/README.md +264 -0
  34. package/_system/architecture/CANON.md +159 -0
  35. package/_system/architecture/invariants.yml +87 -0
  36. package/_system/architecture/project-schema.json +98 -0
  37. package/_system/architecture/workflow-state-layout.md +68 -0
  38. package/_system/artifacts/SYSTEM_STATE.md +43 -0
  39. package/_system/artifacts/confidence-calibration.json +16 -0
  40. package/_system/artifacts/dependencies.md +46 -0
  41. package/_system/artifacts/framework-files-manifest.json +179 -0
  42. package/_system/artifacts/usage.json +1 -0
  43. package/_system/behaviors/DO_RELEASE.md +371 -0
  44. package/_system/behaviors/DO_RELEASE_AI.md +329 -0
  45. package/_system/behaviors/PREPARE_RELEASE.md +373 -0
  46. package/_system/behaviors/PREPARE_RELEASE_AI.md +234 -0
  47. package/_system/behaviors/WORK_ROOT_PLATFORM_ISSUES.md +140 -0
  48. package/_system/behaviors/WORK_TEST_PLAN_ISSUES.md +380 -0
  49. package/_system/do-not-repeat/abandoned-designs.md +18 -0
  50. package/_system/do-not-repeat/bad-patterns.md +19 -0
  51. package/_system/do-not-repeat/failed-experiments.md +18 -0
  52. package/_system/do-not-repeat/rejected-libraries.md +19 -0
  53. package/_system/drift/baselines.md +49 -0
  54. package/_system/drift/metrics.md +33 -0
  55. package/_system/golden-data/.gitkeep +0 -0
  56. package/_system/golden-data/README.md +47 -0
  57. package/_system/reports/mutation/mutation.html +492 -0
  58. package/_system/security/audit-allowlist.json +4 -0
  59. package/bin/create-shipit-app +29 -0
  60. package/bin/shipit +183 -0
  61. package/cli/src/commands/check.js +82 -0
  62. package/cli/src/commands/create.js +195 -0
  63. package/cli/src/commands/init.js +267 -0
  64. package/cli/src/commands/upgrade.js +196 -0
  65. package/cli/src/utils/config.js +27 -0
  66. package/cli/src/utils/file-copy.js +144 -0
  67. package/cli/src/utils/gitignore-merge.js +44 -0
  68. package/cli/src/utils/manifest.js +105 -0
  69. package/cli/src/utils/package-json-merge.js +163 -0
  70. package/cli/src/utils/project-json-merge.js +57 -0
  71. package/cli/src/utils/prompts.js +30 -0
  72. package/cli/src/utils/stack-detection.js +56 -0
  73. package/cli/src/utils/stack-files.js +364 -0
  74. package/cli/src/utils/upgrade-backup.js +159 -0
  75. package/cli/src/utils/version.js +64 -0
  76. package/dashboard-app/README.md +73 -0
  77. package/dashboard-app/eslint.config.js +23 -0
  78. package/dashboard-app/index.html +13 -0
  79. package/dashboard-app/package.json +30 -0
  80. package/dashboard-app/pnpm-lock.yaml +2721 -0
  81. package/dashboard-app/public/dashboard.json +66 -0
  82. package/dashboard-app/public/vite.svg +1 -0
  83. package/dashboard-app/src/App.css +141 -0
  84. package/dashboard-app/src/App.tsx +155 -0
  85. package/dashboard-app/src/assets/react.svg +1 -0
  86. package/dashboard-app/src/index.css +68 -0
  87. package/dashboard-app/src/main.tsx +10 -0
  88. package/dashboard-app/tsconfig.app.json +28 -0
  89. package/dashboard-app/tsconfig.json +4 -0
  90. package/dashboard-app/tsconfig.node.json +26 -0
  91. package/dashboard-app/vite.config.ts +7 -0
  92. package/package.json +116 -0
  93. package/scripts/README.md +70 -0
  94. package/scripts/audit-check.sh +125 -0
  95. package/scripts/calibration-report.sh +198 -0
  96. package/scripts/check-readiness.sh +155 -0
  97. package/scripts/collect-metrics.sh +116 -0
  98. package/scripts/command-manifest.yml +131 -0
  99. package/scripts/create-test-plan-issue.sh +110 -0
  100. package/scripts/dashboard-start.sh +16 -0
  101. package/scripts/deploy.sh +170 -0
  102. package/scripts/drift-check.sh +93 -0
  103. package/scripts/execute-rollback.sh +177 -0
  104. package/scripts/export-dashboard-json.js +208 -0
  105. package/scripts/fix-intents.sh +239 -0
  106. package/scripts/generate-dashboard.sh +136 -0
  107. package/scripts/generate-docs.sh +279 -0
  108. package/scripts/generate-project-context.sh +142 -0
  109. package/scripts/generate-release-plan.sh +443 -0
  110. package/scripts/generate-roadmap.sh +189 -0
  111. package/scripts/generate-system-state.sh +95 -0
  112. package/scripts/gh/create-intent-from-issue.sh +82 -0
  113. package/scripts/gh/create-issue-from-intent.sh +59 -0
  114. package/scripts/gh/create-pr.sh +41 -0
  115. package/scripts/gh/link-issue.sh +44 -0
  116. package/scripts/gh/on-ship-update-issue.sh +42 -0
  117. package/scripts/headless/README.md +8 -0
  118. package/scripts/headless/call-llm.js +109 -0
  119. package/scripts/headless/run-phase.sh +99 -0
  120. package/scripts/help.sh +271 -0
  121. package/scripts/init-project.sh +976 -0
  122. package/scripts/kill-intent.sh +125 -0
  123. package/scripts/lib/common.sh +29 -0
  124. package/scripts/lib/intent.sh +61 -0
  125. package/scripts/lib/progress.sh +57 -0
  126. package/scripts/lib/suggest-next.sh +131 -0
  127. package/scripts/lib/validate-intents.sh +240 -0
  128. package/scripts/lib/verify-outputs.sh +55 -0
  129. package/scripts/lib/workflow_state.sh +201 -0
  130. package/scripts/new-intent.sh +271 -0
  131. package/scripts/publish-npm.sh +28 -0
  132. package/scripts/scope-project.sh +380 -0
  133. package/scripts/setup-worktrees.sh +125 -0
  134. package/scripts/status.sh +278 -0
  135. package/scripts/suggest.sh +173 -0
  136. package/scripts/test-headless.sh +47 -0
  137. package/scripts/test-shipit.sh +52 -0
  138. package/scripts/test-workflow-state.sh +49 -0
  139. package/scripts/usage-report.sh +47 -0
  140. package/scripts/usage.sh +58 -0
  141. package/scripts/validate-cursor.sh +151 -0
  142. package/scripts/validate-project.sh +71 -0
  143. package/scripts/validate-vscode.sh +146 -0
  144. package/scripts/verify.sh +153 -0
  145. package/scripts/workflow-orchestrator.sh +97 -0
  146. package/scripts/workflow-templates/01_analysis.md.tpl +25 -0
  147. package/scripts/workflow-templates/02_plan.md.tpl +30 -0
  148. package/scripts/workflow-templates/03_implementation.md.tpl +25 -0
  149. package/scripts/workflow-templates/04_verification.md.tpl +29 -0
  150. package/scripts/workflow-templates/05_release_notes.md.tpl +16 -0
  151. package/scripts/workflow-templates/05_verification_legacy.md.tpl +6 -0
  152. package/scripts/workflow-templates/active.md.tpl +18 -0
  153. package/scripts/workflow-templates/phases.yml +39 -0
  154. package/stryker.conf.json +8 -0
  155. package/work/intent/templates/api-endpoint.md +124 -0
  156. package/work/intent/templates/bugfix.md +116 -0
  157. package/work/intent/templates/frontend-feature.md +115 -0
  158. package/work/intent/templates/generic.md +122 -0
  159. package/work/intent/templates/infra-change.md +121 -0
  160. package/work/intent/templates/refactor.md +116 -0
@@ -0,0 +1,371 @@
1
+ # Release Execution Guide
2
+
3
+ **Purpose:** This document provides step-by-step instructions for executing a release after preparation is complete. Follow these steps in order, validating each step before proceeding.
4
+
5
+ **When to use:** After completing all steps in `PREPARE_RELEASE.md`.
6
+
7
+ ## Scope and Safety
8
+
9
+ - This document covers execution only (commit, tag, push, release).
10
+ - Do NOT modify product/code files here. Only commit the release prep files.
11
+ - If any step requires edits beyond release prep files, stop and report.
12
+ - If you are not on the release branch, stop and switch to the correct branch.
13
+
14
+ **Prerequisites:**
15
+
16
+ - All preparation steps from `PREPARE_RELEASE.md` are complete
17
+ - Version consistency verified across all files
18
+ - All release preparation changes are ready to commit
19
+ - No uncommitted changes except release preparation files
20
+
21
+ ## Release Version (required)
22
+
23
+ - Define `VERSION=X.Y.Z` before starting.
24
+ - Use this exact `VERSION` in all commands below.
25
+ - If the version changes mid-process, stop and restart from Step 1.
26
+
27
+ **Important:** This process will commit changes, create tags, push to GitHub, and create a GitHub release. Ensure you have proper permissions and are ready to publish.
28
+
29
+ ---
30
+
31
+ ## Step 1: Commit Release Preparation
32
+
33
+ **Objective:** Commit all release preparation changes.
34
+
35
+ **Actions:**
36
+
37
+ 1. Confirm correct branch: `git branch --show-current`
38
+ - **Verify:** You are on the intended release branch (usually `main` or `master`)
39
+ 2. Confirm only release prep files are modified: `git status --porcelain`
40
+ - **Verify:** Only `CHANGELOG.md`, `package.json`, `README.md` appear
41
+ - **If other files:** Stop and revert or stash unrelated changes
42
+ 3. Stage release prep files only:
43
+ - `git add CHANGELOG.md package.json README.md`
44
+ 4. Review staged changes: `git diff --cached`
45
+ - **Verify:** Only the release prep files are staged
46
+ 5. Commit with message: `git commit -m "chore: prepare release vX.Y.Z"`
47
+ 6. Verify commit: `git log -1 --stat`
48
+
49
+ **Commit Message Format:**
50
+
51
+ ```
52
+ chore: prepare release vX.Y.Z
53
+
54
+ - Update CHANGELOG.md with vX.Y.Z changes
55
+ - Bump version to X.Y.Z in package.json
56
+ - Update README.md version badge and history
57
+ ```
58
+
59
+ **Validation:**
60
+
61
+ - All release prep files are committed
62
+ - Commit message follows conventional commit format
63
+ - No uncommitted changes remain
64
+ - Commit is on correct branch (main/master)
65
+
66
+ **Rule:** Release preparation commits should be separate from feature commits.
67
+
68
+ **If validation fails:** Fix issues before proceeding. Do not create tag with uncommitted changes.
69
+
70
+ **STOP GATE:** If any validation fails, stop and fix before moving to Step 2.
71
+
72
+ ---
73
+
74
+ ## Step 2: Create Git Tag
75
+
76
+ **Objective:** Create an annotated git tag for the release.
77
+
78
+ **Actions:**
79
+
80
+ 1. Confirm `VERSION` matches `package.json` before tagging
81
+ 2. Create annotated tag: `git tag -a vX.Y.Z -m "Release vX.Y.Z: Brief description"`
82
+ 3. Verify tag: `git tag -l "v*" | tail -1`
83
+ 4. Show tag message: `git show vX.Y.Z`
84
+
85
+ **Tag Message Format:**
86
+
87
+ ```
88
+ Release vX.Y.Z: Brief Description
89
+
90
+ Key highlights:
91
+ - Feature 1
92
+ - Feature 2
93
+ - Improvement 1
94
+
95
+ See CHANGELOG.md for full details.
96
+ ```
97
+
98
+ **Tag Message Best Practices:**
99
+
100
+ - Use the version section from CHANGELOG.md as reference
101
+ - Include 2-4 key highlights
102
+ - Reference CHANGELOG.md for full details
103
+ - Keep it concise but informative
104
+
105
+ **Validation:**
106
+
107
+ - Tag name matches version (e.g., `v0.2.0`)
108
+ - Tag is annotated (not lightweight) - verify with `git show vX.Y.Z` shows tag message
109
+ - Tag message is descriptive and includes key highlights
110
+ - Tag points to the commit just created (verify with `git log --oneline --decorate`)
111
+
112
+ **Rule:** Always use annotated tags for releases (not lightweight tags). Use `-a` flag.
113
+
114
+ **If validation fails:** Delete tag with `git tag -d vX.Y.Z`, fix issues, then recreate tag.
115
+
116
+ **STOP GATE:** If tag validation fails, stop and fix before moving to Step 3.
117
+
118
+ ---
119
+
120
+ ## Step 3: Push to Remote
121
+
122
+ **Objective:** Push commits and tags to GitHub.
123
+
124
+ **Actions:**
125
+
126
+ 1. Determine branch name: `git branch --show-current`
127
+ 2. Push commits first: `git push origin <branch-name>`
128
+ - **Example:** `git push origin main`
129
+ 3. Verify commits pushed: Check GitHub repository
130
+ 4. Push tag: `git push origin vX.Y.Z`
131
+ 5. Verify tag pushed: Check GitHub tags page or releases page
132
+
133
+ **Validation:**
134
+
135
+ - Commits pushed successfully (no errors)
136
+ - Tag pushed successfully (no errors)
137
+ - Tag visible on GitHub releases/tags page
138
+ - Tag points to correct commit on GitHub
139
+
140
+ **Rule:** Push commits before tags to ensure tag references exist on remote.
141
+
142
+ **If validation fails:**
143
+
144
+ - If commit push fails: Fix branch/remote issues, then retry
145
+ - If tag push fails: Verify tag exists locally, check remote permissions, then retry
146
+ - Do not proceed to GitHub release until tag is visible on GitHub
147
+
148
+ **STOP GATE:** If the tag is not visible on GitHub, stop and resolve before moving to Step 4.
149
+
150
+ ---
151
+
152
+ ## Step 4: Create GitHub Release
153
+
154
+ **Objective:** Create a GitHub release with release notes. **This step is REQUIRED, not optional.**
155
+
156
+ **Actions:**
157
+
158
+ 1. Navigate to GitHub repository releases page:
159
+ - URL format: `https://github.com/<owner>/<repo>/releases`
160
+ - Or: Repository → Releases → "Draft a new release"
161
+ 2. Click "Draft a new release" button
162
+ 3. Select tag: Choose `vX.Y.Z` from dropdown
163
+ - **Verify:** Tag exists and is correct version
164
+ 4. Set release title: `Release vX.Y.Z: Brief Description`
165
+ - Use same description from tag message
166
+ 5. Set release description:
167
+ - Copy entire version section from CHANGELOG.md
168
+ - Include all categories (Added, Changed, Fixed, Removed)
169
+ - Keep markdown formatting
170
+ - Add links to issues if applicable (e.g., `[#123](https://github.com/owner/repo/issues/123)`)
171
+ 6. Mark as "Latest release" checkbox:
172
+ - **Check this** if this is the newest release
173
+ - **Uncheck** if releasing an older version
174
+ 7. Click "Publish release" button
175
+ 8. Verify release is published:
176
+ - Release appears on releases page
177
+ - Release notes are complete
178
+ - Release is marked as latest (if checked)
179
+
180
+ **Release Notes Format:**
181
+ Copy the version section from CHANGELOG.md, for example:
182
+
183
+ ```markdown
184
+ ## [0.2.0] - 2026-01-27
185
+
186
+ ### Added
187
+
188
+ - Intent validation and auto-fix (`/fix` command)
189
+ - Output verification system with automatic generator chaining
190
+ - Unified status dashboard (`/status` command)
191
+
192
+ ### Changed
193
+
194
+ - Enhanced `/scope-project` with batched prompts
195
+ - Enhanced `/generate-release-plan` with validation warnings
196
+
197
+ ### Fixed
198
+
199
+ - Fixed numeric validation in dependency ordering checks
200
+ - Fixed temp file cleanup in fix-intents.sh
201
+ ```
202
+
203
+ **Validation:**
204
+
205
+ - Release is published on GitHub (not draft)
206
+ - Release notes are complete and accurate
207
+ - Release notes match CHANGELOG.md version section
208
+ - Release is marked as latest (if appropriate)
209
+ - Release tag matches the tag that was pushed
210
+ - Release is accessible via repository releases page
211
+
212
+ **Rule:** GitHub release creation is MANDATORY. Do not skip this step.
213
+
214
+ **If validation fails:**
215
+
216
+ - If release creation fails: Check GitHub permissions, verify tag exists, then retry
217
+ - If release notes are incomplete: Edit release and update notes
218
+ - If release is draft: Click "Publish release" to make it public
219
+
220
+ **STOP GATE:** If the release is not published and verified, stop and fix before final verification.
221
+
222
+ ---
223
+
224
+ ## Step 5: Publish to npm (optional)
225
+
226
+ **Objective:** Publish the ShipIt CLI package to npm so users can install with `npm install -g @nlaprell/shipit`. Skip if not publishing to npm for this release.
227
+
228
+ **Actions:**
229
+
230
+ 1. Ensure `package.json` version matches the release (e.g. `X.Y.Z` for tag `vX.Y.Z`).
231
+ 2. Run tests: `pnpm test && pnpm test:cli && pnpm test:shipit`.
232
+ 3. Preview: `npm pack` then inspect tarball if desired.
233
+ 4. Publish: `npm publish` (requires `npm login` and 2FA).
234
+ 5. Verify at https://www.npmjs.com/package/shipit.
235
+
236
+ **If using CI:** A workflow may publish on release creation when `NODE_AUTH_TOKEN` (or `NPM_TOKEN`) is set. See `docs/PUBLISHING.md`.
237
+
238
+ **Validation:**
239
+
240
+ - Package version on npm matches GitHub release tag.
241
+ - `npm install -g @nlaprell/shipit` works and `shipit --help` runs.
242
+
243
+ ---
244
+
245
+ ## Final Verification
246
+
247
+ **Objective:** Verify the complete release process was successful.
248
+
249
+ **Checklist:**
250
+
251
+ - [ ] Release preparation commit created and pushed
252
+ - [ ] Git tag created and pushed to GitHub
253
+ - [ ] GitHub release created and published
254
+ - [ ] (Optional) npm package published; version matches release
255
+ - [ ] Release notes match CHANGELOG.md
256
+ - [ ] Release is marked as latest (if appropriate)
257
+ - [ ] Version badge on README.md links to correct release
258
+ - [ ] All validation steps passed
259
+
260
+ **Verification Commands:**
261
+
262
+ ```bash
263
+ # Verify tag exists locally and remotely
264
+ git tag -l "v*" | tail -1
265
+ git ls-remote --tags origin | grep "vX.Y.Z"
266
+
267
+ # Verify release commit
268
+ git log --oneline -1
269
+ git show HEAD --stat
270
+
271
+ # Verify version consistency (should still match)
272
+ CURRENT_VERSION=$(grep '"version"' package.json | cut -d'"' -f4)
273
+ echo "Current version: $CURRENT_VERSION"
274
+ ```
275
+
276
+ **Manual Verification:**
277
+
278
+ 1. Visit GitHub releases page: `https://github.com/<owner>/<repo>/releases`
279
+ 2. Verify release `vX.Y.Z` exists and is published
280
+ 3. Verify release notes are complete
281
+ 4. Verify README.md badge links to correct release
282
+ 5. Verify tag exists and points to correct commit
283
+
284
+ **If any verification fails:** Fix issues immediately. If release was published incorrectly, you may need to:
285
+
286
+ - Delete and recreate the GitHub release
287
+ - Delete and recreate the tag (if necessary)
288
+ - Fix any documentation issues
289
+
290
+ ---
291
+
292
+ ## Rules and Constraints
293
+
294
+ ### Mandatory Rules:
295
+
296
+ 1. **GitHub release is required** - Do not skip Step 4. Every release must have a GitHub release.
297
+ 2. **Tags must be annotated** - Always use `-a` flag when creating tags
298
+ 3. **Push commits before tags** - Ensure commits exist on remote before pushing tags
299
+ 4. **Release notes must match CHANGELOG.md** - Keep them synchronized
300
+ 5. **Verify before proceeding** - Validate each step before moving to next
301
+ 6. **No uncommitted changes** - All changes must be committed before tagging
302
+ 7. **No file edits in this phase** - Only commit the prepared files; do not modify other files
303
+
304
+ ### Best Practices:
305
+
306
+ 1. **Review before committing** - Review `git diff --cached` before committing
307
+ 2. **Descriptive tag messages** - Include key highlights in tag message
308
+ 3. **Complete release notes** - Copy full version section from CHANGELOG.md
309
+ 4. **Mark as latest** - Check "Latest release" if this is the newest version
310
+ 5. **Test tag locally** - Verify tag before pushing to remote
311
+
312
+ ### Error Handling:
313
+
314
+ - **If commit fails:** Fix issues, then retry commit
315
+ - **If tag creation fails:** Check for existing tag, delete if needed, then recreate
316
+ - **If push fails:** Check remote permissions and branch protection rules
317
+ - **If GitHub release fails:** Verify tag exists on GitHub, check permissions, then retry
318
+ - **If any step fails:** Stop immediately, fix the issue, then restart from the failed step
319
+
320
+ ---
321
+
322
+ ## Quick Reference Checklist
323
+
324
+ Use this checklist when executing a release:
325
+
326
+ ```
327
+ [ ] Step 1: Commit release preparation
328
+ [ ] Step 2: Create git tag (annotated)
329
+ [ ] Step 3: Push commits and tag to GitHub
330
+ [ ] Step 4: Create GitHub release (REQUIRED)
331
+ [ ] Step 5: Publish to npm (optional)
332
+ [ ] Final verification: All steps completed successfully
333
+ ```
334
+
335
+ ---
336
+
337
+ ## Automation Notes
338
+
339
+ **For AI Agents:**
340
+
341
+ - Execute steps sequentially
342
+ - Validate each step before proceeding
343
+ - Use provided validation commands
344
+ - Stop on any error
345
+ - Report progress clearly
346
+ - Document any deviations
347
+ - **Do not skip GitHub release creation** - it is mandatory
348
+
349
+ **For Human Review:**
350
+
351
+ - Review commit changes before committing
352
+ - Verify tag message is appropriate
353
+ - Check release notes match CHANGELOG.md
354
+ - Confirm release is marked as latest (if appropriate)
355
+ - Verify release is accessible on GitHub
356
+
357
+ ---
358
+
359
+ ## Post-Release Tasks
360
+
361
+ After completing the release, consider:
362
+
363
+ 1. **Announce release** - Notify stakeholders if applicable
364
+ 2. **Update documentation** - Ensure all docs reference new version
365
+ 3. **Monitor issues** - Watch for any issues reported with new release
366
+ 4. **Plan next release** - Start tracking changes for next version in CHANGELOG.md [Unreleased]
367
+
368
+ ---
369
+
370
+ **Last Updated:** 2026-01-27
371
+ **Version:** 1.0
@@ -0,0 +1,329 @@
1
+ # AI Release Execution Guide
2
+
3
+ **Purpose:** Deterministic, agent-safe execution flow for publishing a release. This is the AI-native alternative to `DO_RELEASE.md`.
4
+
5
+ **When to use:** After completing all steps in `PREPARE_RELEASE_AI.md` (or `PREPARE_RELEASE.md`).
6
+
7
+ ## Scope and Safety
8
+
9
+ - Execution only (commit, tag, push, release).
10
+ - Do NOT modify product/code files here.
11
+ - Only commit the release prep files: `CHANGELOG.md`, `package.json`, `README.md`.
12
+ - Execute steps sequentially. Stop on any failure.
13
+ - Require explicit user approval to proceed (from the prep summary handoff).
14
+
15
+ ---
16
+
17
+ ## Confirmation (required)
18
+
19
+ **Objective:** Ensure the user explicitly approves execution.
20
+
21
+ **Check:**
22
+
23
+ - The user responded "yes" (or equivalent) to the prep handoff question.
24
+
25
+ **STOP GATE:** If approval is missing or ambiguous, stop and ask for confirmation.
26
+
27
+ ---
28
+
29
+ ## Step 0.5: Carry-Forward Summary (required)
30
+
31
+ **Objective:** Anchor execution to the prep summary for auditability.
32
+
33
+ **Record (copy from prep summary):**
34
+
35
+ ```
36
+ Release Status: READY | BLOCKED
37
+ Version: X.Y.Z
38
+ Prepared by: <agent or user>
39
+ Notes: <short status note>
40
+ Approval: <yes/no + who approved>
41
+ ```
42
+
43
+ **STOP GATE:** If any field is missing, stop and request the missing detail.
44
+
45
+ ---
46
+
47
+ ## Step 0: Preflight Gate (single command)
48
+
49
+ **Objective:** Fail fast if prereqs are not met.
50
+
51
+ **Command:**
52
+
53
+ ```bash
54
+ BRANCH=$(git branch --show-current)
55
+ STATUS=$(git status --porcelain)
56
+ echo "$BRANCH"
57
+ echo "$STATUS"
58
+
59
+ # Fail if not on intended release branch
60
+ if [ "$BRANCH" != "main" ] && [ "$BRANCH" != "master" ]; then
61
+ echo "✗ Wrong branch: $BRANCH"
62
+ exit 1
63
+ fi
64
+
65
+ # Fail if any file other than allowed prep files is modified
66
+ ALLOWED="CHANGELOG.md|package.json|README.md"
67
+ if echo "$STATUS" | grep -vE "^[ MADRCU?!]{1,2} ($ALLOWED)$" >/dev/null; then
68
+ echo "✗ Non-release-prep files modified"
69
+ echo "$STATUS"
70
+ exit 1
71
+ fi
72
+ ```
73
+
74
+ **Validation:**
75
+
76
+ - Branch is the intended release branch (usually `main` or `master`).
77
+ - Only release prep files appear in status.
78
+ - User explicitly approved execution after prep summary.
79
+
80
+ **STOP GATE:** If any validation fails, stop and report.
81
+
82
+ ---
83
+
84
+ ## Step 1: Lock VERSION
85
+
86
+ **Objective:** Use one version string for the entire execution.
87
+
88
+ **Actions:**
89
+
90
+ 1. Set `VERSION=X.Y.Z` and export it.
91
+ 2. Validate it matches `package.json`.
92
+
93
+ **Command:**
94
+
95
+ ```bash
96
+ export VERSION="X.Y.Z"
97
+ CURRENT_VERSION=$(grep '"version"' package.json | cut -d'"' -f4)
98
+ if [ "$VERSION" != "$CURRENT_VERSION" ]; then
99
+ echo "✗ VERSION mismatch: package.json=$CURRENT_VERSION, VERSION=$VERSION"
100
+ exit 1
101
+ fi
102
+ ```
103
+
104
+ **STOP GATE:** If `VERSION` does not match `package.json`, stop.
105
+
106
+ ---
107
+
108
+ ## Step 2: Commit Release Preparation
109
+
110
+ **Objective:** Commit only the release prep changes.
111
+
112
+ **Commands:**
113
+
114
+ ```bash
115
+ git add CHANGELOG.md package.json README.md
116
+ git diff --cached
117
+
118
+ # Fail if staged files include anything else
119
+ if git diff --cached --name-only | grep -vE "^(CHANGELOG.md|package.json|README.md)$" >/dev/null; then
120
+ echo "✗ Staged non-release-prep files"
121
+ git diff --cached --name-only
122
+ exit 1
123
+ fi
124
+
125
+ git commit -m "chore: prepare release v$VERSION" \
126
+ -m "- Update CHANGELOG.md with v$VERSION changes" \
127
+ -m "- Bump version to $VERSION in package.json" \
128
+ -m "- Update README.md version badge and history"
129
+ git log -1 --stat
130
+ ```
131
+
132
+ **Validation:**
133
+
134
+ - Only prep files are staged and committed.
135
+ - Commit message follows the required format.
136
+
137
+ **STOP GATE:** If validation fails, stop and fix.
138
+
139
+ ---
140
+
141
+ ## Step 3: Create Annotated Tag
142
+
143
+ **Objective:** Create a descriptive annotated tag.
144
+
145
+ **Actions:**
146
+
147
+ 1. Extract 2–4 highlights from the `CHANGELOG.md` section for `VERSION`.
148
+ 2. Create an annotated tag using those highlights.
149
+
150
+ **Extraction (deterministic):**
151
+
152
+ ```bash
153
+ # Pull first 4 bullet lines from the VERSION section (any category)
154
+ HIGHLIGHTS=$(awk -v v="## [$VERSION]" '
155
+ $0 ~ v {in=1; next}
156
+ in && /^## \\[/ {exit}
157
+ in && /^- / {print; c++}
158
+ c==4 {exit}
159
+ ' CHANGELOG.md)
160
+ ```
161
+
162
+ **Command (template):**
163
+
164
+ ```bash
165
+ git tag -a "v$VERSION" -m "Release v$VERSION: <Brief Description>" \
166
+ -m "Key highlights:" \
167
+ -m "$(echo "$HIGHLIGHTS" | sed -n '1p')" \
168
+ -m "$(echo "$HIGHLIGHTS" | sed -n '2p')" \
169
+ -m "$(echo "$HIGHLIGHTS" | sed -n '3p')" \
170
+ -m "" \
171
+ -m "See CHANGELOG.md for full details."
172
+ git tag -l "v*" | tail -1
173
+ git show "v$VERSION"
174
+ ```
175
+
176
+ **STOP GATE:** If tag is not annotated or does not point at the commit just created, stop and fix.
177
+
178
+ ---
179
+
180
+ ## Step 4: Push Commit and Tag
181
+
182
+ **Objective:** Push to GitHub in correct order.
183
+
184
+ **Commands:**
185
+
186
+ ```bash
187
+ BRANCH=$(git branch --show-current)
188
+ git push origin "$BRANCH"
189
+ git push origin "v$VERSION"
190
+ ```
191
+
192
+ **STOP GATE:** If either push fails, stop and resolve before proceeding.
193
+
194
+ ---
195
+
196
+ ## Step 5: Create GitHub Release (CLI)
197
+
198
+ **Objective:** Publish the release using the exact changelog section.
199
+
200
+ **Actions:**
201
+
202
+ 1. Extract the `CHANGELOG.md` section for `VERSION` into a temporary notes file.
203
+ 2. Use `gh release create` with the notes file to avoid shell expansion.
204
+
205
+ **Commands (safe):**
206
+
207
+ ```bash
208
+ # Extract the exact VERSION section into a notes file
209
+ awk -v v="## [$VERSION]" '
210
+ $0 ~ v {in=1}
211
+ in {print}
212
+ in && /^## \\[/ && $0 !~ v {exit}
213
+ ' CHANGELOG.md > "/tmp/release_notes_$VERSION.md"
214
+
215
+ gh release create "v$VERSION" \
216
+ --title "Release v$VERSION: <Brief Description>" \
217
+ --notes-file "/tmp/release_notes_$VERSION.md"
218
+ ```
219
+
220
+ **STOP GATE:** If the release is not published or notes are incomplete, stop and fix.
221
+
222
+ ---
223
+
224
+ ## Step 5.5: Idempotency Guard
225
+
226
+ **Objective:** Prevent collisions if a tag or release already exists.
227
+
228
+ **Commands:**
229
+
230
+ ```bash
231
+ if git rev-parse "v$VERSION" >/dev/null 2>&1; then
232
+ echo "✗ Tag v$VERSION already exists"
233
+ exit 1
234
+ fi
235
+
236
+ if gh release view "v$VERSION" >/dev/null 2>&1; then
237
+ echo "✗ GitHub release v$VERSION already exists"
238
+ exit 1
239
+ fi
240
+ ```
241
+
242
+ **STOP GATE:** If either exists, stop and decide whether to delete/recreate or abort.
243
+
244
+ ---
245
+
246
+ ## Step 6: Verification Bundle
247
+
248
+ **Objective:** Verify release integrity end-to-end.
249
+
250
+ **Commands:**
251
+
252
+ ```bash
253
+ git tag -l "v*" | tail -1
254
+ git ls-remote --tags origin | grep "v$VERSION"
255
+ git log --oneline -1
256
+ git show HEAD --stat
257
+ gh release view "v$VERSION" --json name,tagName,url,isDraft,isPrerelease,publishedAt
258
+ ```
259
+
260
+ **Validation:**
261
+
262
+ - Tag exists locally and on remote.
263
+ - GitHub release is published (not draft).
264
+ - Release notes match the `CHANGELOG.md` section for `VERSION`.
265
+
266
+ **STOP GATE:** If any check fails, stop and resolve before proceeding.
267
+
268
+ ---
269
+
270
+ ## Rollback (if needed)
271
+
272
+ **Objective:** Provide a clean recovery path if a release was created incorrectly.
273
+
274
+ **Commands:**
275
+
276
+ ```bash
277
+ # Delete GitHub release (if created)
278
+ gh release delete "v$VERSION" --yes
279
+
280
+ # Delete local and remote tag
281
+ git tag -d "v$VERSION"
282
+ git push origin ":refs/tags/v$VERSION"
283
+ ```
284
+
285
+ **STOP GATE:** After rollback, restart from Step 0.
286
+
287
+ ---
288
+
289
+ ## Step 7: Stop and Summarize (final step)
290
+
291
+ **Objective:** End execution cleanly and report status.
292
+
293
+ **Report Template (fill in):**
294
+
295
+ ```
296
+ [x] Release prep commit created and pushed
297
+ [x] Annotated tag vX.Y.Z created and pushed
298
+ [x] GitHub release published
299
+ [x] Release notes match CHANGELOG.md
300
+ [x] All validation checks passed
301
+ ```
302
+
303
+ **STOP GATE:** Do not proceed to any other steps here.
304
+
305
+ ---
306
+
307
+ ## Agent Output Guidance (recommended)
308
+
309
+ **Objective:** Make the agent's logs easy to scan for humans.
310
+
311
+ **Per-step output format:**
312
+
313
+ ```
314
+ Step X: <Name>
315
+ - Status: PASS | FAIL
316
+ - Evidence: <command or artifact>
317
+ - Notes: <short reason or error>
318
+ ```
319
+
320
+ **Final summary (always print):**
321
+
322
+ ```
323
+ Release Execution Summary
324
+ - Version: X.Y.Z
325
+ - Commit: <sha>
326
+ - Tag: vX.Y.Z
327
+ - Release URL: <url>
328
+ - Gates passed: <count>/<count>
329
+ ```