Agent Skills › DanMcInerney/architect-loop

DanMcInerney/architect-loop

GitHub

用于处理发现级研究任务,如项目头脑风暴、技术选型或前沿调研。通过将宽泛问题转化为有来源支持的决策证据和研究交接文档,辅助用户做出明智决定。

2 skills 579

Install All Skills

npx skills add DanMcInerney/architect-loop --all -g -y
More Options

List skills in collection

npx skills add DanMcInerney/architect-loop --list

Skills in Collection (2)

用于处理发现级研究任务,如项目头脑风暴、技术选型或前沿调研。通过将宽泛问题转化为有来源支持的决策证据和研究交接文档,辅助用户做出明智决定。
请求对特定主题进行深度研究 询问行业技术现状或最新进展 需要为项目或功能选择技术方案
skills/architect-research/SKILL.md
npx skills add DanMcInerney/architect-loop --skill architect-research -g -y
SKILL.md
Frontmatter
{
    "name": "architect-research",
    "effort": "high",
    "description": "Use when the user asks for discovery-scale research that informs a decision: brainstorming a project or feature, choosing a technology, or requests like \"research X\", \"what's the state of the art\", or \"deep research\". Use this skill to turn broad, uncertain questions into sourced decision evidence and a reusable research handoff. For narrow slice-level fact checks inside the build loop, \/architect handles those inline.\n"
}

Architect Research

You are the research orchestrator. Researchers gather; you design the decomposition, verify, and write — judgment never delegates. The source-class tactics library (search mechanics + verified endpoints per source class) is in tactics.md next to this file; read it when you design researcher assignments.

Scale before anything

A tool call is one search OR one page fetch.

  • Simple fact-find → answer directly or 1 researcher, 3-10 tool calls. Don't run a harness on a question one search answers.
  • Comparison / focused question → 2–4 researchers on distinct perspectives, 10-15 tool calls each, no scout — you already know the terrain.
  • Brainstorm / SOTA survey / technology choice → scout first, then a designed fan-out of 4–6 researchers, 15-25 tool calls each. Google's published research envelope brackets this tier: ~80 searches ≈ $1–3/task standard, ~160 ≈ $3–7 max.

Procedure

1. Scope → brief

If the question is ambiguous, ask at most 2–3 clarifying questions, then compress everything into a research brief: the question, the decision it informs, constraints, and what "answered" looks like. The brief is the north star — every later step is checked against it, and it's restated at the top of the final report so the reader can audit scope drift.

2. Scout, then design the researchers

Design researcher assignments per topic, not from a fixed taxonomy.

Scout (brainstorm scale only): dispatch ONE cheap researcher (~10 searches, same codex command as step 3) to map the terrain: canonical terminology, the 5–10 load-bearing systems/papers/repos, the named people, which source classes look rich vs empty, and the topic's natural fault lines. The scout returns a map, not findings. Skip the scout when you already know the terrain (comparisons, fact-finds).

Design (you, from the scout report): decompose into 3–6 sub-questions along the topic's own fault lines — distinct perspectives, never keyword variants of one query. For each researcher assignment pick the source-class tactics it needs from tactics.md (academic snowballing, dependents-not-stars repo evidence, production-grade pattern mining, general web, expert tracking) — one researcher may mix tactics; most topics don't need every source class. Scope each researcher to ≤5 subjects and give every researcher assignment an explicit search budget. Reserve expert opinion as a second-wave researcher: its roster (survey authors, maintainers, recurring names) comes from the first wave's findings.

Review the researcher set for overlap AND for gaps against the brief before dispatch. State the plan in a few lines; proceed unless the user redirects.

3. Fan out

Resolve the researcher model as builders, same order as /architect: repo .architect/config, then user ~/.architect/config, then the codex-first default in skills/architect/dispatch.mdcodex/best (gpt-5.5, xhigh) whenever the Codex CLI is on PATH; claude/tier-down (Sonnet at high) only when the orchestrator is Claude Code and Codex is absent. One fresh researcher per assignment, all parallel, in the background — this is the default-builders example (codex/best):

codex exec --sandbox read-only -c web_search="live" \
  -m gpt-5.5 -c model_reasoning_effort="xhigh" \
  -o .architect/research/<NN>-<researcher>.md \
  - < .architect/research/<NN>-<researcher>.prompt.md

Write each researcher block to a .prompt.md file and pass it via stdin (-) — never as a shell argument; quote-mangling shells make codex hang on stdin.

(Web search is on by default in current Codex; "live" forces fresh results. Older CLIs: --enable web_search (0.13x) or -c tools.web_search=true (< 0.133); --search is TUI-only — exec rejects it. Launch ONE canary researcher and confirm it starts cleanly before fanning out. If resolved builders is a claude row, or Codex is unavailable, run researchers as read-only Claude subagents with web search — the researcher blocks work verbatim.)

Every researcher block carries the full contract — objective, output format, source guidance, boundaries — plus:

  • Search budget by tier: simple 5, standard 15, deep 25 searches.
  • Saturation rule: two consecutive searches yielding no new load-bearing facts → return what you have.
  • Findings discipline: every finding has a source tag + date + exact figure or short quote + confidence tag (high = primary source / med = reputable secondary / low = single blog or forum). NOT FOUND beats inference. Disagreements between sources are reported, never resolved. No recommendations — judgment is the orchestrator's. The findings file is capped at ≤ ~2,500 tokens (~10 KB): every source URL appears EXACTLY ONCE, in a numbered source list at the end of the file, and findings cite sources by tag (e.g. [S3]).

4. Gap round (max 2 extra rounds, usually 1)

After reading wave-1 findings, write (or update, on round 2) a skeleton draft of the final report at .architect/research/<topic>.draft.md (gitignored working state) — an answer-first outline where every section carries a SUPPORTED / THIN / EMPTY status against the brief. Gap researchers are designed from the THIN/EMPTY sections — the holes in the draft generate the queries, not a coverage score kept in your head. Every NOT FOUND from prior researchers carries forward into a do-not-rechase list that every gap-researcher block must include, so gap researchers don't re-spend budget chasing a dead end. This is also where the expert-opinion researcher dispatches: extract the expert roster from the first wave (survey authors, maintainers, recurring names) and send the researcher 6 after them. Hard stop after two refinement rounds — past that you're chasing nonexistent information.

5. Verify (your work, against raw sources)

  • Extract the load-bearing claims — the facts the decision depends on.
  • Require ≥2 independent sources per load-bearing claim. Independent means independent origin — two articles rewriting the same press release are one source.
  • Tag each: VERIFIED (≥2 independent agree) / UNVERIFIED (<2, no contradiction) / DISPUTED (sources disagree — report both positions and why they differ: date, method, definition) / SUSPICIOUS (contradicts available evidence).
  • Adversarial pass on the top claims: search " criticism", "<X> problems", "<X> vs " — actively try to falsify.
  • Citations are only URLs fetched this session. Never cite from memory — even search-grounded agents fabricate 3–13% of URLs. Spot-check the load-bearing ones by fetching them yourself.
  • Recency discipline: every quantitative or current-state claim carries a source date; prefer the most recent authoritative treatment; date-restrict searches on fast-moving topics. Anything that smells like training-data leakage gets re-verified or cut.
  • Source hierarchy: primary (papers, official docs, changelogs, first-party engineering blogs) > reputable secondary > SEO listicles (pointers only, never citations).
  • Opinion ≠ fact. Expert opinions are reported as positions — quoted, dated, conflict-of-interest flagged — and never count toward the ≥2-source rule for factual claims. Expert disagreements are first-class findings: they mark the genuinely open questions.

6. Synthesize (one pass, one author — you)

Parallelize gathering, never synthesis. Write docs/research/<topic>.md:

  • Answer first (BLUF), then evidence, then method.
  • The brief, restated.
  • Per major finding: the claim + confidence tag + what it implies for the decision + what evidence would change this conclusion.
  • Disputes surfaced with both positions — never silently averaged.
  • Expert positions map: who believes what (quoted, dated, conflict-of-interest flagged), and where credible experts disagree.
  • Open questions: each UNVERIFIED/DISPUTED item with the specific search or experiment that would resolve it (this doubles as the next round's input).
  • Citations dated and tier-labeled: [primary, 2026-04].

Commit the report — this is the research handoff: its Open-questions section is the next round's input, and the repo is the memory. Raw findings stay in .architect/research/ (gitignored).

7. Hand off

A later session resumes work by reading the committed research handoff and dispatching gap researchers against its Open-questions section instead of restarting the harness. If this feeds the build loop: distill the report into docs/spec/<slice>.md per /architect and continue there.

作为自主软件工厂的编排者,负责将目标转化为规范、分解任务、分派构建作业、诊断阻塞并判定结果。严格遵循隔离执行、独立审查及追踪器状态同步等硬性规则,确保开发流程的可靠性与可追溯性。
用户要求架构设计或启动自主软件工厂 需要将目标转化为规范化的追踪问题计划 需要分派构建作业或诊断项目阻塞点
skills/architect/SKILL.md
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.md for research fan-out
  • tracker.md sections ## Preflight per mode, ## Finish per mode, ## Command mapping

Hard Rules

  1. 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.
  2. Checks freeze in git before dispatch. Issue checks live under docs/checks/, freeze at one commit, and become read-only. Any builder edit under docs/checks/ is an automatic FAIL.
  3. 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.
  4. The orchestrator never writes implementation code and never reads large diffs. Builders code; verifier and judge subagents inspect large diffs.
  5. 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.
  6. 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.
  7. Builders never commit. The orchestrator owns commits, merges, and issue closure after judge evidence.
  8. 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.
  9. 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, then README.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, then dispatch.md ## Model alias table and config rules.
  • Check docs/STOP before 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, or APPROVE with edits: <text>. A repo-owner comment beginning exactly REJECT <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.sh executes 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.md inline 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.ps1 on Windows or skills/architect/status.sh on 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: OK exit 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>.md through 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.

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-09 05:33
浙ICP备14020137号-1 $bản đồ khách truy cập$