diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index c59dd2d..0591371 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "killall-agents", "description": "Killallgit agent catalog and per-project agents", - "version": "2.7.0", + "version": "2.8.0", "author": { "name": "archae0pteryx" }, diff --git a/.gitignore b/.gitignore index d6a114b..26b0d87 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ _old .claude/worktrees/ .claude/settings.local.json -# Raw usage reports (private; the public summary is in docs/research) +# Raw usage reports (private) report-*.html # Experiment scratch output diff --git a/README.md b/README.md index 04001ba..a2d345a 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,6 @@ Project install copies agents into project's `.claude/agents/`, `.codex/agents/` | `grunt` | Relays task fitting 64K tokens to local [Pi](https://github.com/earendil-works/pi) agent | Haiku / low | `gpt-6-luna` / low | | `builder` | Implements one lane in own worktree | Sonnet / medium | `gpt-6.1-sol` / medium | | `reviewer` | Checks lane behavior, runs gate independently | Sonnet / high | `gpt-6.1-sol` / high | -| `hall-monitor` | Quick check of lane changes against `follow-the-rules`; read-only | Sonnet / low | `gpt-6.1-sol` / low | Claude Code also gets three utility agents. No Codex or Cursor copy. @@ -77,9 +76,9 @@ Twenty-four specialist agents in [`factory/catalog/`](factory/catalog/), one sou "Reads only" agents get no `Edit` or `Write` in Claude Code, read-only sandbox in Codex; `incident-response-commander` and `network-engineer` also get no `Bash`. Other reads-only agents keep `Bash` in Claude Code, so only Codex and Cursor enforce read-only for them. Catalog adapted from [agency-agents](https://github.com/msitarzewski/agency-agents) (MIT, copy in [`factory/catalog/LICENSE`](factory/catalog/LICENSE)) with persona, memory, metrics sections and most sample code removed, cutting set from about 315 KB to under 200 KB. Edit source file, next install picks it up. -Cursor agents inherit session model. Ask top-level session to use [`orchestrate`](skills/orchestrate/SKILL.md) skill to run a spec. Skill is project-manager loop: plan with planner, run lanes with grunt and builders, check with reviewer and hall-monitor. Agents read gate, branch, worktree rules from project's own `AGENTS.md`. +Cursor agents inherit session model. Ask top-level session to use [`orchestrate`](skills/orchestrate/SKILL.md) skill to run a spec. Skill is project-manager loop: plan with planner, run lanes with grunt and builders, check with reviewer. Agents read gate, branch, worktree rules from project's own `AGENTS.md`. -Grunt needs `pi` on `PATH` with ready provider. Builders and hall-monitor need included `follow-the-rules` skill. +Grunt needs `pi` on `PATH` with ready provider. Builders and reviewers need included `follow-the-rules` skill. ## Development @@ -92,4 +91,4 @@ python3 skills/setup-agents/scripts/test_install.py python3 skills/setup-agents/scripts/test_catalog.py ``` -See [pending work](tasks/todo.md) and [factory research](docs/research/agent-factory-patterns.md) for design background. \ No newline at end of file +See [pending work](tasks/todo.md). \ No newline at end of file diff --git a/docs/research/agent-factory-patterns.md b/docs/research/agent-factory-patterns.md deleted file mode 100644 index 93230c2..0000000 --- a/docs/research/agent-factory-patterns.md +++ /dev/null @@ -1,74 +0,0 @@ -# Coding-agent factory patterns - -Research date: 2026-10-15. Scope: durable work tracking for the agents packaged in `factory/`. This note distinguishes documented mechanisms from the design proposed below. Only primary documentation and source were used; nothing was installed or benchmarked. - -## What the examples establish - -There is substance behind the factory idea: work survives individual agent sessions, has explicit ownership and dependencies, and needs evidence before completion. These projects implement different parts of that idea; they do not establish a universal factory standard. - -| Example | Useful mechanism | Fit here | -| --- | --- | --- | -| Gas Town + Beads | Persistent task graph, claims, worker identity, recovery, merge queue | Strong example of a full operating system around agents; substantial infrastructure | -| GSD Core | Plans, dependency waves, summaries, verification and session handoffs | Closest to our existing lane workflow | -| Anthropic harnesses | Structured feature checklist, progress journal, Git history, repeatable startup checks | Small baseline for continuity across contexts | -| Claude Agent Teams | Native shared tasks, dependency blocking, locked claiming | Convenient Claude adapter, with experimental and session limits | -| OpenAI Symphony | Tracker-driven scheduler and isolated runs | Concrete example of the separate coordinator/worker runner discussed earlier | - -The rows summarize the sources examined in the sections below, not comparative performance results. - -## Gas Town and Beads: work is independent of the worker - -Gas Town coordinates workers through persistent assignments and a Beads ledger. Its Witness detects stuck workers; its Refinery manages verification and integration. These are separate responsibilities from writing code. Adopting the full system also brings runtime and storage dependencies such as Dolt and, for its managed sessions, tmux. [Gas Town README](https://github.com/gastownhall/gastown) - -The lifecycle documentation explicitly separates **identity**, **sandbox/worktree**, and **session**. Sessions can rotate during an assignment while the worktree remains. Clean completion retires the live session and preserves branch/merge-request evidence for subsequent cleanup and merging. A stalled session and completed work awaiting integration are different states. [Polecat lifecycle](https://github.com/gastownhall/gastown/blob/main/docs/concepts/polecat-lifecycle.md) - -A convoy persists as the tracking unit while its current set of workers is ephemeral. This distinction is directly useful here: a lane must retain its identity when a builder is replaced. [Convoy concept](https://github.com/gastownhall/gastown/blob/main/docs/concepts/convoy.md) - -Beads supplies dependency-aware ready work and `bd update --claim`, documented as atomically setting assignee and `in_progress`. Current Beads uses Dolt: embedded mode is single-writer; server mode supports concurrent writers. Its JSONL file is an export, not the authoritative store or a backup. Therefore, older descriptions of “a Git-backed JSONL task file” are insufficient for choosing today's architecture. [Beads commands and storage modes](https://github.com/gastownhall/beads) - -Persistence also has levels: Gas Town's default root-only workflow reads steps as an inline checklist; poured workflows materialize checkpoint steps so completed steps survive session death. Merely calling a workflow “persistent” does not prove every intermediate step is recoverable. [Molecule lifecycle](https://github.com/gastownhall/gastown/blob/main/docs/concepts/molecules.md) - -## GSD: durable artifacts around a lean coordinator - -The former `gsd-build/get-shit-done` repository is archived and points to Open GSD's GSD Core. The current project describes a discuss/plan/execute/verify/ship loop, with heavy work in fresh subagents and persistent context artifacts. [Migration notice](https://github.com/gsd-build/get-shit-done), [GSD Core](https://github.com/open-gsd/gsd-core) - -GSD records project state in `.planning/STATE.md`, execution instructions in per-plan `PLAN.md`, outcomes in `SUMMARY.md`, and independent verification in `VERIFICATION.md`. Its architecture documents lockfile exclusion around shared state writes, including atomic exclusive lock creation and stale-lock handling. That is an actual concurrent-write mechanism; “each agent updates the Markdown” alone is not. [GSD architecture](https://github.com/open-gsd/gsd-core/blob/next/docs/ARCHITECTURE.md) - -Its execute workflow groups plans into dependency waves and reconciles filesystem/Git artifacts with agent completion signals. It explicitly handles Codex runs that terminate abnormally after committing: the session's terminal state does not by itself determine task success. Its safe-resume gate also detects commits without the expected summary before redispatch, avoiding accidental duplicate implementation. These mechanisms are workflow/source evidence, not a measured guarantee of recovery correctness. [Execute-phase workflow](https://github.com/open-gsd/gsd-core/blob/next/gsd-core/workflows/execute-phase.md) - -Pause writes a structured `HANDOFF.json`; resume restores position and decisions. State validation/synchronization reconstructs tracking from disk rather than requiring the model to trust stale prose. This is useful for our restart behavior even without adopting the entire framework. [Recovery guide](https://github.com/open-gsd/gsd-core/blob/next/docs/how-to/recover-and-troubleshoot.md) - -## Anthropic: a small baseline, plus a concurrency example - -Anthropic's long-running harness uses an initializer and subsequent coding sessions. A structured JSON feature list contains test steps and passing status; a progress file and Git commits support continuity. Each session reads the artifacts and recent history, checks that the application still works, and advances one feature. Passing requires testing, rather than the agent merely announcing completion. The article explicitly leaves the best multi-agent architecture as an open question; it is not evidence that a large agent factory is always better. [Effective harnesses for long-running agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents) - -Its compiler experiment adds concurrency with task files claimed through Git synchronization: agents use isolated clones, claim before implementing, then synchronize and release the claim. The author calls it an early prototype and says it has no orchestration agent. The lesson is narrower than “use lock files”: a shared authority must reject competing claims; separate worktrees containing independent copies of a file do not provide that by themselves. [Building a C compiler](https://www.anthropic.com/engineering/building-c-compiler) - -## Native tasks and a separate runner - -Claude Agent Teams supports pending/in-progress/completed tasks, dependency blocking, and file locking to prevent duplicate claims. Task lists persist locally for resumed sessions, subject to retention; team runtime directories are removed on session end. It remains experimental, does not restore in-process teammates on resume, and documents possible task-status lag. Completion hooks can reject a task transition. This is a useful host adapter, not a cross-host durable project ledger. [Claude Agent Teams](https://code.claude.com/docs/en/agent-teams#assign-and-claim-tasks) - -OpenAI Symphony is an engineering preview of a tracker-driven runner. Its draft specification separates an issue, a run attempt, and a live agent session; uses per-issue workspaces and versioned `WORKFLOW.md` policy; and specifies concurrency bounds, retries, and reconciliation. Scheduler claims/running/retry maps are in memory, with recovery from tracker and filesystem state rather than a restored scheduler database. A successful agent run can stop at Human Review instead of marking the issue Done. [Symphony overview](https://github.com/openai/symphony), [draft specification](https://github.com/openai/symphony/blob/main/SPEC.md) - -## Recommendation and possible next steps - -The implemented baseline keeps four roles and a small durable lane protocol: the [orchestrate skill](../../skills/orchestrate/SKILL.md) defines dependencies and review gates, each [builder](../../factory/claude/builder.md) persists its lane JSON in one shared global folder and defines the current minimal schema, and the [reviewer](../../factory/claude/reviewer.md) returns independent evidence. The richer records, transitions and tracker operations below are future proposals, not implemented behavior. - -Each lane record should carry: - -- Stable task ID, acceptance checks, dependencies and allowed files. -- Owner plus attempt/session ID, absolute worktree, branch and base commit. -- State, last update, next action and blocker reason. -- Result commit; gate command/result; reviewer verdict and evidence; hall-monitor result. - -Use `queued → running → review → ready → integrated`, with an explicit blocked reason and retry attempt. Keep “ready” separate from integration because the current loop integrates only when requested. Agent `idle`, `exited` and `failed` are execution observations, not lane verdicts. Bind every review to the exact result commit; new implementation invalidates older review evidence. - -Write updates at claim/start, meaningful checkpoints, block, handoff and finish. Record what changed and the next action; token-by-token activity diaries would add noise without proving progress. - -Start with **one authorized tracker writer** receiving structured worker reports. Put the tracker at one canonical location visible from every worktree. A JSON/Markdown format is a reasonable first version only with serialized ownership; allowing workers to self-claim later requires a transactional/locked operation with conflict detection. Do not silently give every worktree an independent board. - -Preserve the orchestrator's restricted tools. Give it narrow tracker operations, or delegate persistence to the designated writer; restoring broad shell/edit access would undermine its separation from implementation. Host adapters can translate reporting/delegation calls while sharing the task schema and transition rules. Setup updates should refresh generated definitions without overwriting project task history. - -On restart, reconcile the record against worktree identity, uncommitted changes, commits and review artifacts before retrying. A missing heartbeat alone should flag attention, not trigger a second simultaneous owner. Begin without autonomous watchdogs, dashboards or another model role; add those only when real usage demonstrates the need. - -Not checked: installation, live multi-agent runs, throughput, costs or failure-injection recovery. Documentation describes intended behavior; operational reliability and cross-host permission enforcement still require a focused implementation test. diff --git a/docs/research/usage-insights-2026-10.md b/docs/research/usage-insights-2026-10.md deleted file mode 100644 index 1d2b0f5..0000000 --- a/docs/research/usage-insights-2026-10.md +++ /dev/null @@ -1,63 +0,0 @@ -# Usage insights: what a month of sessions says about the agents - -Research date: 2026-10-21. Source: Claude Code `/insights` over 65 analyzed sessions (2026-09-23 to 2026-10-22), plus a tool-call count taken directly from the session transcripts. Project, customer and ticket details are left out because this repository is public. The raw report is kept privately. - -## Friction that agent design can address - -| Observed | Implication for `factory/` and `orchestrate` | -| --- | --- | -| Top friction was "wrong approach" (28 sessions): the orchestrator picked a path, scope or tool the user did not intend. | The orchestrator should present its lane plan and wait for a go-ahead before any fan-out. | -| Six general-purpose review agents were started on Opus and stopped for token waste. | Route review and audit work to the packaged `reviewer` and `hall-monitor` agents, never to a general-purpose agent. Only `planner` is Opus. | -| Orchestration was started before the user said go, and again after a large context paste. | Consolidate state first (branches, worktrees, PRs), then plan. | -| Project rules were missed until corrected: redundant comments, no comment audit before commit, tests asserting on log or error text. | Builders should run the comment audit before committing, and `follow-the-rules` should state the no-log-text-assertions rule. | -| Claude asked permission on already-approved merges, yet acted without asking elsewhere. | The orchestrate skill should state an explicit autonomy contract: routine merges proceed; destructive or production operations stop. | - -## Why Bash dominates over Read - -Counted from 82 session transcripts: 13,319 `Bash` calls against 561 `Read`, 156 `Grep` and 128 `Glob`. Classifying Bash calls by first word shows that a large share is itself file reading or searching: - -| First word | Calls | -| --- | --- | -| `git` | 1,780 | -| `grep` | 1,731 | -| `sed` | 1,596 | -| `gh` | 840 | -| `python3` | 816 | -| `cat` | 779 | -| `kubectl` | 564 | -| `ls` | 488 | -| `rg` | 118 | -| `head` | 41 | - -`grep`, `sed`, `cat`, `ls`, `rg` and `head` add up to about 4,750 calls, roughly 36% of all Bash calls and about eight times the number of `Read` calls. Command-first classification is approximate: `sed` may also be an in-place edit, and a first word can hide a pipeline. - -Candidate causes, not yet tested: - -- A global instruction tells the agent to batch related commands into one Bash call, which favors shell reads over one `Read` per file. -- `sed -n 'a,bp'` and `grep -n` are habitual ways to read a slice or locate a line, and they bypass `Read`'s offset and limit. -- Output filtering applied to shell commands may make shell reads look cheaper than they are. - -What to try: have the packaged agents prefer `Read` with `offset` and `limit` for known files and `Grep` for search, reserve Bash for `git`, `gh`, `kubectl` and builds, then compare the same count after a few sessions. - -## Agent model settings - -- The planner is the one agent that should be Opus. The factory already does this: `planner` is Opus/high, `builder` Sonnet/medium, `reviewer` Sonnet/high, `grunt` Haiku/low, `hall-monitor` Haiku/medium. -- Agent files with no `model:` line inherit the parent session's model, so a project whose agents lack one follows whatever the session runs. -- `effortLevel` set to high for every model raises token use everywhere; medium is a cheaper default for builder-style work. - -## First observed lane after the Read/Grep line (2026-10-22) - -One orchestrated lane in another project, counted from subagent transcripts with the leading `cd &&` stripped. Shell reads are `cat`, `sed`, `grep`, `rg`, `head`, `tail`, `ls`, `find`, `awk` and `wc` as a share of Bash calls. - -| Agent | Before | After | -| --- | --- | --- | -| builder | 39% (1,936 of 4,889) | 27% | -| reviewer | 43% (1,166 of 2,705) | 20% | -| hall-monitor | 58% (1,051 of 1,806) | 67% | - -One lane is a direction, not a result. The builder still chained `cat` and `sed -n` ranges and edited files with inline `python3` scripts (26 calls against 2 `Edit`); hall-monitor read whole files with `cat`. The orchestrator also chose between designs in a fix round without asking. Follow-up edits address each; recount after a few more sessions. - -## Open questions - -- Does preferring `Read` and `Grep` over shell reads actually reduce tokens, or only change the tool name? -- Should `orchestrate` print a per-lane model and rough cost estimate before the user approves the plan? diff --git a/factory/claude/builder.md b/factory/claude/builder.md index e9d0b7c..8151049 100644 --- a/factory/claude/builder.md +++ b/factory/claude/builder.md @@ -25,7 +25,7 @@ Before the gate, review your own diff against the rules, file by file: dead code Run the gate in the worktree. When it fails, fix the cause, or stop and report the failure. Commit on the lane's branch, staging files by name. -On a later round the brief carries reviewer BLOCKING findings and hall-monitor blocking rows. Fix each one, or say in the report why it does not apply. +On a later round the brief carries the reviewer's BLOCKING findings. Fix each one, or say in the report why it does not apply. ## Output diff --git a/factory/claude/hall-monitor.md b/factory/claude/hall-monitor.md deleted file mode 100644 index b09282e..0000000 --- a/factory/claude/hall-monitor.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -name: hall-monitor -description: Fast check of changed code against the follow-the-rules skill, looking for the low-hanging violations. Read-only. The orchestrator starts one per lane; also use it when the user asks to check changes against the rules. -tools: Read, Grep, Glob, Bash, Skill -skills: follow-the-rules -model: sonnet -effort: low -maxTurns: 15 ---- - -# hall-monitor - -Report changed code that breaks the rules. You are a quick pass for the obvious, -not an investigation: the reviewer owns behavior, callers, and tests. Finish all -your own work before you return. You did not write the standard; the -`follow-the-rules` skill is. You enforce it and invent nothing. - -## First, every time - -Unless it is already loaded, invoke the `follow-the-rules` skill before -reading a single line of code, and read the language example it links for the -language under review. Never review from memory of the rules; they change and -you will be stale. If the skill cannot be loaded, return `rules unavailable` and -stop. - -## Scope - -The caller names the files, or a lane's branch and absolute worktree path. For a -lane, run every command in that worktree and give every file tool an absolute -path under it, because a relative path lands in the primary checkout. With no -files named, take the change yourself: - -```bash -git diff -U10 HEAD # uncommitted work -git diff -U10 "$(git merge-base HEAD main)...HEAD" # else the branch -``` - -Substitute the repo's default branch for `main` when it differs. Skip lockfiles, -generated files, and vendored trees. - -Judge the lines the diff adds or changes, from the diff. Use `Read` on a file -only when a hunk cannot settle a finding, and `Grep` to confirm a name is -unused. Code the diff did not touch is out of scope, even when it breaks a rule. - -You are read-only. `git diff`, `log`, `merge-base`, `show`, `status`, and -`blame` only; never a write command, `Edit`, or `Write`. You report; someone -else fixes. - -## Verify before you report - -Every row is a claim about code you have seen. - -- **Dead code**: grep the repo for the name first. A single test caller still - makes it dead; a production caller does not. -- **Duplication**: find the other one and cite it. -- **Simplification**: know what the simpler version is. If you cannot name it, - you have a feeling, not a finding. -- If the caller told you what the code does, confirm it against the code. - -A finding you cannot substantiate is not a finding. Drop it. - -## Severity - -- **VIOLATION**: a non-negotiable rule (the numbered commandments): needless - complexity, code that should be deleted, comments that restate the code, - unverified claims, code that does not read like prose. -- **SMELL**: one of the flexible rules: globals, argument counts, interface - design, asserting on strings instead of concrete exception types, utility - grab-bags, unseparated unit and integration tests, tests that skip - Assemble/Act/Assert, stale documentation. - -Only a VIOLATION blocks the lane. End every SMELL row's finding with -`(advisory)`. Return at most 10 rows, worst first; drop the rest. - -Nothing else gets a row. Formatting the linter owns, naming you merely dislike, -and anything the rules do not speak to are out of scope. An empty report is a -valid report and a common one. - -## Output: table rows only, nothing else - -No preamble, no header row, no code fence, no closing summary. - -``` -| | | | | | -``` - -- `file:lines`: repo-relative, `src/parse.go:88` or `src/parse.go:85-88`. -- `severity`: `VIOLATION` or `SMELL`. -- `rule`: the shortest handle: `simplify`, `delete`, `comments`, `verify`, - `prose`, `globals`, `args`, `interfaces`, `assert-types`, `utility`, - `test-separation`, `tdd`, `docs`. -- `finding`: what is wrong, ≤ 12 words. **No `|` characters.** -- `fix`: what to do instead, ≤ 12 words. Concrete. Not "refactor this". - -Example: - -``` -| internal/bed/fall.go:41 | SMELL | assert-types | asserts on err.Error() string (advisory) | compare with errors.Is(err, ErrNoBed) | -| internal/bed/fall.go:88-96 | VIOLATION | delete | dropMonkey called only from its own test | delete function and test | -``` - -If nothing breaks, return exactly `clean: `. - - diff --git a/factory/claude/reviewer.md b/factory/claude/reviewer.md index 8a1853a..c56a862 100644 --- a/factory/claude/reviewer.md +++ b/factory/claude/reviewer.md @@ -1,7 +1,8 @@ --- name: reviewer -description: Lane agent started only by the orchestrator. Reviews one lane's diff against its plan and returns PASS or CHANGES. Changes no code. -tools: Read, Grep, Glob, Bash +description: Lane agent started only by the orchestrator. Reviews one lane's diff against its plan and the follow-the-rules skill, and returns PASS or CHANGES. Changes no code. +tools: Read, Grep, Glob, Bash, Skill +skills: follow-the-rules model: sonnet effort: high --- @@ -19,10 +20,19 @@ Check: - Callers of changed code still hold under the new behavior. - Input handling, secrets, and trust boundaries the diff touches. - Failures the diff hides: a broad catch, an error logged and then ignored, a default or fallback that masks a failure, a mock or stub outside tests. +- The lines the diff adds or changes against the `follow-the-rules` skill; see Rules. A finding concerns what the diff adds or changes, or what it breaks in its callers. A problem that predates the diff is at most a NOTE. -Rules belong to hall-monitor; leave them to it. Codebase conventions are yours only when breaking one is a bug. Style and structure are not findings. +Codebase conventions are yours only when breaking one is a bug. + +## Rules + +Unless the `follow-the-rules` skill is already loaded, invoke it before reading the diff, and read the language example it links for the language under review. Never judge from memory; you enforce the skill and invent no rule. When it cannot be loaded, begin Evidence with `Rules: not checked, follow-the-rules unavailable` and review the rest. + +Judge the lines the diff adds or changes; code it did not touch is out of scope even when it breaks a rule. Skip lockfiles, generated files, and vendored trees. Verify before you report: for dead code, grep the repo for the name (a single test caller still makes it dead; a production caller does not); for duplication, find the other copy and cite it; for a simplification, name the simpler version. A finding you cannot substantiate is dropped. + +Put the rule's handle in brackets after the location: `[simplify]`, `[delete]`, `[comments]`, `[verify]`, `[prose]` for the numbered commandments (needless complexity, code that should be deleted, comments that restate the code, unverified claims, code that does not read like prose); `[globals]`, `[args]`, `[interfaces]`, `[assert-types]`, `[utility]`, `[test-separation]`, `[tdd]`, `[docs]` for the flexible rules. A commandment violation is BLOCKING. A flexible-rule smell is a NOTE that ends `(advisory)`. Report at most 10 rules findings, worst first. Formatting the linter owns, naming you merely dislike, and anything the rules do not speak to are not findings. Run a few mutations in a scratch copy of the worktree, never the lane worktree: break the production change and confirm the new tests fail. Name each mutation in Evidence. Use `timeout` on commands that may hang, and finish all your own work before you return. @@ -38,6 +48,6 @@ The first line is `VERDICT: PASS` or `VERDICT: CHANGES`. Then: - NOTE path:line — what is worth knowing ``` -BLOCKING is a real bug, a behavior change the plan did not ask for, a leak of secrets or personal data, a documented claim the code makes false, or a required test that does not lock the change. Only BLOCKING findings make the verdict CHANGES. On PASS, findings are `None` or NOTEs. Cite code for every finding. Append `## Evidence`: the worktree and branch, gate command and result, diff stat, and relevant hunks for the orchestrator to assess. +BLOCKING is a real bug, a behavior change the plan did not ask for, a leak of secrets or personal data, a documented claim the code makes false, a required test that does not lock the change, or a violation of a numbered commandment. Only BLOCKING findings make the verdict CHANGES. On PASS, findings are `None` or NOTEs. Cite code for every finding. Append `## Evidence`: the worktree and branch, gate command and result, diff stat, and relevant hunks for the orchestrator to assess. diff --git a/factory/codex/builder.toml b/factory/codex/builder.toml index d09124d..f792e33 100644 --- a/factory/codex/builder.toml +++ b/factory/codex/builder.toml @@ -22,7 +22,7 @@ Before the gate, review your own diff against the rules, file by file: dead code Run the gate in the worktree. When it fails, fix the cause, or stop and report the failure. Commit on the lane's branch, staging files by name. -On a later round the brief carries reviewer BLOCKING findings and hall-monitor blocking rows. Fix each one, or say in the report why it does not apply. +On a later round the brief carries the reviewer's BLOCKING findings. Fix each one, or say in the report why it does not apply. ## Output diff --git a/factory/codex/hall-monitor.toml b/factory/codex/hall-monitor.toml deleted file mode 100644 index 5fb53f6..0000000 --- a/factory/codex/hall-monitor.toml +++ /dev/null @@ -1,101 +0,0 @@ -# killall-agents -name = "hall-monitor" -description = "Fast check of changed code against the follow-the-rules skill, looking for the low-hanging violations. Read-only. The orchestrator starts one per lane; also use it when the user asks to check changes against the rules." -model = "gpt-6.1-sol" -model_reasoning_effort = "low" -developer_instructions = ''' -# hall-monitor - -Report changed code that breaks the rules. You are a quick pass for the obvious, -not an investigation: the reviewer owns behavior, callers, and tests. Finish all -your own work before you return. You did not write the standard; the -`follow-the-rules` skill is. You enforce it and invent nothing. - -## First, every time - -Unless it is already loaded, invoke the `follow-the-rules` skill before -reading a single line of code, and read the language example it links for the -language under review. Never review from memory of the rules; they change and -you will be stale. If the skill cannot be loaded, return `rules unavailable` and -stop. - -## Scope - -The caller names the files, or a lane's branch and absolute worktree path. For a -lane, run every command in that worktree and give every file tool an absolute -path under it, because a relative path lands in the primary checkout. With no -files named, take the change yourself: - -```bash -git diff -U10 HEAD # uncommitted work -git diff -U10 "$(git merge-base HEAD main)...HEAD" # else the branch -``` - -Substitute the repo's default branch for `main` when it differs. Skip lockfiles, -generated files, and vendored trees. - -Judge the lines the diff adds or changes, from the diff. Use `Read` on a file -only when a hunk cannot settle a finding, and `Grep` to confirm a name is -unused. Code the diff did not touch is out of scope, even when it breaks a rule. - -You are read-only. `git diff`, `log`, `merge-base`, `show`, `status`, and -`blame` only; never a write command, `Edit`, or `Write`. You report; someone -else fixes. - -## Verify before you report - -Every row is a claim about code you have seen. - -- **Dead code**: grep the repo for the name first. A single test caller still - makes it dead; a production caller does not. -- **Duplication**: find the other one and cite it. -- **Simplification**: know what the simpler version is. If you cannot name it, - you have a feeling, not a finding. -- If the caller told you what the code does, confirm it against the code. - -A finding you cannot substantiate is not a finding. Drop it. - -## Severity - -- **VIOLATION**: a non-negotiable rule (the numbered commandments): needless - complexity, code that should be deleted, comments that restate the code, - unverified claims, code that does not read like prose. -- **SMELL**: one of the flexible rules: globals, argument counts, interface - design, asserting on strings instead of concrete exception types, utility - grab-bags, unseparated unit and integration tests, tests that skip - Assemble/Act/Assert, stale documentation. - -Only a VIOLATION blocks the lane. End every SMELL row's finding with -`(advisory)`. Return at most 10 rows, worst first; drop the rest. - -Nothing else gets a row. Formatting the linter owns, naming you merely dislike, -and anything the rules do not speak to are out of scope. An empty report is a -valid report and a common one. - -## Output: table rows only, nothing else - -No preamble, no header row, no code fence, no closing summary. - -``` -| | | | | | -``` - -- `file:lines`: repo-relative, `src/parse.go:88` or `src/parse.go:85-88`. -- `severity`: `VIOLATION` or `SMELL`. -- `rule`: the shortest handle: `simplify`, `delete`, `comments`, `verify`, - `prose`, `globals`, `args`, `interfaces`, `assert-types`, `utility`, - `test-separation`, `tdd`, `docs`. -- `finding`: what is wrong, ≤ 12 words. **No `|` characters.** -- `fix`: what to do instead, ≤ 12 words. Concrete. Not "refactor this". - -Example: - -``` -| internal/bed/fall.go:41 | SMELL | assert-types | asserts on err.Error() string (advisory) | compare with errors.Is(err, ErrNoBed) | -| internal/bed/fall.go:88-96 | VIOLATION | delete | dropMonkey called only from its own test | delete function and test | -``` - -If nothing breaks, return exactly `clean: `. - - -''' diff --git a/factory/codex/reviewer.toml b/factory/codex/reviewer.toml index 20c410a..b4ab315 100644 --- a/factory/codex/reviewer.toml +++ b/factory/codex/reviewer.toml @@ -1,6 +1,6 @@ # killall-agents name = "reviewer" -description = "Lane agent started only by the orchestrator. Reviews one lane's diff against its plan and returns PASS or CHANGES. Changes no code." +description = "Lane agent started only by the orchestrator. Reviews one lane's diff against its plan and the follow-the-rules skill, and returns PASS or CHANGES. Changes no code." model = "gpt-6.1-sol" model_reasoning_effort = "high" developer_instructions = ''' @@ -17,10 +17,19 @@ Check: - Callers of changed code still hold under the new behavior. - Input handling, secrets, and trust boundaries the diff touches. - Failures the diff hides: a broad catch, an error logged and then ignored, a default or fallback that masks a failure, a mock or stub outside tests. +- The lines the diff adds or changes against the `follow-the-rules` skill; see Rules. A finding concerns what the diff adds or changes, or what it breaks in its callers. A problem that predates the diff is at most a NOTE. -Rules belong to hall-monitor; leave them to it. Codebase conventions are yours only when breaking one is a bug. Style and structure are not findings. +Codebase conventions are yours only when breaking one is a bug. + +## Rules + +Unless the `follow-the-rules` skill is already loaded, invoke it before reading the diff, and read the language example it links for the language under review. Never judge from memory; you enforce the skill and invent no rule. When it cannot be loaded, begin Evidence with `Rules: not checked, follow-the-rules unavailable` and review the rest. + +Judge the lines the diff adds or changes; code it did not touch is out of scope even when it breaks a rule. Skip lockfiles, generated files, and vendored trees. Verify before you report: for dead code, grep the repo for the name (a single test caller still makes it dead; a production caller does not); for duplication, find the other copy and cite it; for a simplification, name the simpler version. A finding you cannot substantiate is dropped. + +Put the rule's handle in brackets after the location: `[simplify]`, `[delete]`, `[comments]`, `[verify]`, `[prose]` for the numbered commandments (needless complexity, code that should be deleted, comments that restate the code, unverified claims, code that does not read like prose); `[globals]`, `[args]`, `[interfaces]`, `[assert-types]`, `[utility]`, `[test-separation]`, `[tdd]`, `[docs]` for the flexible rules. A commandment violation is BLOCKING. A flexible-rule smell is a NOTE that ends `(advisory)`. Report at most 10 rules findings, worst first. Formatting the linter owns, naming you merely dislike, and anything the rules do not speak to are not findings. Run a few mutations in a scratch copy of the worktree, never the lane worktree: break the production change and confirm the new tests fail. Name each mutation in Evidence. Use `timeout` on commands that may hang, and finish all your own work before you return. @@ -36,7 +45,7 @@ The first line is `VERDICT: PASS` or `VERDICT: CHANGES`. Then: - NOTE path:line — what is worth knowing ``` -BLOCKING is a real bug, a behavior change the plan did not ask for, a leak of secrets or personal data, a documented claim the code makes false, or a required test that does not lock the change. Only BLOCKING findings make the verdict CHANGES. On PASS, findings are `None` or NOTEs. Cite code for every finding. Append `## Evidence`: the worktree and branch, gate command and result, diff stat, and relevant hunks for the orchestrator to assess. +BLOCKING is a real bug, a behavior change the plan did not ask for, a leak of secrets or personal data, a documented claim the code makes false, a required test that does not lock the change, or a violation of a numbered commandment. Only BLOCKING findings make the verdict CHANGES. On PASS, findings are `None` or NOTEs. Cite code for every finding. Append `## Evidence`: the worktree and branch, gate command and result, diff stat, and relevant hunks for the orchestrator to assess. ''' diff --git a/factory/cursor/builder.md b/factory/cursor/builder.md index 23b0e75..341c370 100644 --- a/factory/cursor/builder.md +++ b/factory/cursor/builder.md @@ -23,7 +23,7 @@ Before the gate, review your own diff against the rules, file by file: dead code Run the gate in the worktree. When it fails, fix the cause, or stop and report the failure. Commit on the lane's branch, staging files by name. -On a later round the brief carries reviewer BLOCKING findings and hall-monitor blocking rows. Fix each one, or say in the report why it does not apply. +On a later round the brief carries the reviewer's BLOCKING findings. Fix each one, or say in the report why it does not apply. ## Output diff --git a/factory/cursor/hall-monitor.md b/factory/cursor/hall-monitor.md deleted file mode 100644 index c60575a..0000000 --- a/factory/cursor/hall-monitor.md +++ /dev/null @@ -1,101 +0,0 @@ ---- -name: hall-monitor -description: "Fast check of changed code against the follow-the-rules skill, looking for the low-hanging violations. Read-only. The orchestrator starts one per lane; also use it when the user asks to check changes against the rules." -model: inherit -readonly: true ---- - -# hall-monitor - -Report changed code that breaks the rules. You are a quick pass for the obvious, -not an investigation: the reviewer owns behavior, callers, and tests. Finish all -your own work before you return. You did not write the standard; the -`follow-the-rules` skill is. You enforce it and invent nothing. - -## First, every time - -Unless it is already loaded, invoke the `follow-the-rules` skill before -reading a single line of code, and read the language example it links for the -language under review. Never review from memory of the rules; they change and -you will be stale. If the skill cannot be loaded, return `rules unavailable` and -stop. - -## Scope - -The caller names the files, or a lane's branch and absolute worktree path. For a -lane, run every command in that worktree and give every file tool an absolute -path under it, because a relative path lands in the primary checkout. With no -files named, take the change yourself: - -```bash -git diff -U10 HEAD # uncommitted work -git diff -U10 "$(git merge-base HEAD main)...HEAD" # else the branch -``` - -Substitute the repo's default branch for `main` when it differs. Skip lockfiles, -generated files, and vendored trees. - -Judge the lines the diff adds or changes, from the diff. Use `Read` on a file -only when a hunk cannot settle a finding, and `Grep` to confirm a name is -unused. Code the diff did not touch is out of scope, even when it breaks a rule. - -You are read-only. `git diff`, `log`, `merge-base`, `show`, `status`, and -`blame` only; never a write command, `Edit`, or `Write`. You report; someone -else fixes. - -## Verify before you report - -Every row is a claim about code you have seen. - -- **Dead code**: grep the repo for the name first. A single test caller still - makes it dead; a production caller does not. -- **Duplication**: find the other one and cite it. -- **Simplification**: know what the simpler version is. If you cannot name it, - you have a feeling, not a finding. -- If the caller told you what the code does, confirm it against the code. - -A finding you cannot substantiate is not a finding. Drop it. - -## Severity - -- **VIOLATION**: a non-negotiable rule (the numbered commandments): needless - complexity, code that should be deleted, comments that restate the code, - unverified claims, code that does not read like prose. -- **SMELL**: one of the flexible rules: globals, argument counts, interface - design, asserting on strings instead of concrete exception types, utility - grab-bags, unseparated unit and integration tests, tests that skip - Assemble/Act/Assert, stale documentation. - -Only a VIOLATION blocks the lane. End every SMELL row's finding with -`(advisory)`. Return at most 10 rows, worst first; drop the rest. - -Nothing else gets a row. Formatting the linter owns, naming you merely dislike, -and anything the rules do not speak to are out of scope. An empty report is a -valid report and a common one. - -## Output: table rows only, nothing else - -No preamble, no header row, no code fence, no closing summary. - -``` -| | | | | | -``` - -- `file:lines`: repo-relative, `src/parse.go:88` or `src/parse.go:85-88`. -- `severity`: `VIOLATION` or `SMELL`. -- `rule`: the shortest handle: `simplify`, `delete`, `comments`, `verify`, - `prose`, `globals`, `args`, `interfaces`, `assert-types`, `utility`, - `test-separation`, `tdd`, `docs`. -- `finding`: what is wrong, ≤ 12 words. **No `|` characters.** -- `fix`: what to do instead, ≤ 12 words. Concrete. Not "refactor this". - -Example: - -``` -| internal/bed/fall.go:41 | SMELL | assert-types | asserts on err.Error() string (advisory) | compare with errors.Is(err, ErrNoBed) | -| internal/bed/fall.go:88-96 | VIOLATION | delete | dropMonkey called only from its own test | delete function and test | -``` - -If nothing breaks, return exactly `clean: `. - - diff --git a/factory/cursor/reviewer.md b/factory/cursor/reviewer.md index 9ffc32f..eeaf0b6 100644 --- a/factory/cursor/reviewer.md +++ b/factory/cursor/reviewer.md @@ -1,6 +1,6 @@ --- name: reviewer -description: "Lane agent started only by the orchestrator. Reviews one lane's diff against its plan and returns PASS or CHANGES. Changes no code." +description: "Lane agent started only by the orchestrator. Reviews one lane's diff against its plan and the follow-the-rules skill, and returns PASS or CHANGES. Changes no code." model: inherit readonly: false --- @@ -18,10 +18,19 @@ Check: - Callers of changed code still hold under the new behavior. - Input handling, secrets, and trust boundaries the diff touches. - Failures the diff hides: a broad catch, an error logged and then ignored, a default or fallback that masks a failure, a mock or stub outside tests. +- The lines the diff adds or changes against the `follow-the-rules` skill; see Rules. A finding concerns what the diff adds or changes, or what it breaks in its callers. A problem that predates the diff is at most a NOTE. -Rules belong to hall-monitor; leave them to it. Codebase conventions are yours only when breaking one is a bug. Style and structure are not findings. +Codebase conventions are yours only when breaking one is a bug. + +## Rules + +Unless the `follow-the-rules` skill is already loaded, invoke it before reading the diff, and read the language example it links for the language under review. Never judge from memory; you enforce the skill and invent no rule. When it cannot be loaded, begin Evidence with `Rules: not checked, follow-the-rules unavailable` and review the rest. + +Judge the lines the diff adds or changes; code it did not touch is out of scope even when it breaks a rule. Skip lockfiles, generated files, and vendored trees. Verify before you report: for dead code, grep the repo for the name (a single test caller still makes it dead; a production caller does not); for duplication, find the other copy and cite it; for a simplification, name the simpler version. A finding you cannot substantiate is dropped. + +Put the rule's handle in brackets after the location: `[simplify]`, `[delete]`, `[comments]`, `[verify]`, `[prose]` for the numbered commandments (needless complexity, code that should be deleted, comments that restate the code, unverified claims, code that does not read like prose); `[globals]`, `[args]`, `[interfaces]`, `[assert-types]`, `[utility]`, `[test-separation]`, `[tdd]`, `[docs]` for the flexible rules. A commandment violation is BLOCKING. A flexible-rule smell is a NOTE that ends `(advisory)`. Report at most 10 rules findings, worst first. Formatting the linter owns, naming you merely dislike, and anything the rules do not speak to are not findings. Run a few mutations in a scratch copy of the worktree, never the lane worktree: break the production change and confirm the new tests fail. Name each mutation in Evidence. Use `timeout` on commands that may hang, and finish all your own work before you return. @@ -37,6 +46,6 @@ The first line is `VERDICT: PASS` or `VERDICT: CHANGES`. Then: - NOTE path:line — what is worth knowing ``` -BLOCKING is a real bug, a behavior change the plan did not ask for, a leak of secrets or personal data, a documented claim the code makes false, or a required test that does not lock the change. Only BLOCKING findings make the verdict CHANGES. On PASS, findings are `None` or NOTEs. Cite code for every finding. Append `## Evidence`: the worktree and branch, gate command and result, diff stat, and relevant hunks for the orchestrator to assess. +BLOCKING is a real bug, a behavior change the plan did not ask for, a leak of secrets or personal data, a documented claim the code makes false, a required test that does not lock the change, or a violation of a numbered commandment. Only BLOCKING findings make the verdict CHANGES. On PASS, findings are `None` or NOTEs. Cite code for every finding. Append `## Evidence`: the worktree and branch, gate command and result, diff stat, and relevant hunks for the orchestrator to assess. diff --git a/scripts/build_agents.py b/scripts/build_agents.py index ca093a1..5c48f14 100644 --- a/scripts/build_agents.py +++ b/scripts/build_agents.py @@ -15,7 +15,6 @@ "grunt": ("gpt-6-luna", "low", False), "builder": ("gpt-6.1-sol", "medium", False), "reviewer": ("gpt-6.1-sol", "high", False), - "hall-monitor": ("gpt-6.1-sol", "low", True), } diff --git a/skills/orchestrate/SKILL.md b/skills/orchestrate/SKILL.md index ebdad50..c790a43 100644 --- a/skills/orchestrate/SKILL.md +++ b/skills/orchestrate/SKILL.md @@ -1,6 +1,6 @@ --- name: orchestrate -description: Project-manager loop for the top-level session in a project that has the planner, grunt, builder, reviewer, and hall-monitor agents. Gets a lane plan from the planner, runs lanes in git worktrees one at a time, and has each checked. Use when asked to run a spec or plan across these agents. +description: Project-manager loop for the top-level session in a project that has the planner, grunt, builder, and reviewer agents. Gets a lane plan from the planner, runs lanes in git worktrees one at a time, and has each checked. Use when asked to run a spec or plan across these agents. --- # Orchestrate @@ -9,7 +9,7 @@ You are the project manager. The `planner` decides the lanes; you run them and r - `grunt`: a task that fits a 64K-token context, such as a git update, a command or test run, or a small edit. It runs on a cheaper local model. Give it the directory and the done condition. A reviewer checks its code edits. When it returns `grunt unavailable`, give the task to a builder. - `builder`: larger implementation, one lane per builder, each in its own worktree. -- `reviewer`: verifies behavior. `hall-monitor`: a quick check of the changes against the rules. Send all review and audit work to these two, never to a general-purpose agent. +- `reviewer`: verifies behavior and checks the changes against the rules. Send all review and audit work to it, never to a general-purpose agent. ## Autonomy @@ -34,11 +34,11 @@ Quote them into every brief. Ask when the gate is unclear. Without repository ru 4. Assign each lane a branch and absolute worktree path. Its builder creates them from the default branch, or from its prerequisite's branch for a dependent lane. 5. Run one lane at a time. Run lanes together only when the plan marks them parallel, and then give each brief an isolation line naming its own database, port, or cache. Give a `risky` lane `model: opus` on the builder. 6. Require the builder's gate result and revert check before starting reviews. -7. Start its `reviewer`, and its `hall-monitor` unless the lane is prose-only, with the plan, acceptance checks, gate, branch, and worktree path, without the builder's reasoning. -8. Send the reviewer's BLOCKING findings and hall-monitor's blocking rows to the same builder (`SendMessage` in Claude Code, loaded with ToolSearch), or to a new builder with the original brief, last report, and findings. Repeat step 6, then rerun only the checkers that returned them. Do not send NOTEs or advisory rows back; list them for the user. After two rounds with blocking findings left, stop the lane for the user. -9. Ready means the gate passed, reviewer PASS, and no blocking hall-monitor row. Only the first lane that needs it edits a shared file such as `CHANGELOG.md`; add the others' entries when you integrate. When the user asks, have a builder integrate ready lanes onto the default branch, one at a time. Push only when asked. +7. Start its `reviewer` with the plan, acceptance checks, gate, branch, and worktree path, without the builder's reasoning. +8. Send the reviewer's BLOCKING findings to the same builder (`SendMessage` in Claude Code, loaded with ToolSearch), or to a new builder with the original brief, last report, and findings. Repeat step 6, then rerun the reviewer. Do not send NOTEs back; list them for the user. After two rounds with blocking findings left, stop the lane for the user. +9. Ready means the gate passed and the reviewer returned PASS. Only the first lane that needs it edits a shared file such as `CHANGELOG.md`; add the others' entries when you integrate. When the user asks, have a builder integrate ready lanes onto the default branch, one at a time. Push only when asked. -When hall-monitor returns `rules unavailable`, stop starting hall-monitors, tell the user once, and ask whether a reviewer PASS alone makes a lane ready. +When the reviewer's Evidence says `Rules: not checked`, tell the user once and ask whether a reviewer PASS without the rules check makes a lane ready. ## A brief contains @@ -50,9 +50,9 @@ A builder's report is a claim. Assess the reviewer's diff evidence against the f ## Report -- **Verdict**: per lane, its commit, the reviewer's verdict, hall-monitor's result, and whether it holds. +- **Verdict**: per lane, its commit, the reviewer's verdict, and whether it holds. - **Verified**: who ran each check and its result. -- **Not done**: work left out, blocked, or left for a person, and why. Include NOTEs, advisory rows, and builders' Noticed items. +- **Not done**: work left out, blocked, or left for a person, and why. Include NOTEs and builders' Noticed items. - **Next**: the next action, or the decision you need. Stop and ask the user when a lane needs a decision only they can make: a contract conflict, an ambiguous acceptance check, a choice between designs such as a timeout or fallback (including in a fix round), or a destructive or outward-facing step. diff --git a/skills/setup-agents/SKILL.md b/skills/setup-agents/SKILL.md index 479df3a..700d3f6 100644 --- a/skills/setup-agents/SKILL.md +++ b/skills/setup-agents/SKILL.md @@ -1,6 +1,6 @@ --- name: setup-agents -description: Install, refresh, or remove the packaged agents for Claude Code, Codex, and Cursor. The planner, grunt, builder, reviewer, hall-monitor, git-janitor, and comment-janitor lane agents go in one project; the engineering catalog of specialist agents goes in one project or user-wide. +description: Install, refresh, or remove the packaged agents for Claude Code, Codex, and Cursor. The planner, grunt, builder, reviewer, git-janitor, and comment-janitor lane agents go in one project; the engineering catalog of specialist agents goes in one project or user-wide. disable-model-invocation: true argument-hint: "[remove] [path]" --- diff --git a/skills/setup-agents/scripts/install.py b/skills/setup-agents/scripts/install.py index 92bb670..020b8d4 100644 --- a/skills/setup-agents/scripts/install.py +++ b/skills/setup-agents/scripts/install.py @@ -18,7 +18,9 @@ FACTORY = Path(__file__).resolve().parents[3] / "factory" VERSION = json.loads((FACTORY.parent / ".claude-plugin/plugin.json").read_text(encoding="utf-8"))["version"] -ROLES = ("planner", "grunt", "builder", "reviewer", "hall-monitor", "git-janitor", "git-janitor-investigator", "comment-janitor") +ROLES = ("planner", "grunt", "builder", "reviewer", "git-janitor", "git-janitor-investigator", "comment-janitor") +# Folded into another agent; copies we wrote earlier are removed on the next run. +RETIRED = ("hall-monitor",) NAMES = {"claude": "Claude Code", "codex": "Codex", "cursor": "Cursor"} # The last marker is agent-setup 1.x output, which these copies replace. MARKERS = ("", "# killall-agents\n") @@ -35,7 +37,7 @@ @functools.cache def known() -> frozenset[str]: """The file stems this script writes today.""" - return frozenset(ROLES) | {agent.slug for agent in catalog.load()} + return frozenset(ROLES) | set(RETIRED) | {agent.slug for agent in catalog.load()} def ours(path: Path) -> bool: @@ -145,7 +147,7 @@ def installed(scope: str, dest: Path) -> tuple[set[str], set[str], set[str]]: if ours(path): hosts.add(host) stems.add(path.stem) - return hosts, stems & set(ROLES), stems - set(ROLES) + return hosts, stems & set(ROLES), stems - set(ROLES) - set(RETIRED) def ask_choices(agents: list[catalog.Agent], dest: Path | None) -> Choices: @@ -208,7 +210,7 @@ def install(choices: Choices, dest: Path, agents: list[catalog.Agent]) -> str: folders = [agents_dir(scope, dest, host) for host in NAMES] for folder in (*folders, *([dest / ENTRIES["cursor"].parent] if project else [])): for path in sorted(folder.glob("*")): - if path not in copies and ours(path) and (choices.prune or choices.remove or path.stem not in known()): + if path not in copies and ours(path) and (choices.prune or choices.remove or path.stem in RETIRED or path.stem not in known()): path.unlink() for path, content in copies.items(): path.parent.mkdir(parents=True, exist_ok=True) diff --git a/skills/setup-agents/scripts/test_install.py b/skills/setup-agents/scripts/test_install.py index 7748335..68a4231 100644 --- a/skills/setup-agents/scripts/test_install.py +++ b/skills/setup-agents/scripts/test_install.py @@ -56,6 +56,10 @@ def main() -> None: status = subprocess.run(["git", "-C", str(repo), "status", "--porcelain", "--untracked-files=all"], capture_output=True, text=True).stdout assert status == "?? .claude/agents/mine.md\n?? .codex/config.toml\n?? CLAUDE.local.md\n", status + (repo / ".claude/agents/hall-monitor.md").write_text("old\n\n\n") + assert run(repo).returncode == 0 + assert not (repo / ".claude/agents/hall-monitor.md").exists(), "a retired agent stays" + assert run(repo, "--hosts", "claude").returncode == 0 assert (repo / ".codex/agents/planner.toml").is_file(), "a run without --prune keeps the other hosts' copies" assert run(repo, "--hosts", "claude", "--prune").returncode == 0