agentsclimarketplace

Factory init

Skill jchandra74/claude-factory/skills/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

Install
npx -y skills add jchandra74/claude-factory --skill factory-init

Assembled 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 to docs/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 → the HEAD branch: line if a remote exists; else the current branch (git branch --show-current); else whichever of main/master has a local ref (git show-ref --verify refs/heads/main). This is only used to shape the suggested working_branch (see below) — it is never itself a valid working_branch value.
  • Test command — check in this order and keep every hit (there can be more than one):
    • tests/ directory present → look for tests/run.sh (or run.ps1); if found, suggest bash tests/run.sh.
    • package.json with a scripts.test entry → suggest npm test.
    • any *.csproj in the tree → suggest dotnet test.
    • Makefile with a test: target → suggest make test.
    • If nothing matches, leave verify empty 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. Default setup: [] if none match.
  • Codex plugin availability: treat Codex as detected if either holds — a skill named codex-delegate or any codex:*-namespaced skill appears in your available-skills list for this session, OR a codex binary 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 never main/master). Suggest factory/<default branch> (e.g. factory/main). If the user proposes main, 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 — default 3.
  • iteration_cap — default 50.
  • notify — push (default) or none.
  • 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 routing mechanical through 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 — default codex if Codex was detected in step 1, else default claude. The user may also choose none; 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:

  1. $REPO/docs/factory.json — keys must match skills/factory-run/scripts/config.py's DEFAULTS exactly (no unrecognized top-level keys, or config.py will 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_dir is a fixed convention, not an interview question.)

  2. A ## Factory pointer section in $REPO/CLAUDE.md — a pointer, not a value store; exactly three lines, no config values duplicated here (they'd drift from docs/factory.json):

    ## Factory
    
    This project runs claude-factory. Config: `docs/factory.json`. Issues:
    `docs/issues/` (board snapshot: `docs/issues/BOARD.md`).
    

    If $REPO/CLAUDE.md doesn't exist yet, create it with just this section. If it exists and already has a ## Factory heading, 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.

  3. .gitignore entries — ensure $REPO/.gitignore contains a line for .factory/ and a line for the configured worktree_root, adding whichever are missing (don't duplicate ones already present).

  4. $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).

Keep looking

Skills are one crate of 608,475. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.