bigpowers 2.34.0 → 2.34.2

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 (42) 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/smoke-test.md +98 -58
  8. package/.pi/prompts/using-bigpowers.md +2 -2
  9. package/.pi/prompts/validate-contracts.md +169 -54
  10. package/.pi/prompts/wire-ci.md +147 -89
  11. package/.pi/skills/deploy/SKILL.md +53 -28
  12. package/.pi/skills/develop-tdd/SKILL.md +5 -80
  13. package/.pi/skills/migrate-spec/SKILL.md +273 -197
  14. package/.pi/skills/publish-package/SKILL.md +125 -67
  15. package/.pi/skills/release-branch/SKILL.md +85 -69
  16. package/.pi/skills/smoke-test/SKILL.md +98 -58
  17. package/.pi/skills/using-bigpowers/SKILL.md +2 -2
  18. package/.pi/skills/validate-contracts/SKILL.md +169 -54
  19. package/.pi/skills/wire-ci/SKILL.md +147 -89
  20. package/CHANGELOG.md +14 -0
  21. package/README.md +4 -4
  22. package/SKILL-INDEX.md +1 -1
  23. package/deploy/REFERENCE.md +82 -0
  24. package/deploy/SKILL.md +3 -63
  25. package/develop-tdd/SKILL.md +5 -80
  26. package/migrate-spec/REFERENCE.md +268 -0
  27. package/migrate-spec/SKILL.md +5 -199
  28. package/package.json +4 -3
  29. package/publish-package/REFERENCE.md +239 -0
  30. package/publish-package/SKILL.md +8 -192
  31. package/release-branch/REFERENCE.md +83 -0
  32. package/release-branch/SKILL.md +2 -69
  33. package/scripts/generate-reference-tables.sh +1 -0
  34. package/scripts/sync-skills.sh +4 -1
  35. package/skills-lock.json +9 -9
  36. package/smoke-test/REFERENCE.md +162 -0
  37. package/smoke-test/SKILL.md +5 -130
  38. package/using-bigpowers/SKILL.md +2 -2
  39. package/validate-contracts/REFERENCE.md +183 -0
  40. package/validate-contracts/SKILL.md +6 -77
  41. package/wire-ci/REFERENCE.md +257 -0
  42. package/wire-ci/SKILL.md +8 -210
package/deploy/SKILL.md CHANGED
@@ -87,56 +87,15 @@ exit 1
87
87
 
88
88
  After invoking the deploy command, poll for completion:
89
89
 
90
- ```bash
91
- DEPLOY_TIMEOUT="${DEPLOY_TIMEOUT:-300}" # seconds (default 5 minutes)
92
- DEPLOY_POLL_INTERVAL="${DEPLOY_POLL_INTERVAL:-30}" # seconds
93
-
94
- start_time=$(date +%s)
95
- while true; do
96
- elapsed=$(( $(date +%s) - start_time ))
97
- if [ "$elapsed" -ge "$DEPLOY_TIMEOUT" ]; then
98
- echo "FAIL: deploy status polling timed out after ${DEPLOY_TIMEOUT}s"
99
- exit 1
100
- fi
101
-
102
- status=$(get_deploy_status) # platform-specific status check
103
- if [ "$status" = "ready" ] || [ "$status" = "done" ]; then
104
- echo "Deploy completed in ${elapsed}s"
105
- break
106
- fi
107
-
108
- sleep "$DEPLOY_POLL_INTERVAL"
109
- done
110
- ```
90
+ See [REFERENCE.md](REFERENCE.md)
111
91
 
112
92
  Use exponential backoff for retries on transient failures:
113
93
 
114
- ```bash
115
- RETRY_MAX="${RETRY_MAX:-3}"
116
- base_delay=2
117
- for attempt in $(seq 1 "$RETRY_MAX"); do
118
- if deploy_command; then
119
- break
120
- fi
121
- if [ "$attempt" -eq "$RETRY_MAX" ]; then
122
- echo "FAIL: deploy failed after ${RETRY_MAX} attempts"
123
- exit 1
124
- fi
125
- sleep $(( base_delay * 2 ** (attempt - 1) ))
126
- done
127
- ```
94
+ See [REFERENCE.md](REFERENCE.md)
128
95
 
129
96
  ### 6. Baseline smoke test
130
97
 
131
- ```bash
132
- DEPLOY_URL="${DEPLOY_URL:?DEPLOY_URL must be set}"
133
- if curl -sSf "$DEPLOY_URL" > /dev/null 2>&1; then
134
- echo "OK: $DEPLOY_URL responds with HTTP 200"
135
- else
136
- echo "FAIL: $DEPLOY_URL is not responding with HTTP 200"
137
- exit 1
138
- fi
139
- ```
98
+ See [REFERENCE.md](REFERENCE.md)
140
99
 
141
100
  For comprehensive health-checking, chain to the `smoke-test` skill:
142
101
 
@@ -144,22 +103,3 @@ For comprehensive health-checking, chain to the `smoke-test` skill:
144
103
  # After deploy success
145
104
  bash scripts/run-smoke.sh "$DEPLOY_URL"
146
105
  ```
147
-
148
- ## Configuration
149
-
150
- | Variable | Default | Description |
151
- |----------|---------|-------------|
152
- | `ARTIFACT_DIR` | `dist` | Build output directory |
153
- | `DEPLOY_URL` | *(required)* | Live URL for smoke test |
154
- | `DEPLOY_TIMEOUT` | `300` | Max wait for deploy completion (seconds) |
155
- | `DEPLOY_POLL_INTERVAL` | `30` | Polling interval (seconds) |
156
- | `RETRY_MAX` | `3` | Max deploy retry attempts |
157
- | `BUILD_COMMAND` | *(auto-detect)* | Override build command |
158
-
159
- ## Verification
160
-
161
- → verify: `test -f deploy/SKILL.md && grep -q 'name: deploy' deploy/SKILL.md && echo OK`
162
- → verify: `grep -qi 'build\|artifact\|deploy\|smoke' deploy/SKILL.md && echo OK`
163
- → verify: `grep -ci 'package.json\|Cargo.toml\|Makefile\|manifest' deploy/SKILL.md | awk '{if($1>=1) print "OK"; else print "FAIL"}'`
164
- → verify: `grep -ci 'timeout\|poll\|status\|retry\|backoff' deploy/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`
165
- → verify: `grep -q 'curl.*DEPLOY_URL\|smoke\|health' deploy/SKILL.md && echo OK`
@@ -70,70 +70,15 @@ After all tests pass: extract duplication, deepen modules, apply SOLID principle
70
70
 
71
71
  After every behavior cycle, run the verify command from the active epic task. Show evidence before declaring the step done.
72
72
 
73
- ### 6a. CI dry-run sub-step (when modifying workflows)
74
-
75
- If this cycle modified files in `.github/workflows/`, run a CI dry-run before pushing:
76
-
77
- ```bash
78
- # 1. Check for workflow file changes
79
- CHANGED_WORKFLOWS=$(git diff --name-only HEAD | grep '\.github/workflows/' || true)
80
- if [ -n "$CHANGED_WORKFLOWS" ]; then
81
- echo "==> CI dry-run: workflow files changed"
82
- echo " $CHANGED_WORKFLOWS"
83
-
84
- # 2. Validate YAML syntax
85
- if command -v yamllint &>/dev/null; then
86
- for f in $CHANGED_WORKFLOWS; do
87
- yamllint "$f" && echo " OK: $f passes YAML lint" || echo " WARN: $f has YAML issues"
88
- done
89
- else
90
- # Fallback: Python YAML parse
91
- for f in $CHANGED_WORKFLOWS; do
92
- python3 -c "import yaml; yaml.safe_load(open('$f'))" 2>/dev/null && \
93
- echo " OK: $f YAML syntax valid" || \
94
- echo " FAIL: $f has YAML syntax errors"
95
- done
96
- fi
97
-
98
- # 3. Run actionlint if available
99
- if command -v actionlint &>/dev/null; then
100
- for f in $CHANGED_WORKFLOWS; do
101
- actionlint "$f" && echo " OK: $f passes actionlint" || echo " WARN: $f has actionlint issues"
102
- done
103
- fi
104
-
105
- # 4. Check common pitfalls
106
- for f in $CHANGED_WORKFLOWS; do
107
- # Missing permissions block
108
- if ! grep -q 'permissions:' "$f"; then
109
- echo " WARNING: $f missing permissions block — add one for security"
110
- fi
111
- # npm publish without NPM_TOKEN
112
- if grep -q 'npm publish\|npx semantic-release' "$f" && ! grep -q 'NPM_TOKEN' "$f"; then
113
- echo " WARNING: $f has npm publish/semantic-release but no NPM_TOKEN in secrets"
114
- fi
115
- # Hardcoded Node versions
116
- if grep -q 'node-version: [0-9]' "$f"; then
117
- echo " NOTE: $f has hardcoded Node version — consider node-version-file: .nvmrc"
118
- fi
119
- done
120
-
121
- # 5. Suggest local dry-run
122
- if command -v act &>/dev/null; then
123
- echo " SUGGESTION: Run 'act push --dry-run' to test workflows locally"
124
- fi
125
- fi
126
- ```
127
-
128
- Checklist:
129
- - [ ] YAML syntax validated for all changed workflow files
130
- - [ ] No missing permissions, secrets, or hardcoded versions flagged
131
- - [ ] Local dry-run suggested if `act` is available
132
-
133
73
  ### 7. Manual Verification Handover
134
74
 
135
75
  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.
136
76
 
77
+
78
+ ### 6a. CI dry-run sub-step
79
+
80
+ If this cycle modified files in `.github/workflows/`, run the CI dry-run procedure documented in [REFERENCE.md](REFERENCE.md#ci-dry-run).
81
+
137
82
  ## Checklist Per Cycle
138
83
 
139
84
  ```
@@ -149,26 +94,6 @@ Once all tests pass: locate the Verification Script in the active epic capsule,
149
94
  [ ] verify: command passes
150
95
  ```
151
96
 
152
- ## --config mode
153
-
154
- 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."
155
-
156
- **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`.
157
-
158
- **Cycle:**
159
-
160
- ```
161
- RED: Run verify command → it fails (expected)
162
- GREEN: Apply config change → verify passes
163
- COMMIT: commit: chore(<scope>): <change>
164
- ```
165
-
166
- **Rules:**
167
- - Skips test-writing phase entirely — do NOT write a test file for config tasks.
168
- - `verify:` command is **required** and must be runnable (no placeholder).
169
- - Commit message follows Conventional Commits (`chore:` or `feat:` as appropriate).
170
- - Still runs full `verify-work` after all tasks complete.
171
-
172
97
  ## Handoff
173
98
 
174
99
  Gate: READY -> next: verify-work
@@ -1,3 +1,5 @@
1
+ # Migrate Spec — Reference
2
+
1
3
  # migrate-spec Reference — spec-kit, BMAD, Learnings
2
4
 
3
5
  Transformation rules for spec-kit and BMAD projects, plus learnings to adopt and output formats.
@@ -332,3 +334,269 @@ two_pass_spec: # Optional: only if user activates two-pass spec writing gate
332
334
  technical_pass: pending
333
335
  approved_at: null
334
336
  ```
337
+
338
+ ---
339
+
340
+ ## Reference block 1
341
+
342
+ ```
343
+ Detected: GSD
344
+ Found:
345
+ ✓ .planning/ROADMAP.md
346
+ ✓ .planning/REQUIREMENTS.md (12 REQ-XX items)
347
+ ✓ .planning/state.yaml
348
+ ✓ .planning/phases/01-auth/01-CONTEXT.md
349
+ ✗ .planning/METHODOLOGY.md (not present)
350
+
351
+ Skipping:
352
+ .planning/phases/01-auth/01-01-SUMMARY.md (execution record; archived only)
353
+
354
+ Proceed with migration? [yes / skip <artifact> / abort]
355
+ ```
356
+
357
+ ---
358
+
359
+ ## Reference block 2
360
+
361
+ ```yaml
362
+ # CORRECT — first-class id: field
363
+ in_scope:
364
+ - id: REQ-001
365
+ description: "User can register with email/password"
366
+ source: "REQUIREMENTS.md"
367
+
368
+ # DEPRECATED — comment-only
369
+ in_scope:
370
+ - "User can register with email/password" # REQ-001
371
+ ```
372
+
373
+ ---
374
+
375
+ ## Reference block 3
376
+
377
+ ```yaml
378
+ trace:
379
+ - id: FR-001
380
+ type: functional_requirement
381
+ description: "User can register with email/password"
382
+ epic: e02-auth-ui
383
+ story: e02s01
384
+ verify: "grep -q 'FR-001' specs/product/SCOPE_LATEST.yaml && echo OK"
385
+ - id: UJ-001
386
+ type: user_journey
387
+ description: "New user completes registration flow"
388
+ epic: e02-auth-ui
389
+ story: e02s01
390
+ ```
391
+
392
+ ---
393
+
394
+ ## Reference block 4
395
+
396
+ ```yaml
397
+ active_flow: null
398
+ active_epic_id: null
399
+ active_story_id: null
400
+
401
+ # ... other state fields ...
402
+
403
+ handoff:
404
+ last_step_completed: "Migrated from <framework> on <date>"
405
+ open_decisions:
406
+ - "decision text here"
407
+ required_reading:
408
+ - specs/product/VISION_LATEST.yaml
409
+ - specs/product/SCOPE_LATEST.yaml
410
+ - specs/tech-architecture/TECH_STACK_LATEST.md
411
+ - specs/release-plan.yaml
412
+ next_skill: survey-context
413
+ ```
414
+
415
+ ---
416
+
417
+ ## Reference block 5
418
+
419
+ ```markdown
420
+ # Migration Audit — <project-name> from <framework>
421
+
422
+ **Date:** <ISO 8601 timestamp>
423
+ **Status:** Pass / Fail with findings
424
+
425
+ ## Findings
426
+
427
+ ### High Priority
428
+ - Artifact: specs/epics/e02-auth-ui/epic.yaml
429
+ Finding: No verify: commands in story tasks
430
+ Recommendation: Add `verify:` to each task before develop-tdd
431
+
432
+ ### Information
433
+ - Count of TODO markers: 3 (normal for fresh migration)
434
+ ```
435
+
436
+ ---
437
+
438
+ ## Reference block 6
439
+
440
+ ```
441
+ Which lenses to include in specs/tech-architecture/METHODOLOGY_LATEST.md?
442
+
443
+ [x] Cost of Delay (CD3) — Priority & trade-off assessment
444
+ [ ] STRIDE — Security threat modeling
445
+ [ ] F.I.R.S.T — Test quality principles
446
+ [ ] Bayesian Updating — Probabilistic decision-making
447
+ [ ] OWASP Top 10 — Web security framework
448
+ ```
449
+
450
+ ---
451
+
452
+ ### Step 7 — Post-migration: Optional two-pass spec writing gate
453
+
454
+ After Steps 1–6, offer the user an optional two-pass spec writing workflow (spec-kit learning):
455
+
456
+ Prompt: "Use two-pass spec writing (user journeys first, then technical)? [yes / no]"
457
+
458
+ If **yes**, initialize the gate in `specs/state.yaml`:
459
+
460
+ ```yaml
461
+ two_pass_spec:
462
+ journey_pass: pending
463
+ technical_pass: pending
464
+ approved_at: null
465
+ ```
466
+
467
+ The journey pass must be marked "complete" by the user (after stakeholder approval of user-journey specs) before the technical pass begins:
468
+
469
+ ```yaml
470
+ two_pass_spec:
471
+ journey_pass: complete
472
+ approved_at: "2026-06-26T12:00:00Z"
473
+ technical_pass: pending
474
+ ```
475
+
476
+ 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."
477
+
478
+ If **no**, skip the two-pass gate. Proceed directly to plan-work.
479
+
480
+ → verify: `grep -q 'two_pass_spec:' specs/state.yaml && echo "two-pass gate initialized" || echo "two-pass gate not activated"`
481
+
482
+
483
+ ---
484
+
485
+ ### Step 8 — Post-migration: Optional methodology doc template
486
+
487
+ After Steps 1–7, offer the user an optional analytical framework scaffold (GSD learning):
488
+
489
+ Prompt: "Create a methodology doc? [yes / no]"
490
+
491
+ If **yes**, present a checklist of analytical lenses:
492
+
493
+ ```
494
+ Which lenses to include in specs/tech-architecture/METHODOLOGY_LATEST.md?
495
+
496
+ [x] Cost of Delay (CD3) — Priority & trade-off assessment
497
+ [ ] STRIDE — Security threat modeling
498
+ [ ] F.I.R.S.T — Test quality principles
499
+ [ ] Bayesian Updating — Probabilistic decision-making
500
+ [ ] OWASP Top 10 — Web security framework
501
+ ```
502
+
503
+ Copy the template from `migrate-spec/templates/METHODOLOGY_LATEST.md` to `specs/tech-architecture/METHODOLOGY_LATEST.md`.
504
+ - Active lenses remain uncommented
505
+ - Unselected lenses are left commented out
506
+ - Populate `{{project_name}}` with the migrated project's name
507
+
508
+ 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/`"
509
+
510
+ → verify: `test -f specs/tech-architecture/METHODOLOGY_LATEST.md && echo "methodology doc created" || echo "methodology doc skipped"`
511
+
512
+ ---
513
+
514
+
515
+ ---
516
+
517
+ ## Artifact Mapping Summary
518
+
519
+ Full mapping tables: [REFERENCE-GSD.md](./REFERENCE-GSD.md) (GSD) · [REFERENCE.md](./REFERENCE.md) (spec-kit, BMAD, learnings).
520
+
521
+ | Source | Target |
522
+ |--------|--------|
523
+ | GSD `ROADMAP.md` | `specs/release-plan.yaml + epic shards` |
524
+ | GSD `REQUIREMENTS.md` | `specs/product/SCOPE_LATEST.yaml` |
525
+ | GSD `CONTEXT.md` (phases) | `specs/tech-architecture/tech-stack.md` + `specs/adr/` |
526
+ | GSD `PLAN.md` | `specs/epics/eNN-slug/epic.yaml` (tasks with verify in `-tasks.yaml`) |
527
+ | GSD `METHODOLOGY.md` | `specs/tech-architecture/tech-stack.md` |
528
+ | spec-kit `spec.md` | `specs/product/SCOPE_LATEST.yaml` + `specs/tech-architecture/tech-stack.md` |
529
+ | spec-kit `plan.md` | `specs/tech-architecture/tech-stack.md` + `specs/release-plan.yaml` + `specs/epics/` |
530
+ | spec-kit `tasks.md` | `specs/epics/ (see slice-tasks)` |
531
+ | BMAD `prd.md` | `specs/product/SCOPE_LATEST.yaml` |
532
+ | BMAD `architecture.md` | `specs/tech-architecture/tech-stack.md` + `specs/adr/` |
533
+ | BMAD `epic-*.md` | `specs/release-plan.yaml + epic shards` |
534
+ | BMAD `story-*.md` | `specs/epics/ (see slice-tasks)` |
535
+ | BMAD `project-context.md` | `CLAUDE.md` (append project-specific section) |
536
+ | BMAD `decision-log.md` | `specs/adr/` (one ADR per logged decision) |
537
+
538
+ ---
539
+
540
+
541
+ ---
542
+
543
+ ## Rules
544
+
545
+ - **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.
546
+ - **Never merge contradictory docs** — if source has both `CONTEXT.md` and `architecture.md`, create sections in bigpowers `CONTEXT.md`; don't collapse them.
547
+ - **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`.
548
+ - **state.yaml is always regenerated** — never migrate source STATE verbatim; bigpowers state.yaml needs its own format.
549
+ - **specs/ is the only output location** — no files are created outside `specs/` and `CLAUDE.md`.
550
+
551
+ ---
552
+
553
+ ### Step 5 — Surface learnings (optional)
554
+
555
+ After migration, offer the user a brief analysis of what the source framework did that bigpowers doesn't have yet.
556
+
557
+ Use the learnings table from [REFERENCE.md](./REFERENCE.md#learnings-to-adopt). Present as checkboxes so the user can decide which to adopt.
558
+
559
+ → verify: `grep -c "\- \[ \]" specs/state.yaml 2>/dev/null && echo "pending items recorded" || echo "no pending items in state.yaml"`
560
+
561
+
562
+ ---
563
+
564
+ ### Step 6 — Adversarial review (optional)
565
+
566
+ 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.
567
+
568
+ Prompt: "Run adversarial review of migrated artifacts? [yes / skip]"
569
+
570
+ If yes, perform these checks:
571
+
572
+ 1. **Scan for incomplete markers** — Find TODO, FIXME, MISSING in specs/
573
+ 2. **Verify every epic has `verify:` commands** — Parse all `eNN-*/epic.yaml` files
574
+ 3. **Check state.yaml handoff** — Ensure `open_decisions` is documented (even if empty)
575
+
576
+ Collect findings and write to `specs/archive/MIGRATION-AUDIT.md`:
577
+
578
+ ```markdown
579
+ # Migration Audit — <project-name> from <framework>
580
+
581
+ **Date:** <ISO 8601 timestamp>
582
+ **Status:** Pass / Fail with findings
583
+
584
+
585
+ ---
586
+
587
+ ## Findings
588
+
589
+ ### High Priority
590
+ - Artifact: specs/epics/e02-auth-ui/epic.yaml
591
+ Finding: No verify: commands in story tasks
592
+ Recommendation: Add `verify:` to each task before develop-tdd
593
+
594
+ ### Information
595
+ - Count of TODO markers: 3 (normal for fresh migration)
596
+ ```
597
+
598
+ If findings exist, the handoff block should note: "Adversarial review: N findings — see `specs/archive/MIGRATION-AUDIT.md`"
599
+
600
+ If skip is chosen, add to handoff: "Adversarial review: skipped — review manually before plan-work"
601
+
602
+ → verify: `test -f specs/archive/MIGRATION-AUDIT.md && echo "audit completed" || echo "audit skipped or not performed"`
@@ -49,20 +49,7 @@ If none found: ask the user which framework before proceeding.
49
49
 
50
50
  List every artifact found matching the detected framework. Present the list to the user:
51
51
 
52
- ```
53
- Detected: GSD
54
- Found:
55
- ✓ .planning/ROADMAP.md
56
- ✓ .planning/REQUIREMENTS.md (12 REQ-XX items)
57
- ✓ .planning/state.yaml
58
- ✓ .planning/phases/01-auth/01-CONTEXT.md
59
- ✗ .planning/METHODOLOGY.md (not present)
60
-
61
- Skipping:
62
- .planning/phases/01-auth/01-01-SUMMARY.md (execution record; archived only)
63
-
64
- Proceed with migration? [yes / skip <artifact> / abort]
65
- ```
52
+ See [REFERENCE.md](REFERENCE.md) — `Detected: GSD...`
66
53
 
67
54
  → 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`
68
55
 
@@ -78,17 +65,7 @@ Apply the mapping from [REFERENCE.md](./REFERENCE.md) and [REFERENCE-GSD.md](./R
78
65
 
79
66
  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:
80
67
 
81
- ```yaml
82
- # CORRECT — first-class id: field
83
- in_scope:
84
- - id: REQ-001
85
- description: "User can register with email/password"
86
- source: "REQUIREMENTS.md"
87
-
88
- # DEPRECATED — comment-only
89
- in_scope:
90
- - "User can register with email/password" # REQ-001
91
- ```
68
+ See [REFERENCE.md](REFERENCE.md) — `# CORRECT — first-class id: field...`
92
69
 
93
70
  **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.
94
71
 
@@ -100,20 +77,7 @@ See [REFERENCE.md — in_scope format with ID tracking](./REFERENCE.md#in_scope-
100
77
 
101
78
  When source has FR-XX or UJ-XX IDs, emit `specs/product/REQUIREMENTS_TRACE.yaml` for end-to-end requirement traceability:
102
79
 
103
- ```yaml
104
- trace:
105
- - id: FR-001
106
- type: functional_requirement
107
- description: "User can register with email/password"
108
- epic: e02-auth-ui
109
- story: e02s01
110
- verify: "grep -q 'FR-001' specs/product/SCOPE_LATEST.yaml && echo OK"
111
- - id: UJ-001
112
- type: user_journey
113
- description: "New user completes registration flow"
114
- epic: e02-auth-ui
115
- story: e02s01
116
- ```
80
+ See [REFERENCE.md](REFERENCE.md) — `trace:...`
117
81
 
118
82
  **Existing trace file:** If `REQUIREMENTS_TRACE.yaml` already exists, prompt: "REQUIREMENTS_TRACE.yaml exists. [overwrite / merge / skip]"
119
83
 
@@ -131,168 +95,10 @@ See [REFERENCE.md — REQUIREMENTS_TRACE.yaml format](./REFERENCE.md#requirement
131
95
 
132
96
  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:
133
97
 
134
- ```yaml
135
- active_flow: null
136
- active_epic_id: null
137
- active_story_id: null
138
-
139
- # ... other state fields ...
140
-
141
- handoff:
142
- last_step_completed: "Migrated from <framework> on <date>"
143
- open_decisions:
144
- - "decision text here"
145
- required_reading:
146
- - specs/product/VISION_LATEST.yaml
147
- - specs/product/SCOPE_LATEST.yaml
148
- - specs/tech-architecture/TECH_STACK_LATEST.md
149
- - specs/release-plan.yaml
150
- next_skill: survey-context
151
- ```
98
+ See [REFERENCE.md](REFERENCE.md) — `active_flow: null...`
152
99
 
153
100
  If no open decisions were found during migration, the `open_decisions` list may be empty with an explanatory comment:
154
101
 
155
- ```yaml
156
- handoff:
157
- last_step_completed: "..."
158
- open_decisions: [] # None — all decisions resolved during migration
159
- required_reading: [...]
160
- next_skill: survey-context
161
- ```
102
+ See [REFERENCE.md](REFERENCE.md) — `handoff:...`
162
103
 
163
104
  → verify: `grep -q 'handoff:' specs/state.yaml && grep -q 'last_step_completed' specs/state.yaml && echo "ok" || echo "MISSING or INCOMPLETE: handoff block"`
164
-
165
- ### Step 5 — Surface learnings (optional)
166
-
167
- After migration, offer the user a brief analysis of what the source framework did that bigpowers doesn't have yet.
168
-
169
- Use the learnings table from [REFERENCE.md](./REFERENCE.md#learnings-to-adopt). Present as checkboxes so the user can decide which to adopt.
170
-
171
- → verify: `grep -c "\- \[ \]" specs/state.yaml 2>/dev/null && echo "pending items recorded" || echo "no pending items in state.yaml"`
172
-
173
- ### Step 6 — Adversarial review (optional)
174
-
175
- 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.
176
-
177
- Prompt: "Run adversarial review of migrated artifacts? [yes / skip]"
178
-
179
- If yes, perform these checks:
180
-
181
- 1. **Scan for incomplete markers** — Find TODO, FIXME, MISSING in specs/
182
- 2. **Verify every epic has `verify:` commands** — Parse all `eNN-*/epic.yaml` files
183
- 3. **Check state.yaml handoff** — Ensure `open_decisions` is documented (even if empty)
184
-
185
- Collect findings and write to `specs/archive/MIGRATION-AUDIT.md`:
186
-
187
- ```markdown
188
- # Migration Audit — <project-name> from <framework>
189
-
190
- **Date:** <ISO 8601 timestamp>
191
- **Status:** Pass / Fail with findings
192
-
193
- ## Findings
194
-
195
- ### High Priority
196
- - Artifact: specs/epics/e02-auth-ui/epic.yaml
197
- Finding: No verify: commands in story tasks
198
- Recommendation: Add `verify:` to each task before develop-tdd
199
-
200
- ### Information
201
- - Count of TODO markers: 3 (normal for fresh migration)
202
- ```
203
-
204
- If findings exist, the handoff block should note: "Adversarial review: N findings — see `specs/archive/MIGRATION-AUDIT.md`"
205
-
206
- If skip is chosen, add to handoff: "Adversarial review: skipped — review manually before plan-work"
207
-
208
- → verify: `test -f specs/archive/MIGRATION-AUDIT.md && echo "audit completed" || echo "audit skipped or not performed"`
209
-
210
- ### Step 7 — Post-migration: Optional two-pass spec writing gate
211
-
212
- After Steps 1–6, offer the user an optional two-pass spec writing workflow (spec-kit learning):
213
-
214
- Prompt: "Use two-pass spec writing (user journeys first, then technical)? [yes / no]"
215
-
216
- If **yes**, initialize the gate in `specs/state.yaml`:
217
-
218
- ```yaml
219
- two_pass_spec:
220
- journey_pass: pending
221
- technical_pass: pending
222
- approved_at: null
223
- ```
224
-
225
- The journey pass must be marked "complete" by the user (after stakeholder approval of user-journey specs) before the technical pass begins:
226
-
227
- ```yaml
228
- two_pass_spec:
229
- journey_pass: complete
230
- approved_at: "2026-06-26T12:00:00Z"
231
- technical_pass: pending
232
- ```
233
-
234
- 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."
235
-
236
- If **no**, skip the two-pass gate. Proceed directly to plan-work.
237
-
238
- → verify: `grep -q 'two_pass_spec:' specs/state.yaml && echo "two-pass gate initialized" || echo "two-pass gate not activated"`
239
-
240
- ### Step 8 — Post-migration: Optional methodology doc template
241
-
242
- After Steps 1–7, offer the user an optional analytical framework scaffold (GSD learning):
243
-
244
- Prompt: "Create a methodology doc? [yes / no]"
245
-
246
- If **yes**, present a checklist of analytical lenses:
247
-
248
- ```
249
- Which lenses to include in specs/tech-architecture/METHODOLOGY_LATEST.md?
250
-
251
- [x] Cost of Delay (CD3) — Priority & trade-off assessment
252
- [ ] STRIDE — Security threat modeling
253
- [ ] F.I.R.S.T — Test quality principles
254
- [ ] Bayesian Updating — Probabilistic decision-making
255
- [ ] OWASP Top 10 — Web security framework
256
- ```
257
-
258
- Copy the template from `migrate-spec/templates/METHODOLOGY_LATEST.md` to `specs/tech-architecture/METHODOLOGY_LATEST.md`.
259
- - Active lenses remain uncommented
260
- - Unselected lenses are left commented out
261
- - Populate `{{project_name}}` with the migrated project's name
262
-
263
- 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/`"
264
-
265
- → verify: `test -f specs/tech-architecture/METHODOLOGY_LATEST.md && echo "methodology doc created" || echo "methodology doc skipped"`
266
-
267
- ---
268
-
269
- ## Artifact Mapping Summary
270
-
271
- Full mapping tables: [REFERENCE-GSD.md](./REFERENCE-GSD.md) (GSD) · [REFERENCE.md](./REFERENCE.md) (spec-kit, BMAD, learnings).
272
-
273
- | Source | Target |
274
- |--------|--------|
275
- | GSD `ROADMAP.md` | `specs/release-plan.yaml + epic shards` |
276
- | GSD `REQUIREMENTS.md` | `specs/product/SCOPE_LATEST.yaml` |
277
- | GSD `CONTEXT.md` (phases) | `specs/tech-architecture/tech-stack.md` + `specs/adr/` |
278
- | GSD `PLAN.md` | `specs/epics/eNN-slug/epic.yaml` (tasks with verify in `-tasks.yaml`) |
279
- | GSD `METHODOLOGY.md` | `specs/tech-architecture/tech-stack.md` |
280
- | spec-kit `spec.md` | `specs/product/SCOPE_LATEST.yaml` + `specs/tech-architecture/tech-stack.md` |
281
- | spec-kit `plan.md` | `specs/tech-architecture/tech-stack.md` + `specs/release-plan.yaml` + `specs/epics/` |
282
- | spec-kit `tasks.md` | `specs/epics/ (see slice-tasks)` |
283
- | BMAD `prd.md` | `specs/product/SCOPE_LATEST.yaml` |
284
- | BMAD `architecture.md` | `specs/tech-architecture/tech-stack.md` + `specs/adr/` |
285
- | BMAD `epic-*.md` | `specs/release-plan.yaml + epic shards` |
286
- | BMAD `story-*.md` | `specs/epics/ (see slice-tasks)` |
287
- | BMAD `project-context.md` | `CLAUDE.md` (append project-specific section) |
288
- | BMAD `decision-log.md` | `specs/adr/` (one ADR per logged decision) |
289
-
290
- ---
291
-
292
- ## Rules
293
-
294
- - **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.
295
- - **Never merge contradictory docs** — if source has both `CONTEXT.md` and `architecture.md`, create sections in bigpowers `CONTEXT.md`; don't collapse them.
296
- - **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`.
297
- - **state.yaml is always regenerated** — never migrate source STATE verbatim; bigpowers state.yaml needs its own format.
298
- - **specs/ is the only output location** — no files are created outside `specs/` and `CLAUDE.md`.