@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,373 @@
1
+ # Release Preparation Guide
2
+
3
+ **Purpose:** This document provides step-by-step instructions for preparing the ShipIt platform for a new release. Follow these steps in order, validating each step before proceeding.
4
+
5
+ **When to use:** Before executing the release (see `DO_RELEASE.md` for execution steps).
6
+
7
+ ## Scope and Safety
8
+
9
+ - This document covers preparation only.
10
+ - Do NOT commit, tag, push, or create a GitHub release here.
11
+ - Only edit these files: `CHANGELOG.md`, `package.json`, `README.md`.
12
+ - If any step requires edits outside those files, stop and report.
13
+
14
+ **Prerequisites:**
15
+
16
+ - All active issues resolved or documented
17
+ - All tests passing
18
+ - All changes committed to feature branches (if applicable)
19
+ - Main branch is stable and ready for release
20
+
21
+ ## Release Version (required)
22
+
23
+ - Define `VERSION=X.Y.Z` before starting.
24
+ - Use this exact `VERSION` in every file update.
25
+ - If the version changes mid-process, stop and restart from Step 1.
26
+
27
+ **Next Steps:** After completing all preparation steps, proceed to `DO_RELEASE.md` to commit, tag, and publish the release.
28
+
29
+ ---
30
+
31
+ ## Step 1: Verify Code Quality
32
+
33
+ **Objective:** Ensure all code quality checks pass before release.
34
+
35
+ **Actions:**
36
+
37
+ 1. Run linting: `pnpm lint`
38
+ - **Success criteria:** No errors or warnings
39
+ - **If fails:** Fix all linting errors before proceeding
40
+ - **Rule:** Zero tolerance for linting errors in release
41
+
42
+ 2. Run type checking: `pnpm typecheck`
43
+ - **Success criteria:** No type errors
44
+ - **If fails:** Fix all type errors before proceeding
45
+ - **Rule:** TypeScript strict mode must pass completely
46
+
47
+ 3. Run test suite: `pnpm test`
48
+ - **Success criteria:** All tests pass
49
+ - **If fails:** Fix failing tests or document known issues
50
+ - **Rule:** Test suite must be green (100% pass rate expected)
51
+
52
+ 4. Verify clean working tree BEFORE edits: `git status --porcelain`
53
+ - **Success criteria:** No modified files before release prep edits begin
54
+ - **If uncommitted:** Stash or commit non-release changes before proceeding
55
+ - **Rule:** Only release prep files should change during this document
56
+
57
+ **Validation:**
58
+
59
+ ```bash
60
+ pnpm lint && pnpm typecheck && pnpm test && [ -z "$(git status --porcelain)" ]
61
+ ```
62
+
63
+ **If validation fails:** Stop and fix issues. Do not proceed until all checks pass.
64
+
65
+ **STOP GATE:** If any command fails or the working tree is not clean before edits, stop and report. Do not continue.
66
+
67
+ ---
68
+
69
+ ## Step 2: Determine Version Number
70
+
71
+ **Objective:** Select the appropriate semantic version number.
72
+
73
+ **Rules:**
74
+
75
+ - **MAJOR (X.0.0):** Breaking changes that require user action
76
+ - **MINOR (0.X.0):** New features, backward compatible
77
+ - **PATCH (0.0.X):** Bug fixes, backward compatible
78
+
79
+ **Decision Process:**
80
+
81
+ 1. Review `CHANGELOG.md` [Unreleased] section
82
+ 2. Categorize changes:
83
+ - Breaking changes → MAJOR bump
84
+ - New features → MINOR bump
85
+ - Only bug fixes → PATCH bump
86
+ 3. Check current version in `package.json`
87
+ 4. Calculate next version using semantic versioning rules
88
+
89
+ **Example:**
90
+
91
+ - Current: `0.1.0`
92
+ - Changes: New features (validation, status dashboard, progress indicators)
93
+ - Next: `0.2.0` (MINOR bump)
94
+
95
+ **Validation:**
96
+
97
+ - Version number follows semantic versioning format (X.Y.Z)
98
+ - Version number is higher than current version
99
+ - Version bump matches change type (major/minor/patch)
100
+
101
+ **STOP GATE:** If the version is not valid or not agreed, stop and resolve before proceeding.
102
+
103
+ ## Step 2.5: Record Chosen Version
104
+
105
+ **Objective:** Lock the chosen version for the remainder of preparation.
106
+
107
+ **Actions:**
108
+
109
+ 1. Set `VERSION` to the chosen value (e.g., `0.2.0`).
110
+ 2. Use this `VERSION` string consistently in Steps 3–5.
111
+
112
+ **Validation:**
113
+
114
+ - `VERSION` is defined once and reused verbatim
115
+ - No conflicting version strings appear in the release prep files
116
+
117
+ **STOP GATE:** If multiple versions are in play, stop and restart from Step 1 with a single `VERSION`.
118
+
119
+ ---
120
+
121
+ ## Step 3: Update CHANGELOG.md
122
+
123
+ **Objective:** Document all changes in the changelog.
124
+
125
+ **Actions:**
126
+
127
+ 1. Read current `CHANGELOG.md`
128
+ 2. Review `[Unreleased]` section
129
+ 3. Create new version section with date: `## [X.Y.Z] - YYYY-MM-DD`
130
+ 4. Move items from `[Unreleased]` to new version section
131
+ 5. Categorize changes:
132
+ - **Added:** New features, commands, scripts
133
+ - **Changed:** Modifications to existing functionality
134
+ - **Fixed:** Bug fixes and corrections
135
+ - **Removed:** Deprecated or deleted features
136
+ 6. Use clear, concise descriptions
137
+ 7. Reference issue numbers if applicable (e.g., "Fixed ISSUE-021")
138
+ 8. Clear `[Unreleased]` section (set all to "None" or remove items)
139
+
140
+ **Format Requirements:**
141
+
142
+ - Use markdown list format (`- Item description`)
143
+ - Group by category (Added, Changed, Fixed, Removed)
144
+ - Match the existing style in `CHANGELOG.md`
145
+ - Be specific and actionable
146
+
147
+ **Example:**
148
+
149
+ ```markdown
150
+ ## [0.2.0] - 2026-01-27
151
+
152
+ ### Added
153
+
154
+ - Intent validation and auto-fix (`/fix` command)
155
+ - Output verification system with automatic generator chaining
156
+ - Unified status dashboard (`/status` command)
157
+
158
+ ### Changed
159
+
160
+ - Enhanced `/scope-project` with batched prompts
161
+ - Enhanced `/generate-release-plan` with validation warnings
162
+
163
+ ### Fixed
164
+
165
+ - Fixed numeric validation in dependency ordering checks
166
+ - Fixed temp file cleanup in fix-intents.sh
167
+ ```
168
+
169
+ **Validation:**
170
+
171
+ - New version section exists with correct date
172
+ - All changes from `[Unreleased]` are categorized
173
+ - `[Unreleased]` section is cleared
174
+ - Format matches existing changelog style
175
+
176
+ **STOP GATE:** If the changelog does not meet all validations, stop and fix before proceeding.
177
+
178
+ ---
179
+
180
+ ## Step 4: Update package.json Version
181
+
182
+ **Objective:** Update the version field in package.json.
183
+
184
+ **Actions:**
185
+
186
+ 1. Open `package.json`
187
+ 2. Locate `"version"` field
188
+ 3. Update to new version number (e.g., `"0.2.0"`)
189
+ 4. Save file
190
+
191
+ **Validation:**
192
+
193
+ - Version matches the version in CHANGELOG.md
194
+ - Version follows semantic versioning format
195
+ - No other version references need updating (this is the source of truth)
196
+
197
+ **Rule:** `package.json` version is the authoritative version number.
198
+
199
+ **STOP GATE:** If `package.json` does not match `CHANGELOG.md`, stop and fix before proceeding.
200
+
201
+ ---
202
+
203
+ ## Step 5: Update README.md Version References
204
+
205
+ **Objective:** Update version badges and history in README.
206
+
207
+ **Actions:**
208
+
209
+ 1. Find version badge near top of README.md:
210
+ ```markdown
211
+ [![Version](https://img.shields.io/badge/version-X.Y.Z-blue.svg)](https://github.com/NJLaPrell/ShipIt/releases/tag/vX.Y.Z)
212
+ ```
213
+ 2. Update version number in badge URL
214
+ 3. Update version number in badge text
215
+ 4. Find "Version History" section
216
+ 5. Add new version entry at top of history:
217
+ ```markdown
218
+ - **vX.Y.Z** (YYYY-MM-DD) - Brief description
219
+ - Feature highlights
220
+ - Key improvements
221
+ ```
222
+ 6. Keep previous versions in history
223
+
224
+ **Validation:**
225
+
226
+ - Badge shows correct version
227
+ - Badge link points to correct GitHub release tag
228
+ - Version history includes new version
229
+ - Version history is in reverse chronological order (newest first)
230
+
231
+ **Note:** The release tag will not exist until `DO_RELEASE.md` is completed. A temporary broken badge link is expected.
232
+
233
+ **STOP GATE:** If README does not reflect the chosen `VERSION`, stop and fix before proceeding.
234
+
235
+ ---
236
+
237
+ ## Step 6: Final Verification
238
+
239
+ **Objective:** Verify all release preparation steps are complete.
240
+
241
+ **Checklist:**
242
+
243
+ - [ ] All code quality checks pass (lint, typecheck, tests)
244
+ - [ ] Version number determined and documented
245
+ - [ ] CHANGELOG.md updated with new version section
246
+ - [ ] package.json version updated
247
+ - [ ] README.md version badge and history updated
248
+ - [ ] All changes are ready to commit (release prep changes only)
249
+ - [ ] Only release prep files changed (CHANGELOG.md, package.json, README.md)
250
+ - [ ] Active issues in `tests/ISSUES.md` are resolved or explicitly documented
251
+
252
+ **Validation Command:**
253
+
254
+ ```bash
255
+ # Verify version consistency
256
+ CURRENT_VERSION=$(grep '"version"' package.json | cut -d'"' -f4)
257
+ CHANGELOG_VERSION=$(grep '^## \[' CHANGELOG.md | head -1 | sed 's/## \[\(.*\)\].*/\1/')
258
+ README_VERSION=$(grep 'version-' README.md | head -1 | sed 's/.*version-\([0-9.]*\).*/\1/')
259
+
260
+ if [ "$CURRENT_VERSION" = "$CHANGELOG_VERSION" ] && [ "$CURRENT_VERSION" = "$README_VERSION" ]; then
261
+ echo "✓ Version consistency check passed: $CURRENT_VERSION"
262
+ else
263
+ echo "✗ Version mismatch detected!"
264
+ echo " package.json: $CURRENT_VERSION"
265
+ echo " CHANGELOG.md: $CHANGELOG_VERSION"
266
+ echo " README.md: $README_VERSION"
267
+ exit 1
268
+ fi
269
+ ```
270
+
271
+ **If validation fails:** Fix inconsistencies before proceeding.
272
+
273
+ **Fallback (if the command fails or returns empty values):**
274
+
275
+ - Manually open `package.json`, `CHANGELOG.md`, and `README.md`.
276
+ - Confirm the version is identical in all three places.
277
+
278
+ **STOP GATE:** If any validation fails, stop here and do not proceed to `DO_RELEASE.md`.
279
+
280
+ ---
281
+
282
+ ## Step 7: Stop and Summarize (Final Step)
283
+
284
+ **Objective:** End preparation cleanly and report what was accomplished.
285
+
286
+ **Actions:**
287
+
288
+ 1. Stop. Do not commit, tag, push, or create a release here.
289
+ 2. Produce a short summary of completed preparation tasks.
290
+
291
+ **Accomplished (Preparation Complete):**
292
+
293
+ ```
294
+ [ ] Code quality verified (lint, typecheck, tests)
295
+ [ ] Release VERSION selected and locked
296
+ [ ] CHANGELOG.md updated with the new version section
297
+ [ ] package.json version updated
298
+ [ ] README.md badge and version history updated
299
+ [ ] Version consistency validated across all three files
300
+ [ ] Only release prep files modified
301
+ ```
302
+
303
+ **STOP GATE:** This is the final step. Do not proceed to any execution steps here. Move to `DO_RELEASE.md` only after reporting the summary above.
304
+
305
+ ---
306
+
307
+ ## Rules and Constraints
308
+
309
+ ### Mandatory Rules:
310
+
311
+ 1. **Never skip code quality checks** - All lint, typecheck, and tests must pass
312
+ 2. **Version consistency is required** - package.json, CHANGELOG.md, and README.md must match
313
+ 3. **Semantic versioning is mandatory** - Follow MAJOR.MINOR.PATCH rules strictly
314
+ 4. **Changelog must be updated** - Every release requires changelog entry
315
+ 5. **No unrelated edits** - Only release prep files may change during this document
316
+ 6. **No commits in this phase** - Do not commit, tag, push, or release here
317
+
318
+ ### Best Practices:
319
+
320
+ 1. **Test before release** - Run full test suite before preparing release
321
+ 2. **Review changes** - Review all changes in CHANGELOG.md before proceeding
322
+ 3. **Clear documentation** - Ensure all changes are properly documented
323
+ 4. **Update documentation** - Keep README.md and CHANGELOG.md current
324
+
325
+ ### Error Handling:
326
+
327
+ - **If any step fails:** Stop immediately, fix the issue, then restart from Step 1
328
+ - **If version mismatch detected:** Fix all version references before proceeding
329
+ - **If tests fail:** Do not proceed with release until tests pass
330
+ - **If unrelated edits detected:** Revert those files before proceeding
331
+
332
+ ---
333
+
334
+ ## Quick Reference Checklist
335
+
336
+ Use this checklist when preparing a release:
337
+
338
+ ```
339
+ [ ] Step 1: Verify code quality (lint, typecheck, tests)
340
+ [ ] Step 2: Determine version number
341
+ [ ] Step 3: Update CHANGELOG.md
342
+ [ ] Step 4: Update package.json version
343
+ [ ] Step 5: Update README.md version references
344
+ [ ] Step 6: Final verification (version consistency)
345
+ ```
346
+
347
+ **After completing all steps above, proceed to `DO_RELEASE.md`.**
348
+
349
+ ---
350
+
351
+ ## Automation Notes
352
+
353
+ **For AI Agents:**
354
+
355
+ - Execute steps sequentially
356
+ - Validate each step before proceeding
357
+ - Use provided validation commands
358
+ - Stop on any error
359
+ - Report progress clearly
360
+ - Document any deviations
361
+ - Do not proceed to DO_RELEASE.md until all preparation steps pass validation
362
+
363
+ **For Human Review:**
364
+
365
+ - Review CHANGELOG.md before proceeding
366
+ - Verify version number makes sense
367
+ - Check that all changes are documented
368
+ - Confirm all files are ready for commit
369
+
370
+ ---
371
+
372
+ **Last Updated:** 2026-01-27
373
+ **Version:** 1.0
@@ -0,0 +1,234 @@
1
+ # AI Release Preparation Guide
2
+
3
+ **Purpose:** Deterministic, agent-safe release prep flow for ShipIt. This is the AI-native alternative to `PREPARE_RELEASE.md`.
4
+
5
+ **When to use:** Before executing `DO_RELEASE.md`, when prep is performed by an AI agent.
6
+
7
+ ## Scope and Safety
8
+
9
+ - Preparation only. Do NOT commit, tag, push, or create a release here.
10
+ - Only edit these files: `CHANGELOG.md`, `package.json`, `README.md`.
11
+ - If any step requires edits outside those files, stop and report.
12
+ - Execute steps sequentially. Stop on any failure.
13
+
14
+ ---
15
+
16
+ ## Step 0: Preflight Gate (single command)
17
+
18
+ **Objective:** Fail fast if the repo is not clean and green.
19
+
20
+ **Command:**
21
+
22
+ ```bash
23
+ pnpm lint && pnpm typecheck && pnpm test && [ -z "$(git status --porcelain)" ]
24
+ ```
25
+
26
+ **STOP GATE:** If any command fails, stop and report. Do not proceed.
27
+
28
+ ---
29
+
30
+ ## Step 1: Determine Version (machine rules)
31
+
32
+ **Objective:** Choose a semantic version consistently.
33
+
34
+ **Rules:**
35
+
36
+ - **MAJOR:** breaking changes that require user action
37
+ - **MINOR:** backward-compatible features
38
+ - **PATCH:** backward-compatible fixes only
39
+
40
+ **AI Decision Procedure:**
41
+
42
+ 1. Read `[Unreleased]` in `CHANGELOG.md`.
43
+ 2. If all sections are "None" or empty, stop: there is nothing to release.
44
+ 3. Map categories to bump:
45
+ - Any Breaking Changes → MAJOR
46
+ - Any Added/Changed features → MINOR
47
+ - Only Fixed → PATCH
48
+ 4. Read current version in `package.json`.
49
+ 5. Compute `VERSION=X.Y.Z` deterministically.
50
+
51
+ **STOP GATE:** If ambiguity exists, stop and request clarification.
52
+
53
+ ---
54
+
55
+ ## Step 2: Lock VERSION (single source of truth)
56
+
57
+ **Objective:** Define the release version once and reuse everywhere.
58
+
59
+ **Actions:**
60
+
61
+ 1. Set `VERSION=X.Y.Z` (same value for Steps 3–5).
62
+ 2. Export `VERSION` and `TODAY` in the shell to avoid re-reading files.
63
+ 3. Do not allow alternative versions in any file.
64
+
65
+ **STOP GATE:** If multiple versions appear, stop and restart from Step 0.
66
+
67
+ ---
68
+
69
+ ## Step 3: Auto-Generate Changelog (if supported)
70
+
71
+ **Objective:** Use any existing automation to avoid manual drift.
72
+
73
+ **Actions:**
74
+
75
+ 1. Detect a changelog generator in the repo (examples: `scripts/generate-changelog.sh`, `changeset`, or a documented release tool).
76
+ 2. If found, run it and verify it updates `CHANGELOG.md` deterministically.
77
+ 3. If not found, proceed to Step 4 and update manually.
78
+
79
+ **STOP GATE:** If an auto-generator exists but fails, stop and report. Do not fall back to manual edits unless explicitly allowed.
80
+
81
+ ---
82
+
83
+ ## Step 4: Update `CHANGELOG.md` (deterministic)
84
+
85
+ **Objective:** Move `[Unreleased]` into a versioned section.
86
+
87
+ **Actions:**
88
+
89
+ 1. Create a new section: `## [X.Y.Z] - YYYY-MM-DD` (use `$TODAY` if exported).
90
+ 2. Move all `[Unreleased]` items into that section.
91
+ 3. Clear `[Unreleased]` (set each category to `- None`).
92
+ 4. Preserve existing changelog style and ordering.
93
+
94
+ **STOP GATE:** If any `[Unreleased]` item remains in that section, stop and fix.
95
+
96
+ ---
97
+
98
+ ## Step 5: Update `package.json` Version
99
+
100
+ **Objective:** Set the authoritative version field.
101
+
102
+ **Actions:**
103
+
104
+ 1. Update `"version"` to `X.Y.Z`.
105
+ 2. No other version changes in this file.
106
+
107
+ **STOP GATE:** If `package.json` version does not equal `VERSION`, stop.
108
+
109
+ ---
110
+
111
+ ## Step 6: Update `README.md` Version References
112
+
113
+ **Objective:** Keep README version references accurate.
114
+
115
+ **Actions:**
116
+
117
+ 1. Update the version badge to `X.Y.Z`.
118
+ 2. Update the badge link to `.../releases/tag/vX.Y.Z`.
119
+ 3. Add a new entry at the top of "Version History".
120
+ 4. Keep reverse chronological order.
121
+
122
+ **STOP GATE:** If README references a different version, stop.
123
+
124
+ ---
125
+
126
+ ## Step 7: Automated Consistency Check
127
+
128
+ **Objective:** Verify version consistency across all three files.
129
+
130
+ **Command:**
131
+
132
+ ```bash
133
+ CURRENT_VERSION=$(grep '"version"' package.json | cut -d'"' -f4)
134
+ CHANGELOG_VERSION=$(grep '^## \[' CHANGELOG.md | head -1 | sed 's/## \[\(.*\)\].*/\1/')
135
+ README_VERSION=$(grep 'version-' README.md | head -1 | sed 's/.*version-\([0-9.]*\).*/\1/')
136
+
137
+ if [ "$CURRENT_VERSION" = "$CHANGELOG_VERSION" ] && [ "$CURRENT_VERSION" = "$README_VERSION" ]; then
138
+ echo "✓ Version consistency check passed: $CURRENT_VERSION"
139
+ else
140
+ echo "✗ Version mismatch detected!"
141
+ echo " package.json: $CURRENT_VERSION"
142
+ echo " CHANGELOG.md: $CHANGELOG_VERSION"
143
+ echo " README.md: $README_VERSION"
144
+ exit 1
145
+ fi
146
+ ```
147
+
148
+ **STOP GATE:** If this fails, stop and fix.
149
+
150
+ ---
151
+
152
+ ## AI Efficiency Notes (optional)
153
+
154
+ - Prefer a single shell session with `VERSION`/`TODAY` exported to reuse values.
155
+ - If a release-prep helper exists in the repo, use it to update all three files in one pass.
156
+ - Use `git diff --name-only` to validate file scope quickly before full `git status`.
157
+
158
+ ---
159
+
160
+ ## Step 8: Diff Guard (no unrelated changes)
161
+
162
+ **Objective:** Ensure only release prep files changed.
163
+
164
+ **Command:**
165
+
166
+ ```bash
167
+ git status --porcelain
168
+ ```
169
+
170
+ **Validation:**
171
+
172
+ - Only `CHANGELOG.md`, `package.json`, `README.md` appear.
173
+
174
+ **STOP GATE:** If any other file appears, stop and revert those changes.
175
+
176
+ ---
177
+
178
+ ## Step 9: Stop and Summarize (final step)
179
+
180
+ **Objective:** End prep cleanly and hand off to `DO_RELEASE.md`.
181
+
182
+ **Report Template (fill in):**
183
+
184
+ ```
185
+ [x] Preflight gate passed (lint/typecheck/tests/clean tree)
186
+ [x] VERSION locked: X.Y.Z
187
+ [x] CHANGELOG.md updated
188
+ [x] package.json version updated
189
+ [x] README.md version badge + history updated
190
+ [x] Version consistency validated
191
+ [x] Only release prep files modified
192
+ ```
193
+
194
+ **Release Status Summary (required):**
195
+
196
+ ```
197
+ Release Status: READY | BLOCKED
198
+ Version: X.Y.Z
199
+ Prepared by: <agent or user>
200
+ Notes: <short status note>
201
+ ```
202
+
203
+ **Human Handoff Question (required):**
204
+
205
+ ```
206
+ The release is ready to execute. Do you want me to proceed with the release steps now?
207
+ ```
208
+
209
+ **STOP GATE:** Do not proceed to execution steps unless the user explicitly says yes.
210
+
211
+ ---
212
+
213
+ ## Agent Output Guidance (recommended)
214
+
215
+ **Objective:** Make the agent's logs easy to scan for humans.
216
+
217
+ **Per-step output format:**
218
+
219
+ ```
220
+ Step X: <Name>
221
+ - Status: PASS | FAIL
222
+ - Evidence: <command or file touched>
223
+ - Notes: <short reason or error>
224
+ ```
225
+
226
+ **Final summary (always print):**
227
+
228
+ ```
229
+ Release Prep Summary
230
+ - Version: X.Y.Z
231
+ - Files changed: CHANGELOG.md, package.json, README.md
232
+ - Gates passed: <count>/<count>
233
+ - Next: Proceed with release execution steps if approved
234
+ ```