No description
  • Go 93.7%
  • Go Template 2.2%
  • Dockerfile 2.1%
  • Just 1.4%
  • Shell 0.6%
Find a file
2026-11-29 16:13:33 +01:00
.claude Phase 1: repo skeleton, config, local Forgejo test environment 2026-11-06 21:36:28 +01:00
.factory Kit build checks factory.json 2026-11-27 11:50:59 +01:00
cmd/factory Fix -ref: drop the old -ref alias of -item 2026-11-27 11:26:02 +01:00
docs Kit build checks factory.json 2026-11-27 11:50:59 +01:00
internal Fix -ref: drop the old -ref alias of -item 2026-11-27 11:26:02 +01:00
prompts References: read-only code outside the working copy 2026-11-27 10:49:53 +01:00
skills Task session: work with the agent without a work item 2026-11-24 16:23:09 +01:00
template Kit build checks factory.json 2026-11-27 11:50:59 +01:00
test Forgejo: take the login from bot_login, so repository-scoped tokens work 2026-11-18 11:17:42 +01:00
.gitignore Move the factory's own sandbox to .factory/ and make it the template 2026-11-23 11:32:32 +01:00
AGENTS.md docs: define the sandbox only as files; rename the setup and run guides 2026-11-23 10:20:07 +01:00
CLAUDE.md Phase 1: repo skeleton, config, local Forgejo test environment 2026-11-06 21:36:28 +01:00
factory.example.json Local models: set the server's sampling per model; mlx-serve reads model_id 2026-11-20 13:03:52 +01:00
go.mod Use the real module path git.darioveltri.de/dario/factory 2026-11-07 12:50:30 +01:00
justfile Move the factory's own sandbox to .factory/ and make it the template 2026-11-23 11:32:32 +01:00
README.md A minimal template for a repository's .factory/ 2026-11-23 13:51:16 +01:00

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:

  1. 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
    
  2. Fill in the placeholders (grep -rn REPLACE .factory) and add your toolchain:
    • .factory/sbxenv.yaml: a sandbox name of 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.
  3. Commit .factory/ through your normal review. The factory itself never pushes changes to it.

Each engineer, from their checkout:

  1. Store your forge token on the host; it never enters the sandbox:
    sbx secret set app-forge
    
  2. Create and enter the sandbox, approve the plan sbx shows, 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
    
  3. Run a task on a small issue, watching the agent the first time:
    factory run implement-issue -repo team/app -item 12 -interactive
    factory run review-pr -repo team/app -pr 34
    
    Review the pull request on the forge and merge it yourself.

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.