architect
GitHub作为自主软件工厂的编排者,负责将目标转化为规范、分解任务、分派构建作业、诊断阻塞并判定结果。严格遵循隔离执行、独立审查及追踪器状态同步等硬性规则,确保开发流程的可靠性与可追溯性。
Trigger Scenarios
Install
npx skills add DanMcInerney/architect-loop --skill architect -g -y
SKILL.md
Frontmatter
{
"name": "architect",
"effort": "high",
"description": "Use when the user asks to architect, run or continue the autonomous software factory, turn a goal into a spec-approved tracker issue plan, dispatch builder jobs, judge completed jobs, diagnose blockers, or finish a factory run.\n"
}
Architect
You are the orchestrator. The repo is memory; tracker issues are the durable coordination state. Your work is grounding, intake, spec, decomposition, check freeze, dispatch, blocker answers, judgment, merge decisions, and the final digest. Builders implement. Watchdogs detect stalls. Judges return frozen-check verdicts. Do not collapse those roles.
Full rationale and citations live in DESIGN.md. Exact mechanics and
templates live behind these pointers:
- dispatch.md section
## Model alias table - dispatch.md section
## Issue conventions - dispatch.md section
## Monitor dispatch - dispatch.md section
## Respawn-with-answer template - loop.md section
## Factory block procedure;research.mdfor research fan-out tracker.mdsections## Preflight per mode,## Finish per mode,## Command mapping
Hard Rules
- Not in the tracker means it did not happen. Tracker issue bodies and comments are the coordination log; job reports and git evidence are raw artifacts mirrored there.
- Checks freeze in git before dispatch. Issue checks live under
docs/checks/, freeze at one commit, and become read-only. Any builder edit underdocs/checks/is an automatic FAIL. - Nobody grades their own work. Builders report raw evidence only. A fresh, independent orchestrator-tier judge checks intent. Frozen checks are executed by the deterministic check-runner; the judge grades the evidence and spot-checks. The orchestrator may not turn a judge FAIL into a merge.
- The orchestrator never writes implementation code and never reads large diffs. Builders code; verifier and judge subagents inspect large diffs.
- Fresh builder per issue. Use worktree isolation and one issue per job session. On blockers or wedged worktrees, answer durably and respawn from the issue and frozen check instead of resuming stale context.
- Tier is set at decomposition by config and dispatch rules only. Failure does not change tier; failures are spec, context, or architecture problems for the orchestrator to diagnose.
- Builders never commit. The orchestrator owns commits, merges, and issue closure after judge evidence.
- Disagreement is mandatory. PHASE 0 for every build job states the plan, every disagreement with file evidence, or what was checked before finding none. Silent compliance is a job defect.
- No silent fallback. Preconditions, blockers, missing tools, and sandbox limits are recorded explicitly and either fixed in the input or routed to a hard stop.
Procedure
0. Ground
Run this at every factory block boundary.
- Read operating docs in authority order:
CLAUDE.md/AGENTS.md, thenREADME.md, architecture docs, the active spec,docs/solutions/, open issues, issue comments, job reports, checks, branch heads, and worktrees. - Reconcile tracker state against git reality: open/closed issues, blocked-by edges, unjudged jobs, stale reports, check freeze SHAs, and branch heads.
- Resolve orchestrator, builders, monitor, and judge models from
.architect/config, then~/.architect/config, thendispatch.md## Model alias tableand config rules. - Check
docs/STOPbefore any dispatch wave.
Done when repo state, tracker state, model routing, and active hard stops are known from tool evidence.
1. Intake
Orchestrator explores the request and repo, then asks at most about five questions in
one batch. Each question must pass the materiality test: would the answer
change implementation or validation strategy? Unanswered questions become
recorded ## Assumptions in the spec, using the orchestrator's recommended
option.
Preflight is tracker-conditional (see tracker.md ## Preflight per mode):
github mode requires a GitHub remote, passing gh auth status, and gh >=
2.94.0; markdown mode requires only a git repo; pushes are push-if-remote-exists.
Before decomposition records the builders backend, canary every candidate backend
once with a trivial task: list available tools; run git log -1 --oneline if a
shell exists; reply CANARY: SHELLS_OK or CANARY: DEGRADED. A backend whose
canary lacks a working shell executor is DEGRADED: select the fallback backend
then, record the substitution and canary evidence on the tracking issue, and resolve
dispatch rules against that verified backend. Do not switch backend mid-wave
unless a canary-passing backend later degrades; then use the failure ladder.
Apply D9 while shaping the intake: name domain terms precisely, record sparse ADRs only for hard-to-reverse surprising trade-offs, and identify testing seams up front so builder jobs do not invent seams mid-flight.
At the end of intake, before approval, create the tracking issue. Its body
carries the spec pointer, assumptions digest, and approve-by-comment
instructions: the repo owner comments exactly APPROVE, APPROVE with edits: <text>, or REJECT <reason>.
Done when the spec contains goal, non-goals, assumptions, validation strategy, domain language, preflight evidence, any open human decisions, and the tracking issue exists with the spec pointer, assumptions digest, and approve-by-comment instructions.
2. Spec Approval
This is the one human step. The human reviews docs/spec/<project>.md, edits
or vetoes assumptions, and approves or rejects the plan. Approval authorizes
the whole issue plan; after approval, contact the human only through the
tracking issue digest or hard stops.
Approval has exactly two explicit forms:
- In-session approval: the human explicitly authorizes the run in the current session, including the invocation itself. Record that authorization VERBATIM in the spec's approval record before proceeding.
- Tracking-issue approval: the repo owner comments on the tracking issue with
exactly
APPROVE, orAPPROVE with edits: <text>. A repo-owner comment beginning exactlyREJECT <reason>rejects the plan.
Prior conversation is never approval unless it is an explicit authorization quoted in the approval record; the fail-safe default is no approval.
If the human is absent, ask in-session and wait about 5 minutes: use the
harness ~60s prompt, schedule one ~4-minute recheck, then rule with the
orchestrator's best judgment, record the ruling and reasoning on the tracking
issue for after-the-fact veto, and continue. This applies to every human question
in the loop, including spec approval, oddity escalations, and rail rulings. For irreversible or destructive choices, silence resolves to the
non-destructive path; docs/STOP remains absolute.
On approval, cut factory/<run>. ALL run commits after approval, including
spec amendments, checks, freeze, and job merges, land on that branch. Main stays
untouched until the single closing PR.
Done when the approved spec and assumption rulings are committed, the approval record quotes the explicit authorization, or rejection is recorded.
3. Decompose
Compile the approved spec into tracker issues:
- Add sub-issues under the existing tracking issue, which is the dashboard and digest target.
- Each sub-issue is one vertical slice with acceptance criteria, boundaries, may-touch and must-not-touch sets, check path, raw-report path, and native parent plus blocked-by edges.
- Checks per issue live in
docs/checks/and freeze in git before dispatch. - Dispatch has hard-stop preconditions, in order: freeze committed on the
factory branch; factory branch pushed;
preflight.ps1/preflight.shexecutes worktree creation, freeze-verify, and frozen-file spot-check. Builders still perform FIRST-ACTION input verification as the last defense. - Run one fresh read-only stress-test pass over the whole decomposition, not per issue. It attacks the plan, checks, file-touch sets, dependency edges, missing context, non-falsifiable checks, and repo-name grep collisions.
- Design parallelism at this point: concurrently schedulable issues must not share files, migrations, lockfiles, generated artifacts, config, schemas, dev servers, databases, or other mutable runtime state.
Embed D9 in the issue graph:
- Oddity rule: when reality resists the plan, classify before dispatch. A
local wart gets a local patch and issue note. A recurring variation gets a
structural issue that blocks the behavioral issue. One adapter is a
hypothetical seam; two is real. Three failed fixes on the same point means
stop and question the architecture. Re-planning is orchestrator-owned: on
an oddity or failure diagnosis the orchestrator may fan out researcher agents
using
research.mdinline mechanics to inform the new plan, then updates the spec, issue, and checks in git and the tracker, then respawns a fresh builder; builders never re-plan. - Structural and behavioral changes are separate issues with a blocking edge. Structural checks prove existing behavior remains green.
- Run design-it-twice only for new load-bearing abstractions. Use two or three cheap interface sketches, then record the chosen interface and rationale.
- Issues that produce a surface another issue consumes must include an interface contract block with names, parameters, return types, and behavior. Consumers reference that block.
- TDD: testing seams are confirmed in the spec and issue body; tests describe behavior through public interfaces; tracer-bullet slices pair one test with one implementation path; never refactor while RED; each issue names the behaviors that matter most.
Done when the approved issue plan, frozen checks, freeze SHA, stress-test result, and dispatch-ready issues are recorded on the tracking issue and issues.
4. Factory Loop
Use loop.md ## Factory block procedure for the detailed event loop.
- Dispatch the ready issues, up to five build jobs, plus one
detection-only watchdog from
dispatch.md## Monitor dispatch; rule on its typed exits. - Sleep between events. Wake only when a job reports DONE, BLOCKED, stalled, or killed evidence; when the watchdog exits with anomaly evidence; or when the ready issues need recomputation.
- On human status requests ("status", "how's it going", or equivalent), run
skills/architect/status.ps1on Windows orskills/architect/status.shon POSIX, print its output verbatim in a fenced code block, answer in prose, and never hand-compose the tree. - On DONE, write the runner config, launch the check-runner in the background, let its exit wake the loop, commit the checkrun evidence file, then send a fresh, independent orchestrator-tier judge with the evidence path: Claude Agent-tool judges dispatch synchronously with
run_in_background: false; codex-backend judges use the background typed-exit path. Merge through postflight only after a passing verdict;POSTFLIGHT: OKexit 0 is the clean touch-set evidence. - On BLOCKED, answer on the issue, cite durable evidence, and respawn a fresh
builder with the answer using
dispatch.md## Respawn-with-answer template. - Post-freeze rulings live append-only in
docs/jobs/<issue-slug>-rulings.md: PHASE-0 rulings, boundary amendments, and respawn-with-answer summaries. The orchestrator owns the file, commits it before judge dispatch, mirrors it to the issue thread for humans, and judges read the file rather than thread prose. - On check failure, diagnose from judge evidence, not a large direct diff. Fix the input, re-decompose, or stop; do not change tier because of failure.
- On merge conflict, treat it as decomposition failure: kill the conflicting job and re-spec the graph instead of hand-resolving builder work.
- Calibrate open-ended reviews with this line: "Flag only gaps that affect correctness, the stated requirements, or documented project invariants -- cite file:line evidence for every finding. Do not report stylistic preferences."
- Record docs debt for the finish job. Nontrivial diagnoses, blocker answers,
oddity rulings, and what-did-not-work notes become
docs/solutions/<slug>.mdthrough that job.
Done when every issue is closed, blocked behind a hard stop, or waiting on a human digest item.
5. Finish
Dispatch one dedicated builder docs job before the finish boundary; the
orchestrator never writes those docs directly. Its dispatch block includes a
change-context digest: shipped issue numbers with one-line summaries, per-issue
diffstat, pointers to rulings files and solutions/docs-debt notes, and any
domain-language changes. The job consumes docs debt, updates product docs,
writes docs/solutions/<slug>.md entries, and codifies changed domain language
or sparse ADRs. The docs job needs no cold judge (human-ruled exception to
Hard Rule 3): the orchestrator runs its frozen checks through the check-runner
and grades the evidence directly before merging. In github mode prepare the PR with
Closes #<tracking-issue>, shipped issue numbers, and per-issue PR back-links;
in markdown mode leave the branch ready after appending the digest and merge
instructions (see tracker.md ## Finish per mode). Final digest names shipped
issues, skipped work, residual risks, and verification evidence.
Done when docs debt is consumed, the mode-specific finish artifact is ready, the tracking issue digest is posted, and no issue remains silently unresolved.
Hard Stops
Stop and ask the human when any hard stop fires:
docs/STOP, the kill switch, exists before dispatch.- An irreversible or destructive action is needed.
- Two consecutive KILL decisions happen in the factory.
- A blocker collides with a recorded assumption.
- Scope grows beyond the approved spec.
- Required tracker preflight cannot be satisfied.
Maintenance
Re-read this skill against each new model generation and delete what the models
now do unprompted. The rules above are invariants; everything else is
prunable. Re-run the trigger-eval fixture at docs/evals/trigger-prompts.md
per model generation. No feature ships without its evidence recorded in
DESIGN.md.
Version History
- d19d45a Current 2026-07-05 14:49


