Settings
This page and the ones it lists are for changing what the factory does in
your repository once it is set up. Everything you can change is in one file,
.claude/factory.yaml, which factory init writes when
you set the factory up. You don't need to read this page top to bottom:
start with
the settings most repositories change,
and look up any other setting under Every setting.
Words this page uses
- Session: one conversation with the coding agent working in your repository. A session on your own machine is a local session. One that runs in the cloud with nobody at the keyboard is an unattended session.
- Build: a session taking one approved ticket to a pull request.
- The cloud runner: where the factory's unattended work runs. Today that is GitHub Actions.
- The board: a view showing each ticket's state as a column, today a GitHub Project. It is optional.
- The board sync: a job on the cloud runner that moves each ticket to its column on the board and fills in its fields. It is the only thing that writes to the board.
factory sync: a command you run. It copies the factory's skills, agents, and rules into your repository, choosing which ones from this file, writes its two workflow files, and writes the settings in effect into.claude/factory.lock. It has nothing to do with the board sync.- Skill and agent: a skill is a set of instructions a session follows, and an agent is a separate reviewer a session launches to read something and report back.
The glossary has the rest.
How the file works
-
Three settings are required, and a fourth before any build. Every file has
version,repository, andcode-host.branch-name, whichfactory initwrites for you, and a session can't build a ticket until you setcommands.gate. Every other setting has a default, and you write it only when you want something else. -
It holds only what a script needs. Anything that needs judgment, such as when one of your reviewers should apply, goes in the instructions your coding agent already reads, such as
CLAUDE.md. -
File patterns are globs.
*matches within one folder and**matches across folders. Both match names that start with a dot. A pattern with no wildcard matches that one path from the repository's root. -
A command is one line of shell. Each runs with bash, from the repository's root. Only the commands under
site.checks,auto-merge.commands, andapproval-policiesare given anything on their standard input, and their entries say what. -
Some settings choose between tools, and name the tool with
type. Whentypeis the only thing in the block, you can write the tool's name on the same line. These two mean the same:specs: openspecspecs: type: openspec -
Your comments are kept.
factory initwrites a comment above each section, and updates never remove yours. -
Every command reads the lock, not this file.
factory synccombines the factory's defaults, anypresetsyou list, and this file, and writes every setting the factory will use, defaults included, into.claude/factory.lock, which you commit and never edit. Until you sync after a change, every command stops and says so, but the ones that fix or report it:factory sync,factory doctor,factory config check, and thefactory presetcommands..claude/factory.yaml changed since the last sync. Run: factory syncfactory config explainprints the settings in effect, each marked with where its value came from.
The shortest file
These are the settings the factory needs before a session can build a ticket. Every other setting has a default.
version: 2
repository: your-name/your-repo
code-host:
branch-name: "{ticket}"
commands:
gate:
- npm testversion,repository, andcode-host.branch-nameare required by every command, andfactory initwrites all three. Without one, every command stops and names it."{ticket}"is a pattern: ticket 12 is built on a branch named12. The code host is GitHub unless you say otherwise.commands.gateis how a session checks a change, such as your tests and linter.factory initasks for one command and writes it. Left empty, it lists the gate under "Left to do", and you add it. Without it the factory still refines tickets, but a session can't build one.
With these, the factory refines a ticket when you run /factory-refine N
in a session, builds it when you run /factory-build N, nothing merges
without you, and there is no board.
With a board, two more settings are required. Skip this part if you
have none:
tickets.board, your board's number, and
tickets.columns, which of its columns shows each of
the six states a ticket goes through.
factory init writes both from the board you choose:
tickets:
board: 1
columns:
backlog: Backlog
refining: In refinement
ready: Ready
building: In progress
review: In review
done: DoneEvery state needs a line. For a state your board has no column for,
write none as its column. By default nothing starts a build when a
ticket reaches Ready (builds.trigger is manual); if you
set it to own-server or github-action, ready must name a column.
factory init may write more, such as tickets.fields
when you confirm the ticket fields it suggests. None of it is required.
It worked when factory config check prints
✓ The settings are valid.
The settings most repositories change
- How to check a change: your tests, linter, and type check, under
commands.gate. A build cannot finish without it. - Quick checks before every commit: your formatter and the other
checks that take a few seconds, under
commands.before-commit. - A board: your board's number, under
tickets.board. - What may merge without you: for example your docs, under
auto-merge.allow. - Reviewers of your own: an agent you wrote, which reads a change that
touches certain files, under
plugins.build.reviewers. Your own skills and agents has a worked example.
After you change the file, run:
factory config check
factory syncfactory config check prints ✓ The settings are valid. when the file
is valid, and names the setting when it is not. factory sync then rewrites the lock and the
copied files that depend on what you changed, and lists each file it
wrote. Every change needs it, one under plugins included, as
How the file works says.
Every setting
version and repository are below. Every other key has a page of its
own:
| Key | What it sets |
|---|---|
presets |
The shared settings this repository follows |
tickets |
The ticket system, the board, its columns, fields, and labels |
code-host |
The code host, how a build names its branch, and its labels |
builds |
Builds in the cloud, and what starts them |
specs |
The spec tool, if any |
commands |
The commands that check a change |
session-minutes |
How long a session in the cloud may run |
plugins |
Your own skills and agents |
site |
A website's pages, for the website review |
auto-merge |
The pull requests that merge themselves |
pr-review |
The automated review |
rules |
The factory's rules, tuned for your repository |
approval-policies |
The checks a person approves |
Example settings files shows three whole files.
version
Which layout of this file you are using. It is not the factory's version.
Write 2.
- Default: none.
factory initwrites it. - If it is wrong, every factory command that reads this file stops
with
version: must be 2. For a version 1 file, it also says where Upgrade notes shows each setting that moved.
repository
Your repository, as owner/name, such as harbor-goods/storefront.
-
Default: none.
factory initwrites it. It proposes the repository from your checkout's remotes, whatever each is called, and asks which one you are setting up when they name a fork or more than one repository. Once the line is written, nothing works it out again. -
If it is wrong, commands read and write another repository's tickets, or fail because it does not exist. A command that reads the default branch, such as
factory sync, stops when no remote of your checkout is that repository:✗ repository: .claude/factory.yaml says acme/web, and no remote here is acme/web. origin is dev/web. Add the remote, or change the line and run factory sync. -
In a run in the cloud too, commands take the repository from this line, and not from the run. After you rename a repository, change the line: the "Factory files in step" check fails on each pull request until you do, with both names:
✗ repository: .claude/factory.yaml says acme/web, and this pull request is in acme/website. Change the line and run factory sync.
It is written down rather than worked out from your checkout, because the poller, which watches your board from outside any checkout, needs it too.
Checking the file
| Command or tool | What it does |
|---|---|
| Your editor | Flags a misspelled setting as you type, using the schema named on the file's first line |
factory config check |
Stops on anything the factory can't use, and warns about patterns that match nothing. CI runs it |
factory config explain |
Prints the whole file as the factory reads it, with every default written out and marked # default |
factory doctor |
Checks the file against your real board, and that each secret the factory needs is set |
A first line like this one is optional. It points your editor at the schema, in the factory's own repository:
# $schema: https://raw.githubusercontent.com/davidbyoung/software-factory/main/settings.schema.jsonJetBrains editors and Visual Studio Code's YAML extension both read it.
The editor's check is only a help: it accepts some things
factory config check refuses, such as a plugin whose file doesn't exist.