@jamie-tam/forge 6.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 (213) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +389 -0
  3. package/agents/architect.md +92 -0
  4. package/agents/builder.md +122 -0
  5. package/agents/code-reviewer.md +107 -0
  6. package/agents/concept-designer.md +207 -0
  7. package/agents/craft-reviewer.md +132 -0
  8. package/agents/critic.md +130 -0
  9. package/agents/doc-writer.md +85 -0
  10. package/agents/dreamer.md +129 -0
  11. package/agents/e2e-runner.md +89 -0
  12. package/agents/gotcha-hunter.md +127 -0
  13. package/agents/prototype-builder.md +193 -0
  14. package/agents/prototype-codifier.md +204 -0
  15. package/agents/prototype-reviewer.md +163 -0
  16. package/agents/security-reviewer.md +108 -0
  17. package/agents/spec-reviewer.md +94 -0
  18. package/agents/tracer.md +98 -0
  19. package/agents/wireframer.md +109 -0
  20. package/commands/abort.md +25 -0
  21. package/commands/bugfix.md +151 -0
  22. package/commands/evolve.md +118 -0
  23. package/commands/feature.md +236 -0
  24. package/commands/forge.md +100 -0
  25. package/commands/greenfield.md +185 -0
  26. package/commands/hotfix.md +98 -0
  27. package/commands/refactor.md +147 -0
  28. package/commands/resume.md +25 -0
  29. package/commands/setup.md +201 -0
  30. package/commands/status.md +27 -0
  31. package/commands/task-force.md +110 -0
  32. package/commands/validate.md +12 -0
  33. package/dist/__tests__/active-manifest.test.js +272 -0
  34. package/dist/__tests__/copy.test.js +96 -0
  35. package/dist/__tests__/gate-check.test.js +384 -0
  36. package/dist/__tests__/wiki.test.js +472 -0
  37. package/dist/__tests__/work-manifest.test.js +304 -0
  38. package/dist/active-manifest.js +229 -0
  39. package/dist/cli.js +158 -0
  40. package/dist/copy.js +124 -0
  41. package/dist/gate-check.js +326 -0
  42. package/dist/hooks.js +60 -0
  43. package/dist/init.js +140 -0
  44. package/dist/manifest.js +90 -0
  45. package/dist/merge.js +77 -0
  46. package/dist/paths.js +36 -0
  47. package/dist/uninstall.js +216 -0
  48. package/dist/update.js +158 -0
  49. package/dist/verify-manifest.js +65 -0
  50. package/dist/verify.js +98 -0
  51. package/dist/wiki-ui.js +310 -0
  52. package/dist/wiki.js +364 -0
  53. package/dist/work-manifest.js +798 -0
  54. package/hooks/config/gate-requirements.json +79 -0
  55. package/hooks/hooks.json +143 -0
  56. package/hooks/scripts/analyze-telemetry.sh +114 -0
  57. package/hooks/scripts/gate-enforcer.sh +164 -0
  58. package/hooks/scripts/pre-compact.sh +90 -0
  59. package/hooks/scripts/session-start.sh +81 -0
  60. package/hooks/scripts/telemetry.sh +41 -0
  61. package/hooks/scripts/wiki-lint.sh +87 -0
  62. package/hooks/templates/AGENTS.md.template +48 -0
  63. package/hooks/templates/CLAUDE.md.template +45 -0
  64. package/package.json +55 -0
  65. package/protocols/README.md +40 -0
  66. package/protocols/codex.md +151 -0
  67. package/protocols/graphify.md +156 -0
  68. package/references/common/agent-coordination.md +65 -0
  69. package/references/common/coding-standards.md +54 -0
  70. package/references/common/feature-tracking.md +21 -0
  71. package/references/common/io-protocol.md +36 -0
  72. package/references/common/phases.md +57 -0
  73. package/references/common/quality-gates.md +130 -0
  74. package/references/common/skill-authoring.md +154 -0
  75. package/references/common/skill-compliance.md +30 -0
  76. package/references/python/standards.md +44 -0
  77. package/references/react/standards.md +61 -0
  78. package/references/typescript/standards.md +42 -0
  79. package/rules/common/forge-system.md +59 -0
  80. package/rules/common/git-workflow.md +40 -0
  81. package/rules/common/guardrails.md +37 -0
  82. package/rules/common/quality-gates.md +18 -0
  83. package/rules/common/security.md +50 -0
  84. package/rules/common/skill-selection.md +78 -0
  85. package/rules/common/testing.md +58 -0
  86. package/rules/common/verification.md +39 -0
  87. package/skills/build-pr-workflow/SKILL.md +301 -0
  88. package/skills/build-pr-workflow/references/pr-template.md +62 -0
  89. package/skills/build-pr-workflow/references/subagent-merge.md +47 -0
  90. package/skills/build-pr-workflow/references/worktree-setup.md +125 -0
  91. package/skills/build-prototype/SKILL.md +264 -0
  92. package/skills/build-scaffold/SKILL.md +340 -0
  93. package/skills/build-tdd/SKILL.md +89 -0
  94. package/skills/build-wireframe/SKILL.md +110 -0
  95. package/skills/build-wireframe/assets/baseline-template.html +486 -0
  96. package/skills/build-wireframe/references/demo-walkthroughs.md +170 -0
  97. package/skills/build-wireframe/references/gotchas.md +188 -0
  98. package/skills/build-wireframe/references/legend-lines.md +141 -0
  99. package/skills/concept-slides/SKILL.md +192 -0
  100. package/skills/deliver-db-migration/SKILL.md +466 -0
  101. package/skills/deliver-deploy/SKILL.md +407 -0
  102. package/skills/deliver-onboarding/SKILL.md +198 -0
  103. package/skills/deliver-onboarding/references/document-templates.md +393 -0
  104. package/skills/deliver-onboarding/templates/getting-started.md +122 -0
  105. package/skills/discover-codebase-analysis/SKILL.md +448 -0
  106. package/skills/discover-requirements/SKILL.md +418 -0
  107. package/skills/discover-requirements/templates/prd.md +99 -0
  108. package/skills/discover-requirements/templates/technical-spec.md +123 -0
  109. package/skills/discover-requirements/templates/user-stories.md +76 -0
  110. package/skills/harden/SKILL.md +214 -0
  111. package/skills/iterate-prototype/SKILL.md +241 -0
  112. package/skills/plan-architecture/SKILL.md +457 -0
  113. package/skills/plan-architecture/templates/adr-template.md +52 -0
  114. package/skills/plan-architecture/templates/api-contract.md +99 -0
  115. package/skills/plan-architecture/templates/db-schema.md +81 -0
  116. package/skills/plan-architecture/templates/system-design.md +111 -0
  117. package/skills/plan-brainstorm/SKILL.md +433 -0
  118. package/skills/plan-design-system/SKILL.md +279 -0
  119. package/skills/plan-task-decompose/SKILL.md +454 -0
  120. package/skills/quality-code-review/SKILL.md +286 -0
  121. package/skills/quality-security-audit/SKILL.md +292 -0
  122. package/skills/quality-security-audit/references/audit-report-template.md +89 -0
  123. package/skills/quality-security-audit/references/owasp-checks.md +178 -0
  124. package/skills/quality-test-execution/SKILL.md +435 -0
  125. package/skills/quality-test-plan/SKILL.md +297 -0
  126. package/skills/quality-test-plan/references/test-type-guide.md +263 -0
  127. package/skills/quality-test-plan/templates/e2e-test-plan.md +72 -0
  128. package/skills/quality-test-plan/templates/integration-test-plan.md +74 -0
  129. package/skills/quality-test-plan/templates/load-test-plan.md +111 -0
  130. package/skills/quality-test-plan/templates/smoke-test-plan.md +68 -0
  131. package/skills/quality-test-plan/templates/unit-test-plan.md +56 -0
  132. package/skills/quality-uiux/SKILL.md +481 -0
  133. package/skills/support-debug/SKILL.md +464 -0
  134. package/skills/support-dream/SKILL.md +213 -0
  135. package/skills/support-gotcha/SKILL.md +249 -0
  136. package/skills/support-runtime-reachability/SKILL.md +190 -0
  137. package/skills/support-runtime-reachability/scripts/__fixtures__/case-01-passes-app-use/src/app.ts +7 -0
  138. package/skills/support-runtime-reachability/scripts/__fixtures__/case-01-passes-app-use/src/handlers/cases.ts +7 -0
  139. package/skills/support-runtime-reachability/scripts/__fixtures__/case-02-orphan-no-app-use/src/app.ts +8 -0
  140. package/skills/support-runtime-reachability/scripts/__fixtures__/case-02-orphan-no-app-use/src/handlers/cases.ts +7 -0
  141. package/skills/support-runtime-reachability/scripts/__fixtures__/case-03-orphan-import-only/src/App.tsx +5 -0
  142. package/skills/support-runtime-reachability/scripts/__fixtures__/case-03-orphan-import-only/src/components/RingingBanner.tsx +7 -0
  143. package/skills/support-runtime-reachability/scripts/__fixtures__/case-03-orphan-import-only/src/hooks/useTwilio.ts +6 -0
  144. package/skills/support-runtime-reachability/scripts/__fixtures__/case-04-jsx-component-rendered/src/App.tsx +5 -0
  145. package/skills/support-runtime-reachability/scripts/__fixtures__/case-04-jsx-component-rendered/src/components/MyComp.tsx +3 -0
  146. package/skills/support-runtime-reachability/scripts/__fixtures__/case-05-jsx-component-not-rendered/src/App.tsx +3 -0
  147. package/skills/support-runtime-reachability/scripts/__fixtures__/case-05-jsx-component-not-rendered/src/components/Orphan.tsx +3 -0
  148. package/skills/support-runtime-reachability/scripts/__fixtures__/case-06-class-instantiated/src/lib/Service.ts +6 -0
  149. package/skills/support-runtime-reachability/scripts/__fixtures__/case-06-class-instantiated/src/main.ts +4 -0
  150. package/skills/support-runtime-reachability/scripts/__fixtures__/case-07-class-not-instantiated/src/lib/Lonely.ts +5 -0
  151. package/skills/support-runtime-reachability/scripts/__fixtures__/case-07-class-not-instantiated/src/main.ts +2 -0
  152. package/skills/support-runtime-reachability/scripts/__fixtures__/case-08-default-export-imported-and-called/src/handler.ts +3 -0
  153. package/skills/support-runtime-reachability/scripts/__fixtures__/case-08-default-export-imported-and-called/src/main.ts +3 -0
  154. package/skills/support-runtime-reachability/scripts/__fixtures__/case-09-default-export-orphan/src/handler.ts +3 -0
  155. package/skills/support-runtime-reachability/scripts/__fixtures__/case-09-default-export-orphan/src/main.ts +2 -0
  156. package/skills/support-runtime-reachability/scripts/__fixtures__/case-10-aliased-named-export/src/lib.ts +5 -0
  157. package/skills/support-runtime-reachability/scripts/__fixtures__/case-10-aliased-named-export/src/main.ts +3 -0
  158. package/skills/support-runtime-reachability/scripts/__fixtures__/case-11-re-export-chain/src/lib/index.ts +1 -0
  159. package/skills/support-runtime-reachability/scripts/__fixtures__/case-11-re-export-chain/src/lib/internal.ts +3 -0
  160. package/skills/support-runtime-reachability/scripts/__fixtures__/case-11-re-export-chain/src/main.ts +3 -0
  161. package/skills/support-runtime-reachability/scripts/__fixtures__/case-12-test-only-caller/src/util.test.ts +5 -0
  162. package/skills/support-runtime-reachability/scripts/__fixtures__/case-12-test-only-caller/src/util.ts +3 -0
  163. package/skills/support-runtime-reachability/scripts/__fixtures__/case-13-gated-pending-annotation/src/future.ts +4 -0
  164. package/skills/support-runtime-reachability/scripts/__fixtures__/case-14-untraceable-annotation/src/decorated.ts +4 -0
  165. package/skills/support-runtime-reachability/scripts/__fixtures__/case-15-untraceable-empty/src/lazy.ts +4 -0
  166. package/skills/support-runtime-reachability/scripts/__fixtures__/case-16-python-module/src/lib.py +15 -0
  167. package/skills/support-runtime-reachability/scripts/__fixtures__/case-16-python-module/src/main.py +5 -0
  168. package/skills/support-runtime-reachability/scripts/__fixtures__/case-17-router-use/src/parent.ts +5 -0
  169. package/skills/support-runtime-reachability/scripts/__fixtures__/case-17-router-use/src/routes/cases.ts +5 -0
  170. package/skills/support-runtime-reachability/scripts/__fixtures__/case-18-shadowed-name-fp/src/lib/foo.ts +3 -0
  171. package/skills/support-runtime-reachability/scripts/__fixtures__/case-18-shadowed-name-fp/src/other.ts +8 -0
  172. package/skills/support-runtime-reachability/scripts/__fixtures__/case-19-same-name-different-module/src/handlers/cases.ts +4 -0
  173. package/skills/support-runtime-reachability/scripts/__fixtures__/case-19-same-name-different-module/src/handlers/users.ts +4 -0
  174. package/skills/support-runtime-reachability/scripts/__fixtures__/case-19-same-name-different-module/src/main.ts +5 -0
  175. package/skills/support-runtime-reachability/scripts/__fixtures__/case-20-aliased-import-usage/src/handlers/cases.ts +3 -0
  176. package/skills/support-runtime-reachability/scripts/__fixtures__/case-20-aliased-import-usage/src/main.ts +4 -0
  177. package/skills/support-runtime-reachability/scripts/__fixtures__/case-21-mixed-default-and-named/src/lib.ts +5 -0
  178. package/skills/support-runtime-reachability/scripts/__fixtures__/case-21-mixed-default-and-named/src/main.ts +5 -0
  179. package/skills/support-runtime-reachability/scripts/__fixtures__/case-22-dynamic-import-then-caller/src/lib.ts +3 -0
  180. package/skills/support-runtime-reachability/scripts/__fixtures__/case-22-dynamic-import-then-caller/src/main.ts +8 -0
  181. package/skills/support-runtime-reachability/scripts/__fixtures__/case-23-dynamic-import-with-space/src/lib.ts +3 -0
  182. package/skills/support-runtime-reachability/scripts/__fixtures__/case-23-dynamic-import-with-space/src/main.ts +7 -0
  183. package/skills/support-runtime-reachability/scripts/check.mjs +638 -0
  184. package/skills/support-runtime-reachability/scripts/check.test.mjs +244 -0
  185. package/skills/support-skill-validator/SKILL.md +194 -0
  186. package/skills/support-skill-validator/references/false-positives.md +59 -0
  187. package/skills/support-skill-validator/references/validation-checks.md +280 -0
  188. package/skills/support-system-guide/SKILL.md +311 -0
  189. package/skills/support-task-force/SKILL.md +265 -0
  190. package/skills/support-task-force/references/dispatch-pattern.md +178 -0
  191. package/skills/support-task-force/references/synthesis-template.md +126 -0
  192. package/skills/support-wiki-bootstrap/SKILL.md +37 -0
  193. package/skills/support-wiki-lint/SKILL.md +196 -0
  194. package/skills/support-wiki-lint/scripts/lint.mjs +488 -0
  195. package/skills/support-wiki-lint/scripts/lint.test.mjs +196 -0
  196. package/templates/README.md +23 -0
  197. package/templates/aiwiki/CLAUDE.md.template +78 -0
  198. package/templates/aiwiki/schemas/architecture.md +118 -0
  199. package/templates/aiwiki/schemas/convention.md +112 -0
  200. package/templates/aiwiki/schemas/decision.md +144 -0
  201. package/templates/aiwiki/schemas/gotcha.md +118 -0
  202. package/templates/aiwiki/schemas/oracle.md +105 -0
  203. package/templates/aiwiki/schemas/session.md +125 -0
  204. package/templates/manifests/bugfix.yaml +41 -0
  205. package/templates/manifests/feature.yaml +69 -0
  206. package/templates/manifests/greenfield.yaml +61 -0
  207. package/templates/manifests/hotfix.yaml +45 -0
  208. package/templates/manifests/refactor.yaml +44 -0
  209. package/templates/manifests/v5/SCHEMA.md +327 -0
  210. package/templates/manifests/v5/feature.yaml +77 -0
  211. package/templates/manifests/v6/SCHEMA.md +199 -0
  212. package/templates/wiki-html/dream-detail.html +378 -0
  213. package/templates/wiki-html/dreams-list.html +155 -0
@@ -0,0 +1,407 @@
1
+ ---
2
+ name: deliver-deploy
3
+ description: "Use when the user says 'deploy', 'ship it', 'push to staging', 'release', 'roll out', 'promote to prod', or asks how to deploy after tests pass and review is complete. Drives the deploy checklist (build, env vars, migrations applied, smoke check, rollback plan). Skip if tests are failing or review is open — route back to those gates first."
4
+ ---
5
+
6
+ # Deliver: Deploy
7
+
8
+ ## Overview
9
+
10
+ This skill enforces a strict pre-deploy to post-deploy pipeline that treats every deployment as a production event -- even to staging.
11
+
12
+ **Core Principle:** Shipping is a process, not an action. Every deploy follows the same pipeline regardless of how "small" the change is.
13
+
14
+ ## The Iron Laws of Deployment
15
+
16
+ ```
17
+ NEVER deploy with failing tests.
18
+ NEVER deploy without code review.
19
+ NEVER deploy without a rollback plan.
20
+ NEVER deploy without smoke tests defined.
21
+ NEVER skip staging when staging exists.
22
+ ```
23
+
24
+ If any of these conditions are not met, STOP. Do not proceed. Do not rationalize.
25
+
26
+ ## When to Use
27
+
28
+ - All tests pass (unit, integration, E2E, smoke)
29
+ - Code review is complete and approved
30
+ - Feature manifest shows all quality gates passed
31
+ - User explicitly requests deployment
32
+ - `/feature` or `/hotfix` command reaches the deploy phase
33
+
34
+ **Do NOT use when:**
35
+ - Tests are still failing ("we'll fix in production")
36
+ - Code review has open items ("reviewer will approve after deploy")
37
+ - You're "just deploying to staging to test" (use test execution skill instead)
38
+ - No rollback plan exists ("we can always revert the commit")
39
+
40
+ ## I/O Contract
41
+
42
+ | Field | Value |
43
+ |---|---|
44
+ | **Requires** | Passing test results (`test-results.md`) + approved code review + feature manifest with all gates passed |
45
+ | **Produces** | Deployed application + deployment record |
46
+ | **Updates** | `.forge/work/{type}/{name}/manifest.yaml`: `artifacts.deliver.locked_at`, deployment record at `artifacts.deliver.deployment`, environment. |
47
+ | **Feeds into** | `deliver-onboarding` (update docs if needed), `support-gotcha` (record any deployment lessons) |
48
+
49
+ ### Input Verification
50
+
51
+ Before starting, read and verify these artifacts exist:
52
+
53
+ ```
54
+ .forge/work/{type}/{name}/
55
+ manifest.yaml -> readiness: artifacts.production-build.locked_at present AND phases.quality.code-review-final.gate-passed: true AND phases.quality.test-execution.gate-passed: true
56
+ test-results.md -> must exist, all tests passing
57
+ architecture/ -> must exist (needed for rollback context)
58
+ ```
59
+
60
+ ### Output Artifacts
61
+
62
+ ```
63
+ .forge/work/{type}/{name}/
64
+ manifest.yaml -> updated: artifacts.deliver.locked_at, artifacts.deliver.deployment (timestamp + environment)
65
+ deploy-log.md -> record of what was deployed, when, where, by whom
66
+ ```
67
+
68
+ ## The Deployment Pipeline
69
+
70
+ ### Phase 1: Pre-Deploy Verification
71
+
72
+ **Purpose:** Confirm everything is genuinely ready. Trust nothing -- verify everything.
73
+
74
+ **Steps:**
75
+
76
+ 1. **Read the Feature Manifest**
77
+ ```yaml
78
+ # Verify readiness in manifest.yaml
79
+ artifacts:
80
+ production-build:
81
+ locked_at: "..." # MUST be present
82
+ phases:
83
+ quality:
84
+ code-review-final:
85
+ gate-passed: true # Review completed
86
+ test-execution:
87
+ gate-passed: true # All test types passing
88
+ # Security audit is required when changes touch auth, payments, encryption,
89
+ # PII, user-input handling (injection/XSS), or external integrations.
90
+ ```
91
+
92
+ 2. **Verify Test Results Are Current**
93
+ - Read `test-results.md` -- when were tests last run?
94
+ - If code changed since last test run, tests MUST be re-executed
95
+ - Check: unit tests, integration tests, E2E tests, smoke test definitions
96
+ - Any skipped tests must have documented justification
97
+
98
+ 3. **Verify Code Review Approval**
99
+ - Check PR status: approved, no outstanding change requests
100
+ - If PR has comments marked "must fix" -- STOP, those must be addressed
101
+ - Verify reviewer is not the same person as the author (when team size allows)
102
+
103
+ 4. **Check for Rollback Plan**
104
+ - Database rollback scripts exist (if migration involved -- see `deliver-db-migration`)
105
+ - Previous known-good version identified
106
+ - Rollback procedure documented (even if it is "revert this commit")
107
+ - Verify rollback can be executed without data loss
108
+
109
+ 5. **Environment Readiness**
110
+ - Target environment is accessible
111
+ - Required environment variables are set
112
+ - Required services are running (database, cache, message queue)
113
+ - Sufficient resources (disk space, memory) for deployment
114
+
115
+ **Gate:** ALL checks must pass. If ANY check fails, output the specific failure and STOP.
116
+
117
+ ```
118
+ PRE-DEPLOY CHECKLIST
119
+ --------------------
120
+ [PASS] Manifest readiness: production-build locked, code-review-final + test-execution gates passed
121
+ [PASS] Test results current (ran 12 min ago)
122
+ [PASS] All test types passing (unit: 142/142, integration: 38/38, e2e: 12/12)
123
+ [PASS] Code review approved (reviewer: @teammate, 2 hours ago)
124
+ [PASS] Rollback plan documented
125
+ [PASS] Environment accessible
126
+ [PASS] Required services running
127
+
128
+ VERDICT: Ready to deploy
129
+ ```
130
+
131
+ ### Phase 2: Staging Validation (When Staging Exists)
132
+
133
+ **Purpose:** Catch environment-specific issues before production.
134
+
135
+ **If project has a staging environment:**
136
+
137
+ 1. **Deploy to Staging First**
138
+ - Use the same deployment mechanism as production
139
+ - Same config structure (different values, same shape)
140
+ - Same deployment scripts
141
+
142
+ 2. **Run Smoke Tests Against Staging**
143
+ - Execute the smoke test suite from `test-plan.md`
144
+ - Verify critical user paths work end-to-end
145
+ - Check integrations with external services (if staging versions exist)
146
+
147
+ 3. **Manual Verification Window**
148
+ - Ask user: "Staging deploy complete. Smoke tests passing. Want to verify manually before production?"
149
+ - If user says yes -- WAIT for their go-ahead
150
+ - If user says no -- proceed to production
151
+ - If user does not respond -- WAIT (never auto-proceed to production)
152
+
153
+ 4. **Staging-Specific Checks**
154
+ - Response times within acceptable range
155
+ - No new error logs appearing
156
+ - Database migrations applied cleanly
157
+ - Feature flags in correct state
158
+
159
+ **If NO staging environment exists:**
160
+ - Document this in the deploy log: "No staging environment -- deploying directly to production"
161
+ - Extra caution: ensure smoke tests are comprehensive
162
+ - Recommend to user: consider adding staging (but do not block deployment)
163
+
164
+ ### Phase 3: Production Deploy
165
+
166
+ **Purpose:** Execute the actual deployment with maximum safety.
167
+
168
+ **Steps:**
169
+
170
+ 1. **Announce Deployment**
171
+ - Log: "Starting production deployment of {feature-name} at {timestamp}"
172
+ - If team communication channel exists, notify
173
+
174
+ 2. **Execute Deployment**
175
+ - Use project's deployment mechanism (detected from project structure):
176
+ - `Dockerfile` / `docker-compose.yml` -- container deployment
177
+ - `fly.toml` -- Fly.io deployment
178
+ - `vercel.json` / `next.config.js` -- Vercel deployment
179
+ - `serverless.yml` -- Serverless Framework
180
+ - `terraform/` -- Infrastructure as Code
181
+ - `Procfile` -- Heroku
182
+ - `package.json` scripts -- custom deployment
183
+ - Manual steps documented in project README
184
+ - If deployment mechanism is unclear, ASK the user
185
+
186
+ 3. **Database Migrations (if applicable)**
187
+ - Run forward migration BEFORE deploying new application code
188
+ - Verify migration succeeded before proceeding
189
+ - If migration fails -- STOP, do not deploy application code
190
+ - See `deliver-db-migration` for migration-specific process
191
+
192
+ 4. **Monitor Deployment Progress**
193
+ - Watch for deployment errors in output
194
+ - If deployment tool provides health checks, monitor them
195
+ - Set a reasonable timeout (project-specific, default 5 minutes)
196
+
197
+ 5. **Handle Deployment Failures**
198
+ - If deployment fails: capture error output completely
199
+ - Do NOT retry automatically without understanding the failure
200
+ - Present failure to user with context
201
+ - If rollback is needed, ask user for confirmation before rolling back
202
+
203
+ ### Phase 4: Post-Deploy Verification
204
+
205
+ **Purpose:** Confirm the deployment is healthy in production.
206
+
207
+ **Steps:**
208
+
209
+ 1. **Run Smoke Tests Against Production**
210
+ - Execute the smoke test suite against the production URL
211
+ - These should be non-destructive (read-only where possible)
212
+ - Verify critical paths:
213
+ - Application responds (health check endpoint)
214
+ - Authentication works (if applicable)
215
+ - Core business operations function
216
+ - Database connectivity confirmed
217
+
218
+ 2. **Monitor for Errors**
219
+ - Check application logs for new errors (first 5 minutes minimum)
220
+ - Check error tracking service if configured (Sentry, Bugsnag, etc.)
221
+ - Check monitoring dashboards if available
222
+ - Compare error rates to pre-deployment baseline
223
+
224
+ 3. **Performance Baseline**
225
+ - Is response time comparable to pre-deployment?
226
+ - Any new slow queries appearing?
227
+ - Memory usage within expected range?
228
+ - CPU usage within expected range?
229
+
230
+ 4. **Declare Deployment Status**
231
+
232
+ **Success:**
233
+ ```
234
+ POST-DEPLOY VERIFICATION
235
+ ------------------------
236
+ [PASS] Smoke tests passing (5/5 critical paths)
237
+ [PASS] No new errors in logs (5 min observation)
238
+ [PASS] Response time within baseline (avg 120ms, baseline 115ms)
239
+ [PASS] All services healthy
240
+
241
+ DEPLOYMENT SUCCESSFUL
242
+ Feature: {feature-name}
243
+ Environment: production
244
+ Timestamp: {ISO 8601}
245
+ Version: {git SHA or tag}
246
+ ```
247
+
248
+ **Failure:**
249
+ ```
250
+ POST-DEPLOY VERIFICATION
251
+ ------------------------
252
+ [PASS] Smoke tests passing (5/5 critical paths)
253
+ [FAIL] New errors detected: TypeError in /api/payments (12 occurrences in 3 min)
254
+ [PASS] Response time within baseline
255
+ [WARN] Memory usage elevated (85% vs baseline 60%)
256
+
257
+ DEPLOYMENT REQUIRES ATTENTION
258
+ Recommended action: Investigate /api/payments errors before declaring success.
259
+ Rollback available: [describe rollback procedure]
260
+ ```
261
+
262
+ ### Phase 5: Manifest Update and Wrap-Up
263
+
264
+ 1. **Update Feature Manifest**
265
+ ```yaml
266
+ artifacts:
267
+ deliver:
268
+ locked_at: "2026-03-25T14:30:00Z"
269
+ deployment:
270
+ environment: production
271
+ timestamp: "2026-03-25T14:30:00Z"
272
+ version: "abc123"
273
+ deployed_by: "claude-code"
274
+ smoke_tests: pass
275
+ rollback_plan: "git revert abc123; run db:rollback"
276
+ ```
277
+
278
+ 2. **Create Deploy Log Entry**
279
+ ```markdown
280
+ # Deploy: {feature-name}
281
+ **Date**: {date}
282
+ **Environment**: production
283
+ **Version**: {git SHA}
284
+ **Duration**: {time from start to verification}
285
+
286
+ ## Changes Deployed
287
+ - {list of changes from PR description}
288
+
289
+ ## Verification Results
290
+ - Smoke tests: PASS
291
+ - Error monitoring: CLEAN
292
+ - Performance: NOMINAL
293
+
294
+ ## Rollback Plan
295
+ {documented rollback procedure}
296
+ ```
297
+
298
+ 3. **Trigger Post-Deploy Skills**
299
+ - If documentation needs updating, flag for `deliver-onboarding`
300
+ - If any issues were encountered during deploy, invoke `support-gotcha`
301
+ - If deployment revealed process improvements, note for `/evolve`
302
+
303
+ ## Rollback Procedures
304
+
305
+ ### When to Roll Back
306
+
307
+ - Smoke tests fail in production
308
+ - Error rate spikes above baseline
309
+ - Critical user path is broken
310
+ - Data corruption detected
311
+ - Security vulnerability exposed
312
+
313
+ ### Rollback Decision Tree
314
+
315
+ ```
316
+ Smoke tests fail?
317
+ +-- Yes --> Roll back immediately (do not debug in production)
318
+ +-- No --> Continue monitoring
319
+ |
320
+ Error rate spike?
321
+ +-- Yes, critical path --> Roll back, then debug
322
+ +-- Yes, non-critical --> Ask user: rollback or hotfix?
323
+ +-- No --> Deployment healthy
324
+ ```
325
+
326
+ ### Rollback Execution
327
+
328
+ 1. **Ask user for confirmation** (unless immediate data corruption risk)
329
+ 2. Execute rollback procedure (documented in deploy log)
330
+ 3. Verify rollback succeeded (run smoke tests against previous version)
331
+ 4. Record in manifest: rollback timestamp, reason, outcome
332
+ 5. Invoke `support-debug` to investigate the failure
333
+ 6. Invoke `support-gotcha` to record what went wrong
334
+
335
+ ## Environment Detection
336
+
337
+ This skill auto-detects the deployment mechanism from project structure:
338
+
339
+ | Indicator | Deployment Method |
340
+ |---|---|
341
+ | `Dockerfile` + `docker-compose.yml` | Docker Compose |
342
+ | `fly.toml` | Fly.io (`fly deploy`) |
343
+ | `vercel.json` or Next.js project | Vercel (`vercel --prod`) |
344
+ | `netlify.toml` | Netlify |
345
+ | `serverless.yml` | Serverless Framework |
346
+ | `terraform/` directory | Terraform (`terraform apply`) |
347
+ | `.github/workflows/deploy.yml` | GitHub Actions (trigger workflow) |
348
+ | `Procfile` | Heroku (`git push heroku main`) |
349
+ | `render.yaml` | Render |
350
+ | Custom scripts in `package.json` | Run the deploy script |
351
+
352
+ If multiple deployment mechanisms are detected, ASK the user which to use.
353
+ If no deployment mechanism is detected, ASK the user how they deploy.
354
+
355
+ ## Red Flags -- STOP and Reconsider
356
+
357
+ If you catch yourself thinking:
358
+
359
+ | Thought | Reality |
360
+ |---|---|
361
+ | "Tests are mostly passing" | ALL tests must pass. No exceptions. |
362
+ | "Code review is basically done" | Approved means approved. Open comments mean not done. |
363
+ | "It's just a small change" | Small changes cause outages. Follow the full pipeline. |
364
+ | "We can fix it in production" | No. Roll back. Fix. Redeploy. |
365
+ | "Staging worked, production will be fine" | Staging reduces risk. It does not eliminate it. |
366
+ | "Skip smoke tests, we already tested" | Post-deploy smoke tests catch deployment-specific issues. |
367
+ | "Rollback is easy, we don't need a plan" | If you do not write it down, you will not remember under pressure. |
368
+ | "Let me just retry the deploy" | Understand why it failed before retrying. |
369
+
370
+ ## Integration with Feature Manifest
371
+
372
+ This skill is the final phase of the feature lifecycle. The manifest tracks the entire journey:
373
+
374
+ ```yaml
375
+ # Example manifest at deployment time
376
+ name: add-payment-processing
377
+ phase_plan:
378
+ concept: active
379
+ wireframe: active
380
+ prototype: active
381
+ codify: active
382
+ production-build: active
383
+ deliver: active
384
+ artifacts:
385
+ concept: { deck_path: decks/{name}/slides.md, locked_at: "..." }
386
+ wireframe: { html_path: pocs/{name}-wireframe/index.html, locked_at: "..." }
387
+ prototype: { path: pocs/{name}-prototype/, locked_at: "..." }
388
+ codify: { locked_at: "..." }
389
+ production-build: { locked_at: "..." }
390
+ deliver: # <-- Added by this skill
391
+ locked_at: "2026-03-25T14:30:00Z"
392
+ deployment:
393
+ environment: production
394
+ timestamp: "2026-03-25T14:30:00Z"
395
+ version: "abc123"
396
+ smoke_tests: pass
397
+ ```
398
+
399
+ ## Quick Reference
400
+
401
+ | Phase | Key Actions | Gate Criteria |
402
+ |---|---|---|
403
+ | **1. Pre-Deploy** | Read manifest, verify tests, check review, confirm rollback plan | ALL checks pass |
404
+ | **2. Staging** | Deploy to staging, run smoke tests, optional manual check | Smoke tests pass |
405
+ | **3. Production** | Execute deployment, run migrations, monitor | Deployment completes without error |
406
+ | **4. Post-Deploy** | Smoke tests, error monitoring, performance check | All verification passes |
407
+ | **5. Wrap-Up** | Update manifest, create deploy log, trigger follow-up skills | Manifest updated |
@@ -0,0 +1,198 @@
1
+ ---
2
+ name: deliver-onboarding
3
+ description: "Use when newcomer-facing docs (README, getting-started, architecture overview, setup guide) need creation or refresh."
4
+ ---
5
+
6
+ # Deliver: Onboarding
7
+
8
+ ## Overview
9
+
10
+ Good onboarding documentation means a new developer can go from `git clone` to running tests in under 5 minutes. This skill generates onboarding documentation derived from actual project state — verified by execution, updated when the project changes.
11
+
12
+ ## When to Use
13
+
14
+ - New project reaches a runnable state (after `build-scaffold`)
15
+ - Major feature adds new concepts, patterns, or setup steps
16
+ - After deployment changes how the project runs
17
+ - New team member is about to start (verify docs are current)
18
+ - User explicitly asks for documentation
19
+ - `/feature` command completes and introduces new patterns
20
+
21
+ **Do NOT use when:**
22
+ - Project is not yet runnable (wait for scaffold/build)
23
+ - Only internal refactoring with no new concepts or setup changes
24
+ - Documentation is already current and verified
25
+
26
+ ## When to load references
27
+
28
+ - **`references/document-templates.md`** — the 6 onboarding documents, each with its full markdown structure and per-document generation process. Load this when you're about to write any of the six docs.
29
+
30
+ ## I/O Contract
31
+
32
+ | Field | Value |
33
+ |---|---|
34
+ | **Requires** | Working project (builds, runs, tests pass) |
35
+ | **Produces** | Onboarding documentation suite in project docs directory |
36
+ | **Feeds into** | -- (final deliverable, consumed by humans) |
37
+ | **Updates** | `.forge/work/{type}/{name}/manifest.yaml` if triggered as part of a feature |
38
+
39
+ ### Input Analysis
40
+
41
+ Before generating docs, analyze the project to extract facts:
42
+
43
+ ```
44
+ Project root/
45
+ package.json / pyproject.toml / go.mod -> Dependencies and scripts
46
+ Dockerfile / docker-compose.yml -> Container setup
47
+ .env.example -> Required environment variables
48
+ README.md -> Existing documentation (preserve or enhance)
49
+ src/ or equivalent -> Source code structure
50
+ tests/ or equivalent -> Test structure and runners
51
+ .claude/ -> forge configuration (skills, agents, hooks)
52
+ ```
53
+
54
+ ### Output Artifacts
55
+
56
+ ```
57
+ docs/ -> Or project's existing docs directory
58
+ getting-started.md -> Clone to running in 5 minutes
59
+ architecture-overview.md -> What does what, how it connects
60
+ local-setup.md -> Detailed environment setup
61
+ testing-guide.md -> How to run each test type
62
+ common-tasks.md -> How to add features, fix bugs, deploy
63
+ glossary.md -> Project-specific terms
64
+ ```
65
+
66
+ If the project uses a different docs structure (e.g., `wiki/`, `documentation/`, Docusaurus), adapt to that structure. ASK the user if unsure about the target directory.
67
+
68
+ ## Agent Dispatch
69
+
70
+ Dispatch the **doc-writer** subagent to generate the documentation. It has Write tool access and specializes in generating accurate, newcomer-friendly docs from the actual codebase.
71
+
72
+ ## The Onboarding Documentation Suite
73
+
74
+ ### Codex Mode Check
75
+
76
+ Run the Codex consent flow from `protocols/codex.md` before generating any documentation.
77
+
78
+ - **Takeover selected:** Dispatch Codex to generate the 6-document onboarding suite from the project analysis and config files. Claude reviews generated docs for accuracy before writing to disk.
79
+ - **Verify selected** or **Skip / Codex unavailable:** Claude generates the docs below. If Verify was selected, Codex reviews the generated docs before writing to disk.
80
+
81
+ ### The Six Documents
82
+
83
+ | # | File | Key question answered |
84
+ |---|------|----------------------|
85
+ | 1 | `docs/getting-started.md` | "How do I get this running?" (zero to tests in 5 minutes) |
86
+ | 2 | `docs/architecture-overview.md` | "How is this organized?" (components, data flow, stack) |
87
+ | 3 | `docs/local-setup.md` | "How do I configure my environment?" (tools, env vars, DB) |
88
+ | 4 | `docs/testing-guide.md` | "How do I test my changes?" (test types, commands, CI) |
89
+ | 5 | `docs/common-tasks.md` | "How do I do X?" (feature, bugfix, migration, deploy) |
90
+ | 6 | `docs/glossary.md` | "What does this term mean?" (project-specific terms) |
91
+
92
+ For each document's full structure (markdown skeleton) and per-document generation process, see **`references/document-templates.md`**. Generate each document by following the structure and process for that document.
93
+
94
+ ## Generation Standards
95
+
96
+ ### Accuracy Over Completeness
97
+
98
+ - Every command in the docs MUST work when copy-pasted
99
+ - If you are unsure about a command, verify it before including
100
+ - Better to say "check with your team lead" than to include a wrong command
101
+ - Never include placeholder values that look real (use `YOUR_API_KEY_HERE` not `sk-abc123`)
102
+
103
+ ### Template Usage
104
+
105
+ If `templates/` exists, use those templates as the starting structure. Adapt content to the actual project but maintain the template's organization.
106
+
107
+ ### Maintaining Docs
108
+
109
+ When to update onboarding docs:
110
+ - After `build-scaffold` completes (initial generation)
111
+ - After `deliver-deploy` if deployment process changed
112
+ - After `deliver-db-migration` if database setup changed
113
+ - After any change to project prerequisites
114
+ - When a gotcha related to setup is recorded in `support-gotcha`
115
+
116
+ ### Tone and Style
117
+
118
+ - Write for someone who is smart but has never seen this project
119
+ - Prefer concrete examples over abstract descriptions
120
+ - Use exact commands, exact file paths, exact URLs
121
+ - Avoid jargon unless it is defined in the glossary
122
+ - Keep sentences short and direct
123
+ - Use numbered steps for procedures, bullet points for lists
124
+
125
+ ## Codex Documentation Verify
126
+
127
+ After all 6 documents are generated (by Claude or Codex depending on mode), check the mode recorded at Codex Mode Check. If **Verify** was selected, dispatch Codex to review the generated docs for accuracy against actual project state — command correctness, env var coverage, broken references, stale instructions. Address any CRITICAL findings before writing to disk. If **Takeover** was selected, skip this step (Codex already generated). If **Skip**, do nothing. Do NOT re-run the consent flow. See **Codex Integration** section below for full details.
128
+
129
+ ## Verification Checklist
130
+
131
+ Before considering onboarding docs complete:
132
+
133
+ ```
134
+ ONBOARDING DOCUMENTATION VERIFICATION
135
+ --------------------------------------
136
+ [ ] Getting Started: Can a new developer go from clone to tests passing in 5 min?
137
+ [ ] Architecture: Does the system diagram match the actual codebase?
138
+ [ ] Local Setup: Are all environment variables documented?
139
+ [ ] Local Setup: Do Docker commands work as written?
140
+ [ ] Testing Guide: Can every test command be copy-pasted and run?
141
+ [ ] Common Tasks: Do the workflows match the actual project process?
142
+ [ ] Glossary: Are all project-specific terms defined?
143
+ [ ] No secrets: No real API keys, passwords, or tokens in any document
144
+ [ ] No broken links: All referenced files and URLs exist
145
+ [ ] No stale info: Docs match the current state of the project
146
+ ```
147
+
148
+ ## Red Flags -- STOP and Reconsider
149
+
150
+ | Thought | Reality |
151
+ |---|---|
152
+ | "Everyone knows how to do this" | New developers do not. Document it. |
153
+ | "The code is self-documenting" | Self-documenting code still needs setup instructions. |
154
+ | "We can fill in details later" | Empty sections are worse than no docs. Write it now or mark as TODO. |
155
+ | "Just read the Dockerfile" | Docs translate Docker configs into human-readable instructions. |
156
+ | "The README covers it" | READMEs are often outdated. Verify every claim. |
157
+ | "It's obvious from the project structure" | Obvious to you. Not to someone seeing it for the first time. |
158
+
159
+ ## Graphify Context (Static-only)
160
+
161
+ **Protocol:** `protocols/graphify.md` | **Mode:** Static-only — read graph files if they exist, skip if absent. No guard, no build prompts, no CLI queries.
162
+
163
+ **How graph data maps to this skill:**
164
+ - **Community labels** → name the subsystems in the architecture overview
165
+ - **God nodes** → highlight as key entry points for new developers
166
+ - **`graph.html`** → reference as an interactive architecture diagram in the onboarding docs ("open `graphify-out/graph.html` for an interactive dependency map")
167
+
168
+ ---
169
+
170
+ ## Codex Integration
171
+ **Modes:** Verify or Takeover | **Protocol:** `protocols/codex.md`
172
+
173
+ - **Verify:** Claude generates docs, Codex reviews for accuracy and completeness.
174
+ - **Takeover:** Codex generates the 6-doc onboarding suite, Claude reviews before writing to disk.
175
+
176
+ **When:** After Claude has analyzed the project (read config files, identified conventions, mapped structure) but before writing the documentation files.
177
+
178
+ **Context to pass:**
179
+ - Path to `.forge/work/{type}/{name}/codebase-analysis.md` (if available)
180
+ - Path to project config files (package.json, pyproject.toml, Dockerfile, etc.)
181
+ - Path to `graphify-out/GRAPH_REPORT.md` (if available)
182
+
183
+ **What Codex generates:**
184
+ - The 6 onboarding documents (getting-started, architecture, local-setup, testing-guide, common-tasks, glossary)
185
+
186
+ **Prompt focus:** "Generate the onboarding documentation suite from the project analysis and config files. Follow the templates and structure defined in the skill. Each document should be accurate to the actual project setup — do not use placeholder values."
187
+
188
+ **Presentation:** Claude reviews Codex's generated docs for accuracy against actual project state before writing to disk.
189
+
190
+ ---
191
+
192
+ ## Integration with Other Skills
193
+
194
+ - **build-scaffold** triggers initial onboarding doc generation
195
+ - **deliver-deploy** triggers doc updates when deployment process changes
196
+ - **deliver-db-migration** triggers doc updates when database setup changes
197
+ - **support-gotcha** provides common troubleshooting items for docs
198
+ - **discover-codebase-analysis** provides the structural understanding this skill documents