bigpowers 2.34.1 → 2.35.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 (48) hide show
  1. package/.pi/package.json +2 -2
  2. package/.pi/prompts/deploy.md +53 -28
  3. package/.pi/prompts/develop-tdd.md +5 -80
  4. package/.pi/prompts/migrate-spec.md +273 -197
  5. package/.pi/prompts/publish-package.md +125 -67
  6. package/.pi/prompts/release-branch.md +85 -69
  7. package/.pi/prompts/security-review.md +323 -0
  8. package/.pi/prompts/smoke-test.md +98 -58
  9. package/.pi/prompts/using-bigpowers.md +2 -2
  10. package/.pi/prompts/validate-contracts.md +169 -54
  11. package/.pi/prompts/wire-ci.md +147 -89
  12. package/.pi/skills/deploy/SKILL.md +53 -28
  13. package/.pi/skills/develop-tdd/SKILL.md +5 -80
  14. package/.pi/skills/migrate-spec/SKILL.md +273 -197
  15. package/.pi/skills/publish-package/SKILL.md +125 -67
  16. package/.pi/skills/release-branch/SKILL.md +85 -69
  17. package/.pi/skills/security-review/SKILL.md +324 -0
  18. package/.pi/skills/smoke-test/SKILL.md +98 -58
  19. package/.pi/skills/using-bigpowers/SKILL.md +2 -2
  20. package/.pi/skills/validate-contracts/SKILL.md +169 -54
  21. package/.pi/skills/wire-ci/SKILL.md +147 -89
  22. package/CHANGELOG.md +14 -0
  23. package/README.md +4 -4
  24. package/SKILL-INDEX.md +2 -2
  25. package/deploy/REFERENCE.md +82 -0
  26. package/deploy/SKILL.md +3 -63
  27. package/develop-tdd/SKILL.md +5 -80
  28. package/migrate-spec/REFERENCE.md +268 -0
  29. package/migrate-spec/SKILL.md +5 -199
  30. package/package.json +2 -2
  31. package/publish-package/REFERENCE.md +239 -0
  32. package/publish-package/SKILL.md +8 -192
  33. package/release-branch/REFERENCE.md +83 -0
  34. package/release-branch/SKILL.md +2 -69
  35. package/scripts/generate-reference-tables.sh +1 -0
  36. package/scripts/sync-skills.sh +4 -1
  37. package/security-review/REFERENCE-confidence-rubric.md +85 -0
  38. package/security-review/REFERENCE-false-positives.md +68 -0
  39. package/security-review/REFERENCE-vuln-categories.md +103 -0
  40. package/security-review/SKILL.md +63 -0
  41. package/skills-lock.json +14 -9
  42. package/smoke-test/REFERENCE.md +162 -0
  43. package/smoke-test/SKILL.md +5 -130
  44. package/using-bigpowers/SKILL.md +2 -2
  45. package/validate-contracts/REFERENCE.md +183 -0
  46. package/validate-contracts/SKILL.md +6 -77
  47. package/wire-ci/REFERENCE.md +257 -0
  48. package/wire-ci/SKILL.md +8 -210
@@ -71,70 +71,15 @@ After all tests pass: extract duplication, deepen modules, apply SOLID principle
71
71
 
72
72
  After every behavior cycle, run the verify command from the active epic task. Show evidence before declaring the step done.
73
73
 
74
- ### 6a. CI dry-run sub-step (when modifying workflows)
75
-
76
- If this cycle modified files in `.github/workflows/`, run a CI dry-run before pushing:
77
-
78
- ```bash
79
- # 1. Check for workflow file changes
80
- CHANGED_WORKFLOWS=$(git diff --name-only HEAD | grep '\.github/workflows/' || true)
81
- if [ -n "$CHANGED_WORKFLOWS" ]; then
82
- echo "==> CI dry-run: workflow files changed"
83
- echo " $CHANGED_WORKFLOWS"
84
-
85
- # 2. Validate YAML syntax
86
- if command -v yamllint &>/dev/null; then
87
- for f in $CHANGED_WORKFLOWS; do
88
- yamllint "$f" && echo " OK: $f passes YAML lint" || echo " WARN: $f has YAML issues"
89
- done
90
- else
91
- # Fallback: Python YAML parse
92
- for f in $CHANGED_WORKFLOWS; do
93
- python3 -c "import yaml; yaml.safe_load(open('$f'))" 2>/dev/null && \
94
- echo " OK: $f YAML syntax valid" || \
95
- echo " FAIL: $f has YAML syntax errors"
96
- done
97
- fi
98
-
99
- # 3. Run actionlint if available
100
- if command -v actionlint &>/dev/null; then
101
- for f in $CHANGED_WORKFLOWS; do
102
- actionlint "$f" && echo " OK: $f passes actionlint" || echo " WARN: $f has actionlint issues"
103
- done
104
- fi
105
-
106
- # 4. Check common pitfalls
107
- for f in $CHANGED_WORKFLOWS; do
108
- # Missing permissions block
109
- if ! grep -q 'permissions:' "$f"; then
110
- echo " WARNING: $f missing permissions block — add one for security"
111
- fi
112
- # npm publish without NPM_TOKEN
113
- if grep -q 'npm publish\|npx semantic-release' "$f" && ! grep -q 'NPM_TOKEN' "$f"; then
114
- echo " WARNING: $f has npm publish/semantic-release but no NPM_TOKEN in secrets"
115
- fi
116
- # Hardcoded Node versions
117
- if grep -q 'node-version: [0-9]' "$f"; then
118
- echo " NOTE: $f has hardcoded Node version — consider node-version-file: .nvmrc"
119
- fi
120
- done
121
-
122
- # 5. Suggest local dry-run
123
- if command -v act &>/dev/null; then
124
- echo " SUGGESTION: Run 'act push --dry-run' to test workflows locally"
125
- fi
126
- fi
127
- ```
128
-
129
- Checklist:
130
- - [ ] YAML syntax validated for all changed workflow files
131
- - [ ] No missing permissions, secrets, or hardcoded versions flagged
132
- - [ ] Local dry-run suggested if `act` is available
133
-
134
74
  ### 7. Manual Verification Handover
135
75
 
136
76
  Once all tests pass: locate the Verification Script in the active epic capsule, present it to the user step-by-step, and wait for confirmation of behavioral correctness.
137
77
 
78
+
79
+ ### 6a. CI dry-run sub-step
80
+
81
+ If this cycle modified files in `.github/workflows/`, run the CI dry-run procedure documented in [REFERENCE.md](REFERENCE.md#ci-dry-run).
82
+
138
83
  ## Checklist Per Cycle
139
84
 
140
85
  ```
@@ -150,26 +95,6 @@ Once all tests pass: locate the Verification Script in the active epic capsule,
150
95
  [ ] verify: command passes
151
96
  ```
152
97
 
153
- ## --config mode
154
-
155
- For pure-config tasks (update package.json, edit YAML, tweak manifest) where there is no test infrastructure to write against. The RED state is "verify command fails"; GREEN is "verify command passes."
156
-
157
- **When to use:** task has a runnable `verify:` command and the deliverable is a config file change with no new behavior to unit-test. Invoke as `develop-tdd --config`.
158
-
159
- **Cycle:**
160
-
161
- ```
162
- RED: Run verify command → it fails (expected)
163
- GREEN: Apply config change → verify passes
164
- COMMIT: commit: chore(<scope>): <change>
165
- ```
166
-
167
- **Rules:**
168
- - Skips test-writing phase entirely — do NOT write a test file for config tasks.
169
- - `verify:` command is **required** and must be runnable (no placeholder).
170
- - Commit message follows Conventional Commits (`chore:` or `feat:` as appropriate).
171
- - Still runs full `verify-work` after all tasks complete.
172
-
173
98
  ## Handoff
174
99
 
175
100
  Gate: READY -> next: verify-work
@@ -48,20 +48,7 @@ If none found: ask the user which framework before proceeding.
48
48
 
49
49
  List every artifact found matching the detected framework. Present the list to the user:
50
50
 
51
- ```
52
- Detected: GSD
53
- Found:
54
- ✓ .planning/ROADMAP.md
55
- ✓ .planning/REQUIREMENTS.md (12 REQ-XX items)
56
- ✓ .planning/state.yaml
57
- ✓ .planning/phases/01-auth/01-CONTEXT.md
58
- ✗ .planning/METHODOLOGY.md (not present)
59
-
60
- Skipping:
61
- .planning/phases/01-auth/01-01-SUMMARY.md (execution record; archived only)
62
-
63
- Proceed with migration? [yes / skip <artifact> / abort]
64
- ```
51
+ See [REFERENCE.md](REFERENCE.md) — `Detected: GSD...`
65
52
 
66
53
  → verify: `find . -maxdepth 4 \( -name "ROADMAP.md" -o -name "spec.md" -o -name "prd.md" -o -name "REQUIREMENTS.md" \) 2>/dev/null | grep -v ".git" | head -15`
67
54
 
@@ -77,17 +64,7 @@ Apply the mapping from [REFERENCE.md](./REFERENCE.md) and [REFERENCE-GSD.md](./R
77
64
 
78
65
  When source artifacts contain IDs (REQ-XX, FR-XX, UJ-XX), emit them as **first-class YAML fields** in `in_scope` entries, not YAML comments:
79
66
 
80
- ```yaml
81
- # CORRECT — first-class id: field
82
- in_scope:
83
- - id: REQ-001
84
- description: "User can register with email/password"
85
- source: "REQUIREMENTS.md"
86
-
87
- # DEPRECATED — comment-only
88
- in_scope:
89
- - "User can register with email/password" # REQ-001
90
- ```
67
+ See [REFERENCE.md](REFERENCE.md) — `# CORRECT — first-class id: field...`
91
68
 
92
69
  **When source has no IDs:** Prompt the user: "No IDs found. Assign auto-generated IDs? [yes / no]". If yes, emit `REQ-{NNN}` with `# auto-generated` annotation.
93
70
 
@@ -99,20 +76,7 @@ See [REFERENCE.md — in_scope format with ID tracking](./REFERENCE.md#in_scope-
99
76
 
100
77
  When source has FR-XX or UJ-XX IDs, emit `specs/product/REQUIREMENTS_TRACE.yaml` for end-to-end requirement traceability:
101
78
 
102
- ```yaml
103
- trace:
104
- - id: FR-001
105
- type: functional_requirement
106
- description: "User can register with email/password"
107
- epic: e02-auth-ui
108
- story: e02s01
109
- verify: "grep -q 'FR-001' specs/product/SCOPE_LATEST.yaml && echo OK"
110
- - id: UJ-001
111
- type: user_journey
112
- description: "New user completes registration flow"
113
- epic: e02-auth-ui
114
- story: e02s01
115
- ```
79
+ See [REFERENCE.md](REFERENCE.md) — `trace:...`
116
80
 
117
81
  **Existing trace file:** If `REQUIREMENTS_TRACE.yaml` already exists, prompt: "REQUIREMENTS_TRACE.yaml exists. [overwrite / merge / skip]"
118
82
 
@@ -130,170 +94,14 @@ See [REFERENCE.md — REQUIREMENTS_TRACE.yaml format](./REFERENCE.md#requirement
130
94
 
131
95
  Always regenerate `specs/state.yaml` from scratch in bigpowers YAML format (see REFERENCE.md for template). The **handoff block is mandatory** and must include all four fields:
132
96
 
133
- ```yaml
134
- active_flow: null
135
- active_epic_id: null
136
- active_story_id: null
137
-
138
- # ... other state fields ...
139
-
140
- handoff:
141
- last_step_completed: "Migrated from <framework> on <date>"
142
- open_decisions:
143
- - "decision text here"
144
- required_reading:
145
- - specs/product/VISION_LATEST.yaml
146
- - specs/product/SCOPE_LATEST.yaml
147
- - specs/tech-architecture/TECH_STACK_LATEST.md
148
- - specs/release-plan.yaml
149
- next_skill: survey-context
150
- ```
97
+ See [REFERENCE.md](REFERENCE.md) — `active_flow: null...`
151
98
 
152
99
  If no open decisions were found during migration, the `open_decisions` list may be empty with an explanatory comment:
153
100
 
154
- ```yaml
155
- handoff:
156
- last_step_completed: "..."
157
- open_decisions: [] # None — all decisions resolved during migration
158
- required_reading: [...]
159
- next_skill: survey-context
160
- ```
101
+ See [REFERENCE.md](REFERENCE.md) — `handoff:...`
161
102
 
162
103
  → verify: `grep -q 'handoff:' specs/state.yaml && grep -q 'last_step_completed' specs/state.yaml && echo "ok" || echo "MISSING or INCOMPLETE: handoff block"`
163
104
 
164
- ### Step 5 — Surface learnings (optional)
165
-
166
- After migration, offer the user a brief analysis of what the source framework did that bigpowers doesn't have yet.
167
-
168
- Use the learnings table from [REFERENCE.md](./REFERENCE.md#learnings-to-adopt). Present as checkboxes so the user can decide which to adopt.
169
-
170
- → verify: `grep -c "\- \[ \]" specs/state.yaml 2>/dev/null && echo "pending items recorded" || echo "no pending items in state.yaml"`
171
-
172
- ### Step 6 — Adversarial review (optional)
173
-
174
- Before the user runs `plan-work`, offer an optional lightweight audit of the migrated artifacts. This catches common migration errors early — incomplete specs, missing verification commands, unresolved decisions.
175
-
176
- Prompt: "Run adversarial review of migrated artifacts? [yes / skip]"
177
-
178
- If yes, perform these checks:
179
-
180
- 1. **Scan for incomplete markers** — Find TODO, FIXME, MISSING in specs/
181
- 2. **Verify every epic has `verify:` commands** — Parse all `eNN-*/epic.yaml` files
182
- 3. **Check state.yaml handoff** — Ensure `open_decisions` is documented (even if empty)
183
-
184
- Collect findings and write to `specs/archive/MIGRATION-AUDIT.md`:
185
-
186
- ```markdown
187
- # Migration Audit — <project-name> from <framework>
188
-
189
- **Date:** <ISO 8601 timestamp>
190
- **Status:** Pass / Fail with findings
191
-
192
- ## Findings
193
-
194
- ### High Priority
195
- - Artifact: specs/epics/e02-auth-ui/epic.yaml
196
- Finding: No verify: commands in story tasks
197
- Recommendation: Add `verify:` to each task before develop-tdd
198
-
199
- ### Information
200
- - Count of TODO markers: 3 (normal for fresh migration)
201
- ```
202
-
203
- If findings exist, the handoff block should note: "Adversarial review: N findings — see `specs/archive/MIGRATION-AUDIT.md`"
204
-
205
- If skip is chosen, add to handoff: "Adversarial review: skipped — review manually before plan-work"
206
-
207
- → verify: `test -f specs/archive/MIGRATION-AUDIT.md && echo "audit completed" || echo "audit skipped or not performed"`
208
-
209
- ### Step 7 — Post-migration: Optional two-pass spec writing gate
210
-
211
- After Steps 1–6, offer the user an optional two-pass spec writing workflow (spec-kit learning):
212
-
213
- Prompt: "Use two-pass spec writing (user journeys first, then technical)? [yes / no]"
214
-
215
- If **yes**, initialize the gate in `specs/state.yaml`:
216
-
217
- ```yaml
218
- two_pass_spec:
219
- journey_pass: pending
220
- technical_pass: pending
221
- approved_at: null
222
- ```
223
-
224
- The journey pass must be marked "complete" by the user (after stakeholder approval of user-journey specs) before the technical pass begins:
225
-
226
- ```yaml
227
- two_pass_spec:
228
- journey_pass: complete
229
- approved_at: "2026-06-26T12:00:00Z"
230
- technical_pass: pending
231
- ```
232
-
233
- Inform the user: "Journey pass is pending. Run `elaborate-spec` for user journeys, get stakeholder approval, then update `two_pass_spec.journey_pass: complete` in state.yaml before proceeding to technical specs."
234
-
235
- If **no**, skip the two-pass gate. Proceed directly to plan-work.
236
-
237
- → verify: `grep -q 'two_pass_spec:' specs/state.yaml && echo "two-pass gate initialized" || echo "two-pass gate not activated"`
238
-
239
- ### Step 8 — Post-migration: Optional methodology doc template
240
-
241
- After Steps 1–7, offer the user an optional analytical framework scaffold (GSD learning):
242
-
243
- Prompt: "Create a methodology doc? [yes / no]"
244
-
245
- If **yes**, present a checklist of analytical lenses:
246
-
247
- ```
248
- Which lenses to include in specs/tech-architecture/METHODOLOGY_LATEST.md?
249
-
250
- [x] Cost of Delay (CD3) — Priority & trade-off assessment
251
- [ ] STRIDE — Security threat modeling
252
- [ ] F.I.R.S.T — Test quality principles
253
- [ ] Bayesian Updating — Probabilistic decision-making
254
- [ ] OWASP Top 10 — Web security framework
255
- ```
256
-
257
- Copy the template from `migrate-spec/templates/METHODOLOGY_LATEST.md` to `specs/tech-architecture/METHODOLOGY_LATEST.md`.
258
- - Active lenses remain uncommented
259
- - Unselected lenses are left commented out
260
- - Populate `{{project_name}}` with the migrated project's name
261
-
262
- If **no**, skip. Add note to handoff: "Methodology doc: skipped — can be added later via `cp migrate-spec/templates/METHODOLOGY_LATEST.md specs/tech-architecture/`"
263
-
264
- → verify: `test -f specs/tech-architecture/METHODOLOGY_LATEST.md && echo "methodology doc created" || echo "methodology doc skipped"`
265
-
266
-
267
- ## Artifact Mapping Summary
268
-
269
- Full mapping tables: [REFERENCE-GSD.md](./REFERENCE-GSD.md) (GSD) · [REFERENCE.md](./REFERENCE.md) (spec-kit, BMAD, learnings).
270
-
271
- | Source | Target |
272
- |--------|--------|
273
- | GSD `ROADMAP.md` | `specs/release-plan.yaml + epic shards` |
274
- | GSD `REQUIREMENTS.md` | `specs/product/SCOPE_LATEST.yaml` |
275
- | GSD `CONTEXT.md` (phases) | `specs/tech-architecture/tech-stack.md` + `specs/adr/` |
276
- | GSD `PLAN.md` | `specs/epics/eNN-slug/epic.yaml` (tasks with verify in `-tasks.yaml`) |
277
- | GSD `METHODOLOGY.md` | `specs/tech-architecture/tech-stack.md` |
278
- | spec-kit `spec.md` | `specs/product/SCOPE_LATEST.yaml` + `specs/tech-architecture/tech-stack.md` |
279
- | spec-kit `plan.md` | `specs/tech-architecture/tech-stack.md` + `specs/release-plan.yaml` + `specs/epics/` |
280
- | spec-kit `tasks.md` | `specs/epics/ (see slice-tasks)` |
281
- | BMAD `prd.md` | `specs/product/SCOPE_LATEST.yaml` |
282
- | BMAD `architecture.md` | `specs/tech-architecture/tech-stack.md` + `specs/adr/` |
283
- | BMAD `epic-*.md` | `specs/release-plan.yaml + epic shards` |
284
- | BMAD `story-*.md` | `specs/epics/ (see slice-tasks)` |
285
- | BMAD `project-context.md` | `CLAUDE.md` (append project-specific section) |
286
- | BMAD `decision-log.md` | `specs/adr/` (one ADR per logged decision) |
287
-
288
-
289
- ## Rules
290
-
291
- - **Preserve source IDs** — REQ-XX, FR-XX, UJ-XX are emitted as first-class `id:` fields in bigpowers YAML targets (e.g., `in_scope` entries). Never silently renumber. See Step 3 ID Tracking subsection for details.
292
- - **Never merge contradictory docs** — if source has both `CONTEXT.md` and `architecture.md`, create sections in bigpowers `CONTEXT.md`; don't collapse them.
293
- - **ADRs are opt-in** — only create an ADR when: hard to reverse, surprising without context, result of a real trade-off. Lightweight decisions go to `specs/DECISION-LOG.md`.
294
- - **state.yaml is always regenerated** — never migrate source STATE verbatim; bigpowers state.yaml needs its own format.
295
- - **specs/ is the only output location** — no files are created outside `specs/` and `CLAUDE.md`.
296
-
297
105
  ---
298
106
 
299
107
  # migrate-spec Reference — GSD
@@ -430,6 +238,8 @@ These GSD artifacts are not migrated — they are execution records, not plannin
430
238
 
431
239
  ---
432
240
 
241
+ # Migrate Spec — Reference
242
+
433
243
  # migrate-spec Reference — spec-kit, BMAD, Learnings
434
244
 
435
245
  Transformation rules for spec-kit and BMAD projects, plus learnings to adopt and output formats.
@@ -764,3 +574,269 @@ two_pass_spec: # Optional: only if user activates two-pass spec writing gate
764
574
  technical_pass: pending
765
575
  approved_at: null
766
576
  ```
577
+
578
+ ---
579
+
580
+ ## Reference block 1
581
+
582
+ ```
583
+ Detected: GSD
584
+ Found:
585
+ ✓ .planning/ROADMAP.md
586
+ ✓ .planning/REQUIREMENTS.md (12 REQ-XX items)
587
+ ✓ .planning/state.yaml
588
+ ✓ .planning/phases/01-auth/01-CONTEXT.md
589
+ ✗ .planning/METHODOLOGY.md (not present)
590
+
591
+ Skipping:
592
+ .planning/phases/01-auth/01-01-SUMMARY.md (execution record; archived only)
593
+
594
+ Proceed with migration? [yes / skip <artifact> / abort]
595
+ ```
596
+
597
+ ---
598
+
599
+ ## Reference block 2
600
+
601
+ ```yaml
602
+ # CORRECT — first-class id: field
603
+ in_scope:
604
+ - id: REQ-001
605
+ description: "User can register with email/password"
606
+ source: "REQUIREMENTS.md"
607
+
608
+ # DEPRECATED — comment-only
609
+ in_scope:
610
+ - "User can register with email/password" # REQ-001
611
+ ```
612
+
613
+ ---
614
+
615
+ ## Reference block 3
616
+
617
+ ```yaml
618
+ trace:
619
+ - id: FR-001
620
+ type: functional_requirement
621
+ description: "User can register with email/password"
622
+ epic: e02-auth-ui
623
+ story: e02s01
624
+ verify: "grep -q 'FR-001' specs/product/SCOPE_LATEST.yaml && echo OK"
625
+ - id: UJ-001
626
+ type: user_journey
627
+ description: "New user completes registration flow"
628
+ epic: e02-auth-ui
629
+ story: e02s01
630
+ ```
631
+
632
+ ---
633
+
634
+ ## Reference block 4
635
+
636
+ ```yaml
637
+ active_flow: null
638
+ active_epic_id: null
639
+ active_story_id: null
640
+
641
+ # ... other state fields ...
642
+
643
+ handoff:
644
+ last_step_completed: "Migrated from <framework> on <date>"
645
+ open_decisions:
646
+ - "decision text here"
647
+ required_reading:
648
+ - specs/product/VISION_LATEST.yaml
649
+ - specs/product/SCOPE_LATEST.yaml
650
+ - specs/tech-architecture/TECH_STACK_LATEST.md
651
+ - specs/release-plan.yaml
652
+ next_skill: survey-context
653
+ ```
654
+
655
+ ---
656
+
657
+ ## Reference block 5
658
+
659
+ ```markdown
660
+ # Migration Audit — <project-name> from <framework>
661
+
662
+ **Date:** <ISO 8601 timestamp>
663
+ **Status:** Pass / Fail with findings
664
+
665
+ ## Findings
666
+
667
+ ### High Priority
668
+ - Artifact: specs/epics/e02-auth-ui/epic.yaml
669
+ Finding: No verify: commands in story tasks
670
+ Recommendation: Add `verify:` to each task before develop-tdd
671
+
672
+ ### Information
673
+ - Count of TODO markers: 3 (normal for fresh migration)
674
+ ```
675
+
676
+ ---
677
+
678
+ ## Reference block 6
679
+
680
+ ```
681
+ Which lenses to include in specs/tech-architecture/METHODOLOGY_LATEST.md?
682
+
683
+ [x] Cost of Delay (CD3) — Priority & trade-off assessment
684
+ [ ] STRIDE — Security threat modeling
685
+ [ ] F.I.R.S.T — Test quality principles
686
+ [ ] Bayesian Updating — Probabilistic decision-making
687
+ [ ] OWASP Top 10 — Web security framework
688
+ ```
689
+
690
+ ---
691
+
692
+ ### Step 7 — Post-migration: Optional two-pass spec writing gate
693
+
694
+ After Steps 1–6, offer the user an optional two-pass spec writing workflow (spec-kit learning):
695
+
696
+ Prompt: "Use two-pass spec writing (user journeys first, then technical)? [yes / no]"
697
+
698
+ If **yes**, initialize the gate in `specs/state.yaml`:
699
+
700
+ ```yaml
701
+ two_pass_spec:
702
+ journey_pass: pending
703
+ technical_pass: pending
704
+ approved_at: null
705
+ ```
706
+
707
+ The journey pass must be marked "complete" by the user (after stakeholder approval of user-journey specs) before the technical pass begins:
708
+
709
+ ```yaml
710
+ two_pass_spec:
711
+ journey_pass: complete
712
+ approved_at: "2026-06-26T12:00:00Z"
713
+ technical_pass: pending
714
+ ```
715
+
716
+ Inform the user: "Journey pass is pending. Run `elaborate-spec` for user journeys, get stakeholder approval, then update `two_pass_spec.journey_pass: complete` in state.yaml before proceeding to technical specs."
717
+
718
+ If **no**, skip the two-pass gate. Proceed directly to plan-work.
719
+
720
+ → verify: `grep -q 'two_pass_spec:' specs/state.yaml && echo "two-pass gate initialized" || echo "two-pass gate not activated"`
721
+
722
+
723
+ ---
724
+
725
+ ### Step 8 — Post-migration: Optional methodology doc template
726
+
727
+ After Steps 1–7, offer the user an optional analytical framework scaffold (GSD learning):
728
+
729
+ Prompt: "Create a methodology doc? [yes / no]"
730
+
731
+ If **yes**, present a checklist of analytical lenses:
732
+
733
+ ```
734
+ Which lenses to include in specs/tech-architecture/METHODOLOGY_LATEST.md?
735
+
736
+ [x] Cost of Delay (CD3) — Priority & trade-off assessment
737
+ [ ] STRIDE — Security threat modeling
738
+ [ ] F.I.R.S.T — Test quality principles
739
+ [ ] Bayesian Updating — Probabilistic decision-making
740
+ [ ] OWASP Top 10 — Web security framework
741
+ ```
742
+
743
+ Copy the template from `migrate-spec/templates/METHODOLOGY_LATEST.md` to `specs/tech-architecture/METHODOLOGY_LATEST.md`.
744
+ - Active lenses remain uncommented
745
+ - Unselected lenses are left commented out
746
+ - Populate `{{project_name}}` with the migrated project's name
747
+
748
+ If **no**, skip. Add note to handoff: "Methodology doc: skipped — can be added later via `cp migrate-spec/templates/METHODOLOGY_LATEST.md specs/tech-architecture/`"
749
+
750
+ → verify: `test -f specs/tech-architecture/METHODOLOGY_LATEST.md && echo "methodology doc created" || echo "methodology doc skipped"`
751
+
752
+ ---
753
+
754
+
755
+ ---
756
+
757
+ ## Artifact Mapping Summary
758
+
759
+ Full mapping tables: [REFERENCE-GSD.md](./REFERENCE-GSD.md) (GSD) · [REFERENCE.md](./REFERENCE.md) (spec-kit, BMAD, learnings).
760
+
761
+ | Source | Target |
762
+ |--------|--------|
763
+ | GSD `ROADMAP.md` | `specs/release-plan.yaml + epic shards` |
764
+ | GSD `REQUIREMENTS.md` | `specs/product/SCOPE_LATEST.yaml` |
765
+ | GSD `CONTEXT.md` (phases) | `specs/tech-architecture/tech-stack.md` + `specs/adr/` |
766
+ | GSD `PLAN.md` | `specs/epics/eNN-slug/epic.yaml` (tasks with verify in `-tasks.yaml`) |
767
+ | GSD `METHODOLOGY.md` | `specs/tech-architecture/tech-stack.md` |
768
+ | spec-kit `spec.md` | `specs/product/SCOPE_LATEST.yaml` + `specs/tech-architecture/tech-stack.md` |
769
+ | spec-kit `plan.md` | `specs/tech-architecture/tech-stack.md` + `specs/release-plan.yaml` + `specs/epics/` |
770
+ | spec-kit `tasks.md` | `specs/epics/ (see slice-tasks)` |
771
+ | BMAD `prd.md` | `specs/product/SCOPE_LATEST.yaml` |
772
+ | BMAD `architecture.md` | `specs/tech-architecture/tech-stack.md` + `specs/adr/` |
773
+ | BMAD `epic-*.md` | `specs/release-plan.yaml + epic shards` |
774
+ | BMAD `story-*.md` | `specs/epics/ (see slice-tasks)` |
775
+ | BMAD `project-context.md` | `CLAUDE.md` (append project-specific section) |
776
+ | BMAD `decision-log.md` | `specs/adr/` (one ADR per logged decision) |
777
+
778
+ ---
779
+
780
+
781
+ ---
782
+
783
+ ## Rules
784
+
785
+ - **Preserve source IDs** — REQ-XX, FR-XX, UJ-XX are emitted as first-class `id:` fields in bigpowers YAML targets (e.g., `in_scope` entries). Never silently renumber. See Step 3 ID Tracking subsection for details.
786
+ - **Never merge contradictory docs** — if source has both `CONTEXT.md` and `architecture.md`, create sections in bigpowers `CONTEXT.md`; don't collapse them.
787
+ - **ADRs are opt-in** — only create an ADR when: hard to reverse, surprising without context, result of a real trade-off. Lightweight decisions go to `specs/DECISION-LOG.md`.
788
+ - **state.yaml is always regenerated** — never migrate source STATE verbatim; bigpowers state.yaml needs its own format.
789
+ - **specs/ is the only output location** — no files are created outside `specs/` and `CLAUDE.md`.
790
+
791
+ ---
792
+
793
+ ### Step 5 — Surface learnings (optional)
794
+
795
+ After migration, offer the user a brief analysis of what the source framework did that bigpowers doesn't have yet.
796
+
797
+ Use the learnings table from [REFERENCE.md](./REFERENCE.md#learnings-to-adopt). Present as checkboxes so the user can decide which to adopt.
798
+
799
+ → verify: `grep -c "\- \[ \]" specs/state.yaml 2>/dev/null && echo "pending items recorded" || echo "no pending items in state.yaml"`
800
+
801
+
802
+ ---
803
+
804
+ ### Step 6 — Adversarial review (optional)
805
+
806
+ Before the user runs `plan-work`, offer an optional lightweight audit of the migrated artifacts. This catches common migration errors early — incomplete specs, missing verification commands, unresolved decisions.
807
+
808
+ Prompt: "Run adversarial review of migrated artifacts? [yes / skip]"
809
+
810
+ If yes, perform these checks:
811
+
812
+ 1. **Scan for incomplete markers** — Find TODO, FIXME, MISSING in specs/
813
+ 2. **Verify every epic has `verify:` commands** — Parse all `eNN-*/epic.yaml` files
814
+ 3. **Check state.yaml handoff** — Ensure `open_decisions` is documented (even if empty)
815
+
816
+ Collect findings and write to `specs/archive/MIGRATION-AUDIT.md`:
817
+
818
+ ```markdown
819
+ # Migration Audit — <project-name> from <framework>
820
+
821
+ **Date:** <ISO 8601 timestamp>
822
+ **Status:** Pass / Fail with findings
823
+
824
+
825
+ ---
826
+
827
+ ## Findings
828
+
829
+ ### High Priority
830
+ - Artifact: specs/epics/e02-auth-ui/epic.yaml
831
+ Finding: No verify: commands in story tasks
832
+ Recommendation: Add `verify:` to each task before develop-tdd
833
+
834
+ ### Information
835
+ - Count of TODO markers: 3 (normal for fresh migration)
836
+ ```
837
+
838
+ If findings exist, the handoff block should note: "Adversarial review: N findings — see `specs/archive/MIGRATION-AUDIT.md`"
839
+
840
+ If skip is chosen, add to handoff: "Adversarial review: skipped — review manually before plan-work"
841
+
842
+ → verify: `test -f specs/archive/MIGRATION-AUDIT.md && echo "audit completed" || echo "audit skipped or not performed"`