- Go 93.7%
- Go Template 2.2%
- Dockerfile 2.1%
- Just 1.4%
- Shell 0.6%
|
|
||
|---|---|---|
| .claude | ||
| .factory | ||
| cmd/factory | ||
| docs | ||
| internal | ||
| prompts | ||
| skills | ||
| template | ||
| test | ||
| .gitignore | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| factory.example.json | ||
| go.mod | ||
| justfile | ||
| README.md | ||
factory
factory is a project-agnostic tool that lets coding agents work on your existing projects, whatever their language or tooling. You hand them work, they open pull requests, and you review and merge. The agents:
- implement issues and open pull requests,
- review pull requests,
- fix stale documentation,
- refine work items (conception work without code),
- propose improvements to their own instructions.
It is deliberately thin: the agents are the harnesses, and factory gives them a clean checkout, a task prompt, skills, tight permissions and a small set of forge tools. Everything runs inside a Docker Sandbox, a microVM whose proxy keeps your credentials on the host, so no agent touches the machine you work on or sees a real token.
- You start every run with
factory run …in the sandbox. Nothing runs on a schedule or reacts to forge events. - Humans always merge. The factory has no merge operation, never approves its own pull requests, and pushes only
factory/*branches. - Swapping agent, model or forge is a configuration change. It supports Claude Code and OpenCode, with hosted or local models. See what has been tested so far. The reviewer can use a different model from the implementer.
| Layer | Where | What |
|---|---|---|
| Knowledge | AGENTS.md, skills/, prompts/ |
Instructions and SKILL.md skills that both harnesses read |
| Forge | internal/forge, internal/ops |
One forge-neutral interface with a backend per forge, exposed as factory forge <op> and as an MCP server |
| Execution | internal/dispatch, internal/harness |
factory run <task> runs a harness headlessly or interactively, within a timeout and budget, and reports back |
What has been tested
| Forge | Harness | Model | How |
|---|---|---|---|
| Forgejo, a personal account | Claude Code | Claude subscription, through the sandbox's proxy | Real runs in a Docker Sandbox, on this repository |
| Forgejo, a personal account | OpenCode | Local: Qwen3-Coder-Next (6-bit) served by mlx-lm on a Mac host | Real runs in a Docker Sandbox, on this repository |
| Forgejo 15, local, bot account | Claude Code, OpenCode | A fake model server (Anthropic and OpenAI wire formats) with scripted tool calls | Automated end-to-end tests: tasks and permission boundaries (tests) |
Not tried yet:
- Forges: Codeberg (it runs Forgejo, so it is expected to work), Gitea (same backend, no test against a Gitea server), GitHub (tested only against a fake of its API, and it doesn't work in the sandbox yet), Azure DevOps (tested only against a fake of its API; it has no issues, so work items come from an MCP tracker).
- Models: API keys, cloud providers (Bedrock, Vertex, Foundry), gateways, other providers through OpenCode, and other local model servers (Ollama, LM Studio, llama.cpp, vLLM).
- A bot account in real runs.
They are supported by the configuration, but a first run may find problems. Please report what you find.
Quickstart
This is the short version of docs/setup.md; follow that guide for the details of each step. The example repository is team/app on git.example.com.
The factory's sandbox is defined in your repository, in .factory/, and shared by the team. It is separate from any sandbox your team develops in. Your repository is not mounted into it: the factory clones it from the forge for every run and pushes its work back as pull requests.
You need, on your host: sbx 0.45+, a checkout of your repository, a forge token scoped to it (docs/tokens.md), and access to a model: an API key or subscription for any provider Claude Code or OpenCode supports, or a local model.
Once per repository:
- Copy the template into your repository's root:
git clone https://git.darioveltri.de/dario/factory /tmp/factory cp -R /tmp/factory/template/.factory .factory - Fill in the placeholders (
grep -rn REPLACE .factory) and add your toolchain:.factory/sbxenv.yaml: a sandboxnameof its own..factory/kit/kit.yaml: your forge's host and package registries in the network rules, and the forge credential bound to your forge..factory/kit/kit.dockerfile: your project's toolchain, as a block of its own..factory/kit/factory.json: the configuration, which the kit installs in the sandbox. The template uses OpenCode with an Anthropic API key; every key is explained in docs/configuration.md.
- Commit
.factory/through your normal review. The factory itself never pushes changes to it.
Each engineer, from their checkout:
- Store your forge token on the host; it never enters the sandbox:
sbx secret set app-forge - Create and enter the sandbox, approve the plan
sbxshows, then check the setup:sbx env run .factory claude # once: /login, then exit (with a Claude subscription) factory config check factory forge get-repo -repo team/app - Run a task on a small issue, watching the agent the first time:
Review the pull request on the forge and merge it yourself.factory run implement-issue -repo team/app -item 12 -interactive factory run review-pr -repo team/app -pr 34
Documentation
| Document | What it covers |
|---|---|
| Setup | Step-by-step setup for your own repository, with troubleshooting and a security checklist |
| Running tasks | The tasks and their flags, what a run does, interactive sessions, taking over runs, reviews |
| Configuration | Every key in factory.json: forge, agent profiles, roles, the repository's agent configuration, MCP servers, environment overrides |
| Forge tokens | The account, token permissions and branch protection for each forge |
| Forge tools | factory forge and factory mcp: the operations agents use, and using them by hand |
| The sandbox | How the sandbox keeps credentials on the host, the security model, local models on the host |
| Developing the factory | Working on this repository with the factory, building, tests, extending it with a new forge or harness |
| Design decisions | The ADRs behind the design |
The canonical repository is https://git.darioveltri.de/dario/factory.