From 66bc0da3f8bdfe27b1be730841b1552450f49a11 Mon Sep 17 00:00:00 2001 From: egerev Date: Thu, 11 Jun 2026 13:06:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20v5.5.0=20=E2=80=94=20hybrid=20Workf?= =?UTF-8?q?low=20acceleration=20+=20/goal=20watchdog=20for=20Phase=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opt-in saved workflows (deployed to ~/.claude/workflows/ via checksum sync): - /superflow-review: unified review fan-out (product + technical in parallel, fenced-JSON verdicts, fail-closed parsing, light-mode product:false, codex runs inside the sprint worktree via workdir arg) - /superflow-wave: implementation-only parallel wave; orchestrator keeps review/docs/PAR/ship per sprint references/workflow-orchestration.md is the single Workflow authority: documented API surface, opt-in policy, permission gates by mode, limits, runtime conventions verified by live smoke runs (top-level body, parallel(thunks), meta pure literal, args may arrive as a JSON string), undocumented-API warning, /goal watchdog, Codex fallback chain. Integration: context.use_workflows opt-in at Phase 1 plan approval (state + charter); /goal ready-to-paste suggestion at Phase 2 launch (user-only command, honestly documented); provider enum gains workflow-review; Codex runtime unaffected (no Workflow tool, no /goal — existing spawn_agent paths). Verification: live smoke runs of both scripts (fail-closed path: 0 agents/12ms; full pipeline: 1 agent, parsed position-bound result); DAG verify 33/33; dual review -> fixes -> scoped re-review APPROVE. Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 17 ++ CLAUDE.md | 18 +- README.md | 4 +- SKILL.md | 8 +- llms.txt | 24 ++- references/codex/phase2-execution.md | 1 + references/phase1-discovery.md | 8 + references/phase2/overview.md | 21 +++ references/phase2/steps/impl-dispatch.md | 18 ++ references/phase2/steps/par-evidence.md | 10 +- references/phase2/steps/review-unified.md | 30 ++++ references/workflow-orchestration.md | 202 ++++++++++++++++++++++ superflow-enforcement.md | 4 +- templates/superflow-state-schema.json | 5 + workflows/superflow-review.js | 143 +++++++++++++++ workflows/superflow-wave.js | 96 ++++++++++ 16 files changed, 589 insertions(+), 20 deletions(-) create mode 100644 references/workflow-orchestration.md create mode 100644 workflows/superflow-review.js create mode 100644 workflows/superflow-wave.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 242df88..6c92bce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ All notable changes to superflow will be documented in this file. +## [5.5.0] - 2026-06-11 + +### Added — Hybrid Workflow Acceleration (opt-in) +- **`references/workflow-orchestration.md`** (202 lines): single authority on Workflow-tool usage inside Superflow — documented facts only (JS script orchestrating subagents in the background, Claude Code ≥ 2.1.154, intermediate results live in script variables, not orchestrator context), opt-in policy with the verbatim plan-approval wording, permission gates table (default: every run; Auto: first launch only; bypass/`-p`/SDK: never) with the Auto-mode recommendation for Phase 2, limits (16 concurrent / 1,000 total / no mid-run input / no script fs-shell access), saved-workflow locations and `/name` invocation, full specs of both saved workflows, the UNDOCUMENTED-API warning, the `/goal` watchdog section, and the Codex/fallback chain. Step files point here instead of re-explaining +- **Two saved workflow scripts** in `workflows/`, deployed via checksum sync to `~/.claude/workflows/` at startup (SKILL.md step 4, Claude runtime only, `mkdir -p ~/.claude/workflows`) — invocable as `/superflow-review` and `/superflow-wave` in any project: + - `workflows/superflow-review.js` (143 lines): unified review fan-out — parallel product reviewer (follows `standard-product-reviewer.md` + charter) and technical reviewer (applies the codex-exec-or-Claude fallback chain itself via Bash); returns `{product, technical, pass}` where `pass` requires both verdicts in APPROVE/ACCEPTED/PASS + - `workflows/superflow-wave.js` (96 lines): implementation-only wave (v5.4.0 parallel-wave dispatch rule: implementation-only fan-out; orchestrator runs review/docs/PAR/ship per sprint) — one implementer agent per sprint, worktree-isolated, no review/docs/PAR/PR; returns position-bound `[{sprint, status: "done"|"failed", summary, test_evidence}]`; the orchestrator still runs review → docs → PAR → ship per sprint afterwards + - Both: documented API surface only (`agent`, `parallel`, `phase`, `log`, `args`), `export const meta`, LAST-fenced-json extraction via regex + `JSON.parse` in try/catch, FAIL CLOSED on any parse failure or null result (REQUEST_CHANGES / `status: "failed"`), no clock or randomness calls (orchestrator stamps timestamps) +- **`context.use_workflows` opt-in**: Phase 1 Step 12 plan-approval summary states the workflows opt-in verbatim (incl. the permission-prompt heads-up and the "no-workflows" objection path); the decision is recorded post-approval in `.superflow-state.json` (`context.use_workflows`, boolean, default true; always false on Codex runtime) and in the Autonomy Charter YAML beside `model_profile`. State schema extended accordingly. The recorded opt-in is what justifies the orchestrator invoking saved workflows in Phase 2 +- **`/goal` watchdog suggestion**: at Phase 2 launch the orchestrator PRINTS a ready-to-paste `/goal Superflow Phase 2 complete: all sprints implemented, unified-reviewed, PRs created and CI-green, Completion Report delivered.` template (`references/phase2/overview.md` § Phase 2 Launch). `/goal` is user-only — the model cannot set it; the evaluator (Haiku, prompt-based Stop hook) judges only the transcript; one goal per session, survives `--resume`, cleared with `/goal clear`; subagents do NOT inherit goals — charter injection remains the per-sprint alignment mechanism +- **`workflow-review` provider**: `.par-evidence.json` provider enum extended to `codex|code-review-skill|split-focus|workflow-review` (enforcement Rule 3 step 7, `par-evidence.md`); workflow returns arrive pre-extracted — skip `extract_verdict` and assemble evidence from `{product, technical, pass}` directly + +### Notes +- **Hybrid, not a rewrite**: the markdown DAG and Agent-based dispatch remain the default path. Workflows accelerate exactly two Phase 2 spots — unified review fan-out (`review-unified.md`) and parallel implementation waves (`impl-dispatch.md`) — both presented as PREFERRED-WHEN-AVAILABLE with explicit fallback to the v5.4.0 Agent flow (no behavior change) +- **Codex runtime unaffected**: no Workflow tool, no `/goal` — Codex ignores `context.use_workflows` and keeps the spawn_agent paths (new Critical Codex Difference #6 in `references/codex/phase2-execution.md`) +- **Documented-API-only scripts**: shipped workflow scripts never use undocumented fields (`schema`, `agentType`, `isolation`, `resume-run-id` — observed in some builds, absent from official docs); structured data returns ONLY via the v5.4.0 fenced-JSON verdict contract with fail-closed parsing + ## [5.4.0] - 2026-06-11 ### Fixed — Critical diff --git a/CLAUDE.md b/CLAUDE.md index b3ee725..7639775 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,7 +1,7 @@ # Superflow — Claude Instructions ## Project Overview -Superflow is a pure Markdown skill that orchestrates a 4-phase dev workflow: onboarding, product discovery with expert panel brainstorming, Product Vision alignment, and git workflow selection, autonomous execution with a selected branch/PR strategy, and merge. v5.4.0, MIT License. Supports both **Claude Code** and **Codex CLI** as primary orchestrator (auto-detected at startup via `$CLAUDE_CODE_SESSION_ID`). +Superflow is a pure Markdown skill that orchestrates a 4-phase dev workflow: onboarding, product discovery with expert panel brainstorming, Product Vision alignment, and git workflow selection, autonomous execution with a selected branch/PR strategy, and merge. v5.5.0, MIT License. Supports both **Claude Code** and **Codex CLI** as primary orchestrator (auto-detected at startup via `$CLAUDE_CODE_SESSION_ID`). ## Key Rules - All documentation output in English — user communication follows their language preference @@ -12,7 +12,7 @@ Superflow is a pure Markdown skill that orchestrates a 4-phase dev workflow: onb ## Architecture ``` -SKILL.md (entry point, ~260 lines, 10-step startup checklist, auto-detects Claude/Codex runtime) +SKILL.md (entry point, ~280 lines, 10-step startup checklist, auto-detects Claude/Codex runtime) ├── superflow-enforcement.md (durable rules → ~/.claude/rules/, checksum-synced at startup) ├── codex/ │ ├── AGENTS.md (durable rules for Codex → ~/.codex/AGENTS.md) @@ -38,7 +38,8 @@ SKILL.md (entry point, ~260 lines, 10-step startup checklist, auto-detects Claud │ │ ├── workflow.json (DAG: 9-cell governance×complexity decision matrix + 7 stages + step_files map) │ │ ├── overview.md (Phase 2 high-level context, wave analysis, model selection) │ │ └── steps/ (10 step detail files: setup-reread, setup-worktree, impl-dispatch, review-unified, par-evidence, ship-pr, compaction-recovery, holistic-review, frontend-testing, completion-report) - │ └── phase3-merge.md (user-initiated merge, 3 stages) + │ ├── phase3-merge.md (user-initiated merge, 3 stages) + │ └── workflow-orchestration.md (single Workflow authority — opt-in policy, permission gates, limits, saved workflow specs, /goal watchdog, fallbacks) ├── prompts/ │ ├── implementer.md (TDD code agent) │ ├── expert-panel.md (expert persona prompt for brainstorming) @@ -52,6 +53,9 @@ SKILL.md (entry point, ~260 lines, 10-step startup checklist, auto-detects Claud │ ├── claude/ (Claude secondary prompts for Codex runtime: audit, code-reviewer, product-reviewer) │ └── codex/ (Codex-specific prompts: code-reviewer, product-reviewer, audit) ├── agents/ (12 agent definitions — deep/standard/fast tiers with model+effort frontmatter) + ├── workflows/ + │ ├── superflow-review.js (saved workflow: parallel product + technical review fan-out → ~/.claude/workflows/) + │ └── superflow-wave.js (saved workflow: implementation-only parallel sprint wave → ~/.claude/workflows/) ├── tools/ │ ├── sf-emit.sh (JSONL event emission library) │ ├── verify-phase2-dag.sh (static DAG verifier) @@ -88,6 +92,9 @@ SKILL.md (entry point, ~260 lines, 10-step startup checklist, auto-detects Claud | `references/phase2-execution.md` | Legacy router (~39 lines) — points at `references/phase2/workflow.json`, `overview.md`, and `steps/`; full prose preserved in git history (pre-Sprint-2) | | `references/phase2/workflow.json` | Phase 2 lifecycle DAG with governance×complexity decision matrix | | `references/phase3-merge.md` | 3 stages, sequential rebase merge with CI gate | +| `references/workflow-orchestration.md` | Single authority on Workflow-tool usage — documented API surface, opt-in policy, permission gates by mode, limits, saved workflow specs, UNDOCUMENTED-API warning, /goal watchdog, Codex/fallback chain (178 lines) | +| `workflows/superflow-review.js` | Saved `/superflow-review` workflow — parallel product + technical reviewers (technical applies the codex-or-Claude fallback chain itself via Bash); returns `{product, technical, pass}`, fail-closed fenced-JSON parsing (112 lines) | +| `workflows/superflow-wave.js` | Saved `/superflow-wave` workflow — one implementer per sprint (worktree-isolated, implementation only, no review/docs/PAR/PR); returns position-bound `[{sprint, status, summary, test_evidence}]`, fail-closed (97 lines) | | `prompts/implementer.md` | Red-Green-Refactor TDD cycle for code agents | | `prompts/expert-panel.md` | Expert persona prompt — proposals, challenge, recommendation | | `prompts/llms-txt-writer.md` | llmstxt.org standard, no hard size limit | @@ -108,7 +115,7 @@ SKILL.md (entry point, ~260 lines, 10-step startup checklist, auto-detects Claud - Both ` -Select the model tier for deep judgment roles (spec/code/product reviewers + deep-analyst) used throughout autonomous execution: +There is no model-profile question to ask. **Fable access is blocked**, so model assignment is fixed +for every run and depth is differentiated by *effort*, not by model: -- **frontier** (default): deep reviewers + deep-analyst use `model: "fable"`; Codex-runtime Claude secondary uses `claude-fable-5`. Best review quality; frontier-model token pricing. -- **balanced**: deep reviewers + deep-analyst use `model: "opus"`; Codex-runtime Claude secondary uses `claude-opus-4-8`. Strong review quality; significantly cheaper for long multi-sprint runs. +- deep judgment roles (spec/code/product reviewers + `deep-analyst`) → **Opus**, effort `max` +- standard reviewers + doc-writers → **Opus**, effort `high` +- implementers → **Sonnet** (`deep`/`standard`/`fast` = effort `max`/`high`/`low`) -All other roles are identical in both profiles (standard reviewers + doc-writers → opus, implementers → sonnet, fast → sonnet). - -Present the recommendation: -> "Model profile for this run: **frontier** (fable — best review quality, frontier-model pricing) or **balanced** (Opus 4.8 — strong quality, lower cost, recommended for 3+ sprint runs). Use frontier? (yes / switch to balanced)" - -Default to **frontier** if the user says "do what you recommend". Wait for confirmation. Store the selected profile in `.superflow-state.json`: -```bash -python3 -c "import json,datetime; s=json.load(open('.superflow-state.json')); s.setdefault('context',{})['model_profile']='PROFILE'; s['last_updated']=datetime.datetime.now(datetime.timezone.utc).isoformat(); json.dump(s,open('.superflow-state.json','w'),indent=2)" -``` -Replace `PROFILE` with `frontier` or `balanced`. +Nothing to ask or persist here — proceed to the next step. ### Light Mode Sprint Breakdown @@ -592,7 +585,6 @@ Present the complete plan overview: - Sprint breakdown with task counts and complexity tags - Key files touched per sprint - Selected git workflow mode and why it fits this task -- **Selected model profile** (frontier=fable / balanced=opus-4.8) — can still be changed here before execution starts (e.g. "switch to balanced") - **Workflows opt-in** (Claude runtime only — omit this line on Codex runtime). State verbatim: "Autonomous execution will use saved multi-agent workflows for review fan-out and parallel waves (recommended). Heads-up: depending on permission mode, the FIRST workflow launch may show one approval prompt (Auto mode: first launch only; default mode: every launch — consider switching to Auto for Phase 2). Say no-workflows to use plain subagent dispatch." User objection ("no-workflows") → `use_workflows=false`. This recorded opt-in is what justifies the orchestrator invoking saved workflows during Phase 2. See `references/workflow-orchestration.md`. - **Sprint wave plan** — show which sprints run in parallel: ``` @@ -642,7 +634,6 @@ success_criteria: - "Measurable outcome 2" governance_mode: "light|standard|critical" # from Step 2 selection git_workflow_mode: "solo_single_pr|sprint_pr_queue|stacked_prs|parallel_wave_prs|trunk_based" # from Step 2b selection -model_profile: "frontier|balanced" # from Step 2c selection; controls deep reviewer + deep-analyst model at dispatch use_workflows: true|false # from Step 12 opt-in; allows saved /superflow-review and /superflow-wave workflows in Phase 2 (Claude runtime only) --- ``` diff --git a/references/phase2/overview.md b/references/phase2/overview.md index c3ecfe0..2691ec6 100644 --- a/references/phase2/overview.md +++ b/references/phase2/overview.md @@ -71,9 +71,9 @@ Sprint complexity tag in the plan drives implementer tier: **ALWAYS pass `model:` explicitly in every Agent() call** — agent definition frontmatter `model:` is NOT reliably inherited. Dispatch rule: implementers → `model: "sonnet"` (haiku permitted for mechanical Phase 0 file/config checks); standard reviewers + doc-writers → `model: "opus"`; deep -reviewers + `deep-analyst` → `"fable"` (model_profile=frontier, default) or `"opus"` (model_profile=balanced -— read `context.model_profile` from `.superflow-state.json`). A forgotten `model:` now silently inherits -the parent frontier model (Fable) — the cost of forgetting went UP. +reviewers + `deep-analyst` → `model: "opus"` (Fable is blocked — depth comes from effort: deep = max, +standard = high, set in agent frontmatter). A forgotten `model:` silently inherits the orchestrator's +session model (Opus), which is wrong for implementers — more expensive than the intended Sonnet. --- diff --git a/references/phase2/steps/impl-dispatch.md b/references/phase2/steps/impl-dispatch.md index 9714b7b..8e43a2d 100644 --- a/references/phase2/steps/impl-dispatch.md +++ b/references/phase2/steps/impl-dispatch.md @@ -92,8 +92,8 @@ Sprint complexity tag in the plan drives implementer tier: | complex | deep-implementer | sonnet | max | 5+ files, new architecture, security-sensitive | **ALWAYS pass `model: "sonnet"` explicitly for implementers** — frontmatter `model:` is NOT -reliably inherited. A forgotten `model:` now silently inherits the parent frontier model (Fable) — -the cost of forgetting went UP. +reliably inherited. A forgotten `model:` silently inherits the orchestrator's session model (Opus), +more expensive than the intended Sonnet. Include `llms.txt` content in agent context (if file exists). Extract and paste the exact task list, file paths, and expected behaviors verbatim into the diff --git a/references/phase2/steps/review-unified.md b/references/phase2/steps/review-unified.md index f247c9f..ea5107e 100644 --- a/references/phase2/steps/review-unified.md +++ b/references/phase2/steps/review-unified.md @@ -16,6 +16,9 @@ workflows available (not `disableWorkflows`, not `CLAUDE_CODE_DISABLE_WORKFLOWS= /superflow-review args: {sprint: , branch: "", base: "", charter_path: "", workdir: "", + spec_path: "", (optional but STRONGLY recommended — enables spec-fit + plan-completeness) + plan_path: "", (optional — reviewers verify each task is implemented, not stubbed) + brief_path: "", (optional — product lens) product: , (false for light-governance cells) diff_hint: ""} ``` @@ -45,7 +48,16 @@ First, look up `decision_matrix.review_config[governance_mode+"+"+complexity]` i - `reviewers: 2` → Both Product + Technical in parallel - `tier` → `standard` or `deep` agent definitions -Both agents receive: the SPEC, the product brief, and the relevant git diff. +Both agents receive a COMPLETE context bundle — never just the diff: +- the SPEC / sprint plan tasks (for spec fit AND the plan-completeness check — the **technical** reviewer + needs this too, not only the product reviewer; a diff without the plan cannot reveal a stub), +- the Autonomy Charter (non-negotiables, success criteria), +- the Product Brief (product lens), +- the relevant git diff. + +Paste these into the dispatch `prompt:` verbatim — do NOT rely on the agent recalling the plan. The agent +definitions reserve `` + `` (code reviewer) and +`` + `` + `` (product reviewer) context slots for exactly this. **Dispatch Claude reviewers as NAMED background agents** so they can be re-engaged after fixes with their original context intact: @@ -53,10 +65,10 @@ with their original context intact: ``` Agent( subagent_type: "standard-product-reviewer", # deep-product-reviewer for deep tier - model: "opus", # standard tier; deep tier → "fable" (frontier) or "opus" (balanced — read context.model_profile) + model: "opus", # standard tier; deep tier also "opus" (effort: max via agent definition; Fable blocked) name: "sprint--product-reviewer", run_in_background: true, - prompt: "[SPEC + brief + diff context]" + prompt: "[SPEC/plan tasks + Product Brief + Autonomy Charter + git diff — fill the agent's // slots verbatim]" ) ``` @@ -77,10 +89,10 @@ Agent( ``` a. Agent(subagent_type: "standard-product-reviewer", model: "opus", name: "sprint--product-reviewer", run_in_background: true, - prompt: "Focus: spec fit, user scenarios, data integrity") + prompt: "Focus: spec fit, user scenarios, data integrity. Context (fill the agent's slots verbatim): SPEC/plan tasks + Product Brief + Autonomy Charter + git diff") b. Agent(subagent_type: "standard-code-reviewer", model: "opus", name: "sprint--technical-reviewer", run_in_background: true, - prompt: "Focus: correctness, security, architecture, performance") + prompt: "Focus: correctness, security, architecture, performance. Context (fill / verbatim): SPEC/plan tasks + Autonomy Charter + git diff") ``` Record `"provider": "split-focus"` in `.par-evidence.json`. diff --git a/references/workflow-orchestration.md b/references/workflow-orchestration.md index fa10233..6047046 100644 --- a/references/workflow-orchestration.md +++ b/references/workflow-orchestration.md @@ -57,7 +57,7 @@ summary states: > consider switching to Auto for Phase 2). Say no-workflows to use plain subagent dispatch. User objection → `context.use_workflows = false`. The decision is stored in -`.superflow-state.json` (`context.use_workflows`, beside `context.model_profile`) and in the +`.superflow-state.json` (`context.use_workflows`) and in the Autonomy Charter. Workflow invocation by the orchestrator during Phase 2 is justified by this recorded user opt-in — per docs, a direct user request is the opt-in mechanism, and plan approval captures it. @@ -114,11 +114,16 @@ reply can never pass a gate. `workflows/superflow-review.js`. Accelerates the review-unified step (`references/phase2/steps/review-unified.md`). -- **args:** `{sprint, branch, base, charter_path, workdir, product, diff_hint}` +- **args:** `{sprint, branch, base, charter_path, workdir, spec_path, plan_path, brief_path, product, diff_hint}` - `workdir` (required): absolute path to the sprint worktree (or repo root for `solo_single_pr`). The technical reviewer cds into workdir before running `codex exec review`; the product reviewer uses `git -C workdir diff` — without this, both would diff the wrong checkout. + - `spec_path`, `plan_path`, `brief_path` (optional, strongly recommended): file paths the + reviewers Read for context. `spec_path`/`plan_path` feed the spec-fit and plan-completeness + checks for BOTH lenses (a diff alone cannot reveal a stub); `brief_path` feeds the product + lens. When absent, the prompts instruct the reviewer to flag the check as unverifiable + rather than pass silently. - `product` (boolean, default `true`): pass `false` for light-governance sprints (single technical reviewer only). Returns `{product: null, technical, pass}` when false. - Returns `{product: null, technical: null, pass: false, error: "missing required args: ..."}` if diff --git a/superflow-enforcement.md b/superflow-enforcement.md index bfabcfd..71225a9 100644 --- a/superflow-enforcement.md +++ b/superflow-enforcement.md @@ -44,7 +44,7 @@ $TIMEOUT_CMD 600 $SECONDARY_PROVIDER "PROMPT" 2>&1 ```bash $TIMEOUT_CMD 600 claude -p "PROMPT" 2>&1 # general $TIMEOUT_CMD 600 claude -p "$(cat prompts/claude/code-reviewer.md) DIFF_CONTEXT" 2>&1 # code review -# claude-fable-5 = frontier profile (default); claude-opus-4-8 = balanced profile — read context.model_profile +# Deep product/research secondary uses claude-opus-4-8 (Fable access is blocked — all judgment roles run on Opus, differentiated by effort) # No secondary → two Codex agents with split focus via spawn_agent (Product + Technical) ``` See `references/codex-dispatch-patterns.md` for the complete dispatch mapping. @@ -53,13 +53,13 @@ See `references/codex-dispatch-patterns.md` for the complete dispatch mapping. | Tier | Claude Agent (subagent_type) | Codex | When | |------|-------------------------------|-------|------| -| **deep** | `deep-spec-reviewer`, `deep-code-reviewer`, `deep-product-reviewer`, `deep-analyst` (fable, effort: max); `deep-doc-writer` (opus, effort: max); `deep-implementer` (sonnet, effort: max) | `-m gpt-5.5 -c model_reasoning_effort=xhigh` + `prompts/codex/` | Phase 0 audit+security, Phase 1 spec review, Phase 2 final holistic, llms.txt/CLAUDE.md generation | +| **deep** | `deep-spec-reviewer`, `deep-code-reviewer`, `deep-product-reviewer`, `deep-analyst` (opus, effort: max); `deep-doc-writer` (opus, effort: max); `deep-implementer` (sonnet, effort: max) | `-m gpt-5.5 -c model_reasoning_effort=xhigh` + `prompts/codex/` | Phase 0 audit+security, Phase 1 spec review, Phase 2 final holistic, llms.txt/CLAUDE.md generation | | **standard** | `standard-spec-reviewer`, `standard-code-reviewer`, `standard-product-reviewer`, `standard-doc-writer` (opus, effort: high); `standard-implementer` (sonnet, effort: high) | `-m gpt-5.5 -c model_reasoning_effort=high` + `prompts/codex/` | Phase 1 plan review, Phase 2 unified review, Phase 3 doc updates | | **fast** | `fast-implementer` (sonnet, effort: low) | `-m gpt-5.5 -c model_reasoning_effort=medium` | Simple implementation tasks | Agent definitions with effort frontmatter are deployed to `~/.claude/agents/` during SKILL.md startup (step 4). Agent() does NOT accept inline `effort` — controlled via agent definition files only. -**CRITICAL: Always pass `model:` explicitly in every Agent() call.** Frontmatter `model:` in agent definitions is NOT reliably inherited — a forgotten `model:` now silently inherits the parent frontier model (Fable); the cost of forgetting went UP. Rule: implementers → `model: "sonnet"` (haiku permitted for mechanical Phase 0 file/config checks); standard reviewers + doc-writers → `model: "opus"`; deep reviewers + `deep-analyst` → `"fable"` (model_profile=frontier, default) or `"opus"` (model_profile=balanced — read `context.model_profile` from `.superflow-state.json`). +**CRITICAL: Always pass `model:` explicitly in every Agent() call.** Frontmatter `model:` in agent definitions is NOT reliably inherited — a forgotten `model:` silently inherits the orchestrator's session model (Opus), which is wrong for implementers (more expensive than the intended Sonnet and defeats effort tiering). Rule: implementers → `model: "sonnet"` (haiku permitted for mechanical Phase 0 file/config checks); standard reviewers + doc-writers → `model: "opus"`; deep reviewers + `deep-analyst` → `model: "opus"`. **Fable access is blocked — every judgment role runs on Opus, depth differentiated by effort (deep = max, standard = high) via agent definition frontmatter.** ## Test & Process Discipline diff --git a/templates/superflow-state-schema.json b/templates/superflow-state-schema.json index 8ce2653..5b64342 100644 --- a/templates/superflow-state-schema.json +++ b/templates/superflow-state-schema.json @@ -189,15 +189,6 @@ "default": "sprint_pr_queue", "description": "Branch, PR, and merge workflow selected in Phase 1" }, - "model_profile": { - "type": "string", - "enum": [ - "frontier", - "balanced" - ], - "default": "frontier", - "description": "Model tier for deep judgment roles: frontier=fable (default), balanced=opus-4.8" - }, "use_workflows": { "type": "boolean", "default": true, diff --git a/workflows/superflow-review.js b/workflows/superflow-review.js index 0bc04db..8f8b4c9 100644 --- a/workflows/superflow-review.js +++ b/workflows/superflow-review.js @@ -13,6 +13,9 @@ // args: { sprint: N, branch: "feat/x-sprint-N", base: "main", // charter_path: "docs/superflow/specs/...-charter.md", // workdir: "/abs/path/to/sprint-worktree", +// spec_path: "...", (optional — sprint spec/requirements; basis for spec-fit + plan-completeness) +// plan_path: "...", (optional — sprint plan tasks; reviewers verify each is implemented, not stubbed) +// brief_path: "...", (optional — Product Brief: user stories + success criteria) // product: true, (default true; pass false for light-governance) // diff_hint: "..." } // returns: { product: |null, technical: , pass: } @@ -63,9 +66,14 @@ function productPrompt(a) { return ( "You are the PRODUCT reviewer for Superflow sprint " + a.sprint + ".\n" + "1. Read ~/.claude/agents/standard-product-reviewer.md and FOLLOW it (role, checks, output format).\n" + - "2. Read the Autonomy Charter at " + a.charter_path + " — source of truth for goal, non-negotiables, success criteria.\n" + + "2. Read and internalize the review context — compare the implementation against ALL of it:\n" + + " - Autonomy Charter: " + a.charter_path + " (goal, non-negotiables, success criteria)\n" + + (a.spec_path ? " - Spec / sprint requirements: " + a.spec_path + " (basis for the Spec fit check)\n" : "") + + (a.plan_path ? " - Sprint plan: " + a.plan_path + " (Plan completeness — every planned task must be implemented in substance, not stubbed)\n" : "") + + (a.brief_path ? " - Product Brief: " + a.brief_path + " (user stories + success criteria)\n" : "") + + " If a referenced file is missing or an input was not provided, say so explicitly and treat that check as unverifiable — never pass silently.\n" + "3. Review the diff of " + a.branch + " against " + a.base + " (git -C " + a.workdir + " diff " + a.base + "..." + a.branch + ") " + - "through the product lens ONLY: spec fit, user scenarios, data integrity. " + + "through the product lens ONLY: spec fit, user scenarios, data integrity, plan completeness. " + "Every finding needs a realistic breakage scenario.\n" + (a.diff_hint ? "Diff hint from the orchestrator: " + a.diff_hint + "\n" : "") + "Allowed verdicts: ACCEPTED or NEEDS_FIXES.\n" + @@ -82,7 +90,11 @@ function technicalPrompt(a) { " Wrap its findings honestly into the verdict block below (verdict APPROVE or REQUEST_CHANGES).\n" + "2. If codex is absent: act as the Claude technical reviewer — Read ~/.claude/agents/standard-code-reviewer.md and FOLLOW it " + "over the diff of " + a.branch + " vs " + a.base + " (git -C " + a.workdir + " diff " + a.base + "..." + a.branch + "; correctness, security, architecture, performance).\n" + - "Also read the Autonomy Charter at " + a.charter_path + " for non-negotiables.\n" + + "Review context — read and compare the implementation against ALL of it:\n" + + " - Autonomy Charter: " + a.charter_path + " (non-negotiables — violations are critical)\n" + + (a.spec_path ? " - Spec / sprint requirements: " + a.spec_path + "\n" : "") + + (a.plan_path ? " - Sprint plan: " + a.plan_path + " (Plan completeness check #11 — every planned task must be implemented in substance, not stubbed)\n" : "") + + " If a referenced file is missing, say so and treat plan completeness as unverifiable.\n" + (a.diff_hint ? "Diff hint from the orchestrator: " + a.diff_hint + "\n" : "") + VERDICT_BLOCK ); @@ -100,6 +112,9 @@ const a = { base: _args.base || "main", charter_path: _args.charter_path, workdir: _args.workdir || "", + spec_path: _args.spec_path || "", + plan_path: _args.plan_path || "", + brief_path: _args.brief_path || "", diff_hint: _args.diff_hint || "", product: !(_args.product === false), }; From c255f79bbd4b1857ab30a2dc2d2dbd16c4b8ed6c Mon Sep 17 00:00:00 2001 From: egerev Date: Tue, 30 Jun 2026 11:59:03 +0800 Subject: [PATCH 3/3] ci: block claude-fable-5 in forbidden-token gate; fix pin message to claude-opus-4-8 Regression guard so the blocked Fable model cannot be reintroduced. Pushing this requires the GitHub `workflow` OAuth scope. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 527f1d7..8ea8d64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,11 @@ jobs: set -euo pipefail EXCLUDE=(':!CHANGELOG.md' ':!.github/workflows/ci.yml') if git grep -nI -e 'claude-opus-4-7' -- "${EXCLUDE[@]}"; then - echo 'FAIL: claude-opus-4-7 found outside CHANGELOG.md (pin is claude-fable-5)' >&2 + echo 'FAIL: claude-opus-4-7 found outside CHANGELOG.md (pin is claude-opus-4-8)' >&2 + exit 1 + fi + if git grep -nI -e 'claude-fable-5' -- "${EXCLUDE[@]}"; then + echo 'FAIL: claude-fable-5 found outside CHANGELOG.md (Fable access is blocked — pin is claude-opus-4-8)' >&2 exit 1 fi if git grep -nIP -e '(?