项目的 README,来自 github.com/coleam00/ai-software-factory。合并为一个 markdown 文件:README.md。
You plan the release. The factory builds it. You test it in staging and anything off goes back in.
You start with a PRD for the next release: a proof of concept for something new, or a small epic for an app that already exists. The factory splits it into linked issues, works out what can run in parallel, and loops on them: an agent picks one, builds it, and two reviewers that did not write it decide whether it merges. Merged work lands in staging, where you use the whole release like a customer would. Anything that is off becomes a new issue, and the factory picks it up.
This is not a dark factory. The middle runs on its own, but you stay at the two places a human adds the most: deciding what to build, and judging whether what got built is right. No plan captures all of your intent up front, and staging is where the gaps show up.
The automation is the easy half. Being able to trust a merge you did not read is the hard half, and most of what is in here exists for that.
All AI work runs through Archon's SDLC pack. This repo supplies the setup, scheduling, project context and ordinary app resources. Archon workflows handle every agent, from triage through verification and merge.
Paste this to your coding agent, in the repo you want the factory in:
Help me set up my own AI software factory in this repo using this GitHub repo:
https://github.com/coleam00/ai-software-factory
Read its README and follow the "Instructions for the agent" section.
Run the installer for me, then help me write the mission and validation journeys
based on this project. Configure Archon with my chosen coding agent and model tiers.
Every AI step must use the shared Archon SDLC workflows.
Leave scheduling off until we have watched one issue go through the factory.
That is the install. It clones this, runs the installer, then walks you through the three files nobody can write for you.
You need: git, Python 3.10+, gh authenticated with the
workflow scope (gh auth login -s workflow, then gh auth setup-git so git itself
can push, including CI workflow files), a GitHub remote, a coding agent,
bun and uv.
Your agent can help install the missing tools. The installer brings its own pinned
Archon source, including the shared workflows; you do not need to check out Archon
or merge its PRs yourself.
Current status: the default pins exact Archon revision
1cfb8fc541580fe5edf15e9a504b572bc9bb45bb on the factory/sdlc-on-dev branch (Archon
dev plus the SDLC pack's factory workflows). archon-loop is the recommended scheduled workflow: each lap picks one move and routes it to an in-loop builder or to archon-ship, then a black-box app check (tested on the merge with the default branch, with probes, a defects-seen record and evidence the next step verifies by script) and a reviewer decide, and a deterministic merge gate merges only what that record supports; the scheduler starts a lap only when there is workable work for it; archon-manager steps back on a slower schedule and also keeps the loop itself healthy (runs that never started, runs that failed on infrastructure, leftover app instances, empty laps). Its pack also supports dependency-aware intake,
reviewed delivery, scoped validation reuse, runtime and optional holdout verification,
bounded repair, discovery handling, a merge queue that reads required checks and protected paths and seals its plan by script,
deterministic deployment, closing the worked issue once its pull requests are confirmed
merged, tolerance for byte-order marks and unescaped Windows paths in agent-written JSON, and scheduling through Archon native triggers. The pin and
pack.json must name the same revision.
This section is addressed to the coding agent. Run the setup for the user.
1. Install it.
Read the application repo first. Check its GitHub remote, existing configuration, toolchain and authentication. Reuse working logins and ask the user to complete any interactive sign-in that is missing. Do not print credentials.
Clone the factory outside the application repo, or update an existing clean clone
with git pull --ff-only:
git clone https://github.com/coleam00/ai-software-factory ~/ai-software-factory
Then, from the root of the application repo:
python ~/ai-software-factory/bin/factory.py init
Use python3 if that is the Python command on the machine. If the user's repo lives
on a server, run the installation and configuration there over SSH.
The installer writes the factory and project templates and installs the pinned
Archon source. It preserves project configuration on upgrades. It does not configure
provider authentication, change model tiers or start a schedule.
It also adds one pointer to factory/WORKFLOW_POLICY.md in the project's root
engineering.md, the conventions file the shared workflows read, without replacing
existing guidance. That policy supplies the
factory-specific bootstrap, runtime, review and state-label requirements that the
general-purpose shared workflows intentionally do not assume.
2. Configure Archon.
Read the installed source's configuration documentation and configure the user's chosen provider through native Archon settings. Preserve existing working settings. For Claude Code, Sonnet for small/medium and Opus for large is a useful starting point; use model identifiers supported by the installed provider and the user's account.
All factory AI work must run through the shared SDLC workflows. Do not add direct coding-agent subprocesses to factory scripts or create factory-local workflow copies.
3. Write the three files with them.
The repo holds either an application or only a product document (a PRD). The interview is the same either way; a PRD answers what the code would have.
Read the repo FIRST. The language, the test command, the start command, the entry point and the routes are all in there, or the PRD is. Then ask at most four questions, each with your proposed answer already filled in so the cheapest reply is "yes". Every question the repo already answered is a reason to regret starting.
| File | What you are writing |
|---|---|
MISSION.md |
What this product is, and the list of things it must never become |
harness/END-TO-END.md |
Two to five journeys, in plain English, that a real user takes |
.factory/holdout/HOLDOUT.md |
Independent scenarios that combine the product's behavior |
The out-of-scope list in MISSION.md is the one that decides whether any of this
works. It is how the factory recognises that a plausible, well-argued, easy
request is drift rather than a good idea. Do not ask the user to produce it from
nothing. Propose seven entries yourself from what you read, make them things a
reasonable person would actually ask for, and have them strike the wrong ones.
Do not draft the holdout yourself: you are a builder, and the fence refuses you the
folder. Dispatch the holdout-writer subagent with the product document, relay its
one-line summary per scenario, and tell the user to review the file in their editor.
Journeys describe what the product does today, never what it should do. A journey for behaviour that does not exist yet leaves the gate red before the first lap, and nothing can merge, including the change that would make it pass. A PRD is the exception: it is the one document that describes behaviour before the code exists, so when the repo holds only a PRD, write all three files from it now, plus the harness commands (the interview decides the stack, so the declared gate has something to run). Replace the installed example journeys entirely; a merge assessor that finds task-service journeys in a pastebin holds the PR. Only the runtime host waits, for the start command the first ticket declares (step 5).
Configure the project's static/unit commands and translate the journeys into the
runtime scenario inputs required by the shared workflows. Follow the installed
factory/RUNTIME_HOST.md for ordinary app startup, fresh state and candidate
resources. Bind preparation and start to the delivering commit, then run the
documented calibration: baseline verified, a relevant deliberate fault failed,
and a wrong-identity check inconclusive. Assertions must exercise real transitions
and nonempty/nonzero user value rather than directly seeding the final state. The
agent handles this wiring; the user supplies the product intent.
4. Check the installation and hand it back.
python factory/consumer.py doctor
python factory/consumer.py list
Show any failures and what remains to configure. Doctor checks the installation and available workflows; it does not prove a live agent can sign in or complete a run.
5. Ask the one question that picks the path: existing codebase, or a PRD?
Existing codebase. The user files issues. Have them write holdouts for the area
first (python factory/consumer.py run archon-holdouts --input source=<docs>), then
give them the exact command for one lap on one issue:
python factory/consumer.py run archon-loop --input merge=approve. With merge=approve
the reviewer approves instead of merging, so the user sees a whole lap before any
merge is automatic.
A PRD. Write the holdouts from it first, then slice it into a backlog:
python factory/consumer.py run archon-holdouts --input source=<path to the PRD>
python factory/consumer.py run archon-backlog --input prd=<path to the PRD> --input publication=approve
The holdout writer reads only the PRD and writes .factory/holdout/HOLDOUT.md; no
builder ever sees it. The backlog workflow slices the document into ordered issues the
way an engineering lead would, the first one making the product runnable end to end
(start command, health check, build-identity endpoint, tests, CI). Re-running it never
duplicates an issue. The first ticket's body names the exact start command and the
health and build-id paths, so write the runtime instructions from it now, before
anything is built. Then every ticket, the first included, goes through archon-loop:
the app check verifies the skeleton against the journeys before it merges, which is
also the first proof the journeys are right.
6. Stop there. Leave scheduling off until the user has watched a lap complete. If they already asked you to run that first lap, continue within that scope.
MISSION.md is what the product is, and what it must never become. The
out-of-scope list is the part that does work: it is how an agent recognises that a
plausible, well-argued, easy request is drift. Without it every request is arguably
in scope, because almost every feature is defensible on its own. Aim for at least
five, and make them things a reasonable person would actually ask for.
harness/END-TO-END.md is two to five journeys in plain English. Name
the value you expect. "The page loads" passes against an app that returns an empty
body forever. The setup agent turns those journeys into inputs for Archon's runtime
verification workflow, which drives the running app and records what it observes.
.factory/holdout/HOLDOUT.md checks the same product through different
combinations and edge cases, written from the product document rather than the
issues. It is committed, so the team shares it, and fenced, so no builder reads it:
.factory/hooks/holdout_fence.py, registered in .claude/settings.json, refuses
every agent except the holdout-writer and holdout-verifier subagents any call
that would show it a scenario: naming the folder, a recursive search that covers
it, or a git diff, log or show that would print one of its files (git is asked
first, so nothing else is refused). Nothing may change the fence but you..ignore keeps the Grep and Glob tools out of the folder.holdout-exposures.jsonl in the repository's git directory, so a leak it
did not foresee is counted.factory doctor runs the hook itself and reports whether the fence holds and
whether it is committed (lap checkouts only carry what is pushed).The fence is a Claude Code hook. A factory running Codex or Pi has no fence: keep its
holdout outside the repository and pass that path as the holdout input instead.
The factory writes none of them. Every AI step is a workflow or command in Archon's shared SDLC pack. You can run the workflows individually or use the full composition.
| What you want | Shared Archon workflow |
|---|---|
| Turn a PRD into an ordered backlog of issues | archon-backlog |
| Write holdout scenarios no builder sees, from the PRD or an escaped defect | archon-holdouts |
| Take an issue through triage, planning, delivery rounds and review to a PR | archon-ship-block |
| Run project checks | archon-validate |
| Exercise a running app and record evidence | archon-verify-runtime |
| Check a baseline and whether verification catches deliberate defects | archon-verify-runtime-suite |
| Re-test existing behavior and diagnose regressions | archon-regress |
| Recheck discoveries, deduplicate them and optionally publish issues | archon-discoveries |
| Check PRs and CI, then merge according to the selected approval mode | archon-merge-queue |
| Roll the default branch onto a running service and read the revision back | archon-deploy |
| Keep a backlog moving unattended, one move per lap, with parallel laps if wanted | archon-loop |
| Step back on a slower schedule: steer the backlog, unstick work, record metrics | archon-manager |
Ship runs its own triage. You do not have to run triage first. Deliver can use an existing run's worktree to repair the same PR. Lifecycle connects the shared workflows; factory Python does not dispatch their individual stages.
The agents use the GitHub CLI inside these workflows for issue publication, CI checks and merging. Configure GitHub branch protection for the checks and reviews your project requires.
The source revision lives in pack.json. Once the
workflow PRs merge upstream, updating that pin moves new installs to the merged
version. Existing installations update by pulling this repo and rerunning init.
Workflow improvements belong in Archon's SDLC pack.
Neutral standalone Archon users do not need MISSION.md,
factory/WORKFLOW_POLICY.md or any other factory file; those are guidance and
inputs supplied by this consumer.
Run these from the application repo after installation:
python factory/consumer.py doctor
python factory/consumer.py list
python factory/consumer.py run archon-ship --input target=https://github.com/OWNER/REPO/issues/1 --detach --json
python factory/consumer.py get <run-id> --json --events
python factory/consumer.py status --all --json
python factory/consumer.py approve <run-id> --comment "Approved"
python factory/consumer.py cancel <run-id>
python factory/consumer.py halt
halt blocks new launches and continuations. Cancel an active run explicitly;
unhalt allows launches again. Runtime-host runs stay in the foreground.
pause only stops the timer from starting laps: it keeps waking runs that wait on CI,
and explicit run commands still launch. unpause resumes scheduled launches. Use it
instead of disabling the host timer, which would leave an in-flight lap paused forever.
After the first successful lap, ask your agent to configure
.factory/schedule.json with a shared workflow and its inputs, then:
python factory/consumer.py schedule install # writes .factory/trigger.json, prints the timer
python factory/consumer.py schedule install --apply # also registers the OS timer
python factory/consumer.py schedule status # Archon's trigger receipts
python factory/consumer.py schedule remove --apply # unregisters the timer
Scheduling is Archon's. schedule install writes an Archon trigger binding for the
scheduled workflow. Each timer tick runs python factory/consumer.py schedule fire,
which calls archon trigger fire and then archon workflow wake:
parallel laps at once (a top-level number in schedule.json, 1 to 8, default 1). A
tick that arrives while every lap is busy is skipped; the next tick starts the next
lap, so ticks never pile up behind a long lap.parallel above 1 for a workflow that keeps parallel laps off each other's
work. archon-loop does: each lap claims its work item with a comment, the oldest
claim holds it, and pick stays out of the areas other laps have claimed. The app's
runtime scripts must also let several checkouts run at once (a port and pid file per
checkout, never one fixed port).workflow wake resumes runs paused on a pending CI check or a provider usage limit.On macOS Archon installs its own launchd jobs. On Windows the timer is a hidden Task
Scheduler task that runs pythonw (no console window) only while you are logged on, and
writes each tick's output to .factory/schedule.log. On Linux it is a systemd user timer.
halt makes schedule fire start nothing.
schedule install refuses a runtime_host entry, because a trigger cannot wrap the
runtime host. Run the host as its own service instead (python factory/runtime_host.py serve) and point the scenarios at its connection file.
Merge policy. Free private GitHub repositories cannot report branch protection, so
the merge queue needs the project to say which CI checks a merge requires. Set
required_checks in harness/harness.config.json to the CI job names (for example
"tests"), or to "none". The factory passes it to archon-merge-queue. Left empty, the merge queue reads GitHub, and on a free private
repository it holds every PR with a reason that names this setting.
Protected paths. Review does not reliably notice an agent editing the files that
govern it (a reviewed delivery once rewrote engineering.md and merged). Set
protected_paths in harness/harness.config.json to comma-separated path patterns,
anchored at the repository root (* within one segment, ** across segments, a
trailing / for a directory). The factory passes it to archon-loop, whose merge
gate refuses any PR that touches a match and says the owner must make that change,
and to archon-merge-queue. New installs protect MISSION.md, FACTORY.md,
FACTORY_RULES.md, harness/**, .factory/** (the holdouts and their fence),
factory/**, .claude/settings.json and .ignore; add the project's
own governance documents. An existing project's harness configuration is never
overwritten, so add the key by hand.
The scheduler never selects work itself: each archon-loop lap's pick agent reads the
whole board and chooses one move (finish an open PR, build a simple item, ship a
complex one), and parallel laps claim their item with a comment so they never collide.
A schedule names the workflow, its inputs and how many laps may run at once:
{
"workflow": "archon-loop",
"parallel": 3,
"inputs": {
"runtime": "/private/runtime/scenario.json",
"merge": "auto"
}
}
The factory adds holdout=.factory/holdout/HOLDOUT.md and the project's
protected_paths unless the schedule names them. Run archon-manager on a slower
schedule (every few hours) above the loop.
publish_holds does not authorize merging, has no effect when merge_mode is
preview, and is deliberately absent from the default example.
A factory that only runs while your laptop is open is a demo. It wants a Linux box
that never sleeps. Any provider. Use the same setup prompt and tell your agent
which server and application repo to use. docs/server-cheat-sheet.md
has every prompt for the whole server setup, in order, from the SSH key to the timer.
For Ubuntu, the agent can inspect and run bin/bootstrap-ubuntu.sh
to install the toolchain, then help with GitHub and provider sign-in. Run the
installer in the application repo on that server.
Watch one issue become a PR, verify the running app, and approve its merge before installing the timer. The timer needs the same tool paths and authentication as the successful manual run. Installation does not start it for you.
The timer on Linux. schedule install prints a systemd user service and timer,
and --apply writes and enables them. They carry what a manual run had and a timer
does not get on its own:
PATH: bun, uv and claude live under the user's home, not /usr/bin. It is
captured from the shell that ran schedule install.IS_SANDBOX=1: Claude Code refuses to run unattended as root without it.EnvironmentFile=-%h/.factory-env: keep the Claude Code token in this mode-600 file,
never in the unit or the repository.A root user timer needs loginctl enable-linger root to keep running after logout.
Stop launching new laps with python factory/consumer.py halt, or remove the timer
with schedule remove --apply.
A run paused on a pending GitHub check resumes on the next tick, through
archon workflow wake.
Deployment is project-specific: the setup agent wires the service (systemd, a
reverse proxy, DNS) and gives the loop its deploy and health
commands. With those set, a confirmed merge runs the shared archon-deploy
workflow, which rolls the default branch onto the service and reads the deployed
revision back. Without them, a merge is only a merge.
It does not judge taste. A green gate never means the product is good. It means the layer a machine can check is intact.
It does not invent a backlog. The backlog comes from you: issues you file, or
a PRD you wrote that archon-backlog slices into issues you approve. Intake only
picks up what is there. Discovery can publish verified findings; that is different
from deciding what the product should become.
It does not maintain a second set of AI workflows. Factory runs the pinned shared SDLC source. Changes to agent behavior belong there.
Instrument your tokens on day one. Start with one small issue and watch the model calls before enabling a loop. Use medium models for routine work and large models where the workflow needs the extra reasoning.
bin/factory.py install and CLI entry point
template/ what init copies into your repo
factory/consumer.py invokes shared Archon workflows and shows their state
factory/pack.json shared source revision and required workflows
factory/WORKFLOW_POLICY.md factory requirements read through engineering.md
factory/RUNTIME_HOST.md app startup and runtime scenario configuration
harness/ project checks and END-TO-END.md
docs/first-hour.md what to do after setup
docs/server-cheat-sheet.md every prompt for a server install, in order
docs/incidents.md historical failures and lessons
To upgrade an installed factory, see factory/MIGRATION.md.