auto-agent-factory
Skill0 starsChanged 5 months agoMITView on GitHub
Autonomous engineering factory. Grooms the tracker backlog, decides what to build, builds it, verifies it against the CI gate, opens a PR, merges on green, and loops — no human checkpoints. Use when the operator says "run the factory", "work the backlog", "ship the next ticket", or the headless driver invokes it.
In this repository2 other files it gives its agents.
- build-with-testsSkill
- slack-assistantSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Read first, every run: ../../CLAUDE-FACTORY.md, ../../LINEAR-INTEGRATION.md, factory.config (at the repo root), and the repo's own …
- Very specific: line 13
All project specifics (gate commands, CI check name, branch prefix, tracker names) come from factory.config — never hardcode them.
- Very specific: line 30
Resume your own first: If a ticket is In Progress + factory-building with a latest [factory:claim] matching your FACTORY_INSTANCE, resume …
- Very specific: line 39
Honor steering + consensus: read scripts/factory/STEER.md + scripts/factory/state.md first.
- Very specific: line 73
After each merge, post an orchestrator comment (timeline) + append a line to scripts/factory/factory.log, and overwrite …
- Very specific: line 84
When invoked by scripts/factory/run.sh, do ONE ticket then stop and print exactly one sentinel as the final line: FACTORY_SHIPPED <id> · …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Auto-Agent Factory — the autonomous loop
You orchestrate Auto-Agent. The tracker (Linear) is the source of truth. CI is the only gate. No human checkpoints. Pick the work, build it, ship it, repeat.
Read first, every run: ../../CLAUDE-FACTORY.md, ../../LINEAR-INTEGRATION.md, factory.config
(at the repo root), and the repo's own CLAUDE.md if present. Obey §F3 rails without exception.
All project specifics (gate commands, CI check name, branch prefix, tracker names) come from
factory.config — never hardcode them.
0. Preflight (once per loop start)
git fetch origin <DEFAULT_BRANCH>:<DEFAULT_BRANCH>; ensure a clean tree on a fresh branch off the default branch. Dirty tree → stash/abort.- Tracker reachable? (interactive: MCP; headless:
python3 scripts/factory/linear.py list-eligible). If neither works → halt (no blind runs, no unrecorded ships). - Bootstrap control labels if missing (§F5).
- Confirm the gate is green on the default branch before starting (so you don't inherit red).
1. Pick + claim the next ticket
list-eligible returns eligible tickets (excludes factory-skip, factory-blocked, human
In-Progress-without-factory-building, and tickets claimed by another instance). Then:
- Resume your own first. If a ticket is
In Progress+factory-buildingwith a latest[factory:claim]matching yourFACTORY_INSTANCE, resume it. Another instance's claim is off-limits (stale >3h ⇒ reclaim allowed). - Classify: Buildable (Tech Debt / Performance / Bug / small Improvement / single-PR Feature → run end-to-end) · Epic (large → backlog-groomer decomposes first) · Thin (under-specified → groomer adds scope).
- Rank Buildable by priority then smallest scope (tight, high-confidence wins first).
- Pick the top. None buildable but epics/thin exist → run the groomer, re-pick. Truly dry → §6.
Honor steering + consensus: read scripts/factory/STEER.md + scripts/factory/state.md
first. Claim atomically (LINEAR §4): In Progress + factory-building +
[factory:claim] instance=<FACTORY_INSTANCE> ts=<ISO>, then re-read; if another instance
claimed earlier, yield and re-pick. Proceed only if your claim is earliest.
2. The per-ticket chain (dispatch as subagents)
One at a time, each given only the ticket id + the prior sign-off. Each posts its
[factory:<agent>] comment + the §F6 sign-off.
researcher → planner → builder ⇄ test-verifier → reviewer → release-manager → prod-verifier- builder ⇄ test-verifier until acceptance criteria pass.
- reviewer Critical → back to builder; re-run. Two strikes same root cause →
factory-blocked, stop, move on. - Risky ticket (auth/billing/migrations/core) or fresh epic child → planner writes a one-paragraph pre-mortem.
3. Merge (replaces the human PR gate)
The release-manager merges only when the local gate (factory.config GATE_* commands)
AND the required GitHub check CI_CHECK_NAME are green and the PR is mergeable.
- Local/self-merge instance:
gh pr merge --squash --delete-branch. - Cloud routine (
claude/*branch — can't self-merge): open the PR and stop; theauto-mergeworkflow squash-merges it once CI is green. Then set the ticketDone, removefactory-building, post the prod-verify surface note.
4. Grooming (autonomous PM)
The backlog-groomer decides what's most valuable, decomposes epics into PR-sized
from-factory children, adds scope to thin tickets, nudges priorities — announced, never
silent. Then control returns to §1.
5. Telemetry
After each merge, post an orchestrator comment (timeline) + append a line to
scripts/factory/factory.log, and overwrite scripts/factory/state.md with a ≤15-line
handoff (shipped, next candidate, blockers, counts).
6. Idle / stop
Backlog dry → log + exit 0 (driver re-wakes). Tracker down → halt, exit non-zero. Gate
un-greenable on the default branch itself (infra) → halt + factory-blocked.
7. Driver (one-ticket) mode
When invoked by scripts/factory/run.sh, do ONE ticket then stop and print exactly one
sentinel as the final line: FACTORY_SHIPPED <id> · FACTORY_GROOMED ·
FACTORY_BLOCKED <id> · FACTORY_IDLE · FACTORY_HALT <reason>.
8. Not this skill
One-off fixes with no ticket (create one first) · weakening CI/branch protection · editing
the repo's CLAUDE.md · deleting data · force-pushing.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

