the-frame-ai 0.14.0 → 0.16.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.
package/README.md CHANGED
@@ -15,7 +15,8 @@ If you're building a product alone with Claude Code and want to work like a team
15
15
  | Losing context between sessions | Project memory and automatic state dump on session start |
16
16
  | Chaos in tasks and priorities | 6-phase workflow: Research → Plan → Build → Review → Ship → Reflect |
17
17
  | Fear of breaking something important | Safety hooks block destructive commands before they run |
18
- | Repetitive routine tasks | 28 ready-made commands for the full development cycle |
18
+ | Repetitive routine tasks | 29 ready-made commands for the full development cycle |
19
+ | Slow, one-by-one fixes after review | `/frame:fix` — closes review findings in parallel, one fixer per file |
19
20
  | Complex features with dependencies | Parallel subagents for independent tasks (wave-based planning) |
20
21
  | No structure for solo work | Roadmap, STATE.md, MAP.md — always know where you are and what's next |
21
22
  | Shipping code with security holes | `/frame:audit` — unified security, performance, and dependency audit before deploy |
@@ -39,7 +40,8 @@ Run `/frame:research <topic>` — Claude explores the codebase and external sour
39
40
  `/frame:build` reads the `Parallel:` labels from plan.md and automatically decides whether to run tasks sequentially or in parallel worktrees. No flags needed. Stuck — `/frame:unstuck`. Found a bug — `/frame:debug`.
40
41
 
41
42
  **Review** — check before deploying
42
- `/frame:review` runs automated checks and a 6-panel review (spec compliance, security, performance, business logic, tests, conventions) on the diff.
43
+ `/frame:review` runs automated checks and a 6-panel review (spec compliance, security, performance, business logic, tests, conventions) on the diff. FAIL findings are verified adversarially in parallel.
44
+ If review requests changes, `/frame:fix` closes the findings in parallel — one fixer subagent per file, light findings skip the TDD ceremony, one quality-gate run at the end.
43
45
 
44
46
  **Ship** — deploy and record
45
47
  `/frame:ship` commits, optional push/PR, and updates project memory.
@@ -186,7 +188,8 @@ claude -p "/frame:audit quick" --allowedTools "Bash,Read,Write,Grep"
186
188
  FRAME provides:
187
189
 
188
190
  - **6-phase workflow**: Research → Plan → Build → Review → Ship → Reflect
189
- - **28 commands**: from quick tasks to full feature development cycle
191
+ - **29 commands**: from quick tasks to full feature development cycle
192
+ - **Parallel review fixes**: `/frame:fix` closes findings file-by-file in one pass — no worktrees, no per-fix ceremony
190
193
  - **10 AI agents**: Researcher, Planner, Builder, Reviewer, Auditor, Devil's Advocate, Security, Performance Auditor, Tests Reviewer, Conventions Reviewer
191
194
  - **Safety Hooks**: block destructive operations, enforce quality gates
192
195
  - **Git Safety**: checkpoints, rollback, worktrees, pause/resume
@@ -255,6 +258,7 @@ These commands cover 90% of solo dev work:
255
258
  | Command | When to use |
256
259
  |---------|-------------|
257
260
  | `/frame:build` | Implement plan with TDD — auto-detects sequential vs parallel from plan |
261
+ | `/frame:fix [REV-N ...]` | Close review findings in parallel — one fixer per file, single gates run |
258
262
  | `/frame:fast <task>` | Quick task under 30 minutes |
259
263
  | `/frame:debug <issue>` | Systematic bug investigation with git archaeology |
260
264
  | `/frame:debug --deep` | Deep forensic investigation (parallel investigators, 5-why, timeline) |
@@ -334,6 +338,7 @@ These commands cover 90% of solo dev work:
334
338
  | `/frame:debug` | Systematically debug an issue — or run deep forensic investigation with 5-why analysis | `[--deep] <SEC-N|issue description>` |
335
339
  | `/frame:doctor` | Check FRAME installation health — verify paths, config, and hook registration | — |
336
340
  | `/frame:fast` | Execute a quick task end-to-end without full research/plan cycle | `<task description>` |
341
+ | `/frame:fix` | Close review findings in parallel — groups findings by file, spawns one fixer per non-conflicting group, single gates run at the end | `[feature] [REV-N ...]` |
337
342
  | `/frame:health` | Daily health check: tests, lint, types, security scan freshness — or sprint velocity check | `[sprint]` |
338
343
  | `/frame:init` | Initialize project: scan codebase, fill MAP.md, STATE.md, and memory files | — |
339
344
  | `/frame:migrate` | Plan and execute a database or schema migration with rollback safety | `<migration description>` |
@@ -415,7 +420,7 @@ npx the-frame-ai version # Show CLI version
415
420
 
416
421
  ```
417
422
  .claude/
418
- commands/ # 28 FRAME commands
423
+ commands/ # 29 FRAME commands
419
424
  agents/ # 10 AI agents
420
425
  hooks/ # 5 safety hooks
421
426
  .frame/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "the-frame-ai",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "FRAME — Framework for AI-Assisted Solo Development",
5
5
  "type": "module",
6
6
  "bin": {
package/src/languages.js CHANGED
@@ -74,11 +74,6 @@ const STACK_PRESETS = {
74
74
  rust: { typecheck: 'cargo check', test: 'cargo test', lint: 'cargo clippy', build: 'cargo build' },
75
75
  };
76
76
 
77
- const MODEL_DESCRIPTIONS = {
78
- opus: 'opus — best quality, slower (recommended for architecture/security)',
79
- sonnet: 'sonnet — faster, good for most tasks',
80
- };
81
-
82
77
  export async function promptConfig(defaultConfig, yes = false) {
83
78
  if (!process.stdin.isTTY || yes) return defaultConfig;
84
79
 
@@ -118,16 +113,6 @@ export async function promptConfig(defaultConfig, yes = false) {
118
113
  }
119
114
  }
120
115
 
121
- console.log('\n? Preferred model for agents:\n');
122
- Object.values(MODEL_DESCRIPTIONS).forEach((d, i) => console.log(` ${i + 1}) ${d}`));
123
- const modelAnswer = (await ask(rl, '\n Enter number [1-2] (or press Enter for opus): ')).trim().toLowerCase();
124
- if (modelAnswer === '2' || modelAnswer === 'sonnet') {
125
- config.model = 'sonnet';
126
- console.log('\x1b[32m✓\x1b[0m Model preference: sonnet');
127
- } else {
128
- config.model = 'opus';
129
- }
130
-
131
116
  rl.close();
132
117
  return config;
133
118
  }
@@ -17,7 +17,19 @@ description: "Implementation agent. Writes code using TDD, runs quality gates, c
17
17
 
18
18
  > **Model**: sonnet (override via `model` in `.frame/config.json`)
19
19
 
20
- ## Instructions
20
+ ## Execution Modes
21
+
22
+ The orchestrating command tells you which mode you are in:
23
+
24
+ | Mode | When | What changes |
25
+ |------|------|--------------|
26
+ | **solo** (default) | Agent invoked directly, no task in the prompt | Full workflow below: find plan.md, loop over all tasks, own checkpoints and commits |
27
+ | **single-task** | `/frame:build` passes exactly one task from a parallel wave | Do **only** that task. Skip Step 1 (don't scan plan.md) and Step 7 (don't loop). Do **not** create checkpoint tags, do **not** edit plan.md/STATE.md — the orchestrator does all of that from your report |
28
+ | **single-fix** | `/frame:fix` passes one group of review findings | Like single-task, but the work is defined by findings (Claim/Evidence/Fix), not a plan task. Ceremony (light vs full-TDD) is specified in the brief. Do **not** commit, do **not** run full gates — only the targeted test for your file(s) |
29
+
30
+ **In single-task and single-fix modes**: everything you need (task/findings, relevant conventions, anti-patterns) is **in the prompt**. Do NOT read memory/context files yourself — that context is already packed in. Return your report as final text; the orchestrator merges it.
31
+
32
+ ## Instructions (solo mode)
21
33
 
22
34
  ### Core Workflow
23
35
 
@@ -37,13 +49,17 @@ Before doing anything, check:
37
49
 
38
50
  > **NEVER write .planning/STATE.md** — STATE.md is owned by the orchestrating command, not subagents.
39
51
 
40
- Then create git checkpoint:
52
+ > **single-task / single-fix mode**: skip this checkpoint entirely. The orchestrator already created one feature-scoped checkpoint before spawning the wave — a second tag from inside a subagent both duplicates it and collides with sibling subagents (git tags are repo-global). Jump straight to your task/findings.
53
+
54
+ Then (solo mode only) create git checkpoint:
41
55
  ```bash
42
- git tag "frame/checkpoint/build-$(date +%Y%m%dT%H%M%S)" -m "Auto checkpoint before build phase"
56
+ git tag "frame/checkpoint/build-{feature}-$(date +%Y%m%dT%H%M%S)" -m "Auto checkpoint before build phase"
43
57
  ```
44
58
 
45
59
  #### Step 1: Find plan.md
46
60
 
61
+ > **single-task / single-fix mode**: skip this step. Your work is defined by the task/findings in the prompt, not by scanning plan.md. Go to Step 3.
62
+
47
63
  ```bash
48
64
  find docs/specs -name "plan.md" | head -5
49
65
  ```
@@ -52,6 +68,8 @@ Read plan.md and find all uncompleted tasks.
52
68
 
53
69
  #### Step 2: Read Context
54
70
 
71
+ > **single-task / single-fix mode**: skip this step. Conventions, anti-patterns, and Memory Impact relevant to your work are already in the prompt. Reading these files again wastes tokens and startup time. Go to Step 3.
72
+
55
73
  Read in this order:
56
74
  - `.planning/memory/context.md` — **read first**: current focus and blockers
57
75
  - `docs/specs/{feature}/research.md` — **Memory Impact** section (why this approach was chosen)
@@ -71,8 +89,10 @@ Read in this order:
71
89
  | Risk | Action |
72
90
  |------|--------|
73
91
  | `low` | Standard TDD cycle |
74
- | `medium` | Create checkpoint: `git tag frame/checkpoint/task-{N}` |
75
- | `high` | Checkpoint + show user warning + **wait for confirmation** before proceeding |
92
+ | `medium` | Create checkpoint: `git tag frame/checkpoint/task-{N}` (solo mode only) |
93
+ | `high` | Checkpoint + show user warning + **wait for confirmation** before proceeding (solo mode only) |
94
+
95
+ > **single-task / single-fix mode**: you cannot wait for user confirmation — a subagent has no channel to the user. `Risk: high` tasks arrive **already confirmed by the orchestrator** (it asked the user before spawning you). Do not create checkpoint tags. Just do the work.
76
96
 
77
97
  ##### RED — Write Test
78
98
  1. Create test file (in project test directory — see CLAUDE.md)
@@ -117,6 +137,8 @@ If after **3 attempts** the test does not reach GREEN:
117
137
 
118
138
  #### Step 5: Git Commit
119
139
 
140
+ > **single-task mode**: skip commit — the orchestrator commits after the wave's quality gates pass, so wave commits stay atomic and ordered. **single-fix mode**: skip commit and skip full gates — run only the targeted test for your file(s); the orchestrator commits once after all fixers return. In both cases, end at your report (see Task Execution Flow).
141
+
120
142
  ```bash
121
143
  git add {specific_files}
122
144
  git commit -m "{type}({scope}): {description}"
@@ -126,13 +148,17 @@ git commit -m "{type}({scope}): {description}"
126
148
 
127
149
  #### Step 6: Update Status
128
150
 
129
- Mark task in plan.md:
151
+ > **single-task / single-fix mode**: do NOT edit plan.md. The orchestrator marks `[DONE]` / `[FIXED]` from your report — concurrent subagents editing the same plan.md would clobber each other.
152
+
153
+ Mark task in plan.md (solo mode only):
130
154
  ```markdown
131
155
  ### Task N: {Name} [DONE]
132
156
  ```
133
157
 
134
158
  #### Step 7: Next Task
135
159
 
160
+ > **single-task / single-fix mode**: there is no next task. Return your report as final text and stop.
161
+
136
162
  If more tasks exist, go to Step 3.
137
163
  If all tasks complete, go to Step 8.
138
164
 
@@ -183,10 +209,12 @@ Run final quality gates:
183
209
  - **NEVER modify files outside task scope**
184
210
  - **NEVER skip quality gates**
185
211
  - **NEVER modify memory files** — that is Retrospective's responsibility
186
- - **NEVER start without plan.md** — fail-fast if missing
212
+ - **NEVER start without plan.md** — fail-fast if missing (solo mode only; single-task/single-fix get their work from the prompt)
213
+ - **NEVER edit plan.md/STATE.md or create checkpoint tags in single-task/single-fix mode** — the orchestrator owns all shared state; concurrent subagents would clobber it
187
214
 
188
215
  ## Task Execution Flow
189
216
 
217
+ ### Solo mode
190
218
  ```
191
219
  Step 0: Fail-fast validation → git checkpoint
192
220
  Step 1: Find plan.md
@@ -212,6 +240,36 @@ Tests: PASS | FAIL
212
240
  Commit: {hash}
213
241
  Acceptance met: {AC ids covered, or "N/A"}
214
242
  ```
243
+
244
+ ### single-task mode (one wave task from /frame:build)
245
+ ```
246
+ Skip Step 0 checkpoint, Step 1, Step 2 (context is in the prompt).
247
+ Do the one task: RED → GREEN → REFACTOR (or per ceremony in brief).
248
+ Run targeted test for your file(s). Do NOT commit, do NOT run full gates, do NOT touch plan.md/STATE.md.
249
+ Return:
250
+ ```
251
+ Task: {task name}
252
+ Status: DONE | FAILED | BLOCKED
253
+ Changed files: {comma-separated list}
254
+ Tests: PASS | FAIL
255
+ Acceptance met: {AC ids covered, or "N/A"}
256
+ Notes: {anything the orchestrator should know}
257
+ ```
258
+
259
+ ### single-fix mode (one findings group from /frame:fix)
260
+ ```
261
+ Skip Step 0/1/2. Apply the fix(es) from the findings brief (Claim/Evidence/Fix).
262
+ Ceremony per brief: light = direct fix + targeted test; full-TDD = RED → GREEN → REFACTOR.
263
+ Run only the targeted test for your file(s). Do NOT commit, do NOT run full gates, do NOT touch plan.md/STATE.md/review.md.
264
+ Return:
265
+ ```
266
+ Group: {file(s)}
267
+ Findings closed: {REV-ids}
268
+ Status: DONE | FAILED | BLOCKED
269
+ Changed files: {comma-separated list}
270
+ Targeted test: PASS | FAIL | none
271
+ Notes: {anything the orchestrator should know}
272
+ ```
215
273
  ```
216
274
 
217
275
  ## Success Criteria
@@ -116,6 +116,16 @@ If a task is too large (Files Changed > 3 or Complexity: high) — split it.
116
116
  | `medium` | 3-5 files or touches public APIs |
117
117
  | `high` | 5+ files, touches core logic or routing |
118
118
 
119
+ **Estimate definition:**
120
+
121
+ | Estimate | Criteria |
122
+ |----------|----------|
123
+ | `30min` | Complexity: low, 1-2 files, no new abstractions |
124
+ | `1h` | Complexity: medium, 2-3 files, or new type/interface/schema |
125
+ | `2h` | Complexity: medium, 3 files, external integration or DB change |
126
+
127
+ If a task would need more than 2h — it is not atomic enough. Split it.
128
+
119
129
  For each requirement, identify:
120
130
  - What files need to be created/modified
121
131
  - What tests need to be written
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: researcher
3
- model: sonnet
3
+ model: opus
4
4
  tools:
5
5
  - Read
6
6
  - Write
@@ -16,7 +16,7 @@ description: "Research agent. Analyzes codebase or web for alternatives and cont
16
16
 
17
17
  **Job**: Receive a scoped brief from the orchestrating command (codebase scope or web scope), conduct focused research, return findings as final text.
18
18
 
19
- > **Model**: sonnet (override via `model` in `.frame/config.json`).
19
+ > **Model**: opus.
20
20
  > **NEVER write .planning/STATE.md** — STATE.md is owned by the orchestrating command, not subagents.
21
21
 
22
22
  ## Instructions
@@ -164,7 +164,7 @@ Create `docs/specs/{feature}/review.md`:
164
164
 
165
165
  Return as final text:
166
166
  - **PASS**: "Review approved. {N} warnings (non-blocking). Ready for /frame:ship."
167
- - **FAIL**: "Review failed. {N} critical issues. Fix via /frame:build. See: docs/specs/{feature}/review.md → Action Items"
167
+ - **FAIL**: "Review failed. {N} critical issues. Fix via /frame:fix (parallel), or /frame:build for large changes. See: docs/specs/{feature}/review.md → Action Items"
168
168
 
169
169
  ## Review Checklist
170
170
 
@@ -16,11 +16,13 @@ Reads plan.md, executes tasks with TDD and quality gates. Parallelism is determi
16
16
 
17
17
  ### Step 0: Checkpoint + Update STATE.md (IN_PROGRESS)
18
18
 
19
- Create checkpoint before starting:
19
+ Create checkpoint before starting (feature-scoped tag — avoids collisions across parallel worktrees):
20
20
  ```bash
21
- git tag "frame/checkpoint/build-$(date +%Y%m%dT%H%M%S)" -m "Auto checkpoint before build phase"
21
+ git tag "frame/checkpoint/build-{feature}-$(date +%Y%m%dT%H%M%S)" -m "Auto checkpoint before build phase"
22
22
  ```
23
23
 
24
+ This is the **only** build checkpoint. Subagents spawned in Step 4 do **not** create their own tags.
25
+
24
26
  Update `.planning/STATE.md`:
25
27
  ```markdown
26
28
  ## Current Position
@@ -42,7 +44,7 @@ Read `docs/specs/{feature}/plan.md`. If not found — STOP: "plan.md not found.
42
44
  ### Step 2: Determine execution mode
43
45
 
44
46
  Check `.planning/STATE.md`:
45
- - `Status: REVIEW_FAILED` → **Fix mode**: read `docs/specs/{feature}/review.md` → Action Items, create fix tasks in plan.md under `## Fix Tasks (review {date})`, then execute using the same algorithm below. Each fix task references its review finding ID.
47
+ - `Status: REVIEW_FAILED` → **prefer `/frame:fix`** for closing review findings — it groups findings by file and fixes them in parallel without the full plan/TDD ceremony. Suggest it: "Review failed with {N} findings. Run `/frame:fix` to close them in parallel." Only continue here in **build fix-mode** when the fixes are large/architectural (findings pile into the same shared files, or require re-planning): read `docs/specs/{feature}/review.md` → Action Items, create fix tasks in plan.md under `## Fix Tasks (review {date})` **with `Files:`, `Wave:`, and a `Parallel:` label on each wave** (otherwise Step 4 can't parallelize them), then execute using the algorithm below. Each fix task references its review finding ID.
46
48
  - Normal plan → proceed with Step 3.
47
49
 
48
50
  ### Step 3: Read Context
@@ -60,6 +62,8 @@ Read before implementing:
60
62
 
61
63
  ### Step 4: Execute waves from plan.md
62
64
 
65
+ **Before any wave — confirm high-risk tasks once.** Scan the whole plan for `Risk: high` tasks. If any exist, list them and **ask the user once**: "These tasks are high-risk: {list}. Proceed with all, or hold some?" Subagents cannot ask mid-run, so all confirmation happens here, up front. Tasks you spawn later are treated as already confirmed.
66
+
63
67
  For each wave defined in plan.md:
64
68
 
65
69
  #### Wave has 1 task OR `Parallel: no`
@@ -68,22 +72,32 @@ Execute inline (sequential TDD cycle — see Step 4.1 below).
68
72
 
69
73
  #### Wave has ≥2 tasks AND `Parallel: yes`
70
74
 
71
- Launch one `builder` subagent per task, one message, `isolation: "worktree"`, max 5 concurrent.
75
+ The planner already guarantees **no two tasks in a wave touch the same file** (frame:plan.md Step A4). So parallel builders can safely share the working tree — **no worktree isolation needed** in the normal case.
76
+
77
+ Launch one `builder` subagent per task, one message, max 5 concurrent. Pass each subagent **`Mode: single-task`**.
72
78
 
73
- Each subagent receives:
74
- - Task description + Files + Acceptance criteria
75
- - Relevant conventions (from conventions.md)
76
- - Anti-patterns to avoid
77
- - Instructions: return final text with list of changed files + test status + commit hash
79
+ Each subagent receives a self-contained brief (it does NOT read memory/context itself):
80
+ - **Mode: single-task** do only this task; don't scan plan.md, don't loop, don't checkpoint, don't edit plan.md/STATE.md, don't commit
81
+ - Task description + Files + Acceptance criteria + Risk (already confirmed if high)
82
+ - Relevant conventions (extract the 3-5 applicable rules from conventions.md — don't make the agent read the file)
83
+ - Anti-patterns to avoid (the applicable ones from learnings.md)
84
+ - Instructions: implement + run the targeted test for your file(s); return final text with changed files + test status (no commit hash — orchestrator commits)
78
85
 
79
- After all subagents complete **wave quality gates**:
86
+ **Isolation exception**: only if a wave's tasks *could* still touch a shared file (e.g. a barrel/index, a config, a lock file the planner couldn't fully separate) — spawn those with `isolation: "worktree"` and, after each returns, bring its work into the current branch with `git cherry-pick {hash}` before running wave gates. Default path (file-disjoint tasks) needs none of this.
87
+
88
+ After all subagents complete → **wave commit + quality gates** (orchestrator, in the shared tree):
80
89
  ```bash
90
+ # commit each task's changes (specific files from the subagent reports)
91
+ git add {files_from_reports}
92
+ git commit -m "{type}({scope}): {wave description}"
93
+
81
94
  {quality.commands.typecheck}
82
95
  {quality.commands.test}
83
96
  {quality.commands.lint}
84
97
  ```
98
+ Then mark each completed task `[DONE]` in plan.md (orchestrator owns plan.md — subagents never touch it).
85
99
 
86
- If wave gates FAIL → retry only the failed tasks (max 2 retries). If still failing:
100
+ If wave gates FAIL → retry only the failed tasks (re-spawn single-task, max 2 retries). If still failing:
87
101
  ```bash
88
102
  git tag "frame/wave-failure-$(date +%Y%m%dT%H%M%S)"
89
103
  ```
@@ -223,6 +237,10 @@ Next step: `/frame:review`
223
237
  - **Never modify files outside the task scope** — stay within task boundaries
224
238
  - **Parallelism from plan, not flags** — plan.md `Parallel: yes/no` is the source of truth
225
239
  - **Max 5 subagents per wave** — concurrency cap
240
+ - **Shared tree by default** — file-disjoint wave tasks need no worktree; use `isolation: "worktree"` + `cherry-pick` only for the shared-file exception
241
+ - **Orchestrator owns commits, plan.md, STATE.md, checkpoints** — single-task subagents own none of these
242
+ - **Confirm high-risk once, up front** — never rely on a subagent to wait for the user
243
+ - **Review fixes → prefer `/frame:fix`** — build fix-mode is only for large/architectural changes
226
244
 
227
245
  ## Result
228
246
 
@@ -0,0 +1,190 @@
1
+ ---
2
+ description: "Close review findings in parallel — groups findings by file, spawns one fixer per non-conflicting group, single gates run at the end"
3
+ argument-hint: "[feature] [REV-N ...]"
4
+ allowed-tools: [Read, Write, Edit, Bash]
5
+ ---
6
+ # /frame:fix -- Parallel Review Fixes
7
+
8
+ Reads `review.md`, takes confirmed FAIL findings, groups them by file, and spawns one fixer subagent per non-conflicting group **in parallel, in the shared tree** (no worktrees — findings in different files never collide). Light findings skip the full TDD ceremony. One quality-gate run at the end, then a scoped re-review.
9
+
10
+ This is the fast path for "review found N small issues in N different files". For large architectural rework, use `/frame:build` fix-mode instead.
11
+
12
+ ### Routing
13
+
14
+ - (no args) — fix all confirmed FAIL findings from the current feature's `review.md`
15
+ - `{feature}` — fix findings for a specific feature
16
+ - `REV-1 REV-4 ...` — fix only the listed finding IDs
17
+
18
+ ## Instructions
19
+
20
+ ### Step 0: Find review.md + checkpoint
21
+
22
+ Determine feature from `.planning/STATE.md` (or the `{feature}` arg). Read `docs/specs/{feature}/review.md`.
23
+
24
+ If not found → **STOP**: "review.md not found. Run /frame:review first."
25
+
26
+ Create a single checkpoint (orchestrator-owned, feature-scoped to avoid collisions):
27
+ ```bash
28
+ git tag "frame/checkpoint/fix-{feature}-$(date +%Y%m%dT%H%M%S)" -m "Auto checkpoint before fix phase"
29
+ ```
30
+
31
+ ### Step 1: Select findings
32
+
33
+ From `review.md → Findings`, select findings that are **confirmed FAIL**:
34
+ - `Verified: yes` (refuted findings are skipped — they are not real)
35
+ - Severity CRITICAL / HIGH / MEDIUM (LOW findings are optional; include only if explicitly listed by ID)
36
+
37
+ If `REV-N` IDs were passed as args → restrict to those.
38
+
39
+ If nothing selected → **STOP**: "No confirmed FAIL findings to fix. Review recommendation: {approve/...}."
40
+
41
+ **Heartbeat**: "Selected {N} findings to fix across {M} files."
42
+
43
+ ### Step 2: Group by file (conflict-free batches)
44
+
45
+ Group selected findings so that **no two groups touch the same file**:
46
+ - Findings whose `File` is the same path → one group (one fixer handles them together, so two fixers never edit the same file).
47
+ - Findings in distinct files → separate groups → run in parallel.
48
+
49
+ Determine each group's ceremony level from the findings' `Effort` field:
50
+ - All findings in the group are `Effort: XS` or `S` → **light** (direct fix + targeted test, no RED-first cycle)
51
+ - Any finding is `Effort: M` or `L` → **full TDD** (RED → GREEN → REFACTOR)
52
+
53
+ If a finding has no `Effort` field, infer: single-line/local change → light; new logic or multi-function change → full TDD.
54
+
55
+ ### Step 3: Confirm risky fixes up front (before spawning)
56
+
57
+ Scan selected findings for any that touch core logic, auth, money, migrations, or routing (Severity CRITICAL on such files). If any exist → list them and **ask the user once**: "These fixes touch sensitive areas: {list}. Proceed with all, or hold some for manual review?"
58
+
59
+ Subagents cannot ask questions mid-run — all confirmation happens here, at the orchestrator level, before any fixer is spawned.
60
+
61
+ ### Step 4: Spawn fixers in parallel
62
+
63
+ Launch one `builder` subagent **per group, in a single message** (parallel), max 5 concurrent. **No `isolation: "worktree"`** — groups are file-disjoint by construction, so they share the working tree safely.
64
+
65
+ Each fixer receives a self-contained brief (it does **not** read memory/context files itself — everything it needs is in the prompt):
66
+ - **Mode**: `single-fix` (fix only what is described; do not scan plan.md, do not loop over other tasks, do not create checkpoints, do not edit plan.md/STATE.md)
67
+ - **Findings** (full): for each — `ID`, `File:line`, `Claim`, `Evidence` (code quote), `Fix` (approach), `Effort`
68
+ - **Ceremony**: light or full-TDD (from Step 2)
69
+ - **Relevant conventions**: the specific naming/type/style rules from `conventions.md` that apply to these files (orchestrator extracts and pastes them — 3-5 lines, not the whole file)
70
+ - **Anti-patterns**: any from `learnings.md` that apply to this change
71
+ - **Instructions**: apply the fix; add/adjust a targeted test only if logic changed; run `{quality.commands.test} {file}` for the touched file; do **not** run full gates (orchestrator does that once); do **not** commit (orchestrator commits); return the final report
72
+
73
+ Each fixer returns:
74
+ ```
75
+ Group: {file(s)}
76
+ Findings closed: {REV-ids}
77
+ Status: DONE | FAILED | BLOCKED
78
+ Changed files: {list}
79
+ Targeted test: PASS | FAIL | none
80
+ Notes: {anything the orchestrator should know}
81
+ ```
82
+
83
+ **Heartbeat**: "Spawned {M} fixers, waiting for completion..."
84
+
85
+ ### Step 5: One quality-gate run
86
+
87
+ After **all** fixers return, run full gates once in the shared tree:
88
+ ```bash
89
+ {quality.commands.typecheck}
90
+ {quality.commands.test}
91
+ {quality.commands.lint}
92
+ ```
93
+
94
+ **D-step**: all must pass.
95
+
96
+ If gates FAIL → identify which group's change caused it (from the error location), re-spawn only that fixer with the error output (max 2 retries). If still failing:
97
+ ```bash
98
+ git tag "frame/fix-failure-$(date +%Y%m%dT%H%M%S)"
99
+ ```
100
+ Report to the user, do **not** roll back the passing fixes. Stop.
101
+
102
+ ### Step 6: Commit
103
+
104
+ Commit the fixes (orchestrator-owned). Prefer one commit that references all closed findings:
105
+ ```bash
106
+ git add {specific_files}
107
+ git commit -m "fix(review): close {REV-ids}"
108
+ ```
109
+ If the groups are logically distinct, one commit per group is also fine. **Never `git add -A`** — add only the files the fixers changed.
110
+
111
+ Mark each closed finding in `review.md`:
112
+ ```markdown
113
+ ### [REV-1] {Title} [FIXED]
114
+ ```
115
+
116
+ ### Step 7: Scoped re-review
117
+
118
+ Re-verify only the categories whose findings were fixed (same idea as `/frame:review audit` — don't re-run the whole panel).
119
+
120
+ For each closed finding, launch the matching panel agent on the **new** diff to confirm the issue is gone:
121
+
122
+ | Finding category | Re-review agent |
123
+ |------------------|-----------------|
124
+ | Spec / architecture | reviewer |
125
+ | Security | security |
126
+ | Performance | performance-auditor |
127
+ | Business logic | devils-advocate |
128
+ | Tests | tests-reviewer |
129
+ | Conventions | conventions-reviewer |
130
+
131
+ Launch the needed agents in one message (parallel). Each confirms: is `REV-N` actually resolved in the diff? Return `RESOLVED | STILL_OPEN` per finding.
132
+
133
+ Any `STILL_OPEN` → note it, keep the `[FIXED]` mark off that finding, report to user.
134
+
135
+ ### Step 8: Update STATE.md + report
136
+
137
+ **If all findings RESOLVED**:
138
+ ```markdown
139
+ ## Current Position
140
+ - Phase: REVIEW
141
+ - Feature: {feature}
142
+ - Status: Review complete, ready to ship
143
+ - Review: docs/specs/{feature}/review.md
144
+ ```
145
+ ```
146
+ ✅ Fixed {N} findings across {M} files ({parallel} in parallel). Gates green, re-review clean.
147
+ → /frame:ship
148
+ ```
149
+
150
+ **If any STILL_OPEN**:
151
+ ```markdown
152
+ ## Current Position
153
+ - Phase: BUILD
154
+ - Feature: {feature}
155
+ - Status: REVIEW_FAILED
156
+ - Review: docs/specs/{feature}/review.md
157
+ - Remaining: {list of STILL_OPEN ids}
158
+ ```
159
+ ```
160
+ ⚠️ Closed {X}/{N} findings. Remaining: {ids} — need manual attention or /frame:build.
161
+ ```
162
+
163
+ ---
164
+
165
+ ## When to use
166
+
167
+ - `/frame:review` came back with **request changes** and the findings are localized edits in distinct files.
168
+ - You want the fixes done in one parallel pass instead of a sequential build cycle.
169
+
170
+ **Not for**: fixes that require re-architecting, cross-cutting changes touching many shared files, or anything where findings pile into the same 1-2 files (no parallelism to gain — use `/frame:build` fix-mode).
171
+
172
+ ## Rules
173
+
174
+ - **Confirmed FAIL only** — never act on refuted findings
175
+ - **File-disjoint groups** — one file is owned by exactly one fixer; no worktrees needed
176
+ - **Light findings skip TDD** — Effort XS/S get a direct fix; M/L keep full TDD
177
+ - **Subagents don't self-read context** — the orchestrator packs conventions/anti-patterns into the brief
178
+ - **Subagents don't commit or run full gates** — orchestrator does both, once
179
+ - **Confirmation before spawn** — sensitive fixes are cleared with the user up front, never mid-run
180
+ - **Specific files only** — never `git add -A`
181
+ - **Scoped re-review** — only re-run the categories that were fixed
182
+
183
+ ## Result
184
+
185
+ - Confirmed FAIL findings closed in parallel
186
+ - One quality-gate run, all green
187
+ - Fixes committed with finding references
188
+ - Findings marked `[FIXED]` in review.md
189
+ - Scoped re-review confirms resolution
190
+ - `.planning/STATE.md` updated (ready to ship, or remaining list)
@@ -83,6 +83,16 @@ If task too large (>3 files or Complexity: high) — split it.
83
83
  | `medium` | 3–5 files or touches public APIs |
84
84
  | `high` | 5+ files, touches core logic or routing |
85
85
 
86
+ **Estimate definition**:
87
+
88
+ | Estimate | Criteria |
89
+ |----------|----------|
90
+ | `30min` | Complexity: low, 1–2 files, no new abstractions |
91
+ | `1h` | Complexity: medium, 2–3 files, or new type/interface/schema |
92
+ | `2h` | Complexity: medium, 3 files, external integration or DB change |
93
+
94
+ If a task would need more than 2h — it is not atomic. Split it.
95
+
86
96
  Each task gets:
87
97
  - `Acceptance: AC2, AC5` — which ACs it covers
88
98
  - `Findings: ` — empty for feature tasks (used in Mode B)
@@ -111,11 +111,17 @@ Launch all panel agents in one message (parallel). Each receives:
111
111
 
112
112
  ### Step 4: Verification pass
113
113
 
114
- For each **FAIL** finding from the panel:
115
- 1. Open the referenced file at the given line
116
- 2. Attempt to refute the finding: is there validation higher in the stack? Is the condition reachable? Is this a test file?
117
- 3. **Not refuted** `Verified: yes` — confirmed FAIL
118
- 4. **Refuted** downgrade to WARN with note `unverifiedsee appendix`
114
+ Verify **FAIL** findings adversarially, in parallel — launch `devils-advocate` subagents in refute mode, **batches of ≤5** (same pattern as `/frame:audit` Step 3). Each subagent receives one finding + the referenced file content, and tries to refute it:
115
+ - Is there validation higher in the stack?
116
+ - Is the condition reachable?
117
+ - Is this a test/example file?
118
+ - Output: `{ refuted: boolean, reason: string }` — default `refuted: false` unless there is concrete evidence.
119
+
120
+ Then:
121
+ - **Not refuted** → `Verified: yes` — confirmed FAIL
122
+ - **Refuted** → downgrade to WARN with note `unverified — see appendix`
123
+
124
+ If there are ≤2 FAIL findings, verifying inline (without subagents) is fine — the parallel path is for larger batches.
119
125
 
120
126
  Confirmed FAIL findings block ship.
121
127
 
@@ -173,7 +179,7 @@ Base: {BASE commit or tag}
173
179
  approve | request changes
174
180
 
175
181
  ## Action Items
176
- {For each FAIL finding — numbered, actionable. Build fix-mode reads this section.}
182
+ {For each FAIL finding — numbered, actionable. `/frame:fix` (and build fix-mode) read this section. Each item should carry its finding's File and Effort so the fixer can group and scope the work.}
177
183
  1. [REV-1] Fix {issue} in {file}:{line}
178
184
  2. ...
179
185
 
@@ -211,7 +217,7 @@ approve | request changes
211
217
  ```
212
218
  ❌ Review failed. {N} critical issues.
213
219
  Fixes: docs/specs/{feature}/review.md → Action Items
214
- Run /frame:build to fix.
220
+ Run /frame:fix to close them in parallel (or /frame:build for large/architectural changes).
215
221
  ```
216
222
 
217
223
  ---