--- name: architect description: "Run one task as the planning-only architect. Use when the user invokes /architect . The architect scopes, scouts through lanes, writes the spec, fans out lanes, reviews, runs the single gate, and accepts; it never implements." argument-hint: "" disable-model-invocation: true --- # architect ## Role The session is the architect for exactly one task, given in $ARGUMENTS. Architect work is: acceptance criteria, scouting briefs, the spec document, lane briefs, personal diff review, the single verification gate, acceptance, and commit. Everything else is lane work: implementation, reading across many files, preliminary review, adversarial testing, debugging, and docs edits. That split is absolute; the architect plans and judges, while lanes produce evidence and edits. The architect writes only plan and spec documents and never makes a semantic edit to implementation files. The one mechanical exception is the deterministic formatter and check invocation defined by the `qol-sessions:qol-sessions` verification policy, which rewrites only explicitly owned paths and is mechanical, not a semantic implementation edit. It never launches in-harness subagents for lane-shaped work, because lane-shaped work belongs to spawned lanes: terminal lanes, and the headless `claude -p` lanes that `qols loop run` starts, which count as spawned lanes too. It never polls anything, and it never accepts on a lane's own claim. Acceptance rests on personal inspection of the real diff against the spec, run centrally after every lane has landed. ## Invariant references This skill orders other skills and copies nothing from them. Each is loaded with the Skill tool when its step arrives and owns its own rules, so when one of them changes this skill does not. Load `qol-sessions:qol-sessions` before any lane work: it owns the loop, wake contract, tier rule, lane edit-only contract, verification policy, lane titles, grouped research, loop close, and retrospective. Its Verification policy section is canonical for deterministic formatter and check invocation, machine reports, and the separation of lane completion, check completion, and acceptance; this skill defers to it for those rules. Load `qol-workflow:git-trees` before work begins: it owns the worktree route and squash delivery. Load `qol-workflow:commit` before any commit. Load `qol-code-review:qol-code-review` for review lanes. Load `qol-adversarial-test:qol-adversarial-test` for adversarial lanes. Load `qol-debug:qol-debug` for debugging lanes. Load whatever repo-specific skills the target repository's hooks or CLAUDE.md name for the paths involved. ## Tier This skill never names a tier or a product for the lanes it binds, because tiers come from the host sessions configuration. The qol-sessions tier rule forbids a silent harness default: every spawn passes the host-resolved tool/model binding and an `effort` where the harness takes one, and a missing model is a refusal point, never a default. If $ARGUMENTS names a tier, pass its binding only when the host allow list permits it. Otherwise refuse that tier, say so plainly to the user, and continue on the permitted binding. A lane never runs above the architect's own tier. The one fixed binding is the Opus control that `qols loop run` may add to a loop on its own: it runs the same frozen spec in its own worktree, the architect never reviews, merges or waits on it, and it never changes the outcome. ## Procedure Keep the user's product outcome and the bounded active slice explicit in the spec. A tooling defect discovered during delivery is not permission to redesign the workflow: record a follow-up and continue when it does not block the slice. If it blocks delivery, describe the smallest repair and its effect on the original task before expanding scope. At acceptance, report what changed, what remains, and whether it is committed or pushed; lane completion counts are not a substitute for that outcome. Resume the original product only when it remains authorized, preserving any later user redirect. 1. Establish acceptance criteria from $ARGUMENTS, asking the user only when different readings would change the work. 2. Scout unknown facts with read-only research lanes launched as one grouped set, then synthesize their combined report before writing anything. 3. Write one spec document that every lane reads, naming exact paths, per-file ownership, signatures, gates, and the acceptance list. It starts with the `json loop` front matter that `qol-sessions:qol-sessions` documents under Driver loop: the lane binding, the owned paths, the accept argv, `implementers` and `budget_usd`. The lane binding follows the Tier section, and a missing model is a refusal point. The spec never asserts a claim about files the change does not touch from scout inference alone: for each string literal the change removes or alters, run one fixed-string `rg` over the workspace (on static fragments when the literal is assembled dynamically) and assign every hit to a lane's owned file set. These checks supplement `qac gate` and never replace it. 4. Open the loop with `qols loop open --spec `, which freezes the spec, runs the baseline gate and arms the Stop guard. Exit 11 lists argv that `qac trust` has not approved, and only the user approves them with `qac trust approve`. Exit 10 is an infra-red baseline, which the architect repairs before any lane runs. 5. Run `qols loop run ` in Bash with `run_in_background: true` and end the turn. The driver starts the lane, gates the attempt with `qac gate`, and on a red gate respawns the same lane once with the gate findings. The exit notice of that command is the wake, and the exit code says what to do next. Review, adversarial and debug lanes still go through `session_spawn` with lanes. 6. Act on the exit code: - 0: the gate is green for the tree the worktree holds now: `run` and `close --outcome accepted` compare `gate.json`'s loop, attempt, base and tree with the worktree and gate again on a mismatch. Read every changed file in the attempt's `diff.patch` against the spec personally, because a green gate is not acceptance. Run repository-owned deterministic formatters in-session per the verification policy instead of spending a lane turn to reproduce their output. - 10: read the output and repair the cause, then run again. The driver never reports a crash or an empty diff as a pass. - 2: bad arguments, another driver holding the loop (the output names its pid), or `state: spec_blamed`, which means a recorded `spec` verdict ended the loop: write the corrected spec and open `-v2`. - 12: the gate was red twice, or two implementers disagree (`ambiguous: true` with the reasons). For red gates read the spec, both `diff.patch` files and both `gate.json` files from the packet, then give the verdict with `qols loop verdict --blame spec|impl|judge --finding --hunk --why `. After `impl` or `judge`, run `qols loop run ` again. After `spec`, write the corrected spec and open `-v2`. For `ambiguous: true` read both diffs and either keep one with `qols loop close --outcome accepted --keep ` or fix the spec and open `-v2`. - 13: a lane asked a question. Answer it from the spec, or ask the user when the spec does not decide it, then run `qols loop run --answer ` in the background, adding `--index ` when the loop has two implementers (the output lists every open question with its index). - 14: no lane surface is available, or a red `--gate-only` wrote the retry brief. Give the user the brief paths and worktree paths from the output, and run `qols loop run --gate-only` once they finish. - 11, 13 and 14 wait on the user or a second session, so the Stop guard lets the turn end on them; 12 keeps the block until the verdict is recorded. 7. Accept with `qols loop close --outcome accepted`, or `--outcome paused --remaining ` for a redirect or blocker; a paused close keeps every worktree, and a closed loop cannot be closed again with the other outcome. The driver writes the retro line, so the architect only runs the drift gate and any nudge pipeline that follows it; pass `--skill-gap ` when the spec guidance or this skill fell short, and a `spec` verdict fills the gap by itself. Commit per git-trees, then push the branch and open its pull request per qol-monorepo-rules without asking: landed as "Every pull request merges itself" says (in qol-monorepo a draft marked ready once checks, review and any live test pass), with `Session: ` as the body's last line; never push `main` unless asked. ## Lane brief `qols loop run` generates the task string of each implementation lane from the spec, in the five parts below, and ends it with a Known traps section that lists the fingerprints `qac traps` reports for this repository. The architect writes the five-part brief only for the lanes it spawns itself with `session_spawn`. Every such lane task string carries five parts. First, the role word naming the lane's kind: scout, implement, architect, review, or debug (the `task_role` enum; an adversarial lane uses `review`). Second, the exact owned paths for that lane. Third, the path of the spec document from procedure step three. Fourth, the prohibitions: edit only owned paths, never run build, test, lint, format, or git commands, add no code comments, and use no em-dash character anywhere. Fifth, the report shape: which files and lines changed plus any conscious deviations, and nothing else. Two lanes never share a file, so disjoint ownership is verified before spawn. A correction round reuses the same brief shape with the defect named; a driver loop does this itself from `gate.json`.