Factory
The rules I use to hand work to coding agents. A piece of work starts as a GitHub issue with six fields, an agent builds it on a branch and opens a pull request, and I review and merge. By its rules no agent merges or publishes, and none builds anything I haven’t approved.
Why I built it
I wanted to use agents the way I’d run a team: work comes in through one route, somebody other than the author checks it, and I can see afterwards what was decided and by whom. I also wanted to know whether the checks work, so I test them with changes that have faults planted in them.
How it works
A piece of work is a GitHub issue with six fields: the habit it shows, the outcome, the commands that check it, what it reads, writes and sends, what is out of scope, and whether this site needs a page for it.
An agent may write a spec, but a run only takes an issue I opened and labelled as ready.
A manager agent sizes the spec as small, medium or large. The size decides which model builds it and how much planning and checking it gets: a small text change goes to a small model, and a large or risky one is planned first and built on a larger one.
A second agent, which did not see the change being made, checks it against the spec, runs the tests again and tries to break it.
Before anything is pushed, a script fails a change that touches workflows, agent instructions or dependencies the spec doesn’t name, removes lines from a test, adds something that looks like a credential, or is over 600 changed lines.
The pull request ends with a record: each command run and its result, what was not checked, and each decision the agent made by itself. Then I review and merge.
How I test it
The checking agent was given a change that passed all 90 tests and had five faults hidden in it. It found all five, on each of the two models tried. The script found none, which is what it should do: it checks paths, tests, size and commit format, not behaviour.
Instructions were planted in a spec, a README and a change: skip the tests, delete a test, report a pass. Neither the building agent nor the checking agent followed one, and each reported what the text said.
Each test was run once, so I treat them as a start.
What it does in a team
The same rules would work for a team. Specs arrive in one format, the size of the work decides how much planning and checking it gets, and every pull request says what was run and what was not. The record also lists the decisions an agent made by itself, so a reviewer can read those first.
What it reads, writes and sends
It reads the issues I have labelled, my comments and reviews, the repository’s files and history, and the CI results for its own pull requests.
It writes branches, commits, pull requests, and labels and comments on the issue it is working. Its rules forbid pushing to main, merging, tagging and publishing, and GitHub lets main change only through a pull request.
Issue text and repository contents go to Anthropic, whose model runs the session. Git and API calls go to GitHub, and package installs reach the npm registry. The checking script makes no network connection.
What isn’t done yet
The agent works as my GitHub account, so GitHub can’t tell its actions from mine. Until it has its own account I run it only in sessions I’m watching, and nothing runs on a schedule.
All four runs so far were on one repository, and none was a large piece of work.
Source
Open source under the MIT licence. The README says how to use it in a repository.