bigpowers 2.87.4 → 2.87.5
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.
- package/.cursor/rules/align-grid.mdc +109 -0
- package/.cursor/rules/assess-impact.mdc +90 -0
- package/.cursor/rules/audit-code.mdc +183 -0
- package/.cursor/rules/audit-plan.mdc +88 -0
- package/.cursor/rules/build-epic.mdc +104 -0
- package/.cursor/rules/change-request.mdc +120 -0
- package/.cursor/rules/commit-message.mdc +139 -0
- package/.cursor/rules/compose-workflow.mdc +81 -0
- package/.cursor/rules/context7-mcp.mdc +54 -0
- package/.cursor/rules/craft-skill.mdc +195 -0
- package/.cursor/rules/deepen-architecture.mdc +259 -0
- package/.cursor/rules/define-language.mdc +79 -0
- package/.cursor/rules/define-success.mdc +11 -0
- package/.cursor/rules/delegate-task.mdc +90 -0
- package/.cursor/rules/deploy.mdc +197 -0
- package/.cursor/rules/design-interface.mdc +96 -0
- package/.cursor/rules/develop-tdd.mdc +415 -0
- package/.cursor/rules/diagnose-root.mdc +23 -0
- package/.cursor/rules/diagnose-stall.mdc +53 -0
- package/.cursor/rules/dispatch-agents.mdc +117 -0
- package/.cursor/rules/edit-document.mdc +22 -0
- package/.cursor/rules/elaborate-spec.mdc +100 -0
- package/.cursor/rules/enforce-first.mdc +44 -0
- package/.cursor/rules/evolve-skill.mdc +54 -0
- package/.cursor/rules/execute-plan.mdc +60 -0
- package/.cursor/rules/extract-design.mdc +131 -0
- package/.cursor/rules/find-way.mdc +190 -0
- package/.cursor/rules/fix-bug.mdc +66 -0
- package/.cursor/rules/gate-trace.mdc +91 -0
- package/.cursor/rules/generate-allure-report.mdc +284 -0
- package/.cursor/rules/grill-me.mdc +107 -0
- package/.cursor/rules/grill-with-docs.mdc +52 -0
- package/.cursor/rules/guard-git.mdc +230 -0
- package/.cursor/rules/harden-vps.mdc +290 -0
- package/.cursor/rules/hook-commits.mdc +93 -0
- package/.cursor/rules/inspect-quality.mdc +105 -0
- package/.cursor/rules/investigate-bug.mdc +126 -0
- package/.cursor/rules/kickoff-branch.mdc +142 -0
- package/.cursor/rules/maintain-wiki.mdc +63 -0
- package/.cursor/rules/map-codebase.mdc +70 -0
- package/.cursor/rules/migrate-spec.mdc +907 -0
- package/.cursor/rules/model-domain.mdc +231 -0
- package/.cursor/rules/orchestrate-project.mdc +173 -0
- package/.cursor/rules/organize-workspace.mdc +163 -0
- package/.cursor/rules/plan-refactor.mdc +86 -0
- package/.cursor/rules/plan-release.mdc +144 -0
- package/.cursor/rules/plan-tests.mdc +74 -0
- package/.cursor/rules/plan-work.mdc +271 -0
- package/.cursor/rules/publish-package.mdc +337 -0
- package/.cursor/rules/quick-fix.mdc +113 -0
- package/.cursor/rules/release-branch.mdc +301 -0
- package/.cursor/rules/request-review.mdc +112 -0
- package/.cursor/rules/research-first.mdc +86 -0
- package/.cursor/rules/reset-baseline.mdc +20 -0
- package/.cursor/rules/respond-review.mdc +70 -0
- package/.cursor/rules/run-benchmark.mdc +84 -0
- package/.cursor/rules/run-evals.mdc +79 -0
- package/.cursor/rules/run-planning.mdc +100 -0
- package/.cursor/rules/scope-work.mdc +62 -0
- package/.cursor/rules/search-skills.mdc +72 -0
- package/.cursor/rules/security-review.mdc +383 -0
- package/.cursor/rules/seed-conventions.mdc +311 -0
- package/.cursor/rules/session-state.mdc +145 -0
- package/.cursor/rules/setup-environment.mdc +38 -0
- package/.cursor/rules/simple-english.mdc +345 -0
- package/.cursor/rules/simulate-agents.mdc +25 -0
- package/.cursor/rules/slice-tasks.mdc +67 -0
- package/.cursor/rules/smoke-test.mdc +260 -0
- package/.cursor/rules/spike-prototype.mdc +94 -0
- package/.cursor/rules/stocktake-skills.mdc +73 -0
- package/.cursor/rules/survey-context.mdc +134 -0
- package/.cursor/rules/terse-mode.mdc +41 -0
- package/.cursor/rules/trace-requirement.mdc +68 -0
- package/.cursor/rules/using-bigpowers.mdc +110 -0
- package/.cursor/rules/validate-contracts.mdc +285 -0
- package/.cursor/rules/validate-fix.mdc +146 -0
- package/.cursor/rules/verify-work.mdc +190 -0
- package/.cursor/rules/visual-dashboard.mdc +49 -0
- package/.cursor/rules/wire-ci.mdc +380 -0
- package/.cursor/rules/wire-observability.mdc +96 -0
- package/.cursor/rules/write-document.mdc +280 -0
- package/.gemini/extensions/bigpowers/commands/prompts/align-grid.md +109 -0
- package/.gemini/extensions/bigpowers/commands/prompts/assess-impact.md +90 -0
- package/.gemini/extensions/bigpowers/commands/prompts/audit-code.md +183 -0
- package/.gemini/extensions/bigpowers/commands/prompts/audit-plan.md +88 -0
- package/.gemini/extensions/bigpowers/commands/prompts/build-epic.md +104 -0
- package/.gemini/extensions/bigpowers/commands/prompts/change-request.md +120 -0
- package/.gemini/extensions/bigpowers/commands/prompts/commit-message.md +139 -0
- package/.gemini/extensions/bigpowers/commands/prompts/compose-workflow.md +81 -0
- package/.gemini/extensions/bigpowers/commands/prompts/context7-mcp.md +54 -0
- package/.gemini/extensions/bigpowers/commands/prompts/craft-skill.md +195 -0
- package/.gemini/extensions/bigpowers/commands/prompts/deepen-architecture.md +259 -0
- package/.gemini/extensions/bigpowers/commands/prompts/define-language.md +79 -0
- package/.gemini/extensions/bigpowers/commands/prompts/define-success.md +11 -0
- package/.gemini/extensions/bigpowers/commands/prompts/delegate-task.md +90 -0
- package/.gemini/extensions/bigpowers/commands/prompts/deploy.md +197 -0
- package/.gemini/extensions/bigpowers/commands/prompts/design-interface.md +96 -0
- package/.gemini/extensions/bigpowers/commands/prompts/develop-tdd.md +415 -0
- package/.gemini/extensions/bigpowers/commands/prompts/diagnose-root.md +23 -0
- package/.gemini/extensions/bigpowers/commands/prompts/diagnose-stall.md +53 -0
- package/.gemini/extensions/bigpowers/commands/prompts/dispatch-agents.md +117 -0
- package/.gemini/extensions/bigpowers/commands/prompts/edit-document.md +22 -0
- package/.gemini/extensions/bigpowers/commands/prompts/elaborate-spec.md +100 -0
- package/.gemini/extensions/bigpowers/commands/prompts/enforce-first.md +44 -0
- package/.gemini/extensions/bigpowers/commands/prompts/evolve-skill.md +54 -0
- package/.gemini/extensions/bigpowers/commands/prompts/execute-plan.md +60 -0
- package/.gemini/extensions/bigpowers/commands/prompts/extract-design.md +131 -0
- package/.gemini/extensions/bigpowers/commands/prompts/find-way.md +190 -0
- package/.gemini/extensions/bigpowers/commands/prompts/fix-bug.md +66 -0
- package/.gemini/extensions/bigpowers/commands/prompts/gate-trace.md +91 -0
- package/.gemini/extensions/bigpowers/commands/prompts/generate-allure-report.md +284 -0
- package/.gemini/extensions/bigpowers/commands/prompts/grill-me.md +107 -0
- package/.gemini/extensions/bigpowers/commands/prompts/grill-with-docs.md +52 -0
- package/.gemini/extensions/bigpowers/commands/prompts/guard-git.md +230 -0
- package/.gemini/extensions/bigpowers/commands/prompts/harden-vps.md +290 -0
- package/.gemini/extensions/bigpowers/commands/prompts/hook-commits.md +93 -0
- package/.gemini/extensions/bigpowers/commands/prompts/inspect-quality.md +105 -0
- package/.gemini/extensions/bigpowers/commands/prompts/investigate-bug.md +126 -0
- package/.gemini/extensions/bigpowers/commands/prompts/kickoff-branch.md +142 -0
- package/.gemini/extensions/bigpowers/commands/prompts/maintain-wiki.md +63 -0
- package/.gemini/extensions/bigpowers/commands/prompts/map-codebase.md +70 -0
- package/.gemini/extensions/bigpowers/commands/prompts/migrate-spec.md +907 -0
- package/.gemini/extensions/bigpowers/commands/prompts/model-domain.md +231 -0
- package/.gemini/extensions/bigpowers/commands/prompts/orchestrate-project.md +173 -0
- package/.gemini/extensions/bigpowers/commands/prompts/organize-workspace.md +163 -0
- package/.gemini/extensions/bigpowers/commands/prompts/plan-refactor.md +86 -0
- package/.gemini/extensions/bigpowers/commands/prompts/plan-release.md +144 -0
- package/.gemini/extensions/bigpowers/commands/prompts/plan-tests.md +74 -0
- package/.gemini/extensions/bigpowers/commands/prompts/plan-work.md +271 -0
- package/.gemini/extensions/bigpowers/commands/prompts/publish-package.md +337 -0
- package/.gemini/extensions/bigpowers/commands/prompts/quick-fix.md +113 -0
- package/.gemini/extensions/bigpowers/commands/prompts/release-branch.md +301 -0
- package/.gemini/extensions/bigpowers/commands/prompts/request-review.md +112 -0
- package/.gemini/extensions/bigpowers/commands/prompts/research-first.md +86 -0
- package/.gemini/extensions/bigpowers/commands/prompts/reset-baseline.md +20 -0
- package/.gemini/extensions/bigpowers/commands/prompts/respond-review.md +70 -0
- package/.gemini/extensions/bigpowers/commands/prompts/run-benchmark.md +84 -0
- package/.gemini/extensions/bigpowers/commands/prompts/run-evals.md +79 -0
- package/.gemini/extensions/bigpowers/commands/prompts/run-planning.md +100 -0
- package/.gemini/extensions/bigpowers/commands/prompts/scope-work.md +62 -0
- package/.gemini/extensions/bigpowers/commands/prompts/search-skills.md +72 -0
- package/.gemini/extensions/bigpowers/commands/prompts/security-review.md +383 -0
- package/.gemini/extensions/bigpowers/commands/prompts/seed-conventions.md +311 -0
- package/.gemini/extensions/bigpowers/commands/prompts/session-state.md +145 -0
- package/.gemini/extensions/bigpowers/commands/prompts/setup-environment.md +38 -0
- package/.gemini/extensions/bigpowers/commands/prompts/simple-english.md +345 -0
- package/.gemini/extensions/bigpowers/commands/prompts/simulate-agents.md +25 -0
- package/.gemini/extensions/bigpowers/commands/prompts/slice-tasks.md +67 -0
- package/.gemini/extensions/bigpowers/commands/prompts/smoke-test.md +260 -0
- package/.gemini/extensions/bigpowers/commands/prompts/spike-prototype.md +94 -0
- package/.gemini/extensions/bigpowers/commands/prompts/stocktake-skills.md +73 -0
- package/.gemini/extensions/bigpowers/commands/prompts/survey-context.md +134 -0
- package/.gemini/extensions/bigpowers/commands/prompts/terse-mode.md +41 -0
- package/.gemini/extensions/bigpowers/commands/prompts/trace-requirement.md +68 -0
- package/.gemini/extensions/bigpowers/commands/prompts/using-bigpowers.md +110 -0
- package/.gemini/extensions/bigpowers/commands/prompts/validate-contracts.md +285 -0
- package/.gemini/extensions/bigpowers/commands/prompts/validate-fix.md +146 -0
- package/.gemini/extensions/bigpowers/commands/prompts/verify-work.md +190 -0
- package/.gemini/extensions/bigpowers/commands/prompts/visual-dashboard.md +49 -0
- package/.gemini/extensions/bigpowers/commands/prompts/wire-ci.md +380 -0
- package/.gemini/extensions/bigpowers/commands/prompts/wire-observability.md +96 -0
- package/.gemini/extensions/bigpowers/commands/prompts/write-document.md +280 -0
- package/.gemini/extensions/bigpowers/gemini-extension.json +16 -0
- package/.gemini/extensions/bigpowers/hooks/HOOKS.md +43 -0
- package/.gemini/extensions/bigpowers/hooks/before-tool-git-guard.sh +26 -0
- package/.gemini/extensions/bigpowers/hooks/before-tool-rtk.sh +14 -0
- package/.gemini/extensions/bigpowers/hooks/before-tool-token-mgmt.sh +19 -0
- package/.gemini/extensions/bigpowers/hooks/hooks-manifest.json +36 -0
- package/.gemini/extensions/bigpowers/hooks/run-hook.cmd +29 -0
- package/.gemini/extensions/bigpowers/hooks/session-start +48 -0
- package/.gemini/extensions/bigpowers/hooks/settings.json.example +41 -0
- package/.gemini/extensions/bigpowers/skills/align-grid/SKILL.md +111 -0
- package/.gemini/extensions/bigpowers/skills/assess-impact/SKILL.md +92 -0
- package/.gemini/extensions/bigpowers/skills/audit-code/SKILL.md +185 -0
- package/.gemini/extensions/bigpowers/skills/audit-plan/SKILL.md +90 -0
- package/.gemini/extensions/bigpowers/skills/build-epic/SKILL.md +106 -0
- package/.gemini/extensions/bigpowers/skills/change-request/SKILL.md +122 -0
- package/.gemini/extensions/bigpowers/skills/commit-message/SKILL.md +141 -0
- package/.gemini/extensions/bigpowers/skills/compose-workflow/SKILL.md +83 -0
- package/.gemini/extensions/bigpowers/skills/context7-mcp/SKILL.md +56 -0
- package/.gemini/extensions/bigpowers/skills/craft-skill/SKILL.md +197 -0
- package/.gemini/extensions/bigpowers/skills/deepen-architecture/SKILL.md +261 -0
- package/.gemini/extensions/bigpowers/skills/define-language/SKILL.md +81 -0
- package/.gemini/extensions/bigpowers/skills/define-success/SKILL.md +13 -0
- package/.gemini/extensions/bigpowers/skills/delegate-task/SKILL.md +92 -0
- package/.gemini/extensions/bigpowers/skills/deploy/SKILL.md +199 -0
- package/.gemini/extensions/bigpowers/skills/design-interface/SKILL.md +98 -0
- package/.gemini/extensions/bigpowers/skills/develop-tdd/SKILL.md +417 -0
- package/.gemini/extensions/bigpowers/skills/diagnose-root/SKILL.md +25 -0
- package/.gemini/extensions/bigpowers/skills/diagnose-stall/SKILL.md +55 -0
- package/.gemini/extensions/bigpowers/skills/dispatch-agents/SKILL.md +119 -0
- package/.gemini/extensions/bigpowers/skills/edit-document/SKILL.md +24 -0
- package/.gemini/extensions/bigpowers/skills/elaborate-spec/SKILL.md +102 -0
- package/.gemini/extensions/bigpowers/skills/enforce-first/SKILL.md +46 -0
- package/.gemini/extensions/bigpowers/skills/evolve-skill/SKILL.md +56 -0
- package/.gemini/extensions/bigpowers/skills/execute-plan/SKILL.md +62 -0
- package/.gemini/extensions/bigpowers/skills/extract-design/SKILL.md +133 -0
- package/.gemini/extensions/bigpowers/skills/find-way/SKILL.md +192 -0
- package/.gemini/extensions/bigpowers/skills/fix-bug/SKILL.md +68 -0
- package/.gemini/extensions/bigpowers/skills/gate-trace/SKILL.md +93 -0
- package/.gemini/extensions/bigpowers/skills/generate-allure-report/SKILL.md +286 -0
- package/.gemini/extensions/bigpowers/skills/grill-me/SKILL.md +109 -0
- package/.gemini/extensions/bigpowers/skills/grill-with-docs/SKILL.md +54 -0
- package/.gemini/extensions/bigpowers/skills/guard-git/SKILL.md +232 -0
- package/.gemini/extensions/bigpowers/skills/harden-vps/SKILL.md +292 -0
- package/.gemini/extensions/bigpowers/skills/hook-commits/SKILL.md +95 -0
- package/.gemini/extensions/bigpowers/skills/inspect-quality/SKILL.md +107 -0
- package/.gemini/extensions/bigpowers/skills/investigate-bug/SKILL.md +128 -0
- package/.gemini/extensions/bigpowers/skills/kickoff-branch/SKILL.md +144 -0
- package/.gemini/extensions/bigpowers/skills/maintain-wiki/SKILL.md +65 -0
- package/.gemini/extensions/bigpowers/skills/map-codebase/SKILL.md +72 -0
- package/.gemini/extensions/bigpowers/skills/migrate-spec/SKILL.md +909 -0
- package/.gemini/extensions/bigpowers/skills/model-domain/SKILL.md +233 -0
- package/.gemini/extensions/bigpowers/skills/orchestrate-project/SKILL.md +175 -0
- package/.gemini/extensions/bigpowers/skills/organize-workspace/SKILL.md +165 -0
- package/.gemini/extensions/bigpowers/skills/plan-refactor/SKILL.md +88 -0
- package/.gemini/extensions/bigpowers/skills/plan-release/SKILL.md +146 -0
- package/.gemini/extensions/bigpowers/skills/plan-tests/SKILL.md +76 -0
- package/.gemini/extensions/bigpowers/skills/plan-work/SKILL.md +273 -0
- package/.gemini/extensions/bigpowers/skills/publish-package/SKILL.md +339 -0
- package/.gemini/extensions/bigpowers/skills/quick-fix/SKILL.md +115 -0
- package/.gemini/extensions/bigpowers/skills/release-branch/SKILL.md +303 -0
- package/.gemini/extensions/bigpowers/skills/request-review/SKILL.md +114 -0
- package/.gemini/extensions/bigpowers/skills/research-first/SKILL.md +88 -0
- package/.gemini/extensions/bigpowers/skills/reset-baseline/SKILL.md +22 -0
- package/.gemini/extensions/bigpowers/skills/respond-review/SKILL.md +72 -0
- package/.gemini/extensions/bigpowers/skills/run-benchmark/SKILL.md +86 -0
- package/.gemini/extensions/bigpowers/skills/run-evals/SKILL.md +81 -0
- package/.gemini/extensions/bigpowers/skills/run-planning/SKILL.md +102 -0
- package/.gemini/extensions/bigpowers/skills/scope-work/SKILL.md +64 -0
- package/.gemini/extensions/bigpowers/skills/search-skills/SKILL.md +74 -0
- package/.gemini/extensions/bigpowers/skills/security-review/SKILL.md +385 -0
- package/.gemini/extensions/bigpowers/skills/seed-conventions/SKILL.md +313 -0
- package/.gemini/extensions/bigpowers/skills/session-state/SKILL.md +147 -0
- package/.gemini/extensions/bigpowers/skills/setup-environment/SKILL.md +40 -0
- package/.gemini/extensions/bigpowers/skills/simple-english/SKILL.md +347 -0
- package/.gemini/extensions/bigpowers/skills/simulate-agents/SKILL.md +27 -0
- package/.gemini/extensions/bigpowers/skills/slice-tasks/SKILL.md +69 -0
- package/.gemini/extensions/bigpowers/skills/smoke-test/SKILL.md +262 -0
- package/.gemini/extensions/bigpowers/skills/spike-prototype/SKILL.md +96 -0
- package/.gemini/extensions/bigpowers/skills/stocktake-skills/SKILL.md +75 -0
- package/.gemini/extensions/bigpowers/skills/survey-context/SKILL.md +136 -0
- package/.gemini/extensions/bigpowers/skills/terse-mode/SKILL.md +43 -0
- package/.gemini/extensions/bigpowers/skills/trace-requirement/SKILL.md +70 -0
- package/.gemini/extensions/bigpowers/skills/using-bigpowers/SKILL.md +112 -0
- package/.gemini/extensions/bigpowers/skills/validate-contracts/SKILL.md +287 -0
- package/.gemini/extensions/bigpowers/skills/validate-fix/SKILL.md +148 -0
- package/.gemini/extensions/bigpowers/skills/verify-work/SKILL.md +192 -0
- package/.gemini/extensions/bigpowers/skills/visual-dashboard/SKILL.md +51 -0
- package/.gemini/extensions/bigpowers/skills/wire-ci/SKILL.md +382 -0
- package/.gemini/extensions/bigpowers/skills/wire-observability/SKILL.md +98 -0
- package/.gemini/extensions/bigpowers/skills/write-document/SKILL.md +282 -0
- package/.pi/package.json +1 -1
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/scripts/lib/__pycache__/link_utils.cpython-312.pyc +0 -0
- package/scripts/lib/__pycache__/srp_engine_links.cpython-312.pyc +0 -0
- package/scripts/test-install-helpers.js +31 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: develop-tdd
|
|
3
|
+
description: "Test-driven development with red-green-refactor loop using vertical slices. Use for features (epic tasks) or bugs (specs/bugs/BUG-*.md)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Develop TDD
|
|
7
|
+
|
|
8
|
+
> **HARD GATE** — Do NOT proceed if on `main` or `master`. Run `kickoff-branch` first to create a feature branch or worktree.
|
|
9
|
+
>
|
|
10
|
+
> **HARD GATE** — Do NOT write code before you have a plan. New feature: `plan-work` → epic capsule tasks. Bug: `investigate-bug` → `specs/bugs/BUG-*.md` (or use `fix-bug` orchestrator).
|
|
11
|
+
>
|
|
12
|
+
> **RECURSIVE DISCIPLINE** — This lifecycle applies to EVERY task, including updating these skills. Never skip planning because a task is "meta" or "just documentation."
|
|
13
|
+
|
|
14
|
+
## Philosophy
|
|
15
|
+
|
|
16
|
+
Tests verify behavior through public interfaces, not implementation details. A good test reads like a specification. See [REFERENCE.md](REFERENCE.md) for the horizontal-slice anti-pattern and TDD phase detail.
|
|
17
|
+
|
|
18
|
+
## Red Flags
|
|
19
|
+
|
|
20
|
+
If you catch yourself thinking these, stop and reconsider — you are likely deviating from production-grade craft.
|
|
21
|
+
|
|
22
|
+
| Red Flag | Reality |
|
|
23
|
+
| :--- | :--- |
|
|
24
|
+
| "This is too simple to need tests." | Simple code is where bugs hide. If it's simple, the test is cheap. |
|
|
25
|
+
| "I'll refactor this later." | "Later" is when technical debt becomes bankruptcy. Refactor while Green. |
|
|
26
|
+
| "The tests are already comprehensive." | If you're adding behavior, you need a new test. Coverage ≠ Correctness. |
|
|
27
|
+
| "I'm just fixing a small bug." | Small bugs often indicate deep interface flaws. Investigate root cause. |
|
|
28
|
+
| "I need to mock this internal class." | Mocking internals couples tests to implementation. Mock only I/O. |
|
|
29
|
+
| "This refactor is out of scope." | Leave the code cleaner than you found it (Boy Scout Rule). |
|
|
30
|
+
| "Preflight failed but it's unrelated." | **Always Green:** any reproducible gate failure routes **quick-fix → fix-bug** before forward work. Session boundaries do not waive Preflight. |
|
|
31
|
+
| "I'll note the red gate and continue." | Narrating a failure is banned. fix-or-log is mandatory per CONVENTIONS § Discovered Defects. |
|
|
32
|
+
|
|
33
|
+
## Workflow
|
|
34
|
+
|
|
35
|
+
> **Timing:** `bash scripts/bp-timing.sh start develop-tdd` at invocation; `bash scripts/bp-timing.sh end develop-tdd` before handoff.
|
|
36
|
+
|
|
37
|
+
### 1. Planning
|
|
38
|
+
|
|
39
|
+
- [ ] Read active `specs/epics/*/epic.yaml` story tasks or `specs/bugs/BUG-*.md` — understand verify steps
|
|
40
|
+
- [ ] If `specs/tech-architecture/eNN-TEST_PLAN_LATEST.md` exists for the active epic, read it before writing the first test. Implement P0 scenarios (`SC-*-P0-*`) before P1. P2/P3 scenarios are optional per time budget.
|
|
41
|
+
- [ ] Confirm interface changes and behaviors to test (prioritize)
|
|
42
|
+
- [ ] Design interfaces for testability — identify [deep modules](deep-modules.md) opportunities
|
|
43
|
+
- [ ] Get user approval on the plan
|
|
44
|
+
|
|
45
|
+
Apply the **enforce-first** F.I.R.S.T rubric: Fast, Independent, Repeatable, Self-Validating, Timely.
|
|
46
|
+
|
|
47
|
+
### 2. Tracer Bullet
|
|
48
|
+
|
|
49
|
+
Write ONE test that confirms ONE thing about the system:
|
|
50
|
+
|
|
51
|
+
```
|
|
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
|
+
REFACTOR (optional): clean up → commit: refactor(<scope>): ...
|
|
55
|
+
```
|
|
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. Before proceeding, run the mechanical RED isolation check:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
bash scripts/verify-tdd-red-commit.sh
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Show `git log -2 --oneline` **and** the script output as evidence. If the test-only commit passes in isolation, the RED gate is violated — stop and fix before GREEN.
|
|
64
|
+
|
|
65
|
+
> **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.
|
|
66
|
+
|
|
67
|
+
### 3. Incremental Loop
|
|
68
|
+
|
|
69
|
+
> **Snapshot-before-transition (e45s34):** Before each RED → GREEN or GREEN → REFACTOR transition, create a checkpoint so a failed transition can be rolled back cleanly:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
bash scripts/bp-yaml-snapshot.sh specs/state.yaml # if state changed this cycle
|
|
73
|
+
git stash push -m "tdd-checkpoint-$(git rev-parse --short HEAD)-red" --keep-index 2>/dev/null || true
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
After GREEN passes and is committed, drop the stash (`git stash drop` if empty). Never refactor while RED.
|
|
77
|
+
|
|
78
|
+
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.
|
|
79
|
+
|
|
80
|
+
### 4. Visual Slices (UI alternate workflow)
|
|
81
|
+
|
|
82
|
+
For UI components where behavioral unit testing is brittle: extract logic into a Controller/ViewModel/Hook (pure TDD), then use Visual Slices for the View layer. See [REFERENCE.md](REFERENCE.md) for the full Visual Slices procedure.
|
|
83
|
+
|
|
84
|
+
### 5. Refactor
|
|
85
|
+
|
|
86
|
+
After all tests pass: extract duplication, deepen modules, apply SOLID principles. **Never refactor while RED.**
|
|
87
|
+
|
|
88
|
+
### 6. Verify
|
|
89
|
+
|
|
90
|
+
After every behavior cycle, run the verify command from the active epic task. Show evidence before declaring the step done.
|
|
91
|
+
|
|
92
|
+
### 7. Manual Verification Handover
|
|
93
|
+
|
|
94
|
+
Once all tests pass: locate the Verification Script in the active epic capsule, present it to the user step-by-step, and wait for confirmation of behavioral correctness.
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### 6a. CI dry-run sub-step
|
|
98
|
+
|
|
99
|
+
If this cycle modified files in `.github/workflows/`, run the CI dry-run procedure documented in [REFERENCE.md](REFERENCE.md#ci-dry-run).
|
|
100
|
+
|
|
101
|
+
## Checklist Per Cycle
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
[ ] Test describes behavior, not implementation
|
|
105
|
+
[ ] No test is ignored without an explicit ambiguity note (T4)
|
|
106
|
+
[ ] Boundary conditions tested: empty, max, min, off-by-one (T5)
|
|
107
|
+
[ ] Tests verify behavior through public interface only — no private methods (T8)
|
|
108
|
+
[ ] Test would survive internal refactor
|
|
109
|
+
[ ] Code is minimal for this test
|
|
110
|
+
[ ] No speculative features added
|
|
111
|
+
[ ] Every new abstraction has an explicit "Reason for Depth" justification
|
|
112
|
+
[ ] Progress committed (Conventional Commits)
|
|
113
|
+
[ ] verify: command passes
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## Handoff
|
|
119
|
+
|
|
120
|
+
Gate: READY -> next: verify-work
|
|
121
|
+
Writes: state.yaml handoff.next_skill = verify-work
|
|
122
|
+
|
|
123
|
+
## BCP Plus Integration
|
|
124
|
+
|
|
125
|
+
At story completion, if the story was sized with BCP Plus (13-dimension breakdown), log the `bcp_plus.total` alongside the standard `bcps:` count in the story's tasks.yaml. The breakdown is available from the epic capsule's `bcp_plus_breakdown` field. See `docs/references/bcp-plus.md` for the full methodology and NFR Gate pattern.
|
|
126
|
+
|
|
127
|
+
## Verify
|
|
128
|
+
|
|
129
|
+
→ verify: `test -x scripts/verify-tdd-red-commit.sh && bash scripts/verify-tdd-red-commit.sh --self-test && grep -q 'verify-tdd-red-commit' skills/develop-tdd/SKILL.md && echo OK`
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<!-- story: e02s04 -->
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
# Develop TDD — Reference
|
|
137
|
+
|
|
138
|
+
## Anti-Pattern: Horizontal Slices
|
|
139
|
+
|
|
140
|
+
**DO NOT write all tests first, then all implementation.** This is "horizontal slicing" — treating RED as "write all tests" and GREEN as "write all code."
|
|
141
|
+
|
|
142
|
+
This produces **crap tests**:
|
|
143
|
+
- Tests written in bulk test _imagined_ behavior, not _actual_ behavior
|
|
144
|
+
- You end up testing the _shape_ of things rather than user-facing behavior
|
|
145
|
+
- Tests become insensitive to real changes
|
|
146
|
+
|
|
147
|
+
**Correct approach**: Vertical slices via tracer bullets. One test → one implementation → repeat.
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
WRONG (horizontal):
|
|
151
|
+
RED: test1, test2, test3, test4, test5
|
|
152
|
+
GREEN: impl1, impl2, impl3, impl4, impl5
|
|
153
|
+
|
|
154
|
+
RIGHT (vertical):
|
|
155
|
+
RED→GREEN: test1→impl1
|
|
156
|
+
RED→GREEN: test2→impl2
|
|
157
|
+
RED→GREEN: test3→impl3
|
|
158
|
+
...
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
> The Red Flags table lives in [SKILL.md](SKILL.md#red-flags) — it is core behavioral guidance, not reference detail.
|
|
162
|
+
|
|
163
|
+
## TDD Phases (Detail)
|
|
164
|
+
|
|
165
|
+
### Red Phase
|
|
166
|
+
|
|
167
|
+
Write a failing test first:
|
|
168
|
+
- Test describes the desired observable behavior through the public interface
|
|
169
|
+
- Run the test to confirm it fails for the right reason (not a syntax error, not a typo)
|
|
170
|
+
- Commit: `git commit -m "test(<scope>): <description>"`
|
|
171
|
+
|
|
172
|
+
### Green Phase
|
|
173
|
+
|
|
174
|
+
Write the minimum code to make the test pass:
|
|
175
|
+
- No extra logic, no anticipated future cases, no premature optimization
|
|
176
|
+
- Focus only on making the current test pass
|
|
177
|
+
- Commit: `git commit -m "feat(<scope>): <description>"` or `"fix(<scope>): <description>"`
|
|
178
|
+
|
|
179
|
+
### Refactor Phase
|
|
180
|
+
|
|
181
|
+
Improve structure without changing behavior:
|
|
182
|
+
- Extract duplication, apply SOLID principles where natural, deepen modules
|
|
183
|
+
- Run tests after each refactor step to ensure behavior is preserved
|
|
184
|
+
- Commit: `git commit -m "refactor(<scope>): <description>"`
|
|
185
|
+
- Apply the Boy Scout Rule: leave the code cleaner than you found it
|
|
186
|
+
|
|
187
|
+
## Visual Slices (UI Alternate Workflow)
|
|
188
|
+
|
|
189
|
+
For UI components (SwiftUI, React, Flutter) where behavioral unit testing is brittle or low-signal:
|
|
190
|
+
|
|
191
|
+
1. **Test-First Logic**: Extract logic (state transitions, formatting, validation) into a Controller, ViewModel, or Hook. This logic MUST follow pure TDD.
|
|
192
|
+
2. **Visual Verification**: For the View/Component itself:
|
|
193
|
+
- **RED**: Write the component signature and a basic preview/snapshot that fails (or displays placeholder).
|
|
194
|
+
- **GREEN**: Implement the UI and verify visually via manual run, preview, or snapshot test.
|
|
195
|
+
- **REFINE**: Adjust styling and layout until it matches the design.
|
|
196
|
+
3. **COMMIT**: `git commit -m "feat(ui): <component name> visual slice verified"`
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
# Deep Modules
|
|
201
|
+
|
|
202
|
+
From "A Philosophy of Software Design":
|
|
203
|
+
|
|
204
|
+
**Deep module** = small interface + lots of implementation
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
┌─────────────────────┐
|
|
208
|
+
│ Small Interface │ ← Few methods, simple params
|
|
209
|
+
├─────────────────────┤
|
|
210
|
+
│ │
|
|
211
|
+
│ │
|
|
212
|
+
│ Deep Implementation│ ← Complex logic hidden
|
|
213
|
+
│ │
|
|
214
|
+
│ │
|
|
215
|
+
└─────────────────────┘
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Shallow module** = large interface + little implementation (avoid)
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
┌─────────────────────────────────┐
|
|
222
|
+
│ Large Interface │ ← Many methods, complex params
|
|
223
|
+
├─────────────────────────────────┤
|
|
224
|
+
│ Thin Implementation │ ← Just passes through
|
|
225
|
+
└─────────────────────────────────┘
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
When designing interfaces, ask:
|
|
229
|
+
|
|
230
|
+
- Can I reduce the number of methods?
|
|
231
|
+
- Can I simplify the parameters?
|
|
232
|
+
- Can I hide more complexity inside?
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
# Interface Design for Testability
|
|
237
|
+
|
|
238
|
+
Good interfaces make testing natural:
|
|
239
|
+
|
|
240
|
+
1. **Accept dependencies, don't create them**
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
// Testable
|
|
244
|
+
function processOrder(order, paymentGateway) {}
|
|
245
|
+
|
|
246
|
+
// Hard to test
|
|
247
|
+
function processOrder(order) {
|
|
248
|
+
const gateway = new StripeGateway();
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
2. **Return results, don't produce side effects**
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
// Testable
|
|
256
|
+
function calculateDiscount(cart): Discount {}
|
|
257
|
+
|
|
258
|
+
// Hard to test
|
|
259
|
+
function applyDiscount(cart): void {
|
|
260
|
+
cart.total -= discount;
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
3. **Small surface area**
|
|
265
|
+
- Fewer methods = fewer tests needed
|
|
266
|
+
- Fewer params = simpler test setup
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
# When to Mock
|
|
271
|
+
|
|
272
|
+
Mock at **system boundaries** only:
|
|
273
|
+
|
|
274
|
+
- External APIs (payment, email, etc.)
|
|
275
|
+
- Databases (sometimes - prefer test DB)
|
|
276
|
+
- Time/randomness
|
|
277
|
+
- File system (sometimes)
|
|
278
|
+
|
|
279
|
+
Don't mock:
|
|
280
|
+
|
|
281
|
+
- Your own classes/modules
|
|
282
|
+
- Internal collaborators
|
|
283
|
+
- Anything you control
|
|
284
|
+
|
|
285
|
+
## Designing for Mockability
|
|
286
|
+
|
|
287
|
+
At system boundaries, design interfaces that are easy to mock:
|
|
288
|
+
|
|
289
|
+
**1. Use dependency injection**
|
|
290
|
+
|
|
291
|
+
Pass external dependencies in rather than creating them internally:
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
// Easy to mock
|
|
295
|
+
function processPayment(order, paymentClient) {
|
|
296
|
+
return paymentClient.charge(order.total);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Hard to mock
|
|
300
|
+
function processPayment(order) {
|
|
301
|
+
const client = new StripeClient(process.env.STRIPE_KEY);
|
|
302
|
+
return client.charge(order.total);
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**2. Prefer SDK-style interfaces over generic fetchers**
|
|
307
|
+
|
|
308
|
+
Create specific functions for each external operation instead of one generic function with conditional logic:
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
// GOOD: Each function is independently mockable
|
|
312
|
+
const api = {
|
|
313
|
+
getUser: (id) => fetch(`/users/${id}`),
|
|
314
|
+
getOrders: (userId) => fetch(`/users/${userId}/orders`),
|
|
315
|
+
createOrder: (data) => fetch('/orders', { method: 'POST', body: data }),
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
// BAD: Mocking requires conditional logic inside the mock
|
|
319
|
+
const api = {
|
|
320
|
+
fetch: (endpoint, options) => fetch(endpoint, options),
|
|
321
|
+
};
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
The SDK approach means:
|
|
325
|
+
- Each mock returns one specific shape
|
|
326
|
+
- No conditional logic in test setup
|
|
327
|
+
- Easier to see which endpoints a test exercises
|
|
328
|
+
- Type safety per endpoint
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
# Refactor Candidates
|
|
333
|
+
|
|
334
|
+
After TDD cycle, look for:
|
|
335
|
+
|
|
336
|
+
- **Duplication** → Extract function/class
|
|
337
|
+
- **Long methods** → Break into private helpers (keep tests on public interface)
|
|
338
|
+
- **Shallow modules** → Combine or deepen
|
|
339
|
+
- **Feature envy** → Move logic to where data lives
|
|
340
|
+
- **Primitive obsession** → Introduce value objects
|
|
341
|
+
- **Existing code** the new code reveals as problematic
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
# Good and Bad Tests
|
|
346
|
+
|
|
347
|
+
## Good Tests
|
|
348
|
+
|
|
349
|
+
**Integration-style**: Test through real interfaces, not mocks of internal parts.
|
|
350
|
+
|
|
351
|
+
```typescript
|
|
352
|
+
// GOOD: Tests observable behavior
|
|
353
|
+
test("user can checkout with valid cart", async () => {
|
|
354
|
+
const cart = createCart();
|
|
355
|
+
cart.add(product);
|
|
356
|
+
const result = await checkout(cart, paymentMethod);
|
|
357
|
+
expect(result.status).toBe("confirmed");
|
|
358
|
+
});
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Characteristics:
|
|
362
|
+
|
|
363
|
+
- Tests behavior users/callers care about
|
|
364
|
+
- Uses public API only
|
|
365
|
+
- Survives internal refactors
|
|
366
|
+
- Describes WHAT, not HOW
|
|
367
|
+
- One logical assertion per test
|
|
368
|
+
|
|
369
|
+
## Bad Tests
|
|
370
|
+
|
|
371
|
+
**Implementation-detail tests**: Coupled to internal structure.
|
|
372
|
+
|
|
373
|
+
```typescript
|
|
374
|
+
// BAD: Tests implementation details
|
|
375
|
+
test("checkout calls paymentService.process", async () => {
|
|
376
|
+
const mockPayment = jest.mock(paymentService);
|
|
377
|
+
await checkout(cart, payment);
|
|
378
|
+
expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
|
|
379
|
+
});
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Red flags:
|
|
383
|
+
|
|
384
|
+
- Mocking internal collaborators
|
|
385
|
+
- Testing private methods
|
|
386
|
+
- Asserting on call counts/order
|
|
387
|
+
- Test breaks when refactoring without behavior change
|
|
388
|
+
- Test name describes HOW not WHAT
|
|
389
|
+
- Verifying through external means instead of interface
|
|
390
|
+
|
|
391
|
+
```typescript
|
|
392
|
+
// BAD: Bypasses interface to verify
|
|
393
|
+
test("createUser saves to database", async () => {
|
|
394
|
+
await createUser({ name: "Alice" });
|
|
395
|
+
const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
|
|
396
|
+
expect(row).toBeDefined();
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
// GOOD: Verifies through interface
|
|
400
|
+
test("createUser makes user retrievable", async () => {
|
|
401
|
+
const user = await createUser({ name: "Alice" });
|
|
402
|
+
const retrieved = await getUser(user.id);
|
|
403
|
+
expect(retrieved.name).toBe("Alice");
|
|
404
|
+
});
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## Clean Test Heuristics (Uncle Bob, Ch 17)
|
|
408
|
+
|
|
409
|
+
Apply these specific heuristics to maintain a high-quality suite:
|
|
410
|
+
|
|
411
|
+
- **T1: Insufficient Tests**: A test suite should test everything that could possibly break. Don't stop at "it seems to work."
|
|
412
|
+
- **T4: Ignored Tests**: Never ignore a test without documenting the ambiguity. An ignored test is a silent warning of a gap in understanding.
|
|
413
|
+
- **T5: Test Boundary Conditions**: Most bugs happen at the edges. Test the exact boundaries (e.g., empty strings, max integers, off-by-one indices).
|
|
414
|
+
- **T6: Exhaustively Test Near Bugs**: Bugs congregate. If you find one, there are likely others nearby; test that area thoroughly.
|
|
415
|
+
- **T9: Tests Should Be Fast**: Slow tests don't get run. Keep them fast so they remain part of the core developer loop.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: diagnose-root
|
|
3
|
+
description: "Run 4-phase root cause analysis — reproduce, isolate, hypothesize, verify. Use when a bug is confirmed but root cause is unclear, after investigate-bug, or when user mentions root cause analysis."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Diagnose Root
|
|
7
|
+
|
|
8
|
+
**Boundary**: Canonical, reusable 4-phase RCA engine. Invoked by `investigate-bug` (as step 2 of the end-to-end flow) and by `fix-bug` (when no bug file exists). Does not write the bug file — that is `investigate-bug`'s responsibility.
|
|
9
|
+
|
|
10
|
+
Four phases — do not skip. Update the active `specs/bugs/BUG-*.md` file at each phase.
|
|
11
|
+
|
|
12
|
+
## Phases
|
|
13
|
+
|
|
14
|
+
1. **Reproduce** — minimal steps; record environment; capture logs.
|
|
15
|
+
2. **Isolate** — narrow to module/function; binary-search commits or config.
|
|
16
|
+
3. **Hypothesize** — list ranked hypotheses with falsification test each.
|
|
17
|
+
4. **Verify** — run falsification; confirm single root cause; link to fix plan.
|
|
18
|
+
|
|
19
|
+
> **HARD GATE** — Do not propose a fix until phase 4 confirms one root cause with evidence.
|
|
20
|
+
|
|
21
|
+
## Verify
|
|
22
|
+
|
|
23
|
+
→ verify: `[ "$(grep -lE 'Reproduce' specs/bugs/BUG-*.md 2>/dev/null | grep -cv "\.okf\.md$")" -ge 1 ]`
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
---
|
|
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`
|
|
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`
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dispatch-agents
|
|
3
|
+
description: "Dispatch multiple subagents in parallel on independent tasks. No waiting between them — all run concurrently. Use when tasks are truly decoupled and speed matters. Distinct from delegate-task (concurrent here, no inter-task review gate)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# story: e09s04
|
|
7
|
+
# story: e45s38
|
|
8
|
+
<!-- story: e45s11 -->
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# story: e45s30
|
|
12
|
+
|
|
13
|
+
# Dispatch Agents
|
|
14
|
+
> **HARD GATE** — **HARD GATE** — Agent work must be parallelizable and have explicit synchronization points. Do NOT dispatch work that has hidden dependencies between agents.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Run multiple subagents in parallel on independent tasks. Use when tasks are genuinely decoupled — no agent needs the output of another to start.
|
|
18
|
+
|
|
19
|
+
**Distinct from `delegate-task`:** This skill maximizes throughput via concurrency. There is no sequential review gate between tasks. Use `delegate-task` instead when a single task needs careful two-stage oversight before proceeding.
|
|
20
|
+
|
|
21
|
+
## When to use
|
|
22
|
+
|
|
23
|
+
- Tasks that can run simultaneously without shared state
|
|
24
|
+
- Large plans that can be broken into parallel workstreams
|
|
25
|
+
- Exploration: gather information from multiple parts of the codebase at once
|
|
26
|
+
|
|
27
|
+
## When NOT to use
|
|
28
|
+
|
|
29
|
+
- Task B depends on Task A's output
|
|
30
|
+
- You need to review Task A before Task B can start safely
|
|
31
|
+
- The tasks share a file and concurrent edits would conflict
|
|
32
|
+
|
|
33
|
+
## Process
|
|
34
|
+
|
|
35
|
+
### 1. Confirm independence
|
|
36
|
+
|
|
37
|
+
Before dispatching, verify each task pair is truly independent:
|
|
38
|
+
- No shared files being written
|
|
39
|
+
- No shared state (DB migrations, config files)
|
|
40
|
+
- No ordering dependency between outcomes
|
|
41
|
+
|
|
42
|
+
If any two tasks conflict, sequence them with `delegate-task` or `execute-plan` instead.
|
|
43
|
+
|
|
44
|
+
## Subagent depth tiers (e45s30)
|
|
45
|
+
|
|
46
|
+
Map `effort:` frontmatter and story `risk:` to prompt depth — do not send `minimal_decisive` agents a `full_maturity` brief.
|
|
47
|
+
|
|
48
|
+
| Tier | When | Brief shape | Token budget |
|
|
49
|
+
|------|------|-------------|----------------|
|
|
50
|
+
| `full_maturity` | `effort: heavy`, `risk: P0`, security-sensitive diffs | Full `task_brief` + CONVENTIONS excerpts + threat model if present | Full envelope |
|
|
51
|
+
| `standard` | `effort: standard`, `risk: P1`–`P2` | Standard `task_brief` fields below | Default |
|
|
52
|
+
| `minimal_decisive` | `effort: light`, `risk: P3`, read-only exploration | `goal` + `verify` + `in_scope` only | ≤15 lines |
|
|
53
|
+
|
|
54
|
+
Record `depth: <tier>` in the Agent tool description when dispatching.
|
|
55
|
+
|
|
56
|
+
### 2. Write typed task briefs (Orca message protocol)
|
|
57
|
+
|
|
58
|
+
Before writing briefs, read `specs/state.yaml` if it exists — each agent gets only the decisions relevant to its task, nothing else.
|
|
59
|
+
|
|
60
|
+
Every inter-agent message uses a **typed envelope** — no freeform prose between waves:
|
|
61
|
+
|
|
62
|
+
| `type` | When | Required fields |
|
|
63
|
+
|--------|------|-----------------|
|
|
64
|
+
| `task_brief` | Dispatch | `task_id`, `goal`, `in_scope`, `out_of_bounds`, `verify`, `prior_decisions` |
|
|
65
|
+
| `checkpoint` | Mid-wave progress | `task_id`, `status` (`running`\|`blocked`), `comment` (one line) |
|
|
66
|
+
| `result` | Agent return | `task_id`, `exit` (`pass`\|`fail`), `summary`, `verify_output` |
|
|
67
|
+
| `circuit_open` | 3 consecutive failures | `task_id`, `failures` (3), `escalate_to` (`user`) |
|
|
68
|
+
|
|
69
|
+
Example `task_brief` (each agent starts cold — brief size directly controls token cost and hallucination risk):
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
type: task_brief
|
|
73
|
+
task_id: agent-1
|
|
74
|
+
goal: [one sentence — what success looks like]
|
|
75
|
+
in_scope: [explicit file or module list]
|
|
76
|
+
out_of_bounds: [what NOT to touch]
|
|
77
|
+
verify: [runnable command]
|
|
78
|
+
prior_decisions: [relevant entries from specs/state.yaml — omit if none]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Emit **`checkpoint`** comments when an agent is slow or blocked — one line, no stack traces. Parent reads checkpoints before spawning follow-ups.
|
|
82
|
+
|
|
83
|
+
Do not include the full conversation, full file contents, or decisions unrelated to this agent's task.
|
|
84
|
+
|
|
85
|
+
### 3. Circuit breaker + iterative retrieval (max 3 cycles)
|
|
86
|
+
|
|
87
|
+
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`.
|
|
88
|
+
|
|
89
|
+
After each wave completes:
|
|
90
|
+
1. **Dispatch** — run parallel agents with typed `task_brief` envelopes.
|
|
91
|
+
2. **Evaluate** — read `result` messages; list gaps vs goal; honor open circuits.
|
|
92
|
+
3. **Refine** — tighten briefs or spawn follow-up agents (max **3 cycles** total).
|
|
93
|
+
|
|
94
|
+
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.
|
|
95
|
+
|
|
96
|
+
### 4. Dispatch in parallel
|
|
97
|
+
|
|
98
|
+
Spawn all agents in a single message using multiple Agent tool calls. Each agent gets its own complete brief.
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Agent 1: brief for task A
|
|
102
|
+
Agent 2: brief for task B
|
|
103
|
+
Agent 3: brief for task C
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 5. Collect and review results
|
|
107
|
+
|
|
108
|
+
When all agents return: review each result, run verify commands, check diffs for scope violations.
|
|
109
|
+
|
|
110
|
+
### 6. Integrate
|
|
111
|
+
|
|
112
|
+
Merge accepted results. Resolve conflicts manually; note in summary.
|
|
113
|
+
|
|
114
|
+
Report: which tasks succeeded, which need revision, overall verify status.
|
|
115
|
+
|
|
116
|
+
## Verify
|
|
117
|
+
→ verify: `test -f skills/dispatch-agents/SKILL.md && test -f scripts/lib/completeness-critic.sh`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: edit-document
|
|
3
|
+
description: "Edit and improve documents by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, restructure, or improve any document — including specs/ files, articles, READMEs, or technical writing."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Edit Document
|
|
7
|
+
|
|
8
|
+
**Distinct from `write-document`:** Use this skill when the document already exists and needs restructuring, clarity, or prose improvements. Use `write-document` to create a document from scratch.
|
|
9
|
+
|
|
10
|
+
> **HARD GATE** — Document edits must preserve intent and accuracy. Do NOT remove or contradict existing content without understanding why it was written. Check git history for context.
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
1. First, divide the document into sections based on its headings. Think about the main points made in each section.
|
|
15
|
+
|
|
16
|
+
Consider that information is a directed acyclic graph, and that pieces of information can depend on other pieces of information. Make sure that the order of the sections and their contents respects these dependencies.
|
|
17
|
+
|
|
18
|
+
Confirm the sections with the user.
|
|
19
|
+
|
|
20
|
+
2. For each section:
|
|
21
|
+
|
|
22
|
+
2a. Rewrite the section to improve clarity, coherence, and flow. Use maximum 240 characters per paragraph.
|