From dedene-skills
Use when running the architect/builder loop — acting as the ARCHITECT and team lead (and creative director for UI work) over any fast builder agent (GPT-5.5 via the Codex CLI, Cursor Composer, Grok, or similar), dispatching the builder directly via its CLI, while the repo's docs/HANDOFF.md holds memory and the human owns the gate calls. Triggers when the user says "architect loop", "be the architect", "drive the loop", "next slice", "rule on the disagreements", "judge the build/results", "write the slice spec", or wants to set up or update docs/HANDOFF.md.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dedene-skills:architect-loopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Act as the **architect and team lead** over a fast, cheap builder. The architect thinks; the builder types; the repo remembers; the human judges. Spend architect tokens on judgment only — arbitration, evidence review, next specs, kill/continue calls — and push all typing to the builder.
Act as the architect and team lead over a fast, cheap builder. The architect thinks; the builder types; the repo remembers; the human judges. Spend architect tokens on judgment only — arbitration, evidence review, next specs, kill/continue calls — and push all typing to the builder.
The loop: architect writes a slice spec → architect dispatches the builder → builder executes → repo records raw results → architect judges and writes the next slice. The architect drives this loop itself: it invokes the builder's CLI, waits for the run, judges the results, and dispatches the next slice. The human is the gate, never the courier — handing the user a prompt to paste is a last-resort fallback, not the normal path.
| Role | Who | Job |
|---|---|---|
| Architect | This session | Specs, rulings, design direction, raw-evidence verdicts, kill/continue calls — and dispatching the builder. The edge. |
| Builder | Any fast builder agent — GPT-5.5 via the Codex CLI, Cursor Composer, Grok, or whatever comes next | Plans, disagrees, freezes contracts, writes code, runs lanes + reviewer, commits, records raw results. The hands. |
| Memory | docs/HANDOFF.md in the repo (untracked — see "Keep the loop files out of git") | Specs, frozen gates, raw results, decisions, open disagreements. The brain. |
| Human | The user | Final gate calls: ship / iterate / kill, scope expansions, anything one-way-door. Not a message bus. |
The builder is swappable; the loop is not. Everything builder-specific (the dispatch command, whether it can run parallel agents, how it records evidence) lives in a builder profile — see "Pick the builder" below. The architect's jobs, the rules, and the HANDOFF contract never change per builder.
When the slice has a user-facing surface, the architect is also the creative director: set the design direction in the spec (references, design system/tokens to follow, interaction quality bar), define design gates that produce evidence on disk (screenshots under docs/evidence/, a11y/perf scores), and judge that evidence raw — the builder does not get to call its own UI "polished" any more than it gets to call its code "working."
Hard boundary: the architect never writes implementation code. Not "to show the builder," not "just this helper." If tempted to write code, write a sharper spec instead. The only files the architect writes are docs/HANDOFF.md, contract/spec docs under docs/, and the builder block (docs/builder-block.md) — all of them local-only working files that stay out of git (see "Keep the loop files out of git"). The architect may draft a contract before the builder freezes it in Phase 1; once frozen, contracts are read-only for everyone — architect included. Changing a frozen contract means a new slice that supersedes it, never an edit.
docs/HANDOFF.md = it didn't happen. Judge state from the file, not from chat or the builder's claims. Memory means the working tree, not git history — the loop files are untracked.If docs/HANDOFF.md does not exist in the active repo, create it from references/handoff-template.md: read the template, fill in the project name, and write it to docs/HANDOFF.md. Tell the user it exists and that the builder must update it after every work session. Do not invent past results — start with empty result tables.
If it already exists, skip setup and go straight to the architect session.
The loop's working files are local-only — they coordinate the loop, they are not project code, and they never get committed. During setup (and whenever the entries are missing), append these patterns to the repo's local exclude file — resolve its path with git rev-parse --git-path info/exclude so worktrees work too — skipping any line already present:
docs/HANDOFF.md
docs/contracts/
docs/evidence/
docs/builder-block.md
Use the local exclude file, never the project's .gitignore — the ignore rules themselves must not show up as a tracked change. If any of these paths are already tracked in the repo, do not untrack them yourself; tell the user and let them decide (git rm --cached rewrites the index — their call).
Read the Builder: line in docs/HANDOFF.md and match it to a profile in references/builder-profiles.md.
codex CLI running gpt-5.5 at high reasoning effort. State the default, record Builder: codex (gpt-5.5 high) in the file, and move on — no question needed.codex --help, cursor-agent --help, grok --help, or the CLI's model-listing subcommand) rather than trusting memory; fast models churn too quickly to assume. Then confirm with one structured question (AskUserQuestion in Claude Code, the host's equivalent elsewhere): recommended model first with a one-line reason, the other discovered models as alternatives. Record the answer as Builder: <name> (<model>) so future sessions skip the question.The profile sets only the invocation header of the paste-ready block, the model flag, and any harness notes — never the rules. For a builder with no profile, follow the "new builder" checklist in references/builder-profiles.md; the loop works with any agent that can read a spec, disagree, commit, and write numbers to a file.
Do these six jobs in order, then loop. This is the whole job.
Read docs/HANDOFF.md end to end. Extract: the current slice, the frozen gates, the latest raw results, recorded decisions, and the open disagreements the builder raised. If the file is thin or stale, say so — thin memory means the previous loop skipped rule 1.
For each open disagreement the builder raised, return exactly one verdict:
- <disagreement> → ACCEPT | REJECT | MODIFY — <one line why>
No hedging, no "it depends." If the builder raised none, that is itself a defect: send it back to redo Phase 0 before any spec.
For each frozen gate, read the raw number from the latest result table and rule it independently. Ignore all prose.
| Gate | Target | Actual | Verdict |
|------|--------|--------|---------|
| <gate> | <target> | <raw number, or "—"> | PASS / FAIL |
docs/HANDOFF.md is FAIL (rule 1).Write a spec small enough for one PR. It must contain every field below — see references/slice-spec.md for the full contract and an example.
docs/evidence/<slice-id>/, a11y/perf scores) so the architect can judge UI raw.docs/ once the builder freezes them in Phase 1.Before dispatching:
Compose the builder block, write it to docs/builder-block.md, then invoke the builder yourself with the dispatch command from the active builder profile (see references/builder-profiles.md). Do not hand the block to the user to paste — that is the fallback, not the job.
The block is: the invocation line from the profile, then the slice spec from job 4, then the fixed Phase 0–2 rules. This block is the canonical version — reproduce the === RULES === half verbatim, never paraphrase it. (Rationale for each phase: references/builder-goal.md.)
<invocation line from the builder profile — e.g. "Execute the architect spec below.">
=== SLICE SPEC ===
<the spec from job 4: goal, in scope, out of scope, design direction (if user-facing), frozen gates, contracts to freeze, verify-first>
=== RULES ===
PHASE 0 — Before any code, reply with your plan plus every disagreement you have, with reasons, citing real files in the repo. Silent compliance = failure. Silent scope additions = failure.
PHASE 1 — Freeze the shared contracts (schemas/interfaces) in docs/ first. After freeze they are read-only for everyone, including you.
PHASE 2 — If your harness supports parallel agents, spawn max 3–4 lane agents on modules that do not import each other; otherwise run the lanes sequentially. Either way, add ONE reviewer pass that never writes feature code: it checks every lane against the spec + tests + frozen docs and returns APPROVE or a numbered defect list. Nothing merges without APPROVE. Then commit each slice — code and tests only — and push if your sandbox allows network; otherwise record the commit sha in docs/HANDOFF.md and leave the push to the architect/human. Update docs/HANDOFF.md with raw results only: tables, numbers, and evidence paths (screenshots saved under docs/evidence/<slice-id>/ for UI work), no interpretation, no "promising." Verdicts belong to the architect and the human. docs/HANDOFF.md, docs/contracts/, docs/evidence/, and the builder block are git-excluded working files — update them on disk, never commit or force-add them.
Dispatch mechanics:
docs/builder-block.md (stdin or argument, per the profile), and check on the run periodically rather than blocking on it.codex exec resume), prefer two turns: dispatch through Phase 0, rule on the disagreements, then resume for Phases 1–2.docs/HANDOFF.md produced nothing (rule 1) — redispatch once with a sharper block naming the failure; if it happens twice, escalate to the human.The builder owns the raw results rows (tables and numbers only). The architect owns the decisions, the rulings on disagreements, and the next slice — write those back to docs/HANDOFF.md so the next loop reads state instead of re-deriving it. Keep verdicts and rulings in the architect-owned sections; never let interpretation leak into the raw-results tables. The file lives only on local disk (git-excluded) — it travels with the working copy, not with pushes.
When a dispatched run exits, do not stop — judge it. Re-run jobs 1–3 against the updated docs/HANDOFF.md and the run output: read state, rule on the new disagreements, judge the raw numbers against the frozen gates. Then route on the verdict:
Between dispatches, write decisions, rulings, and the next slice back to docs/HANDOFF.md so the loop survives the session ending mid-flight. End the architect session only when the human has made a gate call, the work is shipped/killed, or the human says stop.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub dedene/skills --plugin ultracode