Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Commit 53f0427

Browse files
z23ccclaude
andcommitted
refactor: flatten phase/step numbering to sequential integers
- Worker phases: 0→1, 1→2, 1.5→3, 2a→4, 2→5, 2.5→6, 3→7, 4→8, 5c→9, 5→10, 5b→11, 6→12 - Plan steps: 0→1, 0.5→2, 0.6→3, 1→4, 1a→5, 1b→6, 2→7, 3→8, 4→9, 5→10, 5.5→11, 6→12, 6b→13, 7→14, 8→15 - Work orchestrator: Phase 1→Step 1, Phase 2→Step 2, 3a-3j→Steps 3-14, Phase 4→Step 15, Phase 5→Step 16 - Added migrate_phase_id() for backward-compat with old SQLite phase progress - Updated all cross-references in markdown and codex mirrors Tasks: fn-104.1 (Rust), fn-104.4 (Plan), fn-104.5 (Work) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6461794 commit 53f0427

12 files changed

Lines changed: 235 additions & 210 deletions

File tree

codex/skills/flow-code-plan/SKILL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,20 @@ Research: repo-scout + rp(<mcp|cli|scout-fallback>) | Depth: <short|standard|dee
104104
### Explicit flag overrides
105105

106106
These flags override the corresponding AI decision without entering the analysis flow:
107-
- `--research=rp|grep`, `--depth=short|standard|deep`, `--review=rp|codex|export|none`, `--plan-only`, `--no-capability-scan` (skip capability-scout in Step 1)
108-
- `--interactive`**opt-in** interview refinement. Before Context Analysis, invoke `/flow-code:interview` with the raw request text. The interview returns refined-spec markdown (Problem / Scope / Acceptance / Open Questions). Use that refined text as the effective request for Context Analysis and Step 1. When this flag is NOT passed, the plan flow is unchanged and the zero-interaction default (AGENTS.md:99) is preserved. There is intentionally no auto-trigger heuristic and no `--no-interview` flag — interview is opt-in only.
107+
- `--research=rp|grep`, `--depth=short|standard|deep`, `--review=rp|codex|export|none`, `--plan-only`, `--no-capability-scan` (skip capability-scout in Step 4)
108+
- `--interactive`**opt-in** interview refinement. Before Context Analysis, invoke `/flow-code:interview` with the raw request text. The interview returns refined-spec markdown (Problem / Scope / Acceptance / Open Questions). Use that refined text as the effective request for Context Analysis and Step 4. When this flag is NOT passed, the plan flow is unchanged and the zero-interaction default (AGENTS.md:99) is preserved. There is intentionally no auto-trigger heuristic and no `--no-interview` flag — interview is opt-in only.
109109

110-
Proceed to Step 1 immediately.
110+
Proceed to Step 4 immediately.
111111

112112
## Workflow
113113

114114
Read [steps.md](steps.md) and follow each step in order.
115115

116-
**CRITICAL — Step 1 (Research)**: You MUST launch ALL scouts listed in steps.md in ONE parallel Task call. Do NOT skip scouts or run them sequentially. Each scout provides unique signal.
116+
**CRITICAL — Step 4 (Research)**: You MUST launch ALL scouts listed in steps.md in ONE parallel Task call. Do NOT skip scouts or run them sequentially. Each scout provides unique signal.
117117

118118
If review was decided (rp/codex/export):
119-
- rp or codex: run `/flow-code:plan-review` after Step 4, fix issues until it passes
120-
- export: run `/flow-code:plan-review` with export mode after Step 4
119+
- rp or codex: run `/flow-code:plan-review` after Step 9, fix issues until it passes
120+
- export: run `/flow-code:plan-review` with export mode after Step 9
121121

122122
## Output
123123

@@ -135,9 +135,9 @@ All plans go into `.flow/`:
135135

136136
## Auto-Execute
137137

138-
**Steps.md Step 8 handles auto-execution.** After steps complete:
139-
- Default: `/flow-code:work <epic-id> --no-review` invoked automatically (Step 8)
140-
- `--plan-only`: shows plan summary and stops (Step 8)
138+
**Steps.md Step 15 handles auto-execution.** After steps complete:
139+
- Default: `/flow-code:work <epic-id> --no-review` invoked automatically (Step 15)
140+
- `--plan-only`: shows plan summary and stops (Step 15)
141141

142142
**After work completes** (if auto-executed):
143143
- All tasks done → Layer 3 adversarial review runs automatically (Phase 3j)

codex/skills/flow-code-plan/steps.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Flow Plan Steps
22

3-
**IMPORTANT**: Steps 1-3 (research, gap analysis, depth) ALWAYS run regardless of input type.
3+
**IMPORTANT**: Steps 4-9 (research, gap analysis, depth) ALWAYS run regardless of input type.
44

55
**CRITICAL**: If you are about to create:
66
- a markdown TODO list,
@@ -34,7 +34,7 @@ Use **T-shirt sizes** based on observable metrics — not token estimates (model
3434

3535
**Rules**: Combine sequential S tasks into one M. Split L tasks into M tasks. If 7+ tasks, look for over-splitting. Minimize file overlap between tasks for parallel work — list expected files in `**Files:**`, use `flowctl dep add` when tasks must share files.
3636

37-
## Step 0: Initialize .flow
37+
## Step 1: Initialize .flow
3838

3939
**CRITICAL: flowctl is BUNDLED — NOT installed globally.** `which flowctl` will fail (expected). Always use:
4040

@@ -46,11 +46,11 @@ FLOWCTL="$HOME/.flow/bin/flowctl"
4646
$FLOWCTL init --json
4747
```
4848

49-
> **Note — opt-in interactive refinement:** If the user passed `--interactive`, BEFORE running Step 0 (Context Analysis in SKILL.md), invoke `/flow-code:interview` with the raw request text. The interview returns refined-spec markdown with Problem / Scope / Acceptance / Open Questions sections; use that refined text as the effective request for Context Analysis and all subsequent steps. Without the flag, skip this entirely — Step 0.5 below remains an automated internal brainstorm and is **not** interactive. Do not add any auto-trigger heuristic (length, punctuation, verb detection); interview must be opt-in only to preserve the zero-interaction contract (AGENTS.md:99).
49+
> **Note — opt-in interactive refinement:** If the user passed `--interactive`, BEFORE running Step 1 (Context Analysis in SKILL.md), invoke `/flow-code:interview` with the raw request text. The interview returns refined-spec markdown with Problem / Scope / Acceptance / Open Questions sections; use that refined text as the effective request for Context Analysis and all subsequent steps. Without the flag, skip this entirely — Step 2 below remains an automated internal brainstorm and is **not** interactive. Do not add any auto-trigger heuristic (length, punctuation, verb detection); interview must be opt-in only to preserve the zero-interaction contract (AGENTS.md:99).
5050
51-
## Step 0.5: Clarity Check (auto — no human input)
51+
## Step 2: Clarity Check (auto — no human input)
5252

53-
**Clear?** (specific behavior, bug with repro, existing pattern, has acceptance criteria) → skip to Step 1.
53+
**Clear?** (specific behavior, bug with repro, existing pattern, has acceptance criteria) → skip to Step 4.
5454

5555
**Ambiguous?** (vague goal, multiple valid approaches, missing who/what/why, unclear scope) → mini brainstorm:
5656

@@ -59,7 +59,7 @@ $FLOWCTL init --json
5959
3. Pick best by: blast radius, value/effort, codebase alignment
6060
4. Output: `Clarified: "<original>" → "<specific target>" | Approach: <A|B|C> — <why>`
6161

62-
## Step 1: Fast research (parallel)
62+
## Step 4: Fast research (parallel)
6363

6464
**If input is a Flow ID** (fn-N-slug or fn-N-slug.M, including legacy fn-N/fn-N-xxx): First fetch it with `$FLOWCTL show <id> --json` and `$FLOWCTL cat <id>` to get the request context.
6565

@@ -103,9 +103,9 @@ Must capture:
103103
- Architecture patterns and data flow
104104
- Epic dependencies (from epic-scout)
105105
- Doc updates needed (from docs-gap-scout) - add to task acceptance criteria
106-
- Capability gaps (from capability-scout) - persist in Step 5 (see below)
106+
- Capability gaps (from capability-scout) - persist in Step 10 (see below)
107107

108-
### Step 1a: Deep context via RP (after repo-scout)
108+
### Step 5: Deep context via RP (after repo-scout)
109109

110110
After repo-scout returns, gather deep codebase context using the best available RP tier. **Exactly one RP-powered call per plan run** — do not call both context_builder and context-scout.
111111

@@ -130,7 +130,7 @@ Run `context-scout` as a subagent (existing behavior, unchanged). This is the pr
130130

131131
Feed RP/context-scout findings into the epic spec alongside repo-scout findings.
132132

133-
## Step 1b: Apply memory lessons (if memory.enabled)
133+
## Step 6: Apply memory lessons (if memory.enabled)
134134

135135
**Skip if memory.enabled is false.**
136136

@@ -158,7 +158,7 @@ $FLOWCTL memory search "<keyword matching this plan's domain>"
158158
- If a past decision conflicts with the current plan, note it as an explicit "supersedes decision #N" in the epic spec
159159
- 0-3 applied entries per plan is normal
160160

161-
## Step 2: Stakeholder & scope check
161+
## Step 7: Stakeholder & scope check
162162

163163
Before diving into gaps, identify who's affected:
164164
- **End users** — What changes for them? New UI, changed behavior?
@@ -167,13 +167,13 @@ Before diving into gaps, identify who's affected:
167167

168168
This shapes what the plan needs to cover.
169169

170-
## Step 3: Flow gap check
170+
## Step 8: Flow gap check
171171

172172
Run gap analyst subagent: `flow-code:flow-gap-analyst(<request>, research_findings)`. Fold gaps into the plan.
173173

174-
**After epic is created (Step 5):** Register gaps via `$FLOWCTL gap add --epic <id> --capability "<desc>" --priority required|important|nice-to-have --source flow-gap-analyst --json`. Priority mapping: "MUST answer" → required, high-impact edge cases → important, deferrable → nice-to-have.
174+
**After epic is created (Step 10):** Register gaps via `$FLOWCTL gap add --epic <id> --capability "<desc>" --priority required|important|nice-to-have --source flow-gap-analyst --json`. Priority mapping: "MUST answer" → required, high-impact edge cases → important, deferrable → nice-to-have.
175175

176-
## Step 4: Pick depth
176+
## Step 9: Pick depth
177177

178178
Default to standard unless complexity demands more or less.
179179

@@ -200,7 +200,7 @@ Default to standard unless complexity demands more or less.
200200
- Docs + metrics
201201
- Risks + mitigations
202202

203-
## Step 5: Write to .flow
203+
## Step 10: Write to .flow
204204

205205
**Efficiency note**: Use stdin (`--file -`) with heredocs to avoid temp files. Use `task spec` to set description + acceptance in one call.
206206

@@ -332,7 +332,7 @@ Default to standard unless complexity demands more or less.
332332
- Max 5-7 targets per task — enough to ground the worker, not so many it wastes context
333333
- Use exact file paths with optional line ranges (e.g., `src/auth.ts:23-45`)
334334
- **Required** = must read before implementing. **Optional** = helpful reference
335-
- Auto-populated from repo-scout/context-scout findings in Step 1 research
335+
- Auto-populated from repo-scout/context-scout findings in Step 4 research
336336
- If no relevant files found by scouts, leave the section empty (worker skips Phase 1.5)
337337
338338
**Layer field**: If stack config is set, tag each task with its primary layer. This helps the worker select the right guard commands (e.g., `pytest` for backend, `pnpm test` for frontend). Full-stack tasks run all guards.
@@ -356,7 +356,7 @@ Default to standard unless complexity demands more or less.
356356
$FLOWCTL cat <epic-id>
357357
```
358358
359-
## Step 5.5: Write capability-gaps.md (if capability-scout ran)
359+
## Step 11: Write capability-gaps.md (if capability-scout ran)
360360
361361
**Skip if `--no-capability-scan` was passed, or capability-scout was not run, or scout errored (fails open).**
362362
@@ -384,26 +384,26 @@ $FLOWCTL gap add --epic <epic-id> \
384384

385385
`important` and `nice-to-have` gaps are recorded in the markdown file only — not in the gap registry (don't over-fill with noise).
386386

387-
## Step 6: Validate
387+
## Step 12: Validate
388388

389389
```bash
390390
$FLOWCTL validate --epic <epic-id> --json
391391
```
392392

393393
Fix any errors before proceeding.
394394

395-
### Step 6b: Auto-Extract Acceptance Checklist
395+
### Step 13: Auto-Extract Acceptance Checklist
396396

397397
After validation, generate `.flow/checklists/<epic-id>.json` by parsing `## Acceptance` sections from epic + task specs. Each `- [ ]` line becomes a checklist item with `source` (epic or task ID) and `status: "pending"`. Skip if no acceptance criteria found. Commit with the plan (`git add .flow/checklists/`). Consumed by `/flow-code:epic-review`.
398398

399-
## Step 7: Review (if chosen at start)
399+
## Step 14: Review (if chosen at start)
400400

401401
If review was decided in Context Analysis:
402402
1. Initialize `PLAN_REVIEW_ITERATIONS=0`
403403
2. Invoke `/flow-code:plan-review` with the epic ID
404404
3. If review returns "Needs Work" or "Major Rethink":
405405
- Increment `PLAN_REVIEW_ITERATIONS`
406-
- **If `PLAN_REVIEW_ITERATIONS >= 2`**: stop the loop. Log: "Plan review: 2 iterations completed. Proceeding." Go to Step 8.
406+
- **If `PLAN_REVIEW_ITERATIONS >= 2`**: stop the loop. Log: "Plan review: 2 iterations completed. Proceeding." Go to Step 15.
407407
- **Re-anchor EVERY iteration** (do not skip):
408408
```bash
409409
$FLOWCTL show <epic-id> --json
@@ -417,7 +417,7 @@ If review was decided in Context Analysis:
417417

418418
**Why re-anchor every iteration?** Per Anthropic's long-running agent guidance: context compresses, you forget details. Re-read before each fix pass.
419419
420-
## Step 8: Execute or Offer next steps
420+
## Step 15: Execute or Offer next steps
421421
422422
**If `--plan-only`**: print `Plan created: <epic-id> (N tasks) | Next: /flow-code:work <epic-id>` and stop.
423423

codex/skills/flow-code-work/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ REVIEW_BACKEND=$($FLOWCTL review-backend)
6969
Based on context, decide:
7070
- **Branch**: on feature branch → stay (`current`). on main/master → create worktree (`worktree`). dirty working tree → `current`.
7171
- **Per-task review**: `none` by default. Three-layer quality system handles review at the right levels:
72-
- Layer 1 (guard): runs per-commit in worker Phase 2.5 — always on
73-
- Layer 3 (codex adversarial): runs at epic completion in Phase 3j — auto-detects codex CLI
72+
- Layer 1 (guard): runs per-commit in Worker Phase 6 — always on
73+
- Layer 3 (codex adversarial): runs at epic completion in Step 14 — auto-detects codex CLI
7474
- Per-task Codex/RP review only if explicitly requested via `--review=rp|codex`
7575

7676
Output one line:

0 commit comments

Comments
 (0)