Route tasks to the lightest correct methodology instead of defaulting to spec-driven #7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The pipeline forces every task through the heaviest methodology's obligatory critical path regardless of the task's nature. A trivial, behaviour-preserving change — e.g. a carrier/newtype narrowing or a constructor rename propagated across N files, where the type checker enumerates every edit site and the existing suite stays green unchanged — pays the same
specify -> planner -> implement -> auditfront-half (two prose artefacts, mandatory subagent gates, a human sign-off wait-gate) as a genuinely novel cross-subsystem feature.The cost to minimise is wall-clock / obligatory per-cycle effort, not tokens. The pain is the lack of proportionality, and it does not scale down with task triviality.
The root is structural, in two coupled places:
The selector has no verification/enumeration axis. The entry-path reflection (
boss/SKILL.md:113-167) partitions feature work three ways on a single "design line" — test-specifiable / settled / fork — keyed only on whether the design is settled, never on what verifies or enumerates the work. A behaviour-preserving mechanical change is neither new behaviour (tdd) nor an observed bug (debug), so it falls tospecifyby elimination (specify/SKILL.md:38-39: specify "sits on every prose-design path — it is not bypassed"). The reflection is asserted to be "always three-way" (boss/SKILL.md:167).The executor is all-or-nothing. The per-task loop runs three phases sequentially in one orchestrator context (
implement/SKILL.md:53: implementer -> spec-compliance -> quality). The documented reason is a platform limit: nested-subagent dispatch is forbidden, so phases are inline role-switches, and a finer-grained invocation is called "a capability Claude Code does not provide" (implement/SKILL.md:211, 242). A lighter path handing work into this loop sheds onlyspecify+planner, not the heaviest node.Lighter machinery already exists but is unreachable:
implement/SKILL.md:41-44permits trivial mechanical edits inline "without dispatch". The selector routes past it by elimination before it can apply.Diagnostic anchor: the existing lighter path is never chosen
tddis a lighter entry path that exists today and is, in practice, never selected — for exactly the two defects above. Its trigger (new behaviour pinnable as one falsifiable assertion) is a narrow subset that behaviour-preserving work cannot satisfy, so such work falls tospecify; and even when chosen it funnels its GREEN side into the same 3-phase loop, so it is barely lighter. Any new lighter path added without fixing both defects inherits this fate: present but unreachable, uneconomical if reached.Direction
Two coupled changes. Either alone reproduces the
tddfailure (selector-only -> unreachable; executor-only -> uneconomical).A. A verification-keyed selector with observe-then-bounce routing
Replace the three-way "design line" with an ordered cascade that adds a verification/enumeration axis before the settled-vs-fork question, so each lighter path carries a positive trigger and is matched by signature rather than reached by elimination.
Design constraint (reasoned): a cascade that routes on predicates which are outcomes of the work — "this change is behaviour-preserving", "the suite will stay green unchanged", "the solution shape is genuinely unknown" — is unsound as a discriminator, because it asks the agent to predict the result before doing the work; determinism then survives only via a conservative tie-break that re-creates the heavy-path gravity well for every borderline task.
The sound form enters on an observable trigger and lets a run settle the verdict:
The fallible ex-ante guess becomes a cheap ex-post detection: a mis-routed behaviour change fails the post-condition and bounces, instead of shipping green-but-wrong. This generalises the existing RED-first philosophy — observe, do not predict.
Hazards a future implementation must respect:
implement/SKILL.md:41-44) a positive selector arm plus an explicit done-signal (clean build + suite green unchanged). Do not over-build a heavy new skill where elevating the carve-out suffices.B. Move the autonomous methodology loops onto the Workflow substrate
The system predates the Workflow feature; the Skill/Agent split and the inline-role-switch workaround are artefacts of orchestrating by prose-interpreted dispatch (
implement/SKILL.md:242documents the missing capability explicitly). The Workflow primitive now provides it. Migrating the autonomous loops dissolves the executor defect:implementer.md's pure-refactor exception cannot be today.Split line, along the interactivity boundary:
Pilot scope: the compiler-driven loop and the implement loop, where the substrate gain is largest and the interactivity risk is zero.
The methodology taxonomy
Development paths differ on two irreducible axes — first artefact written, and correctness oracle. Error-recovery is not a third axis: whole-attempt discard is the plugin's universal containment, not a per-path signature. The top-level cut — ratified prose intent before code (spec-driven) vs. machine / test / run oracles — is the hard boundary; the paths cannot be centralised in one skill, only share the
implementexecutor as a primitive and the cycle-closeaudittail.Scope and non-goals
specifyandbrainstormstay prose-driven and interactive — not migrated to the Workflow substrate.try-and-erroris deferred. Claim (reasoned): it is not a co-equal path but an exploration front-end terminating in a tdd-style handoff, and its attempt tail is structurally unbounded — it can cost more wall-clock than the spec-driven baseline it is meant to beat, and its attempt-budget is a magic number the selector cannot derive. Out of scope until the selector and substrate work lands.closes #Ncommit convention, the standing reading (docs/conventions.md:56-61), or the main-sacrosanct / orchestrator-only-commit discipline.Acceptance checklist
specify/brainstormremain prose and interactive.Design decisions — #7 implementation (full Part A + Part B, single pass)
Implemented directly against the skill/agent/doc surface (this is the meta-repo that defines the pipeline; it does not dogfood its own
specify → planner → implement, so the change lands as a direct commit, per the user's instruction to use none of the plugin's own skills for the work). Every load-bearing decision below is recorded so a future reader can see why, not just what.Part A — verification-keyed selector
boss/SKILL.md"Entry-path reflection" replaces the three-way design line with an ordered cascade that puts a verification/enumeration axis ahead of the settled-vs-fork question. Order:observed bug → debug·forces a design choice → brainstorm·type/signature edit at a def, propagating mechanically → compiler-driven·new behaviour as one assertion → tdd·else → spec-driven. Each lighter arm carries a positive trigger matched by signature; the prose twice rejects reach-by-elimination.compiler-driven; encodes new behaviour (new code path, new observable output) →tdd/spec-driven. Doubt = the change carries behaviour → route up.implement"trivial mechanical edits … without dispatch" carve-out got a positive selector arm + the explicit done-signal. This is why Part A alone already yields a reachable AND economical light path — the arm routes to a path that bypasses the full per-task loop, not into it.Part B — Workflow substrate
<skill>/workflows/(implement/workflows/implement-loop.js,compiler-driven-edit.js).install.shsymlinks each*.jsinto the flat~/.claude/workflows/(where the Workflow tool resolves named workflows);uninstall.shremoves them. Same structural binding as agents.agent()calls (implementer→spec-reviewer→quality-reviewer), with the working-tree diff + task text as the shared medium and the script threading a reviewer's findings back into a repair dispatch. This strengthens the fresh-eyes property the review phases already wanted (structurally enforced, not a mindset switch) and preserves context-offload (per-task chatter stays inside the workflow's agent contexts).stats.json,BLOCKED.md) happens inside anagent()call; routing keys on the structured verdict each agent reports (which encodes the real build/test outcome).BLOCKEDtask stops the loop (no skip-ahead); all agents share one working tree, so noisolation: 'worktree'.implement-orchestratoragent retired; the four phase agents survive. The inline-role-switch orchestrator-agent is deleted — its loop isimplement-loop.jsnow.implementer/spec-reviewer/quality-reviewer/testersurvive as the agent-types the script dispatches; their "phase reference, not separately dispatched" notes are flipped to "dispatched as a workflowagent()call". The carrier contract, sub-status/re-loop logic,BLOCKED.mdtemplate, stats schema, and end-report shape relocated into the script (the single source).tdd/debugGREEN side runs asimplement-loopmode: "mini"(same carrier as before).specifyandbrainstormstay prose + interactive — their oracle is human intent and needs a human in the loop, which a run-to-completion workflow cannot host. Only the autonomous/mechanical loops moved.bossselector arm names its executor (../implement"The compiler-driven arm" +compiler-driven-edit) andimplement/SKILL.mdnames thebossselector arm back — a bidirectional cross-reference, so a future edit re-routing the light path back through the full loop changes both anchors and is a visible regression.One deliberate deviation from the issue's literal text
The issue's taxonomy lists the compiler-driven hole-bounce as
→ specify. I split it: a hole that forces a design choice →specify, a hole that turns out to be test-specifiable new behaviour →tdd(RED-first). Reason: the straddle rule (DD2) routes new behaviour totdd/spec; bouncing test-specifiable new behaviour to the heavyspecifywould re-create exactly the over-routing #7 exists to kill. A regression still bounces todebug. (Surfaced by the adversarial verification pass, lens D3.)Validation
node --checkvia the runtime's async-wrapper); install wiring exercised (symlinks created and discovered).orchestrator-agentline inimplementer.md, and the specify/tdd coherence gap above) were fixed and re-aligned across all docs.Acceptance checklist 1–6 all satisfied; non-goals (specify/brainstorm stay prose; try-and-error deferred;
closes #N/ standing-reading / main-sacrosanct unchanged) respected.