architect — Claude Code¶
Plan a complex task once on the frontier tier (Fable 5.1 today) and write the execution kit — PLAN.md, TASKS.md, GUARDRAILS.md, and model-pinned agents — that a cheaper model then executes at near-Fable quality. Use when the user says "plan this with Fable", "architect this", "review this codebase", or escalates a complex task. Not for running a kit; that is /polytropos:execute.
- Source: skills/architect/SKILL.md
- Also available on: OpenAI Codex CLI, GitHub Copilot CLI
- References shipped with the skill: references/roles/docs-editor.md, references/roles/red-team.md, references/roles/scout.md, references/roles/second-verifier.md, references/roles/security-auditor.md, references/roles/synthesizer.md, references/roles/test-author.md, references/routing-evidence.md
In practice¶
What it does¶
Planning a big task well takes real judgment; running it well mostly doesn't. This skill spends the expensive judgment exactly once — Fable 5 reasons through the hard calls and writes them down — so everything afterward can run on a cheaper model without re-deciding anything Fable already settled. Nothing gets executed here: what comes out is a folder of files, not a chat reply, ready for a separate skill to run.
When to reach for it¶
- A task large enough that one wrong early decision would compound across many later steps.
- Reviewing an unfamiliar codebase before committing to an approach.
- A migration or greenfield project you want to run mostly on Opus or Sonnet afterward.
- Not for one task with a clear, checkable outcome — that's escalate, which needs no kit at all.
Worked example¶
Dispatch mode is the normal path: the session stays on its daily driver and spawns the
architecture work as a Fable subagent, carrying the full brief and conversation context the
subagent otherwise never sees. Native mode (/model fable in-session) exists for steering
interactively, at the cost of tying up a Fable session to do it. Either way it first
shows you the goal, "done" and out-of-scope fence, and writes nothing until you approve
them. Before pinning models or
declaring roles in the plan, consult the evidence rather than guessing:
python3 bin/routing_scorecard.py --history # per-tier track record across prior kits
python3 bin/routing_scorecard.py --roles # per-role marginal value before declaring one
The kit itself lands as:
| File | Owner | Holds |
|---|---|---|
PLAN.md |
architect | goal, constraints, decisions with rationale, optional dials |
TASKS.md |
architect | ordered, self-contained tasks |
GUARDRAILS.md |
architect | kit-scoped fences, read by execute at setup |
NOTES.md |
execute | outcomes, ledger lines, cross-task learnings |
Failure modes & fallbacks¶
- The task is ambiguous. Scoping questions come before Fable time is spent — a well-specified brief up front is what its long-horizon coherence depends on.
- A budget or role dial gets guessed instead of measured. The evidence is the two commands above; a kit built without consulting them repeats the last kit's mistakes.
- A dial is written onto a task instead of the plan.
autonomy:,budget:, androles:are PLAN.md lines only — writing one onto a task breaks nothing but also measures nothing.
Cost & safety¶
Fable time is the one resource this skill exists to spend once instead of repeatedly. Every task afterward dispatches on whatever model its own kit entry pins — the mix is enforced automatically, so nobody has to remember to downgrade mid-run. No figure is ever quoted here; the commands above read current numbers at run time.
Related¶
- execute — the other half of the contract: runs the kit this skill writes.
- repo-bench — measures which model to pin, on this repo's own work, before a kit is even built.
- graphify — grounds planning against an unfamiliar repo before PLAN.md is written.
The skill card — what the model reads¶
This is the SKILL.md body the model reads, transformed for this page: the source's own leading title, if it had one, is removed; every remaining heading is demoted one level to nest under this section; and relative links are rewritten to site or GitHub URLs. ${CLAUDE_PLUGIN_ROOT} and {{POLYTROPOS_ROOT}} are install-time path variables, left intact exactly as the model sees them. The unmodified original is skills/architect/SKILL.md.
The goal: Fable 5 runs once, at the start; its judgment persists as scaffolding. The output is not just a plan — it is an execution kit a lesser model can run at near-Fable quality, because every decision that needed Fable-level judgment is already made and written down.
Step 0 — Get onto the frontier tier (Fable 5.1 today)¶
Check the current session model. Two entry modes:
- Dispatch mode (session is on Opus/Sonnet — the normal daily-driver case): spawn the architecture work as a subagent via the Agent tool with
model: fable. Give it this entire skill's Steps 1–3 as instructions plus a complete brief of the task and all relevant conversation context (the subagent sees none of it otherwise). A subagent cannot ask the user anything, so the run is two hops around Step 1's approval pause: the first hop explores and returns only the spec draft; you relay it to the user verbatim and collect their approval or edits; the second hop gets the approved spec back and writes the kit. Continue the same subagent for the second hop (SendMessage with its id) so its exploration carries over; if it cannot be continued, dispatch a fresh one with the original brief plus the approved spec, and say that the earlier exploration was not carried over. You relay its summary. The main session never leaves the daily driver. - Native mode (user already ran
/model fable, or wants to steer interactively): do Steps 1–3 in this session, stopping at Step 1's approval pause, then remind them to switch back (/model opus) once the kit is built.
If the task is ambiguous, ask the scoping questions BEFORE burning Fable time — Fable works best with the full spec up front in one shot.
Step 1 — The plan¶
Write .claude/kits/<slug>/PLAN.md in the target project (<slug> = short kebab-case task name). It opens with the spec — what and why, no design yet:
- Goal and what "done" looks like (checkable, not vibes)
- Constraints and out-of-scope (explicitly fence what executors must NOT do)
Approval pause — the user signs off on the spec before any design. Draft those two sections, then stop and show them to the user. A misread requirement caught here costs one exchange; caught after the kit is written, it costs the whole Fable run. The draft goes in your reply, never onto disk: write nothing into .claude/kits/<slug>/ before approval, because a kit directory holding a PLAN.md and nothing else is indistinguishable from a broken kit. Below the draft, list the assumptions you made and any open question whose answer would change the plan. Continue only on the user's approval in this conversation. Their edits are the spec: write the approved text into PLAN.md as approved, and if the design later shows the spec cannot hold (a "done" that cannot be checked, a constraint that rules out every approach), stop and bring the conflict back to the user rather than quietly rewriting it. Skip the pause only when the user explicitly says to plan straight through, and say in the Step 3 handoff that the spec was not approved separately.
Once the spec is approved, the rest of PLAN.md is the design:
- Architecture & key decisions, each with rationale — the "why" is what lets a cheaper model make consistent micro-decisions later
- Risks and their tripwires — what an executor should watch for and what to do when hit
- Autonomy posture (optional) — a single
autonomy: advisoryorautonomy: autoline anywhere in PLAN.md (absent = advisory). Execute reads it as the kit's dial for live re-routing and auto-escalation; the user can override it per run at invocation. An optional PLAN.md line, not a task field — the task-field contract is unchanged. - Budget dial (optional) — a single
budget: max-dispatches=N max-escalations=N max-consults=Nline anywhere in PLAN.md (any subset of the three keys; absent = unbounded, today's behavior). Execute's own loop and all four headless drivers (bin/claude_execute.py,bin/copilot_execute.py,bin/codex_execute.py,bin/cursor_execute.py) honor it: on reaching a declared cap they stop cleanly, leave the remaining tasks' status untouched, and append ONEoutcome: ... result=budget-stopline (run=included) instead of dispatching — never folded into a fluent summary. Likeautonomy:, this is a PLAN.md line family, never a task field — the task-field contract is unchanged. - Roles roster (optional) — a single
roles: <token> <token> ...line anywhere in PLAN.md, naming the optional pipeline roles this kit adds beyond the standing trio (implementer / verifier / reviewer). Tokens come from exactly seven:scout,test-author,second-verifier,red-team,security-auditor,docs-editor,synthesizer; anything else is out of grammar. Absent = the trio, today's behavior — every kit written before this dial existed stays valid, and nothing here changes the default or auto-declares a role. An optionalworkflow:line names the assurance level:reviewed(the trio, default),extended(trio + declared roles), ordirect(implementer and deterministic checks only, no independent review; say it by name, never besideroles:). Declare a role for a stated purpose from the task's risk, never because the name exists; its contract ispython3 ${CLAUDE_PLUGIN_ROOT}/bin/kit_contract.py roster --kit .claude/kits/<slug> --json, and a headless driver refuses or discloses a role it cannot sequence, never skips it. Execute reads the line once at setup, dispatches each declared role at its own hook point, and records every declared-role dispatch as anagent:line in the kit's NOTES.md so the roster can be measured afterwards. Likeautonomy:andbudget:, this is a PLAN.md line family, never a task field — the task-field contract is unchanged.
Before dispatching wide exploratory reads over an unfamiliar target repo, check whether it already carries a graphify-out/graph.json (or offer the user /polytropos:graphify to build one — an optional, external, availability-gated tool, not assumed present). When a graph exists, python3 bin/graph_ground.py ground --graph <path> --seed <file-or-symbol> (freshness against the working tree, a bounded walk from the seeds, a search fallback when the graph is stale, unknown, or silent), python3 bin/graph_brief.py brief --graph <path>, and a few targeted graphify explain <symbol> calls ground the plan at near-zero context cost. Read the freshness verdict first: a stale or unknown graph is hints, not evidence. But the graph's limits bind — dynamic loaders (importlib, plugin registries) are invisible to its AST extraction, and the absence of an edge is never evidence of the absence of a dependency — so treat it as a first map that narrows where to look next, never as the sole evidence backing a contract or dependency claim in PLAN.md.
Step 2 — The execution kit¶
This is the part that makes lesser models perform above their weight. Produce:
TASKS.md (same kit directory)¶
Ordered task list. Every task must be executable by a model with zero access to this conversation:
- id, title, status (pending/in-progress/done/blocked), model (sonnet default; opus for the genuinely hard ones; haiku for trivial mechanical ones)
- Self-contained brief: files involved, relevant conventions, interfaces/contracts pinned down exactly, known gotchas, and the why behind the approach
- Acceptance criteria: concrete and checkable
- Verify command: a shell command (tests, build, lint, a curl) that proves the task done
- Optional evidence: — red-green (default), regression, or precondition. Default means the verify command must be able to fail before the work; if it already passes, execute blocks the task. Mark regression/precondition when passing beforehand is the point (refactors, drift guards) — not to silence a check that should have gone red.
- Tasks are grouped under ## Phase N — <name> headings; the execute loop dispatches the reviewer agent at each phase end.
- Each task marks ordering explicitly: depends: <ids> or independent: yes — execute parallelizes only tasks marked independent. depends: is machine-read: ids of task blocks in this kit, comma-separated, or (none) — never prose, ranges, or another kit's ids. Ids are unique; no self-dependency; no cycle. Execution validates the whole graph first and refuses an invalid kit, naming each finding (python3 ${CLAUDE_PLUGIN_ROOT}/bin/kit_contract.py graph --kit .claude/kits/<slug>).
- Flag warm-cluster candidates as free text in the TASKS.md dispatch preamble (e.g. "T2 → T3 → T4 are strictly serial (same file)"): serial depends: chains that share a primary file and carry the same model pin. Execute may then serve the whole cluster with one continued (warm) implementer instead of N cold spawns; tasks marked independent: still fan out fresh. This is a hint, not a new task field — the task-field contract is unchanged.
- The task's model field is authoritative at dispatch time: execute passes it as the Agent tool's model parameter, which overrides the implementer agent's frontmatter default. When a kit runs with the autonomy dial on auto, execute may layer a logged, upgrade-only runtime override on top at dispatch (one tier step, never to frontier) — the field itself is never rewritten and stays the dispatch default.
- Consult the routing history when choosing the initial model pins: python3 bin/routing_scorecard.py --history is EVIDENCE, not an auto-pin-setter — the architect weighs it and decides. Read references/routing-evidence.md when choosing pins or declaring roles: how to read the --history and --roles cards, the escalation lineage and failure breakdown, and the recurring brief-defect kinds that are evidence about your own briefs.
- Execute maintains a NOTES.md beside PLAN.md/TASKS.md — cross-task learnings plus machine-read ledger lines (outcome:, agent:, reviewer:, defect:) that bin/routing_scorecard.py reads. The architect creates none of them, and the task-field contract (id/title/status/model/brief/acceptance/verify) is unchanged by them; their fields and rules are in references/routing-evidence.md.
Pin down contracts and interfaces precisely; leave implementation judgment open where any competent model would do fine. Over-prescription wastes the kit; under-specification wastes the executor.
Project subagents (.claude/agents/ in the target project)¶
Only create what the kit needs and doesn't already exist. Typical trio, each with project-specific conventions baked into its prompt:
- <slug>-implementer.md — model: sonnet — executes one task brief exactly; stops and reports rather than improvising when the brief is wrong
- <slug>-verifier.md — model: sonnet by default (haiku only when every check is mechanical — a command exit code, a byte comparison; the routing history's Role quality card shows why), tools: Bash, Read, Grep, Glob — fresh-context adversarial check of acceptance criteria; never trusts the implementer's claims, reruns the verify command itself
- <slug>-reviewer.md — model: opus, tools: Bash, Read, Grep, Glob — reviews completed phases against PLAN.md for drift
Pin the read-only roles' tools: frontmatter — mandatory for every kit you generate. Verifier and reviewer get tools: Bash, Read, Grep, Glob (read/search plus Bash, no Write, no Edit); the implementer's tools stay unpinned, because writing is its job. Scope structurally rather than by instruction: a verifier with no editor cannot be talked into fixing the defect while it is in there. But write the honest limit into the agent file too, instead of trusting the pin — Bash alone can delete or rewrite any tracked file, and in this repo a verifier holding exactly this pin destroyed an authored docs section during mutation testing, never restored it, and reported its own damage as the implementer's defect. Removing Write/Edit removes the casual path, not the capability. So pair the pin with the practice that actually closes the gap, stated in both read-only agents' prompts: prefer non-mutating checks; when a check genuinely needs mutation, copy the target to a temp directory and mutate the copy, never a tracked file in place; if the tree is touched anyway, restore it byte-for-byte before reporting and say so; and close with git status --porcelain, reporting any unexpected change as the agent's own defect, never the implementer's.
When PLAN.md declares a roles: line, instantiate each declared role from its template. This skill ships one generic template per optional role at skills/architect/references/roles/<role>.md (resolve via ${CLAUDE_PLUGIN_ROOT}, falling back to "relative to this SKILL.md") — each a complete agent file with frontmatter, the role's mission, its hook point in the pipeline, and its recording contract. Copy the template to .claude/agents/<slug>-<role>.md in the target project and replace every <slug> placeholder with the kit slug and <repo-root> with the target repo's root. Templates are consumer-neutral: they name the kit's GUARDRAILS.md and the repo's own conventions, never this plugin's — put the target's fences there. Keep the template's model: default and its tools posture as written — the read-only roles carry the same tools: pin and damage-restore practice as the verifier and reviewer above; the write-capable roles (test-author, docs-editor, synthesizer) carry a scoped write mission instead of a pin — unless this kit has a specific reason to differ, in which case state the reason in PLAN.md. Do not widen a template's mission to cover another role's ground: the boundaries are the design (red-team attacks beyond the acceptance criteria rather than re-running the verifier's checks; security-auditor is fences, leaks, and injection surface only, not the reviewer's drift review; second-verifier must carry a stated different lens from the verifier's). And as with the trio, never reuse the name of an agent listed in an aesop manifest's primitives.agents.
Harness guardrails¶
Write the kit's fences to .claude/kits/<slug>/GUARDRAILS.md — task-scoped conventions, forbidden shortcuts, "always run X before claiming done". Execute reads the file at setup, so they load only when this kit runs and never tax other sessions. Always create this file, one per kit, no exceptions: if the kit genuinely needs no fences beyond PLAN.md's out-of-scope section, write that sentence and point at PLAN.md rather than omitting the file — an absent file is indistinguishable from a forgotten one, and a layout check that requires it fails the whole suite (hence every task's verify command), not just the kit that skipped it. Give it real substance, not a stub. Add to the target project's global CLAUDE.md only an invariant that is genuinely permanent and project-wide — true for every future session, not just this kit — and sparingly: that file is loaded everywhere, forever. Prefer judgement over rules: state the principle and name the signal to read (e.g. "match the surrounding file's error-handling style") instead of an absolute — EXCEPT rules protecting real money, live CLIs, or user data, which stay absolute and explicit. If a procedure is complex enough, make it a project skill (.claude/skills/<name>/SKILL.md) instead. These are the Fable-judgment rails the executors run on.
Aesop-managed target? If the target project has an aesop.yaml at its root, or an <!-- aesop:begin fence in its CLAUDE.md/AGENTS.md, those files are compiled output — hand-edits get flagged as drift by aesop sync and overwritten by aesop compile. Put the guardrails in aesop.yaml under primitives.instructions.blocks (scope: project) instead, then run aesop compile and confirm aesop sync reports no drift. Kit directories (.claude/kits/…) and kit-prefixed agent files are safe to write directly — aesop tracks only files it emits — but never reuse the name of an agent listed in the manifest's primitives.agents.
References — read when¶
references/routing-evidence.md— read when choosingmodelpins, declaring aroles:line, or reading a kit's ledger: the--historyand--rolescards, the roster comparison ladder, theoutcome:line's optional fields, and whatbudget-stopmeans.references/roles/<role>.md— the seven optional-role templates instantiated in Step 2.
Step 3 — Handoff¶
End with exactly what happens next, e.g.:
Kit ready at
.claude/kits/<slug>/. Switch back to your daily driver (/model opus) and run/polytropos:execute <slug>. Blocked tasks escalate back to Fable one at a time — you won't pay Fable prices for execution.
The kit's model-pinned agents mean the model mix is enforced automatically during execution — nobody has to remember to downgrade.
Optional context travel¶
When an explicit repository/kit/assignment and authorized startup config are supplied, use the native context-travel skill and read ${CLAUDE_PLUGIN_ROOT}/docs/CONTEXT-TRAVEL-SURFACES.md (or ../../docs/CONTEXT-TRAVEL-SURFACES.md relative to the context-travel skill) on demand for a bounded planning brief. Treat missing, stale, partial, or refused context as advisory; retain this workflow's authoritative sources, policy, pricing, permission, and mandatory verification rules. If no authorized context transport is available, continue this workflow and report context unavailable.