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
File without changes
File without changes
File without changes
File without changes
package/.pi/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bigpowers",
3
- "version": "2.73.8",
4
- "description": "75 skills — 73 agent skills synthesizing 17 years of software engineering discipline into a prescriptive methodology for solo developers",
3
+ "version": "2.74.0",
4
+ "description": "77 skills — 73 agent skills synthesizing 17 years of software engineering discipline into a prescriptive methodology for solo developers",
5
5
  "keywords": [
6
6
  "pi-package"
7
7
  ],
@@ -11,11 +11,27 @@ Run this self-review before asking anyone else to look at the code. The goal is
11
11
 
12
12
  **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.
13
13
 
14
+ ## Look-here-first (churn heuristic)
15
+
16
+ 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.
17
+
18
+ ```bash
19
+ bash scripts/bp-churn-rank.sh --since 90.days --limit 15
20
+ ```
21
+
22
+ 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.
23
+
14
24
  ## Modes
15
25
 
16
26
  - Default: full checklist
17
27
  - --quick: Run only Supply Chain and Test Coverage. Use for changes under 50 LOC.
18
28
  - --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.
29
+ - --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:
30
+
31
+ ```bash
32
+ bash scripts/lib/parallel-review-worktrees.sh audit-code
33
+ ```
34
+
19
35
 
20
36
  ## Checklist
21
37
 
@@ -107,24 +123,12 @@ Report the checklist with ✓ / ✗ per item. For each ✗, describe what needs
107
123
  If all items pass: suggest running `request-review` for an independent second opinion.
108
124
  If any items fail: fix them before proceeding.
109
125
 
110
- ### Gate mode output (`--gate`)
111
-
112
- In `--gate` mode, print one summary line per checklist section:
113
-
114
- ```
115
- PASS Supply Chain & Security
116
- FAIL Provenance & Metadata (2 items)
117
- PASS Law of Demeter
118
- ...
119
- ```
120
-
121
- 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.
126
+ 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`.
122
127
 
123
128
  ## Verify
124
129
 
125
130
  → verify: `test -f CONVENTIONS.md && test -d skills/enforce-first && test -d skills/request-review && echo "OK: audit-code dependencies present" || echo "FAIL"`
126
131
 
127
-
128
132
  ## Handoff
129
133
 
130
134
  Gate: READY -> next: commit-message
@@ -3,6 +3,8 @@ description: Add a new requirement or reorder epics by WSJF against specs/releas
3
3
  ---
4
4
 
5
5
 
6
+ # story: e45s29
7
+
6
8
  # Change Request
7
9
 
8
10
  > **HARD GATE** — `specs/release-plan.yaml` must exist before running either mode. If it doesn't, run `plan-release` first.
@@ -17,7 +19,7 @@ Intake a new requirement mid-flight without disrupting work in progress.
17
19
 
18
20
  1. **Capture**: What is the change? What problem does it solve?
19
21
  2. **Locate**: Which existing stories in `specs/epics/` does it affect or replace?
20
- 3. **Draft**: Add story + `tasks[]` with Gherkin-style AC in epic YAML (each task has `verify`).
22
+ 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).
21
23
  4. **Place**: Append story under existing epic capsule, or create `specs/epics/eNN-slug.yaml` and register in `release-plan.yaml` `epics[]`.
22
24
  5. **Score**: Compute WSJF; note if it outranks in-progress work.
23
25
 
@@ -3,6 +3,8 @@ description: Chain multiple bigpowers skills into a custom workflow recipe saved
3
3
  ---
4
4
 
5
5
 
6
+ # story: e45s27
7
+
6
8
  # Compose Workflow
7
9
  > **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.
8
10
 
@@ -19,6 +21,19 @@ description: Chain multiple bigpowers skills into a custom workflow recipe saved
19
21
  > **Prefer the YAML recipe format** over the legacy `specs/WORKFLOW-<name>.md` markdown format.
20
22
  > YAML recipes are command-mappable, machine-readable, and listed in the Standard Recipe Library.
21
23
 
24
+ ## Terminal-state taxonomy (e45s27)
25
+
26
+ Every workflow step and `/loop` tick MUST exit with exactly one terminal state:
27
+
28
+ | State | Meaning | Next action |
29
+ |-------|---------|-------------|
30
+ | `success` | Step verify passed; artifacts written | Advance to next skill in recipe |
31
+ | `no-op` | Nothing to do (already green / already applied) | Skip step; advance |
32
+ | `blocked` | External gate (approval, red CI, missing dep) | `diagnose-stall` or escalate to user |
33
+ | `exhausted` | Max iterations/cycles reached (review cap, dispatch cycles) | Stop; human decision required |
34
+
35
+ 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`.
36
+
22
37
  ## Standard Recipe Library
23
38
 
24
39
  Pre-built recipes in `specs/workflows/` map agentic stack commands to skill chains.
@@ -0,0 +1,54 @@
1
+ ---
2
+ 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.
3
+ ---
4
+
5
+
6
+ # Context7 MCP
7
+
8
+ > **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.
9
+ >
10
+ > **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.
11
+
12
+ ## When to Use
13
+
14
+ - Setup/configuration questions ("How do I configure Next.js middleware?")
15
+ - Code involving libraries ("Write a Prisma query for…")
16
+ - API references ("What are the Supabase auth methods?")
17
+ - User mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)
18
+
19
+ ## Bounded Retry (max 3x)
20
+
21
+ | Attempt | Action |
22
+ |---------|--------|
23
+ | 1 | `resolve-library-id` → pick best match |
24
+ | 2 | `query-docs` with selected `libraryId` |
25
+ | 3 | Retry `query-docs` once with refined query (narrower scope) |
26
+
27
+ After 3 failures, stop and print:
28
+
29
+ ```
30
+ CONTEXT7_UNAVAILABLE
31
+ Reason: <quota|rate-limit|no-match|timeout>
32
+ Action: Ask user to retry later, paste official docs URL, or run `bts docs <lib>`.
33
+ Do NOT substitute training-data answers without labeling them UNVERIFIED.
34
+ ```
35
+
36
+ ## Fetch Cache (ETag-revalidated)
37
+
38
+ 1. **Cache key:** `"<libraryId>:<normalized-query>"` (lowercase, trimmed).
39
+ 2. **Read:** `bash scripts/lib/doc-fetch-cache.sh get "<key>"` — exit 0 → use cached body.
40
+ 3. **Miss / stale:** call `query-docs`; store via `doc-fetch-cache.sh put`.
41
+ 4. **TTL:** 300s default (`DOC_CACHE_TTL`). Stale entries refresh on next fetch; honor `ETag` when MCP returns it.
42
+
43
+ `bts docs <lib>` shares the same cache helper when invoked from this skill.
44
+
45
+ ## Process
46
+
47
+ 1. `resolve-library-id` with `libraryName` + full user `query`.
48
+ 2. Select match: name similarity, reputation, benchmark score; prefer version-specific IDs when user names a version.
49
+ 3. `query-docs` with `libraryId` + specific question (one concept per call).
50
+ 4. Answer using fetched docs; cite library/version when relevant.
51
+
52
+ ## Verify
53
+
54
+ → verify: `test -f scripts/lib/doc-fetch-cache.sh && grep -q CONTEXT7_UNAVAILABLE skills/context7-mcp/SKILL.md && echo OK || echo FAIL`
@@ -7,6 +7,19 @@ description: Create new bigpowers skills with proper structure, progressive disc
7
7
 
8
8
  > **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.
9
9
 
10
+ ## CSO Description Discipline (e45s02)
11
+
12
+ The YAML `description` is the **Catalog Selection Object** — the only field agents see when picking a skill.
13
+
14
+ | Rule | Limit |
15
+ |------|-------|
16
+ | Max length | 1024 characters |
17
+ | Voice | Third person |
18
+ | Content | Capability + `Use when …` triggers only |
19
+ | Forbidden | Workflow steps, phase chains, numbered lists, `→ verify:`, HARD GATE prose |
20
+
21
+ Move process detail into the SKILL.md body or REFERENCE.md — never into `description`.
22
+
10
23
  ## Process
11
24
 
12
25
  1. **Gather requirements** — ask user about:
@@ -38,6 +51,12 @@ description: Create new bigpowers skills with proper structure, progressive disc
38
51
  - Anything missing or unclear?
39
52
  - Should any section be more/less detailed?
40
53
 
54
+ 6. **Completion-honesty gate (HARD GATE — e45s02)** — Before declaring done:
55
+ - Run `bash scripts/validate-skill-description.sh skills/<name>/SKILL.md` — must exit 0
56
+ - Run `bash scripts/sync-skills.sh` — must complete without error
57
+ - Run `bash scripts/run-skill-verify.sh <name>` if the skill defines a verify command
58
+ - Show terminal output for each — narration without evidence is rejected
59
+
41
60
  ## Naming Rules
42
61
 
43
62
  Every skill name must be a **two-word verb-noun pair**. See [REFERENCE.md](REFERENCE.md) for full rules, examples, and documented exceptions.
@@ -51,12 +70,21 @@ If the skill produces written output, it goes in `specs/` at the project root. D
51
70
  After drafting, verify:
52
71
 
53
72
  - [ ] Name is a two-word verb-noun pair (or follows grill-me exception)
73
+ - [ ] Description < 1024 chars, triggers only, no workflow-summary leakage
54
74
  - [ ] Description includes triggers ("Use when...")
55
75
  - [ ] SKILL.md under 100 lines
56
76
  - [ ] No time-sensitive info
57
77
  - [ ] Consistent terminology with CONVENTIONS.md
58
78
  - [ ] specs/ output documented if applicable
79
+ - [ ] `validate-skill-description.sh` exits 0
59
80
  - [ ] `sync-skills.sh` run to propagate to Cursor/Gemini
81
+ - [ ] `bash scripts/validate-skill-catalog.sh` passes for the new skill (HARD GATE — completion honesty)
82
+
83
+ > **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.
84
+
85
+ ## Verify
86
+
87
+ → 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`
60
88
 
61
89
  ---
62
90
 
@@ -43,6 +43,12 @@ Read existing documentation first:
43
43
 
44
44
  If any of these files don't exist, proceed silently — don't flag their absence or suggest creating them upfront.
45
45
 
46
+ **Look-here-first (churn heuristic):** Before organic exploration, rank candidate modules by recent commit frequency. High-churn files are architectural friction magnets — start there.
47
+
48
+ ```bash
49
+ bash scripts/bp-churn-rank.sh --since 90.days --limit 20
50
+ ```
51
+
46
52
  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:
47
53
 
48
54
  - Where does understanding one concept require bouncing between many small modules?
@@ -91,6 +97,20 @@ Side effects happen inline as decisions crystallize:
91
97
  - **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).
92
98
  - **Want to explore alternative interfaces for the deepened module?** See [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md).
93
99
 
100
+ ### 5. Import-boundary hygiene (e45s14)
101
+
102
+ 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:
103
+
104
+ ```bash
105
+ bash scripts/check-import-boundaries.sh
106
+ ```
107
+
108
+ Run the check before proposing cross-module `source` edges. Convention docs alone do not authorize new imports; the allowlist must list them.
109
+
110
+ ## Verify
111
+
112
+ → verify: `test -f specs/import-boundaries.json && bash scripts/check-import-boundaries.sh && echo OK || echo FAIL`
113
+
94
114
  ---
95
115
 
96
116
  # Deepening
@@ -3,6 +3,8 @@ description: Delegate one complex task to a single subagent, review its work in
3
3
  ---
4
4
 
5
5
 
6
+ # story: e45s30
7
+
6
8
  # Delegate Task
7
9
  > **HARD GATE** — **HARD GATE** — Delegated work must have clear success criteria and verification commands. The delegate must be able to verify completion independently.
8
10
 
@@ -11,6 +13,18 @@ Delegate a single complex task to a subagent with a two-stage review gate before
11
13
 
12
14
  **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.
13
15
 
16
+ ## Subagent depth tiers (e45s30)
17
+
18
+ Select brief depth from task `risk:` and skill `effort:` before spawning:
19
+
20
+ | Tier | When | Brief includes |
21
+ |------|------|----------------|
22
+ | `full_maturity` | P0 stories, multi-file refactors, security work | Full template + CONVENTIONS excerpts + threat model if present |
23
+ | `standard` | Default implementation tasks | Goal, scope, out-of-bounds, constraints, verify, prior decisions |
24
+ | `minimal_decisive` | Light probes, read-only audits | Goal, verify, explicit file list (≤15 lines total) |
25
+
26
+ State `depth: <tier>` in the Agent tool description field.
27
+
14
28
  ## Process
15
29
 
16
30
  ### 1. Define the task
@@ -103,6 +103,14 @@ For comprehensive health-checking, chain to the `smoke-test` skill:
103
103
  bash scripts/run-smoke.sh "$DEPLOY_URL"
104
104
  ```
105
105
 
106
+ ### 7. Three-independent-facts verification (e45s15)
107
+
108
+ Before declaring deploy success, verify **three independent facts** — build artifact, platform accept, live/registry reachability. See [REFERENCE.md](REFERENCE.md#three-independent-facts).
109
+
110
+ ## Verify
111
+
112
+ → verify: `command -v curl >/dev/null 2>&1 && grep -qi 'three-independent-facts' skills/deploy/SKILL.md && echo OK || echo FAIL`
113
+
106
114
  ---
107
115
 
108
116
  # Deploy — Reference
@@ -49,16 +49,27 @@ Apply the **enforce-first** F.I.R.S.T rubric: Fast, Independent, Repeatable, Sel
49
49
  Write ONE test that confirms ONE thing about the system:
50
50
 
51
51
  ```
52
- RED: Write test for first behavior → test fails → commit: test(<scope>): ...
53
- GREEN: Write minimal code to pass → test passes → commit: feat(<scope>): ...
52
+ RED: Write test for first behavior → test fails → commit: test(<scope>): ... (test-only; red in CI)
53
+ GREEN: Write minimal code to pass → test passes → commit: feat(<scope>): ... (fix commit; green)
54
54
  REFACTOR (optional): clean up → commit: refactor(<scope>): ...
55
55
  ```
56
56
 
57
+ > **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.
58
+
59
+ > **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.
60
+
57
61
  ### 3. Incremental Loop
58
62
 
59
- > **STREAM CONTINUITY** — When writing file content, output in continuous chunks of ~200 lines. Do not pause. Emit a placeholder comment rather than going silent.
63
+ > **Snapshot-before-transition (e45s34):** Before each RED → GREEN or GREEN → REFACTOR transition, create a checkpoint so a failed transition can be rolled back cleanly:
64
+
65
+ ```bash
66
+ bash scripts/bp-yaml-snapshot.sh specs/state.yaml # if state changed this cycle
67
+ git stash push -m "tdd-checkpoint-$(git rev-parse --short HEAD)-red" --keep-index 2>/dev/null || true
68
+ ```
69
+
70
+ After GREEN passes and is committed, drop the stash (`git stash drop` if empty). Never refactor while RED.
60
71
 
61
- For each remaining behavior: RED → GREEN → REFACTOR (optional). One test at a time. Commit after every GREEN phase.
72
+ 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.
62
73
 
63
74
  ### 4. Visual Slices (UI alternate workflow)
64
75
 
@@ -0,0 +1,53 @@
1
+ ---
2
+ 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.
3
+ ---
4
+
5
+
6
+ # Diagnose Stall
7
+
8
+ > **HARD GATE** — Do NOT restart work blindly. Run this diagnostic first when orchestration goes quiet without an explicit terminal state.
9
+
10
+ Explicit handler for silent stalls in long-running agent workflows (`/loop`, `dispatch-agents`, `execute-plan`, `build-epic` resume mode).
11
+
12
+ ## Stall signals
13
+
14
+ | Signal | Likely cause |
15
+ |--------|----------------|
16
+ | No stdout for >5 min on a monitored loop tick | Sleep/watcher misconfigured or prompt never re-armed |
17
+ | Subagent dispatched but no completion message | Agent hung, blocked on approval, or scope too large |
18
+ | `dispatch-agents` cycle 3 reached with gaps | Circuit exhausted — needs human escalation |
19
+ | Verify command running >15 min | Missing timeout or waiting on external service |
20
+ | `handoff.next_skill` unchanged across turns | Prior skill never wrote handoff |
21
+
22
+ ## Process
23
+
24
+ 1. **Read state** — `specs/state.yaml`: `handoff.next_skill`, `active_flow`, `metrics.story_start`, open decisions.
25
+ 2. **Check locks** — `bash scripts/check-stale-locks.sh` if present; read `specs/agent-locks.yaml`.
26
+ 3. **Inspect terminals** — list background shells; note PIDs, last output timestamp, exit codes.
27
+ 4. **Classify stall type:**
28
+ - **waiting_approval** — tool blocked on user consent
29
+ - **blocked_dependency** — prior task incomplete or red gate
30
+ - **agent_exhausted** — max iterations/cycles reached
31
+ - **misconfigured_loop** — duplicate sentinel, wrong regex, or sleeper not re-armed
32
+ - **external_io** — network, CI, or deploy wait without timeout
33
+ - **unknown** — escalate with evidence bundle
34
+ 5. **Recommend recovery** — one action only (resume, kill PID, re-dispatch with smaller brief, escalate to user).
35
+ 6. **Write report** — `specs/verifications/STALL-<timestamp>.md` with classification, evidence, and recommended next skill.
36
+
37
+ ## Integration
38
+
39
+ | Caller | When to invoke |
40
+ |--------|----------------|
41
+ | `/loop` (Cursor) | After two consecutive ticks with no observable progress |
42
+ | `dispatch-agents` | When a wave exceeds expected duration with zero returns |
43
+ | `execute-plan` | When a step checkpoint is overdue |
44
+ | User | "Why did this stop?" / "Nothing is happening" |
45
+
46
+ ## Verify
47
+
48
+ → verify: `test -f specs/state.yaml && echo "OK: diagnose-stall can read session state" || echo "WARN: no state.yaml — diagnostic limited"`
49
+
50
+ ## Handoff
51
+
52
+ Gate: READY → next: survey-context (if state unclear) or resume prior skill from `state.yaml`
53
+ Writes: `specs/verifications/STALL-*.md`
@@ -3,6 +3,8 @@ description: Dispatch multiple subagents in parallel on independent tasks. No wa
3
3
  ---
4
4
 
5
5
 
6
+ # story: e45s30
7
+
6
8
  # Dispatch Agents
7
9
  > **HARD GATE** — **HARD GATE** — Agent work must be parallelizable and have explicit synchronization points. Do NOT dispatch work that has hidden dependencies between agents.
8
10
 
@@ -34,30 +36,57 @@ Before dispatching, verify each task pair is truly independent:
34
36
 
35
37
  If any two tasks conflict, sequence them with `delegate-task` or `execute-plan` instead.
36
38
 
37
- ### 2. Write task briefs
39
+ ## Subagent depth tiers (e45s30)
38
40
 
39
- Before writing briefs, read `specs/state.yaml` if it exists — each agent gets only the decisions relevant to its task, nothing else.
41
+ Map `effort:` frontmatter and story `risk:` to prompt depth — do not send `minimal_decisive` agents a `full_maturity` brief.
40
42
 
41
- For each task, use this minimal template (each agent starts cold — brief size directly controls token cost and hallucination risk):
43
+ | Tier | When | Brief shape | Token budget |
44
+ |------|------|-------------|----------------|
45
+ | `full_maturity` | `effort: heavy`, `risk: P0`, security-sensitive diffs | Full `task_brief` + CONVENTIONS excerpts + threat model if present | Full envelope |
46
+ | `standard` | `effort: standard`, `risk: P1`–`P2` | Standard `task_brief` fields below | Default |
47
+ | `minimal_decisive` | `effort: light`, `risk: P3`, read-only exploration | `goal` + `verify` + `in_scope` only | ≤15 lines |
42
48
 
49
+ Record `depth: <tier>` in the Agent tool description when dispatching.
50
+
51
+ ### 2. Write typed task briefs (Orca message protocol)
52
+
53
+ Before writing briefs, read `specs/state.yaml` if it exists — each agent gets only the decisions relevant to its task, nothing else.
54
+
55
+ Every inter-agent message uses a **typed envelope** — no freeform prose between waves:
56
+
57
+ | `type` | When | Required fields |
58
+ |--------|------|-----------------|
59
+ | `task_brief` | Dispatch | `task_id`, `goal`, `in_scope`, `out_of_bounds`, `verify`, `prior_decisions` |
60
+ | `checkpoint` | Mid-wave progress | `task_id`, `status` (`running`\|`blocked`), `comment` (one line) |
61
+ | `result` | Agent return | `task_id`, `exit` (`pass`\|`fail`), `summary`, `verify_output` |
62
+ | `circuit_open` | 3 consecutive failures | `task_id`, `failures` (3), `escalate_to` (`user`) |
63
+
64
+ Example `task_brief` (each agent starts cold — brief size directly controls token cost and hallucination risk):
65
+
66
+ ```yaml
67
+ type: task_brief
68
+ task_id: agent-1
69
+ goal: [one sentence — what success looks like]
70
+ in_scope: [explicit file or module list]
71
+ out_of_bounds: [what NOT to touch]
72
+ verify: [runnable command]
73
+ prior_decisions: [relevant entries from specs/state.yaml — omit if none]
43
74
  ```
44
- Goal: [one sentence — what success looks like]
45
- In scope: [explicit file or module list]
46
- Out of bounds: [what NOT to touch]
47
- Verify: [runnable command]
48
- Prior decisions: [relevant entries from specs/state.yaml — omit section if none apply]
49
- ```
75
+
76
+ Emit **`checkpoint`** comments when an agent is slow or blocked — one line, no stack traces. Parent reads checkpoints before spawning follow-ups.
50
77
 
51
78
  Do not include the full conversation, full file contents, or decisions unrelated to this agent's task.
52
79
 
53
- ### 3. Iterative retrieval (max 3 cycles)
80
+ ### 3. Circuit breaker + iterative retrieval (max 3 cycles)
81
+
82
+ Track **consecutive failures per `task_id`**. On the **3rd consecutive `result.exit: fail`** for the same task, emit `type: circuit_open` and **stop dispatching** that task — escalate to user with the three failure summaries. Reset counter on any `pass`.
54
83
 
55
84
  After each wave completes:
56
- 1. **Dispatch** — run parallel agents with briefs.
57
- 2. **Evaluate** — read outputs; list gaps vs goal.
85
+ 1. **Dispatch** — run parallel agents with typed `task_brief` envelopes.
86
+ 2. **Evaluate** — read `result` messages; list gaps vs goal; honor open circuits.
58
87
  3. **Refine** — tighten briefs or spawn follow-up agents (max **3 cycles** total).
59
88
 
60
- Stop when gaps empty or cycle 3 reached — escalate to user.
89
+ Stop when gaps empty, circuit opens, or cycle 3 reached — escalate to user. If agents go silent without returning, invoke `diagnose-stall` before spawning another wave.
61
90
 
62
91
  ### 4. Dispatch in parallel
63
92
 
@@ -71,13 +100,14 @@ Agent 3: brief for task C
71
100
 
72
101
  ### 5. Collect and review results
73
102
 
74
- When all agents return:
75
- - Review each result independently
76
- - Run all verify commands
77
- - Check diffs for scope violations or CONVENTIONS.md breaches
103
+ When all agents return: review each result, run verify commands, check diffs for scope violations.
78
104
 
79
105
  ### 6. Integrate
80
106
 
81
- Merge accepted results. If any agent's result conflicts with another, resolve manually and note the conflict.
107
+ Merge accepted results. Resolve conflicts manually; note in summary.
108
+
109
+ Report: which tasks succeeded, which need revision, overall verify status.
110
+
111
+ ## Verify
82
112
 
83
- Report a summary: which tasks succeeded, which need revision, and overall verify status.
113
+ → verify: `grep -q 'circuit_open' skills/dispatch-agents/SKILL.md && grep -q 'task_brief' skills/dispatch-agents/SKILL.md && echo OK || echo FAIL`
@@ -36,7 +36,15 @@ TEA-inspired: if trace links rely on heuristics rather than explicit tags, confi
36
36
  5. Apply oracle confidence downgrade based on the heuristic link ratio from the matrix's `oracle_stats`.
37
37
  6. **Drift check (e39s03):** If `specs/drift-report.json` exists and has suspect links, mark verdict as CONCERNS with note: "Drift detected — some implementing files are newer than their specs. Run scripts/check-spec-drift.sh for details."
38
38
  7. Output verdict + rationale to stdout.
39
- 7. Update `specs/execution-status.yaml` with gate-trace result.
39
+ 8. **Adversarial refute check (e45s32):** Before emitting PASS, attempt to **refute** the verdict — list at least one concrete traceability gap that would block merge if it were real. If the gap is real, downgrade the verdict. Rubber-stamping is prohibited; every PASS must survive one refutation attempt.
40
+ 9. **Completeness critic (e45s05)** — Run adversarial gap-finding:
41
+
42
+ ```bash
43
+ bash scripts/lib/completeness-critic.sh
44
+ ```
45
+
46
+ Classify output as **BLOCKER / WARNING / FILLED**. **BLOCKER overrides any PASS verdict → FAIL.** Append critic summary to rationale.
47
+ 10. Update `specs/execution-status.yaml` with gate-trace result.
40
48
 
41
49
  ## Verdict Semantics
42
50
 
@@ -46,6 +46,20 @@ Full JSON examples, merge rules, Antigravity deny-list entries, and test command
46
46
 
47
47
  # Git guardrails — reference
48
48
 
49
+ ## Navigation
50
+
51
+ | Lines | Section |
52
+ |-------|---------|
53
+ | 1 | Title |
54
+ | 3–14 | Navigation |
55
+ | 16–24 | Secret patterns |
56
+ | 26–44 | Copy layout |
57
+ | 46–72 | Claude Code |
58
+ | 74–92 | Cursor and Cursor CLI |
59
+ | 94–120 | Gemini CLI |
60
+ | 122–135 | Google Antigravity |
61
+ | 137–178 | Verify (local tests) |
62
+
49
63
  ## Secret patterns (audit + pre-commit)
50
64
 
51
65
  Agents must not commit files containing:
@@ -238,6 +238,18 @@ These GSD artifacts are not migrated — they are execution records, not plannin
238
238
 
239
239
  # Migrate Spec — Reference
240
240
 
241
+ ## Navigation
242
+
243
+ | Lines | Section |
244
+ |-------|---------|
245
+ | 1 | Title |
246
+ | 3–22 | Navigation |
247
+ | 24–62 | spec-kit → bigpowers Mapping |
248
+ | 64–130 | BMAD → bigpowers Mapping |
249
+ | 132–154 | Learnings to Adopt |
250
+ | 156–350 | Output Formats + state.yaml template |
251
+ | 352–620 | Reference blocks 1–2 + extended mappings |
252
+
241
253
  # migrate-spec Reference — spec-kit, BMAD, Learnings
242
254
 
243
255
  Transformation rules for spec-kit and BMAD projects, plus learnings to adopt and output formats.