@izkac/forgekit 0.3.11 → 0.3.13
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/bin/forge.mjs +107 -107
- package/bin/forgekit.mjs +83 -83
- package/bin/review.mjs +81 -81
- package/package.json +1 -1
- package/scripts/prepack.mjs +78 -78
- package/scripts/run-tests.mjs +50 -50
- package/src/adr.mjs +236 -236
- package/src/adr.test.mjs +170 -170
- package/src/change.mjs +327 -234
- package/src/change.test.mjs +145 -83
- package/src/cleanup-sessions.mjs +84 -84
- package/src/config.mjs +103 -103
- package/src/defer.mjs +75 -75
- package/src/doctor.mjs +350 -341
- package/src/doctor.test.mjs +114 -114
- package/src/init.mjs +680 -621
- package/src/install.mjs +815 -815
- package/src/install.test.mjs +180 -180
- package/src/integrity-check.mjs +60 -60
- package/src/integrity.mjs +682 -682
- package/src/integrity.test.mjs +566 -566
- package/src/lib.mjs +143 -143
- package/src/models.defaults.json +41 -41
- package/src/new-session.mjs +99 -99
- package/src/openspec-overlays/README.md +19 -19
- package/src/openspec-overlays/openspec-apply-change-footer.md +14 -14
- package/src/openspec-overlays/opsx-apply-completion-step.md +1 -1
- package/src/openspec-overlays/opsx-apply-implement-step.md +11 -11
- package/src/paths.mjs +92 -92
- package/src/plan-engine.mjs +321 -278
- package/src/plan-engine.test.mjs +447 -283
- package/src/preferences.defaults.json +78 -78
- package/src/preferences.mjs +438 -438
- package/src/preferences.test.mjs +174 -174
- package/src/record-evidence.mjs +204 -204
- package/src/resolve-model.mjs +312 -312
- package/src/resolve-model.test.mjs +194 -194
- package/src/review/cli.test.mjs +117 -117
- package/src/review/export.mjs +172 -172
- package/src/review/export.test.mjs +197 -197
- package/src/review/fixtures/valid-review.json +42 -42
- package/src/review/lib.mjs +894 -894
- package/src/review/lib.test.mjs +266 -266
- package/src/review/schema.json +196 -196
- package/src/review/signals.test.mjs +62 -62
- package/src/score-cli.mjs +68 -68
- package/src/score.mjs +568 -566
- package/src/score.test.mjs +366 -340
- package/src/session-reminder.mjs +207 -207
- package/src/session-status.mjs +70 -70
- package/src/set-models.mjs +186 -186
- package/src/set-phase.mjs +205 -205
- package/src/set-prefs.mjs +294 -294
- package/src/specs-sync.mjs +234 -0
- package/src/specs-sync.test.mjs +114 -0
- package/src/spine.mjs +93 -93
- package/src/triage-prompt.mjs +175 -175
- package/src/triage-prompt.test.mjs +50 -50
- package/src/vendor-openspec-overlays.mjs +176 -176
- package/src/vendor-openspec-overlays.test.mjs +62 -62
- package/vendor/skills/archive-to-adr/SKILL.md +149 -149
- package/vendor/skills/forge/SKILL.md +136 -136
- package/vendor/skills/forge/docs/forge.md +650 -647
- package/vendor/skills/forge/phases/brainstorm.md +23 -23
- package/vendor/skills/forge/phases/finish.md +90 -87
- package/vendor/skills/forge/phases/implement.md +77 -77
- package/vendor/skills/forge/phases/plan-openspec.md +60 -60
- package/vendor/skills/forge/phases/plan-specs.md +163 -117
- package/vendor/skills/forge/phases/review.md +25 -25
- package/vendor/skills/forge/phases/verify.md +124 -124
- package/vendor/skills/forge/references/forge-layout.md +85 -85
- package/vendor/skills/forge/references/pace.md +115 -115
- package/vendor/skills/forge/references/plan-routing.md +52 -51
- package/vendor/skills/forge/references/runtime-integrity.md +232 -225
- package/vendor/skills/forge/references/substantial-work.md +37 -37
- package/vendor/skills/forge/references/test-evidence.md +30 -30
- package/vendor/skills/forge/references/test-strategy.md +68 -68
- package/vendor/skills/forge/skills/subagent-driven-development/SKILL.md +87 -87
- package/vendor/skills/forge/subagents/final-reviewer-prompt.md +56 -56
- package/vendor/skills/forge/subagents/implementer-prompt.md +38 -38
- package/vendor/skills/git-resolve-adr-conflict/SKILL.md +132 -132
- package/vendor/skills/thorough-code-review/SKILL.md +290 -290
- package/vendor/skills/thorough-code-review/examples.md +133 -133
- package/vendor/skills/thorough-code-review/reference/accepted-risks.md +26 -26
- package/vendor/skills/thorough-code-review/reference/lenses.md +96 -96
- package/vendor/skills/thorough-code-review/reference/phase1-scout.md +62 -62
- package/vendor/skills/thorough-code-review/reference/phase2-skeptic.md +105 -105
- package/vendor/skills/thorough-code-review/reference/report-schema.json +222 -222
- package/vendor/skills/thorough-code-review/reference/report-template.md +115 -115
- package/vendor/skills/thorough-code-review/reference/severity-rubric.md +49 -49
- package/vendor/skills/thorough-code-review/reference/signals-preflight.md +55 -55
- package/vendor/templates/adr/README.md +7 -7
- package/vendor/templates/adr/decisions.md +141 -141
- package/vendor/templates/adr/hooks/check-pending-adrs.mjs +74 -74
- package/vendor/templates/adr/hooks/check-pending-adrs.sh +3 -3
- package/vendor/templates/adr/hooks/openspec-archive-agent-message.mjs +52 -52
- package/vendor/templates/adr/hooks/openspec-archive-agent-message.sh +3 -3
- package/vendor/templates/project/claude/commands/forge-apply.md +75 -75
- package/vendor/templates/project/claude/commands/forge-brainstorm.md +7 -7
- package/vendor/templates/project/claude/commands/forge-build.md +17 -17
- package/vendor/templates/project/claude/commands/forge-plan.md +12 -12
- package/vendor/templates/project/claude/commands/forge-skip.md +14 -14
- package/vendor/templates/project/claude/commands/forge-status.md +16 -16
- package/vendor/templates/project/claude/commands/forge.md +16 -16
- package/vendor/templates/project/claude/hooks/forge-prompt-hook.mjs +73 -73
- package/vendor/templates/project/claude/hooks/forge-session-start.mjs +19 -19
- package/vendor/templates/project/claude/hooks/forge-triage-hook.mjs +77 -77
- package/vendor/templates/project/cursor/commands/forge-apply.md +75 -75
- package/vendor/templates/project/cursor/commands/forge-brainstorm.md +10 -10
- package/vendor/templates/project/cursor/commands/forge-build.md +17 -17
- package/vendor/templates/project/cursor/commands/forge-plan.md +15 -15
- package/vendor/templates/project/cursor/commands/forge-skip.md +14 -14
- package/vendor/templates/project/cursor/commands/forge-status.md +16 -16
- package/vendor/templates/project/cursor/commands/forge.md +16 -16
- package/vendor/templates/project/cursor/hooks/forge-session-start.mjs +30 -30
- package/vendor/templates/project/cursor/hooks/forge-session-start.sh +3 -3
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
# Tiered test strategy (Forge)
|
|
2
|
-
|
|
3
|
-
Forge uses **three tiers**. Do **not** run the full workspace or monorepo test suite on every subagent task — that is slow and redundant when verify runs tier 3 once.
|
|
4
|
-
|
|
5
|
-
## Tier 1 — TDD loop (within a task)
|
|
6
|
-
|
|
7
|
-
During red/green/refactor, run **scoped** commands only:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm test -- path/to/scoped.test.ts -- path/to/changed.test.ts
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
- Single test file or pattern for the behavior under change
|
|
14
|
-
- Mandatory for TDD integrity (watch fail → pass)
|
|
15
|
-
- Fast; repeat as often as needed
|
|
16
|
-
|
|
17
|
-
## Tier 2 — Task completion evidence
|
|
18
|
-
|
|
19
|
-
Before marking a task complete, run the **narrowest** command that proves **this task's** changes work:
|
|
20
|
-
|
|
21
|
-
- Changed test file(s) + directly related tests in the same module/directory
|
|
22
|
-
- Subpath or pattern filter when the runner supports it
|
|
23
|
-
- **Not** the full workspace suite by default
|
|
24
|
-
|
|
25
|
-
Record in `.forge/sessions/<id>/tasks/<nn>-<slug>/test-evidence.md`. See [test-evidence.md](./test-evidence.md).
|
|
26
|
-
|
|
27
|
-
### Tier 2 may be wider (still not full monorepo)
|
|
28
|
-
|
|
29
|
-
- Shared contract or public API change → include contract tests in affected packages
|
|
30
|
-
- Cross-module integration within one workspace → run the relevant integration test directory
|
|
31
|
-
- Task brief explicitly requires full workspace coverage
|
|
32
|
-
|
|
33
|
-
### Do not use full workspace at tier 2 when
|
|
34
|
-
|
|
35
|
-
- Changes are localized (typical 1–3 file task)
|
|
36
|
-
- Multiple tasks target the same workspace (full suite runs once at **verify**)
|
|
37
|
-
- Motivation is only "to be safe" — that is **verify's** job
|
|
38
|
-
|
|
39
|
-
## Tier 3 — Verify phase (coordinator, after all tasks)
|
|
40
|
-
|
|
41
|
-
After all implement tasks complete:
|
|
42
|
-
|
|
43
|
-
1. **Audit** every `tasks/<nn>-<slug>/test-evidence.md` (exit `0`, pass summary, reviewers approved).
|
|
44
|
-
2. Run **one fresh full workspace test** for each affected workspace (plus downstream consumer workspaces when contracts changed).
|
|
45
|
-
3. Save output to `.forge/sessions/<id>/verify-evidence.md`.
|
|
46
|
-
|
|
47
|
-
Tier 3 is the integration/regression gate. Cite this file when claiming the implementation passes.
|
|
48
|
-
|
|
49
|
-
Re-run tier 3 when: tier 3 failed, coordinator edited code after verify evidence, quality/final review flagged test gaps, or the user asks for a fresh run.
|
|
50
|
-
|
|
51
|
-
**Do not** re-run tier 2 narrow commands at verify — audit them instead.
|
|
52
|
-
|
|
53
|
-
## Quick reference
|
|
54
|
-
|
|
55
|
-
| Tier | Who | When | Scope |
|
|
56
|
-
| ---- | --- | ---- | ----- |
|
|
57
|
-
| 1 | Implementer | Each TDD red/green/refactor | Single file or pattern |
|
|
58
|
-
| 2 | Implementer | Task done | Narrowest proof for this task |
|
|
59
|
-
| 3 | Coordinator | Verify phase (once) | Full affected workspace(s) |
|
|
60
|
-
|
|
61
|
-
## Anti-patterns
|
|
62
|
-
|
|
63
|
-
| Don't | Do instead |
|
|
64
|
-
| ----- | ---------- |
|
|
65
|
-
| Full workspace test on every task | Tier 1 scoped + tier 2 narrow evidence |
|
|
66
|
-
| Skip tier 3 because tasks passed | Always run tier 3 once at verify |
|
|
67
|
-
| Re-run tier 2 commands at verify | Audit task evidence; run tier 3 full suite |
|
|
68
|
-
| Full monorepo test at tier 2 | Tier 2 narrow; tier 3 per workspace (or listed consumers) |
|
|
1
|
+
# Tiered test strategy (Forge)
|
|
2
|
+
|
|
3
|
+
Forge uses **three tiers**. Do **not** run the full workspace or monorepo test suite on every subagent task — that is slow and redundant when verify runs tier 3 once.
|
|
4
|
+
|
|
5
|
+
## Tier 1 — TDD loop (within a task)
|
|
6
|
+
|
|
7
|
+
During red/green/refactor, run **scoped** commands only:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm test -- path/to/scoped.test.ts -- path/to/changed.test.ts
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- Single test file or pattern for the behavior under change
|
|
14
|
+
- Mandatory for TDD integrity (watch fail → pass)
|
|
15
|
+
- Fast; repeat as often as needed
|
|
16
|
+
|
|
17
|
+
## Tier 2 — Task completion evidence
|
|
18
|
+
|
|
19
|
+
Before marking a task complete, run the **narrowest** command that proves **this task's** changes work:
|
|
20
|
+
|
|
21
|
+
- Changed test file(s) + directly related tests in the same module/directory
|
|
22
|
+
- Subpath or pattern filter when the runner supports it
|
|
23
|
+
- **Not** the full workspace suite by default
|
|
24
|
+
|
|
25
|
+
Record in `.forge/sessions/<id>/tasks/<nn>-<slug>/test-evidence.md`. See [test-evidence.md](./test-evidence.md).
|
|
26
|
+
|
|
27
|
+
### Tier 2 may be wider (still not full monorepo)
|
|
28
|
+
|
|
29
|
+
- Shared contract or public API change → include contract tests in affected packages
|
|
30
|
+
- Cross-module integration within one workspace → run the relevant integration test directory
|
|
31
|
+
- Task brief explicitly requires full workspace coverage
|
|
32
|
+
|
|
33
|
+
### Do not use full workspace at tier 2 when
|
|
34
|
+
|
|
35
|
+
- Changes are localized (typical 1–3 file task)
|
|
36
|
+
- Multiple tasks target the same workspace (full suite runs once at **verify**)
|
|
37
|
+
- Motivation is only "to be safe" — that is **verify's** job
|
|
38
|
+
|
|
39
|
+
## Tier 3 — Verify phase (coordinator, after all tasks)
|
|
40
|
+
|
|
41
|
+
After all implement tasks complete:
|
|
42
|
+
|
|
43
|
+
1. **Audit** every `tasks/<nn>-<slug>/test-evidence.md` (exit `0`, pass summary, reviewers approved).
|
|
44
|
+
2. Run **one fresh full workspace test** for each affected workspace (plus downstream consumer workspaces when contracts changed).
|
|
45
|
+
3. Save output to `.forge/sessions/<id>/verify-evidence.md`.
|
|
46
|
+
|
|
47
|
+
Tier 3 is the integration/regression gate. Cite this file when claiming the implementation passes.
|
|
48
|
+
|
|
49
|
+
Re-run tier 3 when: tier 3 failed, coordinator edited code after verify evidence, quality/final review flagged test gaps, or the user asks for a fresh run.
|
|
50
|
+
|
|
51
|
+
**Do not** re-run tier 2 narrow commands at verify — audit them instead.
|
|
52
|
+
|
|
53
|
+
## Quick reference
|
|
54
|
+
|
|
55
|
+
| Tier | Who | When | Scope |
|
|
56
|
+
| ---- | --- | ---- | ----- |
|
|
57
|
+
| 1 | Implementer | Each TDD red/green/refactor | Single file or pattern |
|
|
58
|
+
| 2 | Implementer | Task done | Narrowest proof for this task |
|
|
59
|
+
| 3 | Coordinator | Verify phase (once) | Full affected workspace(s) |
|
|
60
|
+
|
|
61
|
+
## Anti-patterns
|
|
62
|
+
|
|
63
|
+
| Don't | Do instead |
|
|
64
|
+
| ----- | ---------- |
|
|
65
|
+
| Full workspace test on every task | Tier 1 scoped + tier 2 narrow evidence |
|
|
66
|
+
| Skip tier 3 because tasks passed | Always run tier 3 once at verify |
|
|
67
|
+
| Re-run tier 2 commands at verify | Audit task evidence; run tier 3 full suite |
|
|
68
|
+
| Full monorepo test at tier 2 | Tier 2 narrow; tier 3 per workspace (or listed consumers) |
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: subagent-driven-development
|
|
3
|
-
description: Forge — subagent per task with a combined spec+quality review. Internal skill; read via forge orchestrator.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Subagent-Driven Development
|
|
7
|
-
|
|
8
|
-
Execute a plan by dispatching a fresh implementer subagent per task, followed by one **task reviewer** subagent that checks spec compliance first, then code quality.
|
|
9
|
-
|
|
10
|
-
**Why subagents:** isolated context per task. You craft exactly the instructions and context each one needs — they never inherit session history — and your own context stays free for coordination.
|
|
11
|
-
|
|
12
|
-
**Core principle:** fresh implementer per task + combined review (spec gate, then quality) = high quality, fast iteration.
|
|
13
|
-
|
|
14
|
-
## When to use
|
|
15
|
-
|
|
16
|
-
Use when you have an implementation plan with mostly independent tasks and you're staying in this session. Tightly coupled tasks or no plan → execute manually or brainstorm first.
|
|
17
|
-
|
|
18
|
-
## Pace
|
|
19
|
-
|
|
20
|
-
Honor [../../references/pace.md](../../references/pace.md) (`forge prefs` / session `resolvedPace`). Reviewers may be deferred to **OpenSpec group** boundaries under `standard` (`per-group`), or skipped for low-risk work under `brisk`/`lite`; **never** skip review for money/auth/contracts/migrations (immediate per-task review). Tier-2 test evidence stays mandatory for behavior changes on every task.
|
|
21
|
-
|
|
22
|
-
## Per-task loop
|
|
23
|
-
|
|
24
|
-
1. Extract full task text + context from the plan (read the plan file **once**, up front; never make a subagent read it). Note which OpenSpec **group** (`##` section) the task belongs to.
|
|
25
|
-
2. Dispatch **implementer** — [../../subagents/implementer-prompt.md](../../subagents/implementer-prompt.md). Answer any questions it asks before letting it proceed.
|
|
26
|
-
3. Dispatch **reviewer** when pace requires it — [../../subagents/task-reviewer-prompt.md](../../subagents/task-reviewer-prompt.md) (spec compliance gates quality):
|
|
27
|
-
- `always` → after this task
|
|
28
|
-
- `per-group` → after the last task in the current `##` group (or immediately if high-risk); mid-group low-risk → self-check only
|
|
29
|
-
- `high-risk-only` / `never` → only high-risk (hard floor)
|
|
30
|
-
If skipped, write a pace self-check `task-review.md`. Group reviews write `group-review.md` covering every task in the section.
|
|
31
|
-
4. Reviewer REJECTED → same implementer fixes → re-review. Repeat until APPROVED (cap at `review.maxRounds`). Never skip the re-review when a reviewer was dispatched.
|
|
32
|
-
5. Save test evidence; mark task complete.
|
|
33
|
-
6. After all tasks: proceed to verify/review phases (final reviewer subject to pace).
|
|
34
|
-
|
|
35
|
-
## Task batching (small tasks only)
|
|
36
|
-
|
|
37
|
-
Each dispatch pays a full fresh context. Batch **consecutive, small, same-area tasks** (doc edits, config values, wording, mechanical renames) into one implementer brief listing them all, reviewed together in one review pass.
|
|
38
|
-
|
|
39
|
-
**Never batch** tasks that touch money, auth, shared contracts, or migrations — those keep 1:1 dispatch. When in doubt, don't batch.
|
|
40
|
-
|
|
41
|
-
## Model selection
|
|
42
|
-
|
|
43
|
-
Subagent models use **two axes** — never invent host model IDs from memory:
|
|
44
|
-
|
|
45
|
-
| Axis | Values | Default |
|
|
46
|
-
| ---- | ------ | ------- |
|
|
47
|
-
| Capability | `fast` · `standard` · `capable` | role-based (below) |
|
|
48
|
-
| Billing | `included` · `metered` | **`included`** |
|
|
49
|
-
|
|
50
|
-
**Billing `included` unless the user explicitly asks for API/metered models** (or has set `forge models -- metered`). Do **not** auto-switch to `metered` on failure.
|
|
51
|
-
|
|
52
|
-
Capability by role:
|
|
53
|
-
|
|
54
|
-
- Touches 1–2 files with a complete spec → `fast` (most tasks, when the plan is well-specified)
|
|
55
|
-
- Multi-file integration, pattern matching, debugging → `standard`
|
|
56
|
-
- Design judgment, broad codebase understanding, review → `capable`
|
|
57
|
-
|
|
58
|
-
Before every Task/Agent dispatch, resolve:
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
forge resolve-model --tier <fast|standard|capable>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Honor the JSON: if `omitModel` is true, **omit** the host `model` parameter; otherwise pass `model` exactly as returned. Defaults live in `models.defaults.json`. Checkout overlay `.forge/models.local.json` exists only after `forge models included|metered` (bare `forge models` only prints).
|
|
65
|
-
|
|
66
|
-
## Handling implementer status
|
|
67
|
-
|
|
68
|
-
- **DONE** → proceed to review.
|
|
69
|
-
- **DONE_WITH_CONCERNS** → read the concerns; correctness/scope concerns get addressed before review, observations are noted.
|
|
70
|
-
- **NEEDS_CONTEXT** → provide the missing context, re-dispatch.
|
|
71
|
-
- **BLOCKED** → context problem: add context, re-dispatch. Needs more reasoning: escalate **capability tier** within the current billing lane (still `included` by default). Task too large: split it. Plan wrong: escalate to the human. Never force the same model to retry unchanged; never flip to `metered` without an explicit user request.
|
|
72
|
-
|
|
73
|
-
## Red flags — never
|
|
74
|
-
|
|
75
|
-
- Start implementation on main/master without explicit user consent
|
|
76
|
-
- Skip the review, proceed with unfixed spec gaps or Critical/Important issues, or accept "close enough" on spec compliance
|
|
77
|
-
- Dispatch multiple implementer subagents in parallel (conflicts)
|
|
78
|
-
- Make a subagent read the plan file, skip scene-setting context, or ignore its questions
|
|
79
|
-
- Let implementer self-review replace the reviewer (both are needed)
|
|
80
|
-
- Fix a failed task manually in coordinator context — dispatch a fix subagent with specific instructions
|
|
81
|
-
|
|
82
|
-
## Integration
|
|
83
|
-
|
|
84
|
-
- **Plan source:** OpenSpec (`openspec/changes/<name>/tasks.md`)
|
|
85
|
-
- **Subagents must follow:** [references/tdd-core.md](../../references/tdd-core.md) (condensed TDD rules; full skill at [skills/test-driven-development](../test-driven-development/SKILL.md) when stuck)
|
|
86
|
-
- **On blockers:** [skills/systematic-debugging](../systematic-debugging/SKILL.md) before guessing fixes
|
|
87
|
-
- **After all tasks:** [phases/verify.md](../../phases/verify.md) → [phases/review.md](../../phases/review.md) → [phases/finish.md](../../phases/finish.md)
|
|
1
|
+
---
|
|
2
|
+
name: subagent-driven-development
|
|
3
|
+
description: Forge — subagent per task with a combined spec+quality review. Internal skill; read via forge orchestrator.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Subagent-Driven Development
|
|
7
|
+
|
|
8
|
+
Execute a plan by dispatching a fresh implementer subagent per task, followed by one **task reviewer** subagent that checks spec compliance first, then code quality.
|
|
9
|
+
|
|
10
|
+
**Why subagents:** isolated context per task. You craft exactly the instructions and context each one needs — they never inherit session history — and your own context stays free for coordination.
|
|
11
|
+
|
|
12
|
+
**Core principle:** fresh implementer per task + combined review (spec gate, then quality) = high quality, fast iteration.
|
|
13
|
+
|
|
14
|
+
## When to use
|
|
15
|
+
|
|
16
|
+
Use when you have an implementation plan with mostly independent tasks and you're staying in this session. Tightly coupled tasks or no plan → execute manually or brainstorm first.
|
|
17
|
+
|
|
18
|
+
## Pace
|
|
19
|
+
|
|
20
|
+
Honor [../../references/pace.md](../../references/pace.md) (`forge prefs` / session `resolvedPace`). Reviewers may be deferred to **OpenSpec group** boundaries under `standard` (`per-group`), or skipped for low-risk work under `brisk`/`lite`; **never** skip review for money/auth/contracts/migrations (immediate per-task review). Tier-2 test evidence stays mandatory for behavior changes on every task.
|
|
21
|
+
|
|
22
|
+
## Per-task loop
|
|
23
|
+
|
|
24
|
+
1. Extract full task text + context from the plan (read the plan file **once**, up front; never make a subagent read it). Note which OpenSpec **group** (`##` section) the task belongs to.
|
|
25
|
+
2. Dispatch **implementer** — [../../subagents/implementer-prompt.md](../../subagents/implementer-prompt.md). Answer any questions it asks before letting it proceed.
|
|
26
|
+
3. Dispatch **reviewer** when pace requires it — [../../subagents/task-reviewer-prompt.md](../../subagents/task-reviewer-prompt.md) (spec compliance gates quality):
|
|
27
|
+
- `always` → after this task
|
|
28
|
+
- `per-group` → after the last task in the current `##` group (or immediately if high-risk); mid-group low-risk → self-check only
|
|
29
|
+
- `high-risk-only` / `never` → only high-risk (hard floor)
|
|
30
|
+
If skipped, write a pace self-check `task-review.md`. Group reviews write `group-review.md` covering every task in the section.
|
|
31
|
+
4. Reviewer REJECTED → same implementer fixes → re-review. Repeat until APPROVED (cap at `review.maxRounds`). Never skip the re-review when a reviewer was dispatched.
|
|
32
|
+
5. Save test evidence; mark task complete.
|
|
33
|
+
6. After all tasks: proceed to verify/review phases (final reviewer subject to pace).
|
|
34
|
+
|
|
35
|
+
## Task batching (small tasks only)
|
|
36
|
+
|
|
37
|
+
Each dispatch pays a full fresh context. Batch **consecutive, small, same-area tasks** (doc edits, config values, wording, mechanical renames) into one implementer brief listing them all, reviewed together in one review pass.
|
|
38
|
+
|
|
39
|
+
**Never batch** tasks that touch money, auth, shared contracts, or migrations — those keep 1:1 dispatch. When in doubt, don't batch.
|
|
40
|
+
|
|
41
|
+
## Model selection
|
|
42
|
+
|
|
43
|
+
Subagent models use **two axes** — never invent host model IDs from memory:
|
|
44
|
+
|
|
45
|
+
| Axis | Values | Default |
|
|
46
|
+
| ---- | ------ | ------- |
|
|
47
|
+
| Capability | `fast` · `standard` · `capable` | role-based (below) |
|
|
48
|
+
| Billing | `included` · `metered` | **`included`** |
|
|
49
|
+
|
|
50
|
+
**Billing `included` unless the user explicitly asks for API/metered models** (or has set `forge models -- metered`). Do **not** auto-switch to `metered` on failure.
|
|
51
|
+
|
|
52
|
+
Capability by role:
|
|
53
|
+
|
|
54
|
+
- Touches 1–2 files with a complete spec → `fast` (most tasks, when the plan is well-specified)
|
|
55
|
+
- Multi-file integration, pattern matching, debugging → `standard`
|
|
56
|
+
- Design judgment, broad codebase understanding, review → `capable`
|
|
57
|
+
|
|
58
|
+
Before every Task/Agent dispatch, resolve:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
forge resolve-model --tier <fast|standard|capable>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Honor the JSON: if `omitModel` is true, **omit** the host `model` parameter; otherwise pass `model` exactly as returned. Defaults live in `models.defaults.json`. Checkout overlay `.forge/models.local.json` exists only after `forge models included|metered` (bare `forge models` only prints).
|
|
65
|
+
|
|
66
|
+
## Handling implementer status
|
|
67
|
+
|
|
68
|
+
- **DONE** → proceed to review.
|
|
69
|
+
- **DONE_WITH_CONCERNS** → read the concerns; correctness/scope concerns get addressed before review, observations are noted.
|
|
70
|
+
- **NEEDS_CONTEXT** → provide the missing context, re-dispatch.
|
|
71
|
+
- **BLOCKED** → context problem: add context, re-dispatch. Needs more reasoning: escalate **capability tier** within the current billing lane (still `included` by default). Task too large: split it. Plan wrong: escalate to the human. Never force the same model to retry unchanged; never flip to `metered` without an explicit user request.
|
|
72
|
+
|
|
73
|
+
## Red flags — never
|
|
74
|
+
|
|
75
|
+
- Start implementation on main/master without explicit user consent
|
|
76
|
+
- Skip the review, proceed with unfixed spec gaps or Critical/Important issues, or accept "close enough" on spec compliance
|
|
77
|
+
- Dispatch multiple implementer subagents in parallel (conflicts)
|
|
78
|
+
- Make a subagent read the plan file, skip scene-setting context, or ignore its questions
|
|
79
|
+
- Let implementer self-review replace the reviewer (both are needed)
|
|
80
|
+
- Fix a failed task manually in coordinator context — dispatch a fix subagent with specific instructions
|
|
81
|
+
|
|
82
|
+
## Integration
|
|
83
|
+
|
|
84
|
+
- **Plan source:** OpenSpec (`openspec/changes/<name>/tasks.md`)
|
|
85
|
+
- **Subagents must follow:** [references/tdd-core.md](../../references/tdd-core.md) (condensed TDD rules; full skill at [skills/test-driven-development](../test-driven-development/SKILL.md) when stuck)
|
|
86
|
+
- **On blockers:** [skills/systematic-debugging](../systematic-debugging/SKILL.md) before guessing fixes
|
|
87
|
+
- **After all tasks:** [phases/verify.md](../../phases/verify.md) → [phases/review.md](../../phases/review.md) → [phases/finish.md](../../phases/finish.md)
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
# Final implementation reviewer
|
|
2
|
-
|
|
3
|
-
Review the **entire** Forge session implementation against the plan **and**
|
|
4
|
-
the capability specs. See [references/runtime-integrity.md](../references/runtime-integrity.md).
|
|
5
|
-
|
|
6
|
-
## Plan source
|
|
7
|
-
|
|
8
|
-
{PLAN_REFERENCE}
|
|
9
|
-
|
|
10
|
-
## Capability specs (source of truth)
|
|
11
|
-
|
|
12
|
-
{CAPABILITY_SPECS_REFERENCE}
|
|
13
|
-
|
|
14
|
-
## Tasks completed
|
|
15
|
-
|
|
16
|
-
{TASK_SUMMARY}
|
|
17
|
-
|
|
18
|
-
## Scope
|
|
19
|
-
|
|
20
|
-
All files changed in this session (use git diff or explicit list):
|
|
21
|
-
|
|
22
|
-
{CHANGED_FILES}
|
|
23
|
-
|
|
24
|
-
## Spec-to-runtime trace (required)
|
|
25
|
-
|
|
26
|
-
For **each** requirement in the change's capability specs, name the
|
|
27
|
-
**production caller** (worker job kind, HTTP endpoint, CLI command, scheduled
|
|
28
|
-
job, …) that invokes the implementing code. Cross-check against `spine.json`
|
|
29
|
-
(`forge spine check`) — every capability row must be wired, not library-only.
|
|
30
|
-
|
|
31
|
-
- Library-only / no production caller → **`NOT READY`**
|
|
32
|
-
- Stub handler / false success / enqueueable-but-unhandled kind → **`NOT READY`**
|
|
33
|
-
- Job kind on the product surface that is neither wired end-to-end nor deleted → **`NOT READY`**
|
|
34
|
-
- UI/API reads a collection or artifact nothing in the production path writes → **`NOT READY`**
|
|
35
|
-
- Missing E2E fixture path with no explicit `BLOCKED` in `verify-evidence.md` → **`NOT READY`**
|
|
36
|
-
|
|
37
|
-
## Product-loop acceptance (required — executed, not described)
|
|
38
|
-
|
|
39
|
-
`forge e2e check` must be green: `e2e.json` steps drive the **closed loop**
|
|
40
|
-
(produce → consume → decision changes output) and `e2e-results.json` records a
|
|
41
|
-
green, current run (steps hash matches). A single job slice (e.g. ingest→file)
|
|
42
|
-
or a library-level E2E does **not** count as platform E2E. Read the steps —
|
|
43
|
-
would they pass against a stubbed handler? If yes, they prove nothing.
|
|
44
|
-
|
|
45
|
-
- No green, current e2e run and no `BLOCKED` in `verify-evidence.md` → **`NOT READY`**
|
|
46
|
-
- E2E steps assert no domain side effects (would pass on a stub) → **`NOT READY`**
|
|
47
|
-
- `e2e.json` `notApplicable` without a reason no command could overcome → **`NOT READY`**
|
|
48
|
-
- `BLOCKED` present → **`NOT READY`** (honest, but not READY)
|
|
49
|
-
- Unresolved deferrals in `forge defer list` → **`NOT READY`**
|
|
50
|
-
|
|
51
|
-
## Verdict
|
|
52
|
-
|
|
53
|
-
- **READY** — every capability has a runtime owner, product loop evidenced, tests evidence real outcomes, no critical gaps
|
|
54
|
-
- **NOT READY** — list blockers (prefer runtime-integrity and missing wiring first)
|
|
55
|
-
|
|
56
|
-
Do not approve if tests were not run, **`test-evidence.md` is missing**, tasks remain unchecked, or any claimed capability is library-only / stubbed / false-succeeding. Task checkboxes at 100% do **not** override a broken spine.
|
|
1
|
+
# Final implementation reviewer
|
|
2
|
+
|
|
3
|
+
Review the **entire** Forge session implementation against the plan **and**
|
|
4
|
+
the capability specs. See [references/runtime-integrity.md](../references/runtime-integrity.md).
|
|
5
|
+
|
|
6
|
+
## Plan source
|
|
7
|
+
|
|
8
|
+
{PLAN_REFERENCE}
|
|
9
|
+
|
|
10
|
+
## Capability specs (source of truth)
|
|
11
|
+
|
|
12
|
+
{CAPABILITY_SPECS_REFERENCE}
|
|
13
|
+
|
|
14
|
+
## Tasks completed
|
|
15
|
+
|
|
16
|
+
{TASK_SUMMARY}
|
|
17
|
+
|
|
18
|
+
## Scope
|
|
19
|
+
|
|
20
|
+
All files changed in this session (use git diff or explicit list):
|
|
21
|
+
|
|
22
|
+
{CHANGED_FILES}
|
|
23
|
+
|
|
24
|
+
## Spec-to-runtime trace (required)
|
|
25
|
+
|
|
26
|
+
For **each** requirement in the change's capability specs, name the
|
|
27
|
+
**production caller** (worker job kind, HTTP endpoint, CLI command, scheduled
|
|
28
|
+
job, …) that invokes the implementing code. Cross-check against `spine.json`
|
|
29
|
+
(`forge spine check`) — every capability row must be wired, not library-only.
|
|
30
|
+
|
|
31
|
+
- Library-only / no production caller → **`NOT READY`**
|
|
32
|
+
- Stub handler / false success / enqueueable-but-unhandled kind → **`NOT READY`**
|
|
33
|
+
- Job kind on the product surface that is neither wired end-to-end nor deleted → **`NOT READY`**
|
|
34
|
+
- UI/API reads a collection or artifact nothing in the production path writes → **`NOT READY`**
|
|
35
|
+
- Missing E2E fixture path with no explicit `BLOCKED` in `verify-evidence.md` → **`NOT READY`**
|
|
36
|
+
|
|
37
|
+
## Product-loop acceptance (required — executed, not described)
|
|
38
|
+
|
|
39
|
+
`forge e2e check` must be green: `e2e.json` steps drive the **closed loop**
|
|
40
|
+
(produce → consume → decision changes output) and `e2e-results.json` records a
|
|
41
|
+
green, current run (steps hash matches). A single job slice (e.g. ingest→file)
|
|
42
|
+
or a library-level E2E does **not** count as platform E2E. Read the steps —
|
|
43
|
+
would they pass against a stubbed handler? If yes, they prove nothing.
|
|
44
|
+
|
|
45
|
+
- No green, current e2e run and no `BLOCKED` in `verify-evidence.md` → **`NOT READY`**
|
|
46
|
+
- E2E steps assert no domain side effects (would pass on a stub) → **`NOT READY`**
|
|
47
|
+
- `e2e.json` `notApplicable` without a reason no command could overcome → **`NOT READY`**
|
|
48
|
+
- `BLOCKED` present → **`NOT READY`** (honest, but not READY)
|
|
49
|
+
- Unresolved deferrals in `forge defer list` → **`NOT READY`**
|
|
50
|
+
|
|
51
|
+
## Verdict
|
|
52
|
+
|
|
53
|
+
- **READY** — every capability has a runtime owner, product loop evidenced, tests evidence real outcomes, no critical gaps
|
|
54
|
+
- **NOT READY** — list blockers (prefer runtime-integrity and missing wiring first)
|
|
55
|
+
|
|
56
|
+
Do not approve if tests were not run, **`test-evidence.md` is missing**, tasks remain unchecked, or any claimed capability is library-only / stubbed / false-succeeding. Task checkboxes at 100% do **not** override a broken spine.
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
# Implementer subagent brief
|
|
2
|
-
|
|
3
|
-
You are the **implementer** for one Forge task. You receive only this brief — no chat history.
|
|
4
|
-
|
|
5
|
-
## Task
|
|
6
|
-
|
|
7
|
-
{TASK_TITLE}
|
|
8
|
-
|
|
9
|
-
{TASK_BODY}
|
|
10
|
-
|
|
11
|
-
## Files
|
|
12
|
-
|
|
13
|
-
{FILE_LIST}
|
|
14
|
-
|
|
15
|
-
## Requirements / spec excerpt
|
|
16
|
-
|
|
17
|
-
{SPEC_EXCERPT}
|
|
18
|
-
|
|
19
|
-
## Forge constraints
|
|
20
|
-
|
|
21
|
-
- Read and follow [references/tdd-core.md](./references/tdd-core.md) before any production code (full TDD skill only if stuck).
|
|
22
|
-
- **No** `git commit` or `git push` unless the user explicitly asked in the current message.
|
|
23
|
-
- **Testing tiers:** tier 1 = scoped test file/pattern per red/green cycle; tier 2 = narrowest command proving this task. **Do not** run the full workspace suite unless this task touches shared contracts or the brief says so — that is tier 3 and runs once at verify.
|
|
24
|
-
- Include **command, exit code, and pass/fail summary** for tier 2 in your report (coordinator saves to `test-evidence.md`).
|
|
25
|
-
- Minimal diff; match existing style; trace ecosystem consumers if contracts change.
|
|
26
|
-
|
|
27
|
-
## Runtime integrity (hard)
|
|
28
|
-
|
|
29
|
-
Read [references/runtime-integrity.md](../references/runtime-integrity.md). Honor these without exception:
|
|
30
|
-
|
|
31
|
-
- **No stub-with-success.** Do not implement a handler that only logs / bumps progress / marks succeeded. Unwired kinds must fail closed or not be exposed.
|
|
32
|
-
- **Name the runtime caller.** If you add library code, report which production path (job kind, endpoint, CLI) invokes it. If nothing calls it yet, end with `DONE_WITH_CONCERNS` and say so — do not pretend the capability is done.
|
|
33
|
-
- **Tests must fail on a no-op.** Assert domain side effects, not ceremony.
|
|
34
|
-
- If this brief tells you a stub is OK or to “wire later,” **reject the brief**: reply `NEEDS_CONTEXT` / `BLOCKED` and ask the coordinator to restore full scope or get user approval to shrink it.
|
|
35
|
-
|
|
36
|
-
## Report status
|
|
37
|
-
|
|
38
|
-
End with one of: `DONE`, `DONE_WITH_CONCERNS`, `NEEDS_CONTEXT`, `BLOCKED` plus details.
|
|
1
|
+
# Implementer subagent brief
|
|
2
|
+
|
|
3
|
+
You are the **implementer** for one Forge task. You receive only this brief — no chat history.
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
{TASK_TITLE}
|
|
8
|
+
|
|
9
|
+
{TASK_BODY}
|
|
10
|
+
|
|
11
|
+
## Files
|
|
12
|
+
|
|
13
|
+
{FILE_LIST}
|
|
14
|
+
|
|
15
|
+
## Requirements / spec excerpt
|
|
16
|
+
|
|
17
|
+
{SPEC_EXCERPT}
|
|
18
|
+
|
|
19
|
+
## Forge constraints
|
|
20
|
+
|
|
21
|
+
- Read and follow [references/tdd-core.md](./references/tdd-core.md) before any production code (full TDD skill only if stuck).
|
|
22
|
+
- **No** `git commit` or `git push` unless the user explicitly asked in the current message.
|
|
23
|
+
- **Testing tiers:** tier 1 = scoped test file/pattern per red/green cycle; tier 2 = narrowest command proving this task. **Do not** run the full workspace suite unless this task touches shared contracts or the brief says so — that is tier 3 and runs once at verify.
|
|
24
|
+
- Include **command, exit code, and pass/fail summary** for tier 2 in your report (coordinator saves to `test-evidence.md`).
|
|
25
|
+
- Minimal diff; match existing style; trace ecosystem consumers if contracts change.
|
|
26
|
+
|
|
27
|
+
## Runtime integrity (hard)
|
|
28
|
+
|
|
29
|
+
Read [references/runtime-integrity.md](../references/runtime-integrity.md). Honor these without exception:
|
|
30
|
+
|
|
31
|
+
- **No stub-with-success.** Do not implement a handler that only logs / bumps progress / marks succeeded. Unwired kinds must fail closed or not be exposed.
|
|
32
|
+
- **Name the runtime caller.** If you add library code, report which production path (job kind, endpoint, CLI) invokes it. If nothing calls it yet, end with `DONE_WITH_CONCERNS` and say so — do not pretend the capability is done.
|
|
33
|
+
- **Tests must fail on a no-op.** Assert domain side effects, not ceremony.
|
|
34
|
+
- If this brief tells you a stub is OK or to “wire later,” **reject the brief**: reply `NEEDS_CONTEXT` / `BLOCKED` and ask the coordinator to restore full scope or get user approval to shrink it.
|
|
35
|
+
|
|
36
|
+
## Report status
|
|
37
|
+
|
|
38
|
+
End with one of: `DONE`, `DONE_WITH_CONCERNS`, `NEEDS_CONTEXT`, `BLOCKED` plus details.
|