Factory init
Scaffold the software factory in a project (run once per repo) — interview for working branch, verify/setup commands, parallelism, notify preference, model routing and review policy, detecting sensible defaults first, then write docs/factory.json, a CLAUDE.md pointer, .gitignore entries and the docs/issues board. Use when the user says "factory init", "init the factory", "set up claude-factory", "initialize the factory", "bootstrap the factory", or invokes /factory-init. Safe to run on an already-initialized repo (no-op, offers to show the existing config).From its SKILL.md
npx -y skills add jchandra74/claude-factory --skill factory-initAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.6 KB, as published. Nobody here has run it
Factory Init
Turns an ordinary repo into a claude-factory project: one interview, one
config file, one commit. factory-run refuses to guess at
working_branch/verify — this skill is how those get set deliberately.
Call the repo being initialized $REPO (the current working directory
root).
Process
0. Safe no-op check — first, before anything else
Check whether $REPO/docs/factory.json already exists.
- If it does: the repo is already initialized. Do NOT re-run the
interview or touch any files. Tell the user this repo already runs
claude-factory and offer to print the current config (read and show
$REPO/docs/factory.json). Stop here. (Reconfiguring an existing project is a manual edit todocs/factory.json, not this skill's job.) - If it does not: continue to step 1.
1. Detect — gather facts before asking anything
Run these checks against $REPO and keep the results for the interview;
never ask a question you can answer yourself.
- Default branch:
git remote show origin→ theHEAD branch:line if a remote exists; else the current branch (git branch --show-current); else whichever ofmain/masterhas a local ref (git show-ref --verify refs/heads/main). This is only used to shape the suggestedworking_branch(see below) — it is never itself a validworking_branchvalue. - Test command — check in this order and keep every hit (there can be
more than one):
tests/directory present → look fortests/run.sh(orrun.ps1); if found, suggestbash tests/run.sh.package.jsonwith ascripts.testentry → suggestnpm test.- any
*.csprojin the tree → suggestdotnet test. Makefilewith atest:target → suggestmake test.- If nothing matches, leave
verifyempty and say so explicitly — an empty verify list is a real footgun (merges would never be checked), so flag it rather than silently defaulting.
- Setup command — same idea, for a fresh worktree's dependency install:
package.json→npm ci;requirements.txt→pip install -r requirements.txt; any*.csproj→dotnet restore;Gemfile→bundle install;go.mod→go mod download. Defaultsetup: []if none match. - Codex plugin availability: treat Codex as detected if either holds —
a skill named
codex-delegateor anycodex:*-namespaced skill appears in your available-skills list for this session, OR acodexbinary is on PATH (command -v codex/Get-Command codex -ErrorAction SilentlyContinue). This gates whether the routing and review questions below offer Codex at all — never offer an option the repo can't actually use.
2. Interview — ask once, with detected defaults attached
Present everything detected in one message and ask the user to confirm or override, rather than a question at a time. Cover:
working_branch— the factory's own integration branch (decision 6: the ONLY ref the factory may push to, and it is nevermain/master). Suggestfactory/<default branch>(e.g.factory/main). If the user proposesmain,master, or the detected default branch itself, reject it and ask again — this is a hard constraint, not a preference.verify— the detected test command(s), editable; this gates every merge, so confirm it explicitly even when detection found exactly one candidate.setup— the detected install command(s) for a fresh worktree, editable.worktree_root— default a sibling of$REPO, not nested inside it:../<repo folder name>.wt(keeps watchers off nested worktrees, shortens Windows paths).max_parallel— default3.iteration_cap— default50.notify—push(default) ornone.routing— default is all-subagent, no Haiku:mechanical→factory-implementer-light/sonnet,standard→factory-implementer/sonnet,architectural→factory-implementer-heavy/opus. Only if Codex was detected in step 1, additionally offer routingmechanicalthrough the Codex lane ({"lane": "codex"}) as an alternative to the default subagent entry — never present this option when Codex wasn't detected.review.second_model— defaultcodexif Codex was detected in step 1, else defaultclaude. The user may also choosenone; if they do, deliver a loud, explicit warning before accepting it: single-model review loses the adversarial second opinion the gauntlet is built around, and this degrades merge safety. Do not soften or skip the warning.
3. Write — once, after the interview settles
Write exactly these, no more:
-
$REPO/docs/factory.json— keys must matchskills/factory-run/scripts/config.py'sDEFAULTSexactly (no unrecognized top-level keys, orconfig.pywill warn on every load):{ "version": 1, "working_branch": "<answer>", "issues_dir": "docs/issues", "worktree_root": "<answer>", "setup": ["<answer>", "..."], "verify": ["<answer>", "..."], "max_parallel": <answer>, "iteration_cap": <answer>, "notify": "<answer>", "routing": { "mechanical": { "lane": "subagent", "agent": "factory-implementer-light", "model": "sonnet" }, "standard": { "lane": "subagent", "agent": "factory-implementer", "model": "sonnet" }, "architectural": { "lane": "subagent", "agent": "factory-implementer-heavy", "model": "opus" } }, "review": { "second_model": "<answer>" } }(
issues_diris a fixed convention, not an interview question.) -
A
## Factorypointer section in$REPO/CLAUDE.md— a pointer, not a value store; exactly three lines, no config values duplicated here (they'd drift fromdocs/factory.json):## Factory This project runs claude-factory. Config: `docs/factory.json`. Issues: `docs/issues/` (board snapshot: `docs/issues/BOARD.md`).If
$REPO/CLAUDE.mddoesn't exist yet, create it with just this section. If it exists and already has a## Factoryheading, leave it alone (the step 0 no-op check should already have caught this case, but don't double-write). Otherwise append the section to the end of the file. -
.gitignoreentries — ensure$REPO/.gitignorecontains a line for.factory/and a line for the configuredworktree_root, adding whichever are missing (don't duplicate ones already present). -
$REPO/docs/issues/.gitkeep— create the directory and the empty placeholder file so the empty board is tracked from the start.
4. Commit — one scaffold commit
git -C $REPO add docs/factory.json CLAUDE.md .gitignore docs/issues/.gitkeep
git -C $REPO commit -m "chore(factory): initialize factory config + board"
Then tell the user the factory is initialized, show the written
working_branch and verify command, and point them at
/claude-factory:factory-to-tickets (to get work onto the board) and
/claude-factory:factory-run (to start the line).