bigpowers 2.73.8 → 2.74.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 (138) 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/change-request.md +3 -1
  8. package/.pi/prompts/compose-workflow.md +15 -0
  9. package/.pi/prompts/context7-mcp.md +54 -0
  10. package/.pi/prompts/craft-skill.md +28 -0
  11. package/.pi/prompts/deepen-architecture.md +20 -0
  12. package/.pi/prompts/delegate-task.md +14 -0
  13. package/.pi/prompts/deploy.md +8 -0
  14. package/.pi/prompts/develop-tdd.md +15 -4
  15. package/.pi/prompts/diagnose-stall.md +53 -0
  16. package/.pi/prompts/dispatch-agents.md +49 -19
  17. package/.pi/prompts/gate-trace.md +9 -1
  18. package/.pi/prompts/guard-git.md +14 -0
  19. package/.pi/prompts/migrate-spec.md +12 -0
  20. package/.pi/prompts/plan-work.md +62 -2
  21. package/.pi/prompts/publish-package.md +11 -0
  22. package/.pi/prompts/release-branch.md +39 -43
  23. package/.pi/prompts/request-review.md +57 -17
  24. package/.pi/prompts/run-benchmark.md +3 -3
  25. package/.pi/prompts/run-evals.md +26 -6
  26. package/.pi/prompts/security-review.md +56 -8
  27. package/.pi/prompts/seed-conventions.md +61 -0
  28. package/.pi/prompts/session-state.md +5 -10
  29. package/.pi/prompts/slice-tasks.md +3 -0
  30. package/.pi/prompts/smoke-test.md +11 -0
  31. package/.pi/prompts/stocktake-skills.md +2 -1
  32. package/.pi/prompts/validate-contracts.md +12 -0
  33. package/.pi/prompts/validate-fix.md +2 -0
  34. package/.pi/prompts/verify-work.md +31 -20
  35. package/.pi/prompts/wire-ci.md +11 -0
  36. package/.pi/prompts/write-document.md +10 -0
  37. package/.pi/skills/audit-code/SKILL.md +17 -13
  38. package/.pi/skills/change-request/SKILL.md +3 -1
  39. package/.pi/skills/compose-workflow/SKILL.md +15 -0
  40. package/.pi/skills/context7-mcp/SKILL.md +56 -0
  41. package/.pi/skills/craft-skill/SKILL.md +28 -0
  42. package/.pi/skills/deepen-architecture/SKILL.md +20 -0
  43. package/.pi/skills/delegate-task/SKILL.md +14 -0
  44. package/.pi/skills/deploy/SKILL.md +8 -0
  45. package/.pi/skills/develop-tdd/SKILL.md +15 -4
  46. package/.pi/skills/diagnose-stall/SKILL.md +55 -0
  47. package/.pi/skills/dispatch-agents/SKILL.md +49 -19
  48. package/.pi/skills/gate-trace/SKILL.md +9 -1
  49. package/.pi/skills/guard-git/SKILL.md +14 -0
  50. package/.pi/skills/migrate-spec/SKILL.md +12 -0
  51. package/.pi/skills/plan-work/SKILL.md +62 -2
  52. package/.pi/skills/publish-package/SKILL.md +11 -0
  53. package/.pi/skills/release-branch/SKILL.md +39 -43
  54. package/.pi/skills/request-review/SKILL.md +57 -17
  55. package/.pi/skills/run-benchmark/SKILL.md +3 -3
  56. package/.pi/skills/run-evals/SKILL.md +26 -6
  57. package/.pi/skills/security-review/SKILL.md +56 -8
  58. package/.pi/skills/seed-conventions/SKILL.md +61 -0
  59. package/.pi/skills/session-state/SKILL.md +5 -10
  60. package/.pi/skills/slice-tasks/SKILL.md +3 -0
  61. package/.pi/skills/smoke-test/SKILL.md +11 -0
  62. package/.pi/skills/stocktake-skills/SKILL.md +2 -1
  63. package/.pi/skills/validate-contracts/SKILL.md +12 -0
  64. package/.pi/skills/validate-fix/SKILL.md +2 -0
  65. package/.pi/skills/verify-work/SKILL.md +31 -20
  66. package/.pi/skills/wire-ci/SKILL.md +11 -0
  67. package/.pi/skills/write-document/SKILL.md +10 -0
  68. package/CHANGELOG.md +14 -0
  69. package/CLAUDE.md +59 -1
  70. package/CONVENTIONS.md +80 -5
  71. package/README.md +1 -1
  72. package/SKILL-INDEX.md +1 -1
  73. package/package.json +1 -1
  74. package/scripts/bp-churn-rank.sh +49 -0
  75. package/scripts/check-import-boundaries.sh +64 -0
  76. package/scripts/compile-rule-matrix.sh +114 -0
  77. package/scripts/hooks/rtk-rewrite.sh +11 -0
  78. package/scripts/hooks/token-mgmt-pre-tool-use.sh +53 -0
  79. package/scripts/install.sh +6 -0
  80. package/scripts/lib/completeness-critic.sh +62 -0
  81. package/scripts/lib/doc-fetch-cache.sh +71 -0
  82. package/scripts/lib/golden-suite-gates.sh +3 -1
  83. package/scripts/lib/parallel-review-worktrees.sh +34 -0
  84. package/scripts/lib/plan-consistency-check.sh +88 -0
  85. package/scripts/lib/run-benchmark.py +210 -0
  86. package/scripts/lib/simple_yaml.py +130 -0
  87. package/scripts/lib/sync-context-engineering-ref.sh +19 -0
  88. package/scripts/lib/trace-matrix.py +10 -281
  89. package/scripts/lib/trace_renderer.py +147 -0
  90. package/scripts/references-manifest.yaml +19 -0
  91. package/scripts/run-benchmark.sh +6 -0
  92. package/scripts/sync-references.sh +25 -0
  93. package/scripts/test-trace-matrix-size.sh +46 -0
  94. package/scripts/validate-skill-catalog.sh +147 -0
  95. package/scripts/validate-skill-description.sh +70 -0
  96. package/skills/audit-code/SKILL.md +19 -13
  97. package/skills/change-request/SKILL.md +3 -1
  98. package/skills/compose-workflow/SKILL.md +15 -0
  99. package/skills/context7-mcp/SKILL.md +57 -0
  100. package/skills/craft-skill/SKILL.md +29 -0
  101. package/skills/deepen-architecture/SKILL.md +22 -0
  102. package/skills/delegate-task/SKILL.md +14 -0
  103. package/skills/deploy/SKILL.md +9 -0
  104. package/skills/develop-tdd/SKILL.md +18 -4
  105. package/skills/diagnose-stall/SKILL.md +56 -0
  106. package/skills/dispatch-agents/SKILL.md +51 -19
  107. package/skills/gate-trace/SKILL.md +11 -1
  108. package/skills/guard-git/REFERENCE.md +14 -0
  109. package/skills/migrate-spec/REFERENCE.md +12 -0
  110. package/skills/plan-work/REFERENCE.md +29 -2
  111. package/skills/plan-work/SKILL.md +38 -0
  112. package/skills/publish-package/REFERENCE.md +11 -0
  113. package/skills/release-branch/REFERENCE.md +14 -0
  114. package/skills/release-branch/SKILL.md +28 -43
  115. package/skills/request-review/SKILL.md +59 -17
  116. package/skills/run-benchmark/SKILL.md +4 -4
  117. package/skills/run-evals/REFERENCE.md +14 -4
  118. package/skills/run-evals/SKILL.md +13 -2
  119. package/skills/security-review/REFERENCE-false-positives.md +9 -8
  120. package/skills/security-review/REFERENCE-vuln-categories.md +4 -0
  121. package/skills/security-review/SKILL.md +45 -0
  122. package/skills/security-review/fixtures/CWE-79-xss-negative.js +6 -0
  123. package/skills/security-review/fixtures/CWE-79-xss-positive.js +6 -0
  124. package/skills/security-review/fixtures/CWE-89-sqli-negative.py +8 -0
  125. package/skills/security-review/fixtures/CWE-89-sqli-positive.py +9 -0
  126. package/skills/seed-conventions/REFERENCE.md +40 -0
  127. package/skills/seed-conventions/SKILL.md +22 -0
  128. package/skills/session-state/SKILL.md +5 -10
  129. package/skills/slice-tasks/SKILL.md +3 -0
  130. package/skills/smoke-test/REFERENCE.md +11 -0
  131. package/skills/stocktake-skills/SKILL.md +3 -1
  132. package/skills/validate-contracts/REFERENCE.md +12 -0
  133. package/skills/validate-fix/SKILL.md +3 -0
  134. package/skills/verify-work/REFERENCE.md +17 -0
  135. package/skills/verify-work/SKILL.md +18 -20
  136. package/skills/wire-ci/REFERENCE.md +11 -0
  137. package/skills/write-document/REFERENCE.md +10 -0
  138. package/skills-lock.json +32 -22
@@ -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:
@@ -19,6 +19,7 @@ Audit SKILL.md catalog for drift, stale triggers, missing HARD GATEs, and INDEX
19
19
 
20
20
  ## Process
21
21
 
22
+ 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
23
  1. Run `bash scripts/audit-catalog.sh` to verify pi/skills ↔ source SKILL.md sync. Mismatch is a critical finding.
23
24
  2. Run mode; for each skill check: exists, verb-noun, <300 lines total, HARD GATE present, INDEX row matches.
24
25
  3. Write `specs/STOCKTAKE-<date>.md` with findings table (skill, issue, severity).
@@ -50,7 +51,7 @@ Timing data is populated by `scripts/bp-timing.sh start|end <skill>` calls withi
50
51
 
51
52
  ## Verify
52
53
 
53
- → verify: `test -f specs/STOCKTAKE-*.md && echo OK || echo MISSING`
54
+ → verify: `test -f specs/STOCKTAKE-*.md && bash scripts/validate-skill-catalog.sh && echo OK || echo MISSING`
54
55
 
55
56
  See [REFERENCE.md](REFERENCE.md) for checklist.
56
57
 
@@ -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
@@ -43,12 +43,20 @@ Review answers "is the code good?"; Verify answers "does the built thing do what
43
43
  2. **Cold-start smoke** (if app; skip if P3): stop server, clear caches, boot from scratch.
44
44
  3. **AGENTS.md preflight** — if 0a skipped BP_PREFLIGHT, run `bash scripts/bp-read-agents.sh` and use detected command.
45
45
  4. Mechanical gates: build → typecheck → lint → tests (from `CLAUDE.md` or AGENTS.md). Skip tests if P2/P3.
46
+
47
+ > **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.
48
+
46
49
  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
50
  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.
51
+ 5a2. **Completeness critic (e45s05)** — `bash scripts/lib/completeness-critic.sh`. **BLOCKER** aborts merge gate; WARNING → gaps loop; FILLED = evidence only.
52
+
48
53
  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
54
  6. **Step-by-step UAT** (skip if P2/P3) — one user-observable action at a time.
50
55
  7. **Gaps loop** — failures → log → `plan-work` → re-verify. Unaddressed HIGH findings from step 5 feed into this loop alongside other quality gaps.
51
56
 
57
+ 7a. **Validation gate (e45s09)** — All tasks `status: passing`; evidence in `specs/verifications/`; update `execution-status.yaml`.
58
+ 7b. **Reopen-don't-refile (e45s09)** — Regressions reopen existing story/bug — no duplicate capsule entries.
59
+
52
60
  ## Verify sub-operations
53
61
 
54
62
  ### Cold-Start Smoke (absorbed)
@@ -91,6 +99,11 @@ phases:
91
99
  tests:
92
100
  passed: true
93
101
  coverage: "94.2%"
102
+ terminal_verdict:
103
+ command: "npm test"
104
+ exit_code: 0
105
+ captured_at: "2026-06-11T14:25:00Z"
106
+ note: "Single run — do not merge output from other attempts"
94
107
  manual:
95
108
  steps:
96
109
  - step: "Open /login"
@@ -112,26 +125,7 @@ for p in specs/conventions-wiki/*.md; do [ "$(basename "$p")" = "index.md" ]&&co
112
125
 
113
126
  ## --cli mode
114
127
 
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.
128
+ CLI tools: use `--cli` when no server process. Binary detect + checklist: [REFERENCE.md](REFERENCE.md#cli-mode).
135
129
 
136
130
  ## Verify
137
131
 
@@ -166,3 +160,20 @@ sleep 3 && curl -sf http://localhost:<port>/health || echo "BOOT FAIL"
166
160
  ```
167
161
 
168
162
  Feed gaps to `plan-work` as new steps with verify commands, then re-run verify-work.
163
+
164
+ ## CLI mode
165
+
166
+ For CLI tools where cold-start smoke does not apply. Auto-detected when no server process; or use `--cli`.
167
+
168
+ **Auto-detect binary name:**
169
+ ```bash
170
+ BINARY=$(grep '^name' Cargo.toml | head -1 | awk -F'"' '{print $2}') # Cargo
171
+ BINARY=$(node -e "console.log(require('./package.json').bin && Object.keys(require('./package.json').bin)[0] || '')" 2>/dev/null)
172
+ BINARY=$(grep '^BIN\s*=' Makefile 2>/dev/null | awk '{print $3}')
173
+ ```
174
+
175
+ **Checklist (replaces cold-start smoke):**
176
+ 1. `$BINARY --help` → output contains "Usage"
177
+ 2. `$BINARY --version` → matches manifest
178
+ 3. README example command → non-empty output
179
+ 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: e45s29
9
+
8
10
  # Change Request
9
11
 
10
12
  > **HARD GATE** — `specs/release-plan.yaml` must exist before running either mode. If it doesn't, run `plan-release` first.
@@ -19,7 +21,7 @@ Intake a new requirement mid-flight without disrupting work in progress.
19
21
 
20
22
  1. **Capture**: What is the change? What problem does it solve?
21
23
  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`).
24
+ 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
25
  4. **Place**: Append story under existing epic capsule, or create `specs/epics/eNN-slug.yaml` and register in `release-plan.yaml` `epics[]`.
24
26
  5. **Score**: Compute WSJF; note if it outranks in-progress work.
25
27
 
@@ -5,6 +5,8 @@ model: sonnet
5
5
  ---
6
6
 
7
7
 
8
+ # story: e45s27
9
+
8
10
  # Compose Workflow
9
11
  > **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
12
 
@@ -21,6 +23,19 @@ model: sonnet
21
23
  > **Prefer the YAML recipe format** over the legacy `specs/WORKFLOW-<name>.md` markdown format.
22
24
  > YAML recipes are command-mappable, machine-readable, and listed in the Standard Recipe Library.
23
25
 
26
+ ## Terminal-state taxonomy (e45s27)
27
+
28
+ Every workflow step and `/loop` tick MUST exit with exactly one terminal state:
29
+
30
+ | State | Meaning | Next action |
31
+ |-------|---------|-------------|
32
+ | `success` | Step verify passed; artifacts written | Advance to next skill in recipe |
33
+ | `no-op` | Nothing to do (already green / already applied) | Skip step; advance |
34
+ | `blocked` | External gate (approval, red CI, missing dep) | `diagnose-stall` or escalate to user |
35
+ | `exhausted` | Max iterations/cycles reached (review cap, dispatch cycles) | Stop; human decision required |
36
+
37
+ 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`.
38
+
24
39
  ## Standard Recipe Library
25
40
 
26
41
  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
@@ -105,6 +105,14 @@ For comprehensive health-checking, chain to the `smoke-test` skill:
105
105
  bash scripts/run-smoke.sh "$DEPLOY_URL"
106
106
  ```
107
107
 
108
+ ### 7. Three-independent-facts verification (e45s15)
109
+
110
+ Before declaring deploy success, verify **three independent facts** — build artifact, platform accept, live/registry reachability. See [REFERENCE.md](REFERENCE.md#three-independent-facts).
111
+
112
+ ## Verify
113
+
114
+ → verify: `command -v curl >/dev/null 2>&1 && grep -qi 'three-independent-facts' skills/deploy/SKILL.md && echo OK || echo FAIL`
115
+
108
116
  ---
109
117
 
110
118
  # Deploy — Reference
@@ -51,16 +51,27 @@ Apply the **enforce-first** F.I.R.S.T rubric: Fast, Independent, Repeatable, Sel
51
51
  Write ONE test that confirms ONE thing about the system:
52
52
 
53
53
  ```
54
- RED: Write test for first behavior → test fails → commit: test(<scope>): ...
55
- GREEN: Write minimal code to pass → test passes → commit: feat(<scope>): ...
54
+ RED: Write test for first behavior → test fails → commit: test(<scope>): ... (test-only; red in CI)
55
+ GREEN: Write minimal code to pass → test passes → commit: feat(<scope>): ... (fix commit; green)
56
56
  REFACTOR (optional): clean up → commit: refactor(<scope>): ...
57
57
  ```
58
58
 
59
+ > **Two-commit red/green policy (HARD GATE — e45s08)** — Each behavior cycle requires **two separate commits**: (1) test-only commit that fails in CI (RED), then (2) implementation commit that makes it pass (GREEN). Never combine test + fix in one commit. Show `git log -2 --oneline` as evidence before proceeding to the next behavior.
60
+
61
+ > **tasks.yaml ledger (e45s06)** — After each task's `verify:` exits 0, update `eNNsYY-tasks.yaml`: set that task's `status: passing`. Story-level `status: passing` only when all tasks pass.
62
+
59
63
  ### 3. Incremental Loop
60
64
 
61
- > **STREAM CONTINUITY** — When writing file content, output in continuous chunks of ~200 lines. Do not pause. Emit a placeholder comment rather than going silent.
65
+ > **Snapshot-before-transition (e45s34):** Before each RED → GREEN or GREEN → REFACTOR transition, create a checkpoint so a failed transition can be rolled back cleanly:
66
+
67
+ ```bash
68
+ bash scripts/bp-yaml-snapshot.sh specs/state.yaml # if state changed this cycle
69
+ git stash push -m "tdd-checkpoint-$(git rev-parse --short HEAD)-red" --keep-index 2>/dev/null || true
70
+ ```
71
+
72
+ After GREEN passes and is committed, drop the stash (`git stash drop` if empty). Never refactor while RED.
62
73
 
63
- For each remaining behavior: RED → GREEN → REFACTOR (optional). One test at a time. Commit after every GREEN phase.
74
+ For each remaining behavior: RED → GREEN → REFACTOR (optional). One test at a time. **Two commits per behavior** (test-only RED, then fix GREEN). Commit after every GREEN phase.
64
75
 
65
76
  ### 4. Visual Slices (UI alternate workflow)
66
77
 
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: diagnose-stall
3
+ description: "Diagnose why agent orchestration stopped producing progress — silent stalls in /loop, dispatch-agents, or execute-plan. Use when work appears hung, no output for several minutes, or a subagent never returned."
4
+ model: haiku
5
+ ---
6
+
7
+
8
+ # Diagnose Stall
9
+
10
+ > **HARD GATE** — Do NOT restart work blindly. Run this diagnostic first when orchestration goes quiet without an explicit terminal state.
11
+
12
+ Explicit handler for silent stalls in long-running agent workflows (`/loop`, `dispatch-agents`, `execute-plan`, `build-epic` resume mode).
13
+
14
+ ## Stall signals
15
+
16
+ | Signal | Likely cause |
17
+ |--------|----------------|
18
+ | No stdout for >5 min on a monitored loop tick | Sleep/watcher misconfigured or prompt never re-armed |
19
+ | Subagent dispatched but no completion message | Agent hung, blocked on approval, or scope too large |
20
+ | `dispatch-agents` cycle 3 reached with gaps | Circuit exhausted — needs human escalation |
21
+ | Verify command running >15 min | Missing timeout or waiting on external service |
22
+ | `handoff.next_skill` unchanged across turns | Prior skill never wrote handoff |
23
+
24
+ ## Process
25
+
26
+ 1. **Read state** — `specs/state.yaml`: `handoff.next_skill`, `active_flow`, `metrics.story_start`, open decisions.
27
+ 2. **Check locks** — `bash scripts/check-stale-locks.sh` if present; read `specs/agent-locks.yaml`.
28
+ 3. **Inspect terminals** — list background shells; note PIDs, last output timestamp, exit codes.
29
+ 4. **Classify stall type:**
30
+ - **waiting_approval** — tool blocked on user consent
31
+ - **blocked_dependency** — prior task incomplete or red gate
32
+ - **agent_exhausted** — max iterations/cycles reached
33
+ - **misconfigured_loop** — duplicate sentinel, wrong regex, or sleeper not re-armed
34
+ - **external_io** — network, CI, or deploy wait without timeout
35
+ - **unknown** — escalate with evidence bundle
36
+ 5. **Recommend recovery** — one action only (resume, kill PID, re-dispatch with smaller brief, escalate to user).
37
+ 6. **Write report** — `specs/verifications/STALL-<timestamp>.md` with classification, evidence, and recommended next skill.
38
+
39
+ ## Integration
40
+
41
+ | Caller | When to invoke |
42
+ |--------|----------------|
43
+ | `/loop` (Cursor) | After two consecutive ticks with no observable progress |
44
+ | `dispatch-agents` | When a wave exceeds expected duration with zero returns |
45
+ | `execute-plan` | When a step checkpoint is overdue |
46
+ | User | "Why did this stop?" / "Nothing is happening" |
47
+
48
+ ## Verify
49
+
50
+ → verify: `test -f specs/state.yaml && echo "OK: diagnose-stall can read session state" || echo "WARN: no state.yaml — diagnostic limited"`
51
+
52
+ ## Handoff
53
+
54
+ Gate: READY → next: survey-context (if state unclear) or resume prior skill from `state.yaml`
55
+ Writes: `specs/verifications/STALL-*.md`