software-factory
Health Uyari
- License — License: Unlicense
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 6 GitHub stars
Code Basarisiz
- process.env — Environment variable access in bench/cases/credential.mjs
- Hardcoded secret — Potential hardcoded credential in bench/cases/credential.mjs
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
An agentic software factory for Claude Code: GitHub issues in, reviewed pull requests out.
Software Factory
An agentic software factory for Claude Code and GitHub Copilot. GitHub issues go in; reviewed pull requests come out. A team of specialist agents does the work, a small deterministic program decides what happens next, and a human is asked only when the stakes call for it. The pipeline is chosen for each task, and the factory remembers its mistakes so the next job does not repeat them.
FORWARD PRESSURE THE LINE BACK PRESSURE
what starts work what stops bad work
GitHub issues ─┐
Sentry errors ─┤ ┌────────┐ ┌──────┐ ┌───────┐ ┌──────┐ ┌─────────┐ ┌─────────┐
Inbox notes ─┼─▶ issue ─▶ │ intake │─▶│ spec │─▶│ build │─▶│ GATE │─▶│ reviews │─▶│ approve │─▶ merge
Any command ─┘ └────────┘ └──────┘ └───────┘ └──────┘ └─────────┘ └─────────┘
reject or │ ▲ ▲ │ │ │
ask a human ▼ │ gaps └──────────┴──────────┘ ▼
┌────────────┐ fails go back to human approves when
│ spec check │ the builder risk, protected paths
└────────────┘ or a spot-check say so
human answers open questions,
and approves the plan when it
is hard to reverse
Start slow
Every trigger is an accelerator, and accelerators without brakes produce slop at speed. The factory ships with the brakes on:
- A human reads every pull request.
approval.autoMergeisfalseuntil you turn it on. - Sources do not start work. Tickets filed by the collector wait under
factory:triageuntil a person adds thefactorylabel. - Every loop is capped. Review rounds, gate failures and spec revisions each stop at a limit and hand the job to a person. A job whose gate fails the same way twice in a row is handed over sooner, as not converging.
Open one throttle at a time as the checks and reviews earn your trust. factory/DESIGN.md lists every throttle and where it starts.
What it does
Intake. An agent reads the issue against the codebase, checks its claims, decides whether it is worth building, narrows the scope or sends an oversized request to be split into tickets, says what kind of job it is, and rates the risk. Code turns that into the job's plan and writes a brief every later agent reads first.
Kind of job How it is handled feature Designed first when it is risky or hard to reverse; built test-first in thin slices. bug No design stage. Reproduced with a failing test first, fixed at the root cause, nothing else changed. refactor Behaviour pinned down by tests before anything moves; an architecture reviewer always looks at it. docs Light pipeline, one reviewer; every statement checked against the code. chore Light pipeline; one thing changed at a time, the full checks prove nothing else moved. spike Quick experiment to answer a question; never merged without a human. Design. For work that is risky or expensive to reverse, an agent works out how the change fits the existing system: boundaries, interfaces, data model, and the alternatives it rejected.
Spec. An agent writes acceptance criteria and a task plan. If the work fixes something hard to change later (a schema, a public API), a human approves the plan before any code is written.
Spec check. A second agent grills the spec for gaps before any code is written: decisions it left open, criteria nobody could test, claims about the codebase that are not true. Gaps the code or the issue can settle go back to the spec writer. Questions only a person can answer stop the job and are put to you, each with a recommended answer. When the gaps persist but the spec check marks no item as needing a person, the factory accepts its recommended answers itself (at most
maxAutoAnswerstimes per job) instead of stopping.Build. An agent implements the spec test-first in its own git worktree, so several jobs run in parallel without touching each other or your checkout.
Gate. No agent involved. A script runs your real checks (lint, types, tests, build) and scans the diff for committed credentials, suppressed lint rules, skipped or deleted tests, oversized files and oversized diffs. A failing build goes straight back to the builder and never reaches a reviewer. A failed check shows its first 40 and last 80 lines in the gate file, with the number of lines left out between them, and its full output is saved to a log in the job folder that the gate file names.
Reviews. Reviewers are chosen per job and run in parallel:
Reviewer Runs when Looks for code always correctness, fit with the codebase, code that should not exist qa always whether each acceptance criterion is met and properly tested security medium or high risk, or the job touches auth, data, APIs, infrastructure or dependencies what an attacker could now do privacy the job touches personal data or stored data what the system does with people's data: collection, logs, third parties, retention, deletion ux and ui the job touches the interface flows, states and wording; design consistency and accessibility architecture refactors, high risk, or hard-to-reverse designs boundaries, dependencies, invariants, whether the build follows the design performance intake flagged a hot path or cost that grows with data regressions at realistic scale, measured where possible doubt high risk takes every claim the builder made and tries to prove it false Any failure sends the job back to the builder for another round, up to a limit.
From round 2 on, every reviewer still runs, but a reviewer that gave a verdict in an earlier round is told to read only the change since the commit it last reviewed: it checks its earlier findings were fixed, reads that change in full, and opens the whole diff wherever the change touches code it passed. A reviewer new to the job, and any case the factory cannot prove safe (a rewritten history, a merge in between, a git error, a job from before this rule), reads the whole diff. The gate file records each reviewer's range.
Approve. An agent recommends merge or escalate. Then rules it cannot override apply: high risk, protected paths, and a random spot-check all force a human review. Before any merge, the factory's or a human's, the base check runs: if the base branch moved since the gate, the factory merges it into the job's branch and runs the whole gate again. A clean, green result merges without another review; a conflict or a failed check goes back to the builder.
Merge. Once the base check passes, the pull request is merged, the worktree is removed, and the issue is closed with the full history in its comments.
Learn. If anything went wrong on the way, a retro agent works out the cause and records a lesson. See "How it learns" below.
/factory collect turns production errors and inbox notes into new issues, which closes the loop.
Work that is too big
When intake finds a request is several pieces of work, a decompose agent splits it into two to twelve tickets, each buildable and reviewable by itself, and records which depend on which. The factory files them in order with "Depends on #n" lines. A ticket is not started until the tickets it depends on are closed, and tickets with no dependencies between them are built in parallel. You can write "Depends on #12" in any ticket yourself and get the same ordering.
The ticket is the conversation
The ticket tracker is where people talk to the factory. Each ticket shows what the factory is doing through labels (factory:running, factory:needs-human) and comments from every stage. When a job is waiting on you, reply on the ticket with a comment that starts with /factory:
/factory approveapproves the plan, the recommended answers, or the merge, whichever it is waiting for./factory reject <why>drops the job./factory <anything else>is taken as your answer or feedback.
Only comments from the repository's owner, members and collaborators count. The next /factory run picks them up. You can also just answer in the session.
The factory:running label is also what keeps two factories, on two machines, from building the same ticket.
How it learns
The factory keeps a record of its own mistakes and feeds them back into later jobs.
- Every failure is recorded as it happens. A failed gate, a failed review, a gap the spec check found, a correction or answer from a human: the job script writes each one into the job's record. No agent has to remember to report it.
- A job that made mistakes is not finished until it has been learned from. After it merges or is rejected, the retro agent reads what went wrong, finds the cause, and decides for each mistake whether it is a one-off, something new worth remembering, or something the factory already knew and did anyway.
- Lessons are stored in the repository.
factory/memory/lessons.jsonholds them, each tagged with the agents it is for and the kinds of job and areas of code it applies to.factory/LESSONS.mdis the readable view. Commit both and the whole team's factory shares one memory. - The next job is briefed with the lessons that apply to it. A lesson about migrations reaches the builder of the next job that touches data, and does not clutter a CSS change. Each stage gets its own copy of the brief with only its skills and the lessons for it and for everyone, so a reviewer never reads the builder's lessons; the approver and decompose read the full brief.
plan.skillskeys that are not stage names appear only in the full brief. The most-repeated lessons come first. - A lesson that keeps recurring becomes a rule. When the same mistake happens three times despite the lesson, the factory flags it: advice has failed, and it should be enforced by a check in the gate.
/factory retrowrites those proposals for you to review.
You can teach it directly too: /factory lessons lists what it knows, and node factory/bin/job.mjs lesson add --text "..." --agents builder adds one.
Requirements
- Claude Code or GitHub Copilot (the CLI, or agent mode in VS Code)
- Node.js 20 or newer (22.20 or newer for automatic skill installation), and git 2.38 or newer
- The GitHub CLI,
gh, logged in (only needed for issue and pull request features)
There are no npm dependencies.
Install it into a project
git clone https://github.com/cbeeswax/software-factory.git
node software-factory/install.mjs /path/to/your/project
This copies the skill, the agents (for both Claude Code and Copilot) and the factory/ folder into your project, adds a section to your CLAUDE.md and AGENTS.md, adds the ignore rules, installs any agent skills that are missing, registers a Claude Code hook that blocks credentials from being written, and creates the factory and factory:triage labels on GitHub. Run it again to upgrade; it never overwrites your config or lessons.
Then:
- Open
factory/factory.config.jsonand setchecksto the commands that prove a build is good:"checks": [ { "name": "lint", "cmd": "npm run lint" }, { "name": "types", "cmd": "npm run typecheck" }, { "name": "test", "cmd": "npm test" }, { "name": "build", "cmd": "npm run build" } ] - Commit the new files.
- Add the
factorylabel to an issue. Only labelled issues are ever picked up. - Start Claude Code or GitHub Copilot in the project and type
/factory run.
Using it
| Command | What happens |
|---|---|
/factory run |
Processes every open issue labelled factory, three at a time by default. |
/factory run 12 |
Processes only issue 12. |
/factory add a copy button to code blocks |
Builds one feature from your description, with no GitHub issue. Merges locally. |
/factory status |
Shows every job and its stage. |
/factory approve 12 |
You approve a plan, the recommended answers, or a merge that was waiting on you. |
/factory grill 12 |
The factory walks you through the open questions on a spec, one round at a time. |
/factory 12: use a separate table instead |
Your feedback is recorded and the job resumes. |
/factory collect |
Files new issues from the configured sources. |
/factory scan |
Looks over recent changes for places the codebase is drifting, and files refactoring candidates for you to choose from. |
/factory design |
Grills you about a change to the factory itself, in the vocabulary of the software-factory skill, and updates factory/DESIGN.md. |
/factory skills |
Checks that the agent skills are installed, and installs any that are missing. |
/factory lessons |
Shows what the factory has learned. |
/factory retro |
Reviews the factory as a whole and proposes changes to it, including checks for lessons that keep recurring. |
/factory dashboard |
Opens the live board at http://127.0.0.1:4317. |
The session where you type /factory run is the orchestrator. If it dies, type /factory run again: job state is on disk, and each job resumes from its current stage. Work an agent had in flight at that moment is redone.
To keep it running unattended, combine it with your harness's own scheduling, for example /loop 30m /factory run in Claude Code.
Claude Code and GitHub Copilot
The factory is written once and runs in both.
| Piece | Claude Code | GitHub Copilot |
|---|---|---|
The /factory skill |
.claude/skills/factory |
reads the same folder |
| Stage agents | .claude/agents/factory-*.md |
.github/agents/factory-*.agent.md, generated from the Claude files by node factory/bin/sync-agents.mjs |
| Project guidance | CLAUDE.md |
AGENTS.md |
| Agent skills | .claude/skills, or the agent-skills plugin |
reads .claude/skills |
| Job control, gate, dashboard | plain Node scripts | the same scripts |
| Secret guard hook | .claude/settings.json |
not wired; the gate's scan of the final diff still applies |
The orchestrator instructions say "delegate to agent X" and let each harness do that its own way. Where a harness can run subagents in parallel, reviews run in parallel; where it cannot, they run one after another with the same result. The model names in the config (fable, opus, sonnet) are Claude's; in Copilot they are treated as hints, so set models to names your Copilot plan offers if you want per-stage models there.
Agent skills
The stage agents do not invent their own method for writing and judging code. They use two published sets of skills, and the factory installs both:
- addyosmani/agent-skills: the engineering lifecycle, from spec to ship.
- mattpocock/skills: test-driven development, deep-module design, domain language, bug diagnosis and review.
| Stage | From addyosmani/agent-skills | From mattpocock/skills |
|---|---|---|
| Design | api-and-interface-design |
codebase-design, domain-modeling, prototype, research |
| Spec | spec-driven-development, planning-and-task-breakdown, constraint-driven-development |
domain-modeling, diagnosing-bugs |
| Spec check | interview-me, doubt-driven-development |
grilling |
| Build | test-driven-development, incremental-implementation, source-driven-development, debugging-and-error-recovery, frontend-ui-engineering, observability-and-instrumentation, ci-cd-and-automation, git-workflow-and-versioning |
tdd, codebase-design, domain-modeling, diagnosing-bugs |
| Builder's own review, before hand-back | code-simplification, code-review-and-quality, constraint-driven-development |
|
| Code review | code-review-and-quality, code-simplification, constraint-driven-development |
code-review, codebase-design |
| QA review | test-driven-development, browser-testing-with-devtools |
tdd, diagnosing-bugs |
| Security, privacy, performance, UI, UX and architecture reviews | security-and-hardening, performance-optimization, observability-and-instrumentation, accessibility-engineering, frontend-ui-engineering, api-and-interface-design |
codebase-design, domain-modeling |
| Doubt review and approval | doubt-driven-development, shipping-and-launch |
|
| Retro | context-engineering |
writing-for-agents |
| Redesigning the factory | software-factory, grilling |
Three things keep the quality of a change up, beyond the reviewers:
- The builder reviews its own work first. Before handing back, it simplifies its diff, reviews it on five axes (correctness, readability, architecture, security, performance), and writes what that pass changed under "Self-review" in its build notes.
- The quality bar is a contract. If the project has a
CONSTRAINTS.md(theconstraint-driven-developmentskill writes one), the spec carries it into the acceptance criteria, the builder meets it, and the code reviewer treats any lowered bar as at least a major finding. The gate's scan for suppressions and skipped tests still applies either way. - The kind of job picks the skills. The playbook for a feature, bug, refactor, docs change, chore or spike lists the skills that fit, and the job's brief hands them to each stage.
Each agent also carries its own fallback instructions, so the factory works without the skills.
node factory/bin/skills.mjs ensure checks for every skill listed under skills.sources in the config and installs the missing ones into .claude/skills with the open skills installer. The project installer runs it, and so does the orchestrator at the start of each run. Commit the installed skills and everyone on the project has them, in either harness. Set skills.autoInstall to false to only report what is missing. If you already have the agent-skills plugin in Claude Code, its skills count as installed.
A few agents also name skills that are neither set's (review-security, humanize-writing and the like, listed under skills.optional). They are used when you already have them and never installed. A test fails if an agent or a playbook names a skill that is in neither list, so the agents cannot drift from what the factory installs.
What makes this more than a prompt
Code decides, agents recommend. factory/bin/job.mjs is the only thing that writes job state. An agent cannot move a job forward by saying it is done: the intake decision (intake.md), the spec file and the approver's decision (decision.md) have to exist, the gate has to pass, the builder's note has to cite committed evidence for every acceptance criterion, each reviewer's written findings have to exist and agree with its verdict before that verdict is accepted, and commands run out of order are refused. A gate that ran no checks never auto-merges.
A gate agents cannot talk their way past. The cheapest way for an agent to get a green build is to lower the bar. The gate fails the build for a new eslint-disable, @ts-ignore, # noqa, .skip(, .only(, a deleted test file, a credential, uncommitted files, a merge conflict with the base branch, a new file over 500 lines, or a diff over 800 lines. The suppression and test-skip rules apply to code files only: prose files (.md, .markdown, .rst, .adoc) may name them, and every other check still runs on every file. The mode, the size limits and the ignored, generated and test paths are configurable under slop in the config; the markers and the list of prose extensions are fixed. Each finding has a severity. A block fails the gate unless slop.mode is warn, a project-wide switch that only reports block findings. A flag is a per-rule severity for a pattern too noisy to fail a build on: it never fails the gate in either mode, and the gate file lists it under ## Flags for reviewers, which the reviewers of each round must answer one by one. The base check before a merge lists flags the same way, but they never hold the merge and no reviewer is asked to answer them there. Credentials always block. No rule flags yet.
The gate runs again at merge time when the base branch moved after it ran (the base check), so two green jobs cannot merge into a red base unchecked.
Gaps are found before code, not after. The spec check costs one agent. A gap found in review costs a rebuild and a second round of every reviewer.
Review matched to risk. A copy change gets two reviewers on a faster model. A high-risk change to personal data gets security, privacy and doubt reviewers on the strongest model. The routing is one function in factory/lib/core.mjs, and the gate corrects it from the files the build actually changed: a build that touches a dependency manifest, an auth module or a stylesheet gains the reviewers for it.
Humans where judgement matters. A human is asked at three points, each for a reason:
- before building, when the spec has a question only a person can answer, or the plan includes a decision that is expensive to reverse;
- before merging, when the job is high risk, touches protected paths (
migrations,billing,auth,.github, and the factory itself), or the approver agent is unsure; - at random, for one in five jobs that would otherwise auto-merge, so that you keep reading a sample of what ships. Set
approval.auditRateto change this, orapproval.autoMergetofalseto approve everything yourself.
Every pull request reads the same way. The description is written for someone who has not seen the code, in a fixed order the gate enforces:
- Summary in plain words, as three separate parts: what changes, why, and how.
- Component diagram, colour coded: green for newly added, amber for changed, grey for not changed.
- Sequence diagram of the main flow.
- Tests: what was tested at a high level, followed by the checks the factory actually ran and their results.
The builder writes it, the factory applies the same colours and legend to every diagram, a build without it does not pass the gate, and the reviewers and approver check that it matches the code. The risk, review history, builder notes, design and spec follow underneath, folded away.
Everything is written down. Each job keeps its issue, intake, spec, build notes, gate results, every review, the approval decision and your feedback as Markdown in factory/jobs/<id>/, and posts its progress as comments on the GitHub issue. The pull request says plainly that agents wrote it and points at what a human should look at.
Configuration
Everything is in factory/factory.config.json.
| Setting | Default | Meaning |
|---|---|---|
label |
factory |
Issues with this label are picked up. |
concurrency |
3 |
Jobs running at once. Jobs waiting on a human do not count. |
maxRounds |
3 |
Review rounds before a job is handed to a human. |
maxGateFailures |
5 |
Failed gates before a job is handed to a human, or sooner, when two failures in a row are the same. |
planReview |
high-pain |
When a human approves the plan: high-pain, always or never. |
specReview |
true |
Run the spec check before building. |
maxSpecRounds |
2 |
Times the spec writer may revise on its own before the open gaps go to a human. |
maxAutoAnswers |
2 |
Times per job the factory may accept the spec check's recommended answers itself when no item needs a human. 0 turns this off. |
probes.anchors |
81 names (afterGrill, decideApproval, REVIEW_CONTRACT.md, ...) |
Names of the functions, config keys and files that decide whether a job skips a human, a reviewer or a stage. A spec or diff that names one needs a ## Boundary probes section and a probe beyond it (lesson L10). Hand-maintained; [] turns the check off. |
playbooks |
see core.mjs |
Per kind of job: whether it is designed and spec-checked, how the builder approaches it, which skills fit. |
routing |
see core.mjs |
Which reviewers run for which risk levels, kinds of job and areas of code. |
surfacePaths |
see core.mjs |
Globs per surface (deps, data, auth, infra, ui, docs), case ignored. When the diff touches a surface intake did not flag, the gate adds it and the reviewers it routes, and says so under ## Re-route in the gate file. A project's list replaces the default for that surface. |
charter |
PRODUCT.md, DESIGN.md, CONSTRAINTS.md, GLOSSARY.md, CONTEXT.md, docs/adr/** |
Root files that form the product charter, case ignored. [] turns it off. |
memory.maxLessonsInBrief |
12 |
How many lessons each brief carries, after keeping only its reader's. |
memory.promoteAfter |
3 |
Recurrences after which a lesson is flagged to become a check. |
skills.autoInstall |
true |
Install missing agent skills automatically. |
skills.sources |
see file | Which skills the factory expects, and the repository each comes from. |
skills.optional |
see file | Skills some agents name and use when present, which the factory never installs. |
checks |
auto-detected | Commands the gate runs in the job's worktree. See Recommended checks for external tools worth adding. |
setup |
auto-detected | Commands that prepare a fresh worktree, such as npm ci. |
models |
see file | Model per stage, and per risk level for reviewers. |
approval.autoMerge |
false |
Allow merges with no human. Off until you trust the checks and reviews. |
tracker.commandPrefix |
/factory |
What a ticket comment must start with to be read as an answer to the factory. |
tracker.trusted |
owner, members, collaborators | Whose ticket comments the factory acts on. |
memory.sampleCleanJobs |
0.1 |
Share of cleanly merged jobs that still get a retro. |
approval.auditRate |
0.2 |
Share of auto-mergeable jobs sent to a human anyway. |
approval.escalateRisk |
["high"] |
Risk levels that always need a human. |
approval.escalatePaths |
see file | Paths that always need a human. |
slop.mode |
fail |
fail blocks on slop findings of severity block; warn only reports them. Flags never block in either mode, and credentials always block. |
collect.sources |
inbox | Where new work comes from (below). |
pricing |
{} |
Dollars per million tokens by model name, to show cost estimates in job.mjs status, job.mjs stats and the dashboard. |
Product charter
A project's charter is the set of files that say what the product is and how it must be built: by default PRODUCT.md, DESIGN.md, CONSTRAINTS.md, GLOSSARY.md and CONTEXT.md at the repository root and everything under docs/adr/, matched without case. charter in the config changes the list; [] turns it off. Only root paths match, so the factory's own factory/DESIGN.md is not a charter file.
- Every job brief lists the charter files on the base branch as binding. The spec writer, builder, code and UI reviewers and approver read them and report a contradiction instead of making one.
- A change to a charter file, renaming one away included, always goes to a human, even with auto-merge on.
- The factory neither runs nor depends on a design linter. A project that keeps a
DESIGN.mdcan addnpx -p @google/design.md designmd lint DESIGN.md(exit 1 on errors) to its ownchecksinfactory/factory.config.json, as the Design tokens row under Recommended checks shows;designmd diff A Bexits 1 on a regression.
Recommended checks
The gate's built-in scan reads only the diff. It does not look for secrets buried in earlier commits, lint your code, find unused or duplicated code, audit your dependencies or validate design tokens. These external tools cover that ground. The factory does not install or run any of them: you install the ones you want, add them to checks in factory/factory.config.json, and the gate runs them like any other check. A non-zero exit fails the gate.
| Concern | Command | What it fails on |
|---|---|---|
| Secrets in history | gitleaks git --log-opts="<base>..HEAD" |
Secrets in the commits the change adds. |
| Lint | npx @biomejs/biome ci --changed --since=<base> |
Lint and format problems in the files the change touches, including ones those files already had. |
Unused code, duplication, cycles (JS and TS only; pin the version, for example npx fallow@<version> audit ...) |
npx fallow audit --base <base> |
Findings the change introduces. Existing findings do not fail it. |
| Duplication in any language | npx jscpd . --baseline-from-ref <base> --fail-on-new-clones 0 |
Clones that are not in <base>. Leave threshold out of the jscpd config, or old clones fail it too. |
| Vulnerable dependencies | osv-scanner scan source -r . |
Every known-vulnerable dependency in the whole tree, new or not. It has no mode limited to the change. |
| Design tokens | npx -p @google/design.md designmd lint DESIGN.md |
Errors anywhere in the file, not only the lines the change touched. DESIGN.md here is your project's own design-token file in the @google/design.md format, not factory/DESIGN.md. |
<base> stands for the job's base branch or ref. The gate does not fill it in: it runs each command exactly as written, so write your own ref into the command, for example origin/main. That ref must exist in the job's worktree, which it does for a remote branch the worktree's repository has fetched.
Each command runs through the platform shell (cmd.exe on Windows, /bin/sh elsewhere), so it must work in both. Inside the JSON config, escape the inner double quotes as \":
"checks": [
{ "name": "test", "cmd": "npm test" },
{ "name": "secrets", "cmd": "gitleaks git --log-opts=\"origin/main..HEAD\"" },
{ "name": "lint", "cmd": "npx @biomejs/biome ci --changed --since=origin/main" },
{ "name": "duplication", "cmd": "npx jscpd . --baseline-from-ref origin/main --fail-on-new-clones 0" },
{ "name": "dependencies", "cmd": "osv-scanner scan source -r ." }
]
Sources of work
"collect": {
"label": "factory:triage",
"autoQueue": false,
"sources": [
{ "type": "sentry", "org": "acme", "project": "web", "minEvents": 5 },
{ "type": "inbox", "dir": "factory/inbox" },
{ "type": "command", "name": "posthog", "cmd": "node scripts/posthog-errors.mjs" }
]
}
- sentry reads unresolved issues from the Sentry API. Set
SENTRY_AUTH_TOKENin your environment. - inbox turns each Markdown file in a folder into an issue.
- command runs anything that prints a JSON array of
{ "key", "title", "body" }. Use it for PostHog, support tickets, a metrics threshold, or any other system. - ratchet migrates the codebase to a stricter check one file at a time. Turn the new rule on with the failing files on an exception list, then add
{ "type": "ratchet", "name": "strict-types", "listFile": "lint-exceptions.txt", "check": "npm run lint:strict" }. Each collection files one ticket for the next file on the list, and nothing while one is still open, so review stays cheap and the check only ever gets stricter.
Collected issues are labelled factory:triage, not factory, so a person chooses what gets built. Each one carries a Factory-Source: line that stops the same problem being filed twice. If a problem is reported again after its ticket was closed, the collector reopens that ticket. Set autoQueue to true only when you trust a source enough to let it start work on its own.
Where the design comes from
factory/DESIGN.md describes this factory in the shared vocabulary of Matt Pocock's software-factory skill: every service slot and what fills it, every task with what triggers it and what it triggers next, the brakes, and the gaps that remain. Read it before changing how the factory works.
This project implements the ideas in four talks and that skill, and says so where it follows one:
| Idea | Source | Where it lives |
|---|---|---|
| A skill as orchestrator, subagents per stage, Markdown job files, a dashboard, worktrees for parallel jobs | ZazenCodes, Build Your Own AI Software Factory with Claude Code | .claude/skills/factory, .claude/agents, factory/dashboard |
| Issues in and pull requests out, an intake stage, a deterministic spine, a gate before review, routing by risk, concurrency, time and cost per job, resuming after a crash | ZazenCodes, Build a Better Software Factory with Claude Code | factory/bin/job.mjs, factory/lib/core.mjs |
| Collecting work from telemetry, a QA specialist, a "should this code exist" check before building, progress logged on the issue, hooks that block secrets | Eric Tech, I Built a Self-Improving Software Factory | factory/bin/collect.mjs, factory-reviewer-qa, factory-builder, factory/bin/guard.mjs |
| Start slow with throttled triggers and human review; one live run per ticket; humans re-entering through the ticket tracker; the explore, decompose, rework, ratchet, architecture and retro tasks; fixing friction in the environment instead of working around it | Matt Pocock, software-factory and chief-of-staff skills |
factory/DESIGN.md, approval.autoMerge, the claim labels, /factory ticket comments, factory-decompose, the ratchet source, factory-scout, factory-retro |
| Forward and back pressure, understanding the problem before building, planning in proportion to the cost of being wrong, fighting slop with deterministic rules, learning from past sessions, keeping decisions in one place, humans reviewing a subset chosen by stakes | Dex Horthy, 12 Rules for a Software Factory That Doesn't Ship Slop | the slop gate, the design stage, the spec check, plan review, approval.auditRate, factory/memory, factory-retro |
Before you trust it with production
- Leave
autoMergeoff at first, and read what it produces. Turn automation up as it earns it. - The gate is only as good as your checks. With weak tests, the factory will ship code that passes weak tests.
- Issue text is untrusted input. Agents are told to treat it as a request and not as instructions, and only issues you label are processed, but do not label an issue you have not read on a public repository.
- It costs tokens. A small chore runs about five agents; a high-risk feature touching personal data runs fifteen or more, plus rework.
job.mjs status <job>shows the time and the recorded tokens per stage, andjob.mjs statstotals recorded tokens by stage and by model across jobs, so you can see which stage costs most. - It runs on your machine. The orchestrator is your agent session and the job files live on your disk; a label change on GitHub does not start work until
/factory runruns.factory/DESIGN.mdlists this and the other known gaps. - Job files are local.
factory/jobs/is not committed. The durable record is the issue comments and the pull request. - Not yet exercised: the Sentry source has not been run against a real account, and the GitHub Copilot path has not been run in Copilot. The Copilot agent files follow GitHub's documented format, but expect to adjust the delegation wording for your Copilot surface on the first run.
Benchmark
Planted problems detected: 38 of 52; false positives: 0 of 29; replay findings: 3
That line is the head of bench/SCORECARD.md: 81 small fixtures, most with one planted problem (a skipped test, a committed key, a stub), the rest near-misses that must not fire, scored against what the gate, the approval rules and the base check do with them today, plus a replay of the gate over this repository's accepted commits and what agents are made to read. npm run bench regenerates it. npm test fails when the committed scorecard is stale or a number is worse than bench/floor.json, so a change to the gate, routing, approval rules or briefs shows its effect in its own diff.
It measures how well the brakes catch bad work and what agents are made to read. It does not measure the quality of the software the factory builds. Real-job numbers (rework rounds, gate failures, tokens, from node factory/bin/job.mjs stats) are a separate measure, and need many jobs to mean anything.
Development
npm test
test/core.test.mjs covers the decision logic. test/job.test.mjs runs whole job lifecycles against throwaway git repositories with GitHub turned off, and fails if the Copilot agent copies are stale. After editing an agent in .claude/agents, run node factory/bin/sync-agents.mjs.
License
Public domain. No copyright is claimed: anyone may use, copy, change and distribute this for any purpose, with no conditions. See LICENSE (the Unlicense).
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi