bigpowers 2.73.9 → 2.74.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/.continue/rules/context7-mcp.md +0 -0
  2. package/.continue/rules/diagnose-stall.md +0 -0
  3. package/.kilocode/rules/context7-mcp.md +0 -0
  4. package/.kilocode/rules/diagnose-stall.md +0 -0
  5. package/.pi/package.json +2 -2
  6. package/.pi/prompts/audit-code.md +17 -13
  7. package/.pi/prompts/build-epic.md +5 -0
  8. package/.pi/prompts/change-request.md +4 -1
  9. package/.pi/prompts/compose-workflow.md +17 -0
  10. package/.pi/prompts/context7-mcp.md +54 -0
  11. package/.pi/prompts/craft-skill.md +28 -0
  12. package/.pi/prompts/deepen-architecture.md +20 -0
  13. package/.pi/prompts/delegate-task.md +14 -0
  14. package/.pi/prompts/deploy.md +8 -0
  15. package/.pi/prompts/develop-tdd.md +15 -4
  16. package/.pi/prompts/diagnose-stall.md +53 -0
  17. package/.pi/prompts/dispatch-agents.md +53 -19
  18. package/.pi/prompts/evolve-skill.md +7 -0
  19. package/.pi/prompts/gate-trace.md +9 -1
  20. package/.pi/prompts/guard-git.md +14 -0
  21. package/.pi/prompts/kickoff-branch.md +4 -0
  22. package/.pi/prompts/migrate-spec.md +18 -0
  23. package/.pi/prompts/plan-work.md +62 -2
  24. package/.pi/prompts/publish-package.md +11 -0
  25. package/.pi/prompts/release-branch.md +46 -43
  26. package/.pi/prompts/request-review.md +57 -17
  27. package/.pi/prompts/research-first.md +3 -0
  28. package/.pi/prompts/run-benchmark.md +3 -3
  29. package/.pi/prompts/run-evals.md +26 -6
  30. package/.pi/prompts/run-planning.md +1 -0
  31. package/.pi/prompts/scope-work.md +3 -0
  32. package/.pi/prompts/search-skills.md +3 -0
  33. package/.pi/prompts/security-review.md +66 -12
  34. package/.pi/prompts/seed-conventions.md +68 -0
  35. package/.pi/prompts/session-state.md +5 -10
  36. package/.pi/prompts/slice-tasks.md +3 -0
  37. package/.pi/prompts/smoke-test.md +11 -0
  38. package/.pi/prompts/stocktake-skills.md +6 -1
  39. package/.pi/prompts/validate-contracts.md +12 -0
  40. package/.pi/prompts/validate-fix.md +2 -0
  41. package/.pi/prompts/verify-work.md +42 -20
  42. package/.pi/prompts/wire-ci.md +11 -0
  43. package/.pi/prompts/write-document.md +10 -0
  44. package/.pi/skills/audit-code/SKILL.md +17 -13
  45. package/.pi/skills/build-epic/SKILL.md +5 -0
  46. package/.pi/skills/change-request/SKILL.md +4 -1
  47. package/.pi/skills/compose-workflow/SKILL.md +17 -0
  48. package/.pi/skills/context7-mcp/SKILL.md +56 -0
  49. package/.pi/skills/craft-skill/SKILL.md +28 -0
  50. package/.pi/skills/deepen-architecture/SKILL.md +20 -0
  51. package/.pi/skills/delegate-task/SKILL.md +14 -0
  52. package/.pi/skills/deploy/SKILL.md +8 -0
  53. package/.pi/skills/develop-tdd/SKILL.md +15 -4
  54. package/.pi/skills/diagnose-stall/SKILL.md +55 -0
  55. package/.pi/skills/dispatch-agents/SKILL.md +53 -19
  56. package/.pi/skills/evolve-skill/SKILL.md +7 -0
  57. package/.pi/skills/gate-trace/SKILL.md +9 -1
  58. package/.pi/skills/guard-git/SKILL.md +14 -0
  59. package/.pi/skills/kickoff-branch/SKILL.md +4 -0
  60. package/.pi/skills/migrate-spec/SKILL.md +18 -0
  61. package/.pi/skills/plan-work/SKILL.md +62 -2
  62. package/.pi/skills/publish-package/SKILL.md +11 -0
  63. package/.pi/skills/release-branch/SKILL.md +46 -43
  64. package/.pi/skills/request-review/SKILL.md +57 -17
  65. package/.pi/skills/research-first/SKILL.md +3 -0
  66. package/.pi/skills/run-benchmark/SKILL.md +3 -3
  67. package/.pi/skills/run-evals/SKILL.md +26 -6
  68. package/.pi/skills/run-planning/SKILL.md +1 -0
  69. package/.pi/skills/scope-work/SKILL.md +3 -0
  70. package/.pi/skills/search-skills/SKILL.md +3 -0
  71. package/.pi/skills/security-review/SKILL.md +66 -12
  72. package/.pi/skills/seed-conventions/SKILL.md +68 -0
  73. package/.pi/skills/session-state/SKILL.md +5 -10
  74. package/.pi/skills/slice-tasks/SKILL.md +3 -0
  75. package/.pi/skills/smoke-test/SKILL.md +11 -0
  76. package/.pi/skills/stocktake-skills/SKILL.md +6 -1
  77. package/.pi/skills/validate-contracts/SKILL.md +12 -0
  78. package/.pi/skills/validate-fix/SKILL.md +2 -0
  79. package/.pi/skills/verify-work/SKILL.md +42 -20
  80. package/.pi/skills/wire-ci/SKILL.md +11 -0
  81. package/.pi/skills/write-document/SKILL.md +10 -0
  82. package/CHANGELOG.md +15 -0
  83. package/CLAUDE.md +59 -1
  84. package/CONVENTIONS.md +81 -0
  85. package/README.md +1 -1
  86. package/SKILL-INDEX.md +1 -1
  87. package/package.json +1 -1
  88. package/scripts/bp-churn-rank.sh +49 -0
  89. package/scripts/bp-read-agents.sh +1 -0
  90. package/scripts/check-import-boundaries.sh +64 -0
  91. package/scripts/compile-rule-matrix.sh +114 -0
  92. package/scripts/hooks/rtk-rewrite.sh +11 -0
  93. package/scripts/hooks/token-mgmt-pre-tool-use.sh +53 -0
  94. package/scripts/install.sh +6 -0
  95. package/scripts/lib/completeness-critic.sh +62 -0
  96. package/scripts/lib/doc-fetch-cache.sh +71 -0
  97. package/scripts/lib/golden-suite-gates.sh +3 -1
  98. package/scripts/lib/parallel-review-worktrees.sh +34 -0
  99. package/scripts/lib/plan-consistency-check.sh +88 -0
  100. package/scripts/lib/run-benchmark.py +210 -0
  101. package/scripts/lib/sync-context-engineering-ref.sh +19 -0
  102. package/scripts/references-manifest.yaml +19 -0
  103. package/scripts/run-benchmark.sh +6 -0
  104. package/scripts/run-skill-verify.sh +1 -0
  105. package/scripts/sync-references.sh +25 -0
  106. package/scripts/sync-skills.sh +12 -1
  107. package/scripts/validate-skill-catalog.sh +147 -0
  108. package/scripts/validate-skill-description.sh +70 -0
  109. package/skills/audit-code/SKILL.md +19 -13
  110. package/skills/build-epic/SKILL.md +6 -1
  111. package/skills/change-request/SKILL.md +4 -1
  112. package/skills/compose-workflow/SKILL.md +17 -0
  113. package/skills/context7-mcp/SKILL.md +57 -0
  114. package/skills/craft-skill/SKILL.md +29 -0
  115. package/skills/deepen-architecture/SKILL.md +22 -0
  116. package/skills/delegate-task/SKILL.md +14 -0
  117. package/skills/deploy/SKILL.md +9 -0
  118. package/skills/develop-tdd/SKILL.md +18 -4
  119. package/skills/diagnose-stall/SKILL.md +56 -0
  120. package/skills/dispatch-agents/SKILL.md +53 -19
  121. package/skills/elaborate-spec/SKILL.md +1 -0
  122. package/skills/evolve-skill/SKILL.md +7 -0
  123. package/skills/gate-trace/SKILL.md +11 -1
  124. package/skills/guard-git/REFERENCE.md +14 -0
  125. package/skills/kickoff-branch/SKILL.md +4 -1
  126. package/skills/migrate-spec/REFERENCE.md +12 -0
  127. package/skills/migrate-spec/SKILL.md +6 -0
  128. package/skills/plan-work/REFERENCE.md +29 -2
  129. package/skills/plan-work/SKILL.md +38 -0
  130. package/skills/publish-package/REFERENCE.md +11 -0
  131. package/skills/release-branch/REFERENCE.md +14 -0
  132. package/skills/release-branch/SKILL.md +33 -44
  133. package/skills/request-review/SKILL.md +59 -17
  134. package/skills/research-first/SKILL.md +3 -0
  135. package/skills/run-benchmark/SKILL.md +5 -4
  136. package/skills/run-evals/REFERENCE.md +14 -4
  137. package/skills/run-evals/SKILL.md +13 -2
  138. package/skills/run-planning/SKILL.md +1 -0
  139. package/skills/scope-work/SKILL.md +3 -0
  140. package/skills/search-skills/SKILL.md +3 -0
  141. package/skills/security-review/REFERENCE-false-positives.md +9 -8
  142. package/skills/security-review/REFERENCE-vuln-categories.md +4 -0
  143. package/skills/security-review/SKILL.md +53 -4
  144. package/skills/security-review/fixtures/CWE-79-xss-negative.js +6 -0
  145. package/skills/security-review/fixtures/CWE-79-xss-positive.js +6 -0
  146. package/skills/security-review/fixtures/CWE-89-sqli-negative.py +8 -0
  147. package/skills/security-review/fixtures/CWE-89-sqli-positive.py +9 -0
  148. package/skills/seed-conventions/REFERENCE.md +40 -0
  149. package/skills/seed-conventions/SKILL.md +28 -1
  150. package/skills/session-state/SKILL.md +5 -10
  151. package/skills/slice-tasks/SKILL.md +3 -0
  152. package/skills/smoke-test/REFERENCE.md +11 -0
  153. package/skills/stocktake-skills/SKILL.md +8 -1
  154. package/skills/validate-contracts/REFERENCE.md +12 -0
  155. package/skills/validate-fix/SKILL.md +3 -0
  156. package/skills/verify-work/REFERENCE.md +17 -0
  157. package/skills/verify-work/SKILL.md +25 -22
  158. package/skills/wire-ci/REFERENCE.md +11 -0
  159. package/skills/write-document/REFERENCE.md +10 -0
  160. package/skills-lock.json +41 -31
@@ -3,6 +3,13 @@ description: Generate CLAUDE.md and CONVENTIONS.md for a brand-new project throu
3
3
  ---
4
4
 
5
5
 
6
+ # story: e10s01
7
+ # story: e47s02
8
+ # story: e10s02
9
+ # story: e51s02
10
+ # story: e45s21
11
+
12
+
6
13
  # Seed Conventions
7
14
  > **HARD GATE** — Before any new code lands, confirm the project conventions are understood. Ask: 'What does a good commit message look like in this project?'
8
15
 
@@ -61,7 +68,28 @@ echo "# Specs\n\nAll planning documents for this project." > specs/README.md
61
68
 
62
69
  When generating `CLAUDE.md`, if the user did not name a Preflight command, chain the Test + Lint + Build interview answers into one **Preflight** row (e.g. `npm test && npm run lint && npm run build`).
63
70
 
71
+ ### Self-installing fenced markers (e45s21)
72
+
73
+ Skills that write into `CLAUDE.md` or `AGENTS.md` MUST use **fenced HTML comment markers** so handwritten content outside the fence is never clobbered:
74
+
75
+ ```markdown
76
+ <!-- BEGIN bigpowers:section-id -->
77
+ …agent-managed content only…
78
+ <!-- END bigpowers:section-id -->
79
+ ```
80
+
81
+ **Merge rule:** On update, replace only the content *between* matching `BEGIN`/`END` pairs. If a marker pair is missing, append a new fenced block at the end of the file — never rewrite the whole file.
82
+
83
+ **Standard marker IDs** for seeded projects (see [REFERENCE.md](REFERENCE.md) § Fenced markers):
64
84
 
85
+ | Marker ID | Owner skill | Purpose |
86
+ |-----------|-------------|---------|
87
+ | `project` | seed-conventions | Project, Commands, Architecture |
88
+ | `context-routing` | seed-conventions | Glob → sub-AGENTS.md routing table |
89
+ | `learned-preferences` | session-state | Learned User Preferences + Workspace Facts |
90
+ | `tooling` | setup-environment, guard-git | sqz/rtk/hook blocks installed by tooling skills |
91
+
92
+ Emit these fences in `AGENTS.md` (and therefore `CLAUDE.md` symlink) from `docs/templates/AGENTS.md`. User prose outside fences is sacred.
65
93
 
66
94
  - [ ] CLAUDE.md exists and is populated
67
95
  - [ ] CONVENTIONS.md exists and includes specs/ output convention
@@ -75,8 +103,48 @@ When generating `CLAUDE.md`, if the user did not name a Preflight command, chain
75
103
  ---
76
104
 
77
105
  # story: e51s02 e37s01 e37s03 e37s14
106
+ # story: e45s21
78
107
  # Seed Conventions — Reference Templates
79
108
 
109
+ ## Navigation
110
+
111
+ | Lines | Section |
112
+ |-------|---------|
113
+ | 1–4 | Title + story tags |
114
+ | 6–22 | Navigation (this table) |
115
+ | 24–35 | AGENTS.md spine |
116
+ | 37–76 | Agent config template |
117
+ | 78–85 | opencode.json template |
118
+ | 87–96 | Aider bridge |
119
+ | 98–108 | Codex CLI wiring |
120
+ | 110–118 | CONVENTIONS.md |
121
+ | 120–122 | Stack profile fragments |
122
+ | 124–153 | Local tool wiring |
123
+
124
+ ## Fenced markers (e45s21)
125
+
126
+ Self-installing blocks prevent skills from overwriting user-authored prose. Pattern:
127
+
128
+ ```markdown
129
+ <!-- BEGIN bigpowers:section-id -->
130
+ …managed content…
131
+ <!-- END bigpowers:section-id -->
132
+ ```
133
+
134
+ **Merge algorithm:**
135
+
136
+ 1. If `BEGIN bigpowers:<id>` exists → replace inner content only.
137
+ 2. If missing → append new fenced block at EOF.
138
+ 3. Never delete content outside fences.
139
+
140
+ Seed these marker IDs in generated `AGENTS.md`:
141
+
142
+ | ID | Initial content |
143
+ |----|-----------------|
144
+ | `project` | Project, Commands, Architecture, Conventions, Never, Agent Rules |
145
+ | `context-routing` | Glob → sub-AGENTS.md table (see CLAUDE.md e45s22) |
146
+ | `learned-preferences` | Empty Learned User Preferences + Workspace Facts lists |
147
+
80
148
  ## AGENTS.md spine (Reach Template — e37s01)
81
149
 
82
150
  Canonical source: copy from `docs/templates/AGENTS.md` in the bigpowers repo (Reach Template).
@@ -3,6 +3,8 @@ description: Track implementation decisions and progress in specs/state.yaml to
3
3
  ---
4
4
 
5
5
 
6
+ # story: e45s23
7
+
6
8
  # Session State
7
9
  > **HARD GATE** — **HARD GATE** — Session state must be synchronized with git state. If state.yaml conflicts with the working tree, halt and ask for clarification. Do NOT assume state is correct.
8
10
 
@@ -17,6 +19,8 @@ Maintain a single source of truth for the *current* session in `specs/state.yaml
17
19
 
18
20
  Legacy markdown (`specs/archive/STATE.md`, `RELEASE-PLAN.md`) is **not** SoT when YAML exists — use `specs/state.yaml` only.
19
21
 
22
+ When a story modifies existing behavior, patch only between matching marker pairs in `CLAUDE.md` / `AGENTS.md` `learned-preferences` fence — see e45s21.
23
+
20
24
  ## Handoff block (cold start)
21
25
 
22
26
  When ending a session or before a context-heavy spawn, update `handoff` in `state.yaml`:
@@ -63,6 +67,7 @@ When starting a new session or after a significant context flush:
63
67
  Whenever a significant decision is made or a milestone is reached:
64
68
 
65
69
  - [ ] Patch via `bash scripts/bp-yaml-set.sh specs/state.yaml git.hash <hash>` (or edit directly).
70
+ - [ ] Patch `handoff` and `learned_preferences` / `workspace_facts` in `CLAUDE.md` fenced block when durable user preferences or repo facts crystallize (e45s23).
66
71
  - [ ] Update `handoff.open_decisions` with rationale.
67
72
  - [ ] Update `epic_cycle` when advancing `ship-epic` steps.
68
73
  - [ ] Record open questions under `handoff.open_decisions` or an ADR.
@@ -129,16 +134,6 @@ handoff:
129
134
  next_skill: survey-context
130
135
  ```
131
136
 
132
- ## Tracking commit ratio
133
-
134
- After `release-branch` lands, compute fix-to-feature ratio via:
135
- ```bash
136
- FEAT_COUNT=$(git log main --oneline --grep="^feat" | wc -l | tr -d ' ')
137
- FIX_COUNT=$(git log main --oneline --grep="^fix" | wc -l | tr -d ' ')
138
- FIX_PCT=$((FIX_COUNT * 100 / (FEAT_COUNT + FIX_COUNT)))
139
- ```
140
- Update `specs/state.yaml` `metrics.commit_ratio` with counts. If `fix_pct > 30%`, emit: `"High fix rate (N%) — deploy + smoke-test recommended"`.
141
-
142
137
  ## Anti-Patterns
143
138
 
144
139
  - **Duplicate Plan**: Don't copy `release-plan.yaml` or epic shards into `state.yaml`.
@@ -3,6 +3,8 @@ description: "PLANNING SPINE STEP 2 of 3 — Slice the work: break a scoped PRD
3
3
  ---
4
4
 
5
5
 
6
+ # story: e45s29
7
+
6
8
  # Slice Tasks
7
9
 
8
10
  > **Spine position:** Step 2 — scope-work → slice-tasks → plan-work.
@@ -35,6 +37,7 @@ Produce **epic capsule story tasks** in `specs/epics/eNN-slug/` — vertical sli
35
37
  - `eNNsYY-tasks.yaml` with `story_id`, `title`, `status`, `bcps`, `tasks[]` (each with `id`, `description`, `verify`, `status`)
36
38
  - Story spec `.md` files are written by `plan-work` and follow countable-story-format.md
37
39
  - The epic capsule manifest (`epic.yaml`) is updated to list the story ID and BCPs
40
+ - **Requirement deltas (e45s29):** Stories that alter existing behavior MUST carry `delta:` in `epic.yaml` (`ADDED` | `MODIFIED` | `REMOVED` | `RENAMED`). `plan-work` expands deltas into full before/after requirement text.
38
41
 
39
42
  5. **Order by WSJF** in `release-plan.yaml` epic list — highest WSJF first. Weight-shortest-job-first ensures the highest value arrives earliest.
40
43
 
@@ -68,6 +68,17 @@ DEPLOY_URL="$DEPLOY_URL" bash scripts/run-smoke.sh
68
68
 
69
69
  # Smoke Test — Reference
70
70
 
71
+ ## Navigation
72
+
73
+ | Lines | Section |
74
+ |-------|---------|
75
+ | 1 | Title |
76
+ | 3–12 | Navigation |
77
+ | 14–31 | Runner script |
78
+ | 33–42 | Configuration reference |
79
+ | 44–53 | Verification |
80
+ | 55–160 | Reference blocks 1–5 |
81
+
71
82
  ## Runner script
72
83
 
73
84
  A ready-to-use runner is provided for standalone operation:
@@ -3,6 +3,10 @@ description: Sequential subagent batch audit of the bigpowers skill catalog —
3
3
  ---
4
4
 
5
5
 
6
+ # story: e09s01
7
+ <!-- story: e45s12 -->
8
+
9
+
6
10
  # Stocktake Skills
7
11
  > **HARD GATE** — **HARD GATE** — Skill inventory must be current. Missing HARD GATEs, stale descriptions, or broken verify commands are defects, not cosmetic. Fix them in `evolve-skill`.
8
12
 
@@ -19,6 +23,7 @@ Audit SKILL.md catalog for drift, stale triggers, missing HARD GATEs, and INDEX
19
23
 
20
24
  ## Process
21
25
 
26
+ 0. **Catalog validator (code-enforced)** — run `bash scripts/validate-skill-catalog.sh`. Any FAIL is a critical finding before manual review. Add `--archive` to list zero-usage skills from `metrics.skill_timings` for auto-archiving candidates (move to `specs/epics/archive/` or delete after user confirms).
22
27
  1. Run `bash scripts/audit-catalog.sh` to verify pi/skills ↔ source SKILL.md sync. Mismatch is a critical finding.
23
28
  2. Run mode; for each skill check: exists, verb-noun, &lt;300 lines total, HARD GATE present, INDEX row matches.
24
29
  3. Write `specs/STOCKTAKE-<date>.md` with findings table (skill, issue, severity).
@@ -50,7 +55,7 @@ Timing data is populated by `scripts/bp-timing.sh start|end <skill>` calls withi
50
55
 
51
56
  ## Verify
52
57
 
53
- → verify: `test -f specs/STOCKTAKE-*.md && echo OK || echo MISSING`
58
+ → verify: `test -f specs/STOCKTAKE-*.md && bash scripts/validate-skill-catalog.sh && echo OK || echo MISSING`
54
59
 
55
60
  See [REFERENCE.md](REFERENCE.md) for checklist.
56
61
 
@@ -113,6 +113,18 @@ bash scripts/validate-contracts.sh <contract-file>
113
113
 
114
114
  # Validate Contracts — Reference
115
115
 
116
+ ## Navigation
117
+
118
+ | Lines | Section |
119
+ |-------|---------|
120
+ | 1 | Title |
121
+ | 3–14 | Navigation |
122
+ | 16–24 | Integration |
123
+ | 26–35 | Configuration |
124
+ | 37–46 | Verification |
125
+ | 48–170 | Reference blocks + Examples 1–6 |
126
+ | 172–190 | Integration (duplicate) + Configuration + Verification |
127
+
116
128
  ## Integration
117
129
 
118
130
  - **Pre-deploy gate:** The `deploy` skill runs `validate-contracts` before smoke-test.
@@ -9,6 +9,8 @@ description: Prove a fix works before declaring done — re-run the failing test
9
9
 
10
10
  Prove the fix works. "I think it works" is not evidence. Run the suite, show the output, then harden against recurrence.
11
11
 
12
+ > **Two-commit red/green policy (e45s08)** — Bug fixes follow the same two-commit discipline as `develop-tdd`: first commit adds/adjusts the failing test (`test(<scope>): …`), second commit applies the fix (`fix(<scope>): …`). Do not squash RED and GREEN before review.
13
+
12
14
  ## Checklist
13
15
 
14
16
  ### 1. Re-run the originally failing test
@@ -3,6 +3,17 @@ description: Multi-phase UAT gate — cold-start smoke, build, typecheck, lint,
3
3
  ---
4
4
 
5
5
 
6
+ <!-- story: e02s01 e46s03 -->
7
+ <!-- story: e38s05 -->
8
+ <!-- story: e45s05 -->
9
+ <!-- story: e45s09 -->
10
+ <!-- story: e45s13 -->
11
+ <!-- story: e45s40 -->
12
+ <!-- story: e51s03 -->
13
+ <!-- story: e20s04 -->
14
+ <!-- story: e20s06 -->
15
+
16
+
6
17
  # Verify Work
7
18
 
8
19
  > **HARD GATE** — No story is "done" until manual UAT for the active story is confirmed with evidence.
@@ -43,12 +54,20 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
43
54
  2. **Cold-start smoke** (if app; skip if P3): stop server, clear caches, boot from scratch.
44
55
  3. **AGENTS.md preflight** — if 0a skipped BP_PREFLIGHT, run `bash scripts/bp-read-agents.sh` and use detected command.
45
56
  4. Mechanical gates: build → typecheck → lint → tests (from `CLAUDE.md` or AGENTS.md). Skip tests if P2/P3.
57
+
58
+ > **HARD GATE — One-test-minimum terminal verdict (e45s13):** At least one mechanical gate MUST be a **real terminal-verdict command** (shell exits 0 or non-zero — not prose, not combined log excerpts). Record that command's stdout/stderr from a **single contiguous run** in `specs/verifications/eNNsYY-verify.yaml` under `terminal_verdict`. Bug reports and gap logs MUST NOT merge evidence from multiple runs into one verdict — each failing run gets its own evidence block.
59
+
46
60
  5. **Security scan** (skip if P2/P3) — run `security-review` against the git diff (working tree vs merge-base). Parse findings report. If any HIGH findings with confidence ≥ 8 exist → **block the gate**. Write findings to `specs/security/REVIEW.md`. Allow documented exceptions via `specs/security/EXCEPTIONS.md`. MEDIUM/LOW findings warn but don't block.
47
61
  5a. **Blind-spot check** — run `bash scripts/check-blind-spots.sh`. This detects structural quality gaps (verify-gap, test-gap, stale-tag, etc.) beyond percentage coverage. If any HIGH-severity findings exist → **block the verify-work PASS gate**. Findings are written to `specs/blind-spots.json`. MEDIUM/LOW findings warn but don't block.
62
+ 5a2. **Completeness critic (e45s05)** — `bash scripts/lib/completeness-critic.sh`. **BLOCKER** aborts merge gate; WARNING → gaps loop; FILLED = evidence only.
63
+
48
64
  5b. **NFR Evidence Gate** (P0 only) — Produces go/no-go output on three dimensions: Performance (response time, throughput), Reliability (error rate, recovery), and Operability (logging, health checks). Reads thresholds from `specs/tech-architecture/eNN-TEST_PLAN_LATEST.md` and writes evidence as OKF verification-report bundles to `specs/verifications/NFR-eNNsYY.json`. FAIL on any dimension blocks the gate.
49
65
  6. **Step-by-step UAT** (skip if P2/P3) — one user-observable action at a time.
50
66
  7. **Gaps loop** — failures → log → `plan-work` → re-verify. Unaddressed HIGH findings from step 5 feed into this loop alongside other quality gaps.
51
67
 
68
+ 7a. **Validation gate (e45s09)** — All tasks `status: passing`; evidence in `specs/verifications/`; update `execution-status.yaml`.
69
+ 7b. **Reopen-don't-refile (e45s09)** — Regressions reopen existing story/bug — no duplicate capsule entries.
70
+
52
71
  ## Verify sub-operations
53
72
 
54
73
  ### Cold-Start Smoke (absorbed)
@@ -91,6 +110,11 @@ phases:
91
110
  tests:
92
111
  passed: true
93
112
  coverage: "94.2%"
113
+ terminal_verdict:
114
+ command: "npm test"
115
+ exit_code: 0
116
+ captured_at: "2026-06-11T14:25:00Z"
117
+ note: "Single run — do not merge output from other attempts"
94
118
  manual:
95
119
  steps:
96
120
  - step: "Open /login"
@@ -112,26 +136,7 @@ for p in specs/conventions-wiki/*.md; do [ "$(basename "$p")" = "index.md" ]&&co
112
136
 
113
137
  ## --cli mode
114
138
 
115
- For CLI tools where cold-start smoke (stop server / clear caches) does not apply. Auto-detected when the project has no server process (no `listen()`, no `server.js`, no blocking `main()`); or explicitly activated with `--cli`.
116
-
117
- **Auto-detect binary name:**
118
- ```bash
119
- # Cargo.toml
120
- BINARY=$(grep '^name' Cargo.toml | head -1 | awk -F'"' '{print $2}')
121
- # package.json
122
- BINARY=$(node -e "console.log(require('./package.json').bin && Object.keys(require('./package.json').bin)[0] || '')" 2>/dev/null)
123
- # Makefile
124
- BINARY=$(grep '^BIN\s*=' Makefile 2>/dev/null | awk '{print $3}')
125
- ```
126
-
127
- **CLI verification checklist (replaces cold-start smoke):**
128
-
129
- 1. `--help` smoke: `$BINARY --help` → assert output contains "Usage"
130
- 2. `--version` check: `$BINARY --version` → assert version matches manifest (Cargo.toml / package.json)
131
- 3. Happy-path: run documented example command from README.md → assert non-empty output
132
- 4. Edge case: `$BINARY --invalid-flag` → assert exit code ≠ 0 and error message printed
133
-
134
- No "stop server" / "clear caches" in `--cli` mode. Steps 3–6 still run unchanged.
139
+ CLI tools: use `--cli` when no server process. Binary detect + checklist: [REFERENCE.md](REFERENCE.md#cli-mode).
135
140
 
136
141
  ## Verify
137
142
 
@@ -166,3 +171,20 @@ sleep 3 && curl -sf http://localhost:<port>/health || echo "BOOT FAIL"
166
171
  ```
167
172
 
168
173
  Feed gaps to `plan-work` as new steps with verify commands, then re-run verify-work.
174
+
175
+ ## CLI mode
176
+
177
+ For CLI tools where cold-start smoke does not apply. Auto-detected when no server process; or use `--cli`.
178
+
179
+ **Auto-detect binary name:**
180
+ ```bash
181
+ BINARY=$(grep '^name' Cargo.toml | head -1 | awk -F'"' '{print $2}') # Cargo
182
+ BINARY=$(node -e "console.log(require('./package.json').bin && Object.keys(require('./package.json').bin)[0] || '')" 2>/dev/null)
183
+ BINARY=$(grep '^BIN\s*=' Makefile 2>/dev/null | awk '{print $3}')
184
+ ```
185
+
186
+ **Checklist (replaces cold-start smoke):**
187
+ 1. `$BINARY --help` → output contains "Usage"
188
+ 2. `$BINARY --version` → matches manifest
189
+ 3. README example command → non-empty output
190
+ 4. `$BINARY --invalid-flag` → exit ≠ 0 with error message
@@ -106,6 +106,17 @@ Add the following to the project's documentation or CLAUDE.md after setup:
106
106
 
107
107
  # Wire Ci — Reference
108
108
 
109
+ ## Navigation
110
+
111
+ | Lines | Section |
112
+ |-------|---------|
113
+ | 1 | Title |
114
+ | 3–14 | Navigation |
115
+ | 16–38 | Examples |
116
+ | 40–52 | Options |
117
+ | 54–62 | Integration with build-epic |
118
+ | 64–270 | Reference blocks 1–8 |
119
+
109
120
  ## Examples
110
121
 
111
122
  ### Create CI for a Rust project
@@ -80,6 +80,16 @@ Suggest next skill: `audit-code` or `sync-skills.sh`.
80
80
 
81
81
  Combined from dbader/readme-template and jehna/readme-best-practices. No TOC.
82
82
 
83
+ ## Navigation
84
+
85
+ | Lines | Section |
86
+ |-------|---------|
87
+ | 1 | Title |
88
+ | 5–16 | Navigation |
89
+ | 18–24 | Sections intro |
90
+ | 26–178 | README section templates (1–15) |
91
+ | 180–183 | Verify |
92
+
83
93
  ## Sections
84
94
 
85
95
  ### 1. Title + Badges
@@ -13,11 +13,27 @@ Run this self-review before asking anyone else to look at the code. The goal is
13
13
 
14
14
  **Distinct from `request-review`:** This is the coding agent checking its own work. No second agent is involved. Run this first; run `request-review` after this passes.
15
15
 
16
+ ## Look-here-first (churn heuristic)
17
+
18
+ Before the checklist, rank changed files by git churn and review **high-churn hotspots first** — they carry the most latent risk regardless of diff size.
19
+
20
+ ```bash
21
+ bash scripts/bp-churn-rank.sh --since 90.days --limit 15
22
+ ```
23
+
24
+ Apply the full checklist to churn-ranked files in descending order. Files with zero recent commits but large diffs still get reviewed; churn only sets priority, not scope.
25
+
16
26
  ## Modes
17
27
 
18
28
  - Default: full checklist
19
29
  - --quick: Run only Supply Chain and Test Coverage. Use for changes under 50 LOC.
20
30
  - --gate: Non-interactive mode for automated CI gating (used by build-epic step 6). Exit with non-zero status code (`exit 1`) on ANY checklist failure; `exit 0` only if ALL items pass. Produces a compact pass/fail summary to stderr. On failure, list every ✗ item with reason.
31
+ - --parallel: Run checklist sections in **isolated git worktrees** (e45s18) so concurrent checks cannot corrupt each other's working tree. See [REFERENCE.md](REFERENCE.md) or:
32
+
33
+ ```bash
34
+ bash scripts/lib/parallel-review-worktrees.sh audit-code
35
+ ```
36
+
21
37
 
22
38
  ## Checklist
23
39
 
@@ -109,24 +125,12 @@ Report the checklist with ✓ / ✗ per item. For each ✗, describe what needs
109
125
  If all items pass: suggest running `request-review` for an independent second opinion.
110
126
  If any items fail: fix them before proceeding.
111
127
 
112
- ### Gate mode output (`--gate`)
113
-
114
- In `--gate` mode, print one summary line per checklist section:
115
-
116
- ```
117
- PASS Supply Chain & Security
118
- FAIL Provenance & Metadata (2 items)
119
- PASS Law of Demeter
120
- ...
121
- ```
122
-
123
- Aggregate exit code: `0` if all sections PASS, `1` (non-zero) if any section FAILs. Write the full audit report to `specs/verifications/AUDIT-<epic>-<story>.md` as a permanent record.
128
+ In `--gate` mode, print one summary line per checklist section (`PASS Supply Chain` / `FAIL Provenance (2 items)`). Exit `0` only if all PASS. Write full report to `specs/verifications/AUDIT-<epic>-<story>.md`.
124
129
 
125
130
  ## Verify
126
131
 
127
132
  → verify: `test -f CONVENTIONS.md && test -d skills/enforce-first && test -d skills/request-review && echo "OK: audit-code dependencies present" || echo "FAIL"`
128
133
 
129
-
130
134
  ## Handoff
131
135
 
132
136
  Gate: READY -> next: commit-message
@@ -5,6 +5,8 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e20s05
9
+
8
10
  # Build Epic
9
11
 
10
12
  Scope: one story. Called by orchestrate-project Phase 4. Not a replacement for orchestrate-project.
@@ -89,3 +91,6 @@ Write `handoff.next_skill` and `handoff.context` in `state.yaml` when pausing mi
89
91
  ## Verify
90
92
 
91
93
  → verify: `test -f specs/state.yaml && test -f specs/execution-status.yaml && test -f specs/release-plan.yaml && test -d skills/assess-impact && test -d skills/audit-code && test -d skills/security-review && echo "OK: build-epic dependencies present" || echo "FAIL"`
94
+
95
+
96
+ <!-- story: e38s02 -->
@@ -5,6 +5,9 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e45s29
9
+ # story: e20s01
10
+
8
11
  # Change Request
9
12
 
10
13
  > **HARD GATE** — `specs/release-plan.yaml` must exist before running either mode. If it doesn't, run `plan-release` first.
@@ -19,7 +22,7 @@ Intake a new requirement mid-flight without disrupting work in progress.
19
22
 
20
23
  1. **Capture**: What is the change? What problem does it solve?
21
24
  2. **Locate**: Which existing stories in `specs/epics/` does it affect or replace?
22
- 3. **Draft**: Add story + `tasks[]` with Gherkin-style AC in epic YAML (each task has `verify`).
25
+ 3. **Draft**: Add story + `tasks[]` with Gherkin-style AC in epic YAML (each task has `verify`). Tag requirement deltas: `ADDED` / `MODIFIED` / `REMOVED` / `RENAMED` with before/after for non-`ADDED` changes (e45s29).
23
26
  4. **Place**: Append story under existing epic capsule, or create `specs/epics/eNN-slug.yaml` and register in `release-plan.yaml` `epics[]`.
24
27
  5. **Score**: Compute WSJF; note if it outranks in-progress work.
25
28
 
@@ -5,6 +5,10 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e09s01
9
+ # story: e45s27
10
+ # story: e21s04
11
+
8
12
  # Compose Workflow
9
13
  > **HARD GATE** — **HARD GATE** — Workflows are orchestration, not automation. Do NOT create workflows for tasks that should be single skills. Workflow complexity must be justified.
10
14
 
@@ -21,6 +25,19 @@ model: sonnet
21
25
  > **Prefer the YAML recipe format** over the legacy `specs/WORKFLOW-<name>.md` markdown format.
22
26
  > YAML recipes are command-mappable, machine-readable, and listed in the Standard Recipe Library.
23
27
 
28
+ ## Terminal-state taxonomy (e45s27)
29
+
30
+ Every workflow step and `/loop` tick MUST exit with exactly one terminal state:
31
+
32
+ | State | Meaning | Next action |
33
+ |-------|---------|-------------|
34
+ | `success` | Step verify passed; artifacts written | Advance to next skill in recipe |
35
+ | `no-op` | Nothing to do (already green / already applied) | Skip step; advance |
36
+ | `blocked` | External gate (approval, red CI, missing dep) | `diagnose-stall` or escalate to user |
37
+ | `exhausted` | Max iterations/cycles reached (review cap, dispatch cycles) | Stop; human decision required |
38
+
39
+ Record terminal state in `specs/state.yaml` `handoff.last_terminal_state` when a recipe step completes. `/loop` ticks that produce no progress for two consecutive wakes → invoke `diagnose-stall`.
40
+
24
41
  ## Standard Recipe Library
25
42
 
26
43
  Pre-built recipes in `specs/workflows/` map agentic stack commands to skill chains.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: context7-mcp
3
+ description: "Fetch current library docs via Context7 MCP instead of training data. Use when user asks about frameworks, APIs, setup, or code examples for React, Next.js, Prisma, etc."
4
+ model: haiku
5
+ ---
6
+
7
+
8
+ # Context7 MCP
9
+
10
+ > **HARD GATE** — Max **3** Context7 tool calls per user question (`resolve-library-id` + `query-docs` count toward the cap). On quota/rate-limit errors, emit an explicit **CONTEXT7_UNAVAILABLE** block — do NOT silently answer from training data.
11
+ >
12
+ > **HARD GATE** — Before HTTP fetch, check `bash scripts/lib/doc-fetch-cache.sh get "<libraryId>:<query>"`. Cache hit within TTL → use cached body (no round-trip). On ETag mismatch after conditional refresh, replace cache entry.
13
+
14
+ ## When to Use
15
+
16
+ - Setup/configuration questions ("How do I configure Next.js middleware?")
17
+ - Code involving libraries ("Write a Prisma query for…")
18
+ - API references ("What are the Supabase auth methods?")
19
+ - User mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)
20
+
21
+ ## Bounded Retry (max 3x)
22
+
23
+ | Attempt | Action |
24
+ |---------|--------|
25
+ | 1 | `resolve-library-id` → pick best match |
26
+ | 2 | `query-docs` with selected `libraryId` |
27
+ | 3 | Retry `query-docs` once with refined query (narrower scope) |
28
+
29
+ After 3 failures, stop and print:
30
+
31
+ ```
32
+ CONTEXT7_UNAVAILABLE
33
+ Reason: <quota|rate-limit|no-match|timeout>
34
+ Action: Ask user to retry later, paste official docs URL, or run `bts docs <lib>`.
35
+ Do NOT substitute training-data answers without labeling them UNVERIFIED.
36
+ ```
37
+
38
+ ## Fetch Cache (ETag-revalidated)
39
+
40
+ 1. **Cache key:** `"<libraryId>:<normalized-query>"` (lowercase, trimmed).
41
+ 2. **Read:** `bash scripts/lib/doc-fetch-cache.sh get "<key>"` — exit 0 → use cached body.
42
+ 3. **Miss / stale:** call `query-docs`; store via `doc-fetch-cache.sh put`.
43
+ 4. **TTL:** 300s default (`DOC_CACHE_TTL`). Stale entries refresh on next fetch; honor `ETag` when MCP returns it.
44
+
45
+ `bts docs <lib>` shares the same cache helper when invoked from this skill.
46
+
47
+ ## Process
48
+
49
+ 1. `resolve-library-id` with `libraryName` + full user `query`.
50
+ 2. Select match: name similarity, reputation, benchmark score; prefer version-specific IDs when user names a version.
51
+ 3. `query-docs` with `libraryId` + specific question (one concept per call).
52
+ 4. Answer using fetched docs; cite library/version when relevant.
53
+
54
+ ## Verify
55
+
56
+ → verify: `test -f scripts/lib/doc-fetch-cache.sh && grep -q CONTEXT7_UNAVAILABLE skills/context7-mcp/SKILL.md && echo OK || echo FAIL`
@@ -9,6 +9,19 @@ model: sonnet
9
9
 
10
10
  > **HARD GATE** — Do NOT name a skill without a two-word verb-noun pair. Do NOT merge a new skill without running `sync-skills.sh` — the generated `.cursor/rules/` and `.gemini/` artifacts must match the source SKILL.md.
11
11
 
12
+ ## CSO Description Discipline (e45s02)
13
+
14
+ The YAML `description` is the **Catalog Selection Object** — the only field agents see when picking a skill.
15
+
16
+ | Rule | Limit |
17
+ |------|-------|
18
+ | Max length | 1024 characters |
19
+ | Voice | Third person |
20
+ | Content | Capability + `Use when …` triggers only |
21
+ | Forbidden | Workflow steps, phase chains, numbered lists, `→ verify:`, HARD GATE prose |
22
+
23
+ Move process detail into the SKILL.md body or REFERENCE.md — never into `description`.
24
+
12
25
  ## Process
13
26
 
14
27
  1. **Gather requirements** — ask user about:
@@ -40,6 +53,12 @@ model: sonnet
40
53
  - Anything missing or unclear?
41
54
  - Should any section be more/less detailed?
42
55
 
56
+ 6. **Completion-honesty gate (HARD GATE — e45s02)** — Before declaring done:
57
+ - Run `bash scripts/validate-skill-description.sh skills/<name>/SKILL.md` — must exit 0
58
+ - Run `bash scripts/sync-skills.sh` — must complete without error
59
+ - Run `bash scripts/run-skill-verify.sh <name>` if the skill defines a verify command
60
+ - Show terminal output for each — narration without evidence is rejected
61
+
43
62
  ## Naming Rules
44
63
 
45
64
  Every skill name must be a **two-word verb-noun pair**. See [REFERENCE.md](REFERENCE.md) for full rules, examples, and documented exceptions.
@@ -53,12 +72,21 @@ If the skill produces written output, it goes in `specs/` at the project root. D
53
72
  After drafting, verify:
54
73
 
55
74
  - [ ] Name is a two-word verb-noun pair (or follows grill-me exception)
75
+ - [ ] Description < 1024 chars, triggers only, no workflow-summary leakage
56
76
  - [ ] Description includes triggers ("Use when...")
57
77
  - [ ] SKILL.md under 100 lines
58
78
  - [ ] No time-sensitive info
59
79
  - [ ] Consistent terminology with CONVENTIONS.md
60
80
  - [ ] specs/ output documented if applicable
81
+ - [ ] `validate-skill-description.sh` exits 0
61
82
  - [ ] `sync-skills.sh` run to propagate to Cursor/Gemini
83
+ - [ ] `bash scripts/validate-skill-catalog.sh` passes for the new skill (HARD GATE — completion honesty)
84
+
85
+ > **HARD GATE** — Do NOT declare the skill done until `bash scripts/validate-skill-catalog.sh --strict --skill <name>` exits 0. Validator enforces verb-noun name, HARD GATE block, description ≤1024 chars, and `→ verify:` command.
86
+
87
+ ## Verify
88
+
89
+ → verify: `bash scripts/validate-skill-catalog.sh --strict --skill craft-skill && bash scripts/validate-skill-description.sh skills/craft-skill/SKILL.md && echo OK || echo FAIL`
62
90
 
63
91
  ---
64
92
 
@@ -45,6 +45,12 @@ Read existing documentation first:
45
45
 
46
46
  If any of these files don't exist, proceed silently — don't flag their absence or suggest creating them upfront.
47
47
 
48
+ **Look-here-first (churn heuristic):** Before organic exploration, rank candidate modules by recent commit frequency. High-churn files are architectural friction magnets — start there.
49
+
50
+ ```bash
51
+ bash scripts/bp-churn-rank.sh --since 90.days --limit 20
52
+ ```
53
+
48
54
  Then use the Agent tool with `subagent_type=Explore` to walk the codebase. Don't follow rigid heuristics — explore organically and note where you experience friction:
49
55
 
50
56
  - Where does understanding one concept require bouncing between many small modules?
@@ -93,6 +99,20 @@ Side effects happen inline as decisions crystallize:
93
99
  - **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _"Want me to record this as an ADR so future architecture reviews don't re-suggest it?"_ Only offer when the reason would actually be needed by a future explorer. See [ADR-FORMAT.md](../model-domain/ADR-FORMAT.md).
94
100
  - **Want to explore alternative interfaces for the deepened module?** See [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md).
95
101
 
102
+ ### 5. Import-boundary hygiene (e45s14)
103
+
104
+ When a deepening move **splits or merges modules**, update `specs/import-boundaries.json` (Playwright `DEPS.list` pattern) — declare which `scripts/lib/*.sh` files may `source` which peers. CI enforces via:
105
+
106
+ ```bash
107
+ bash scripts/check-import-boundaries.sh
108
+ ```
109
+
110
+ Run the check before proposing cross-module `source` edges. Convention docs alone do not authorize new imports; the allowlist must list them.
111
+
112
+ ## Verify
113
+
114
+ → verify: `test -f specs/import-boundaries.json && bash scripts/check-import-boundaries.sh && echo OK || echo FAIL`
115
+
96
116
  ---
97
117
 
98
118
  # Deepening
@@ -5,6 +5,8 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e45s30
9
+
8
10
  # Delegate Task
9
11
  > **HARD GATE** — **HARD GATE** — Delegated work must have clear success criteria and verification commands. The delegate must be able to verify completion independently.
10
12
 
@@ -13,6 +15,18 @@ Delegate a single complex task to a subagent with a two-stage review gate before
13
15
 
14
16
  **Distinct from `dispatch-agents`:** This skill runs one subagent sequentially with a mandatory review. `dispatch-agents` runs multiple subagents in parallel without inter-task review gates.
15
17
 
18
+ ## Subagent depth tiers (e45s30)
19
+
20
+ Select brief depth from task `risk:` and skill `effort:` before spawning:
21
+
22
+ | Tier | When | Brief includes |
23
+ |------|------|----------------|
24
+ | `full_maturity` | P0 stories, multi-file refactors, security work | Full template + CONVENTIONS excerpts + threat model if present |
25
+ | `standard` | Default implementation tasks | Goal, scope, out-of-bounds, constraints, verify, prior decisions |
26
+ | `minimal_decisive` | Light probes, read-only audits | Goal, verify, explicit file list (≤15 lines total) |
27
+
28
+ State `depth: <tier>` in the Agent tool description field.
29
+
16
30
  ## Process
17
31
 
18
32
  ### 1. Define the task