One-time setup of the maxxfactory runtime on this machine, complete enough that a new project runs without further setup. Finds the AI coding CLIs really installed (Codex, Claude Code, opencode, Grok, Antigravity, Mistral Vibe, ...) and their accounts, asks the owner once which subscription each account is on (paid plan, free plan, reserved for other uses), gives every model its tier and vendor from the owner's tier table, enforces vendor -> CLI, smoke-tests every model, reads the quotas, and...
2 stars
0 votes
0 copies
0 views
Added December 4, 2026
ai-agentsgoshellexpressawsgitapi
Works with
claude code
terminal
cli
api
mcp
Security analysis
D50/100
criticalAccesses sensitive system or user directories
criticalModifies startup scripts or system services for persistence
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Maxxfactory Init?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/icarossio-maxxfactory-init)
---
name: maxxfactory-init
description: One-time setup of the maxxfactory runtime on this machine, complete enough that a new project runs without further setup. Finds the AI coding CLIs really installed (Codex, Claude Code, opencode, Grok, Antigravity, Mistral Vibe, ...) and their accounts, asks the owner once which subscription each account is on (paid plan, free plan, reserved for other uses), gives every model its tier and vendor from the owner's tier table, enforces vendor -> CLI, smoke-tests every model, reads the quotas, and prints per role which models can take it and what is missing. Use when the user says "/maxxfactory-init", "set up the autopilot", "add a harness/account/model to the autopilot", or when another autopilot skill reports a missing roster.
---
# Autopilot: init
**Caveman, always.** Your first action, before any other tool call: invoke the `caveman` skill (`/caveman`), and keep it for the whole session, including after a resume or a context compaction (invoke it again then). If it is not installed, follow its rules anyway: answer first, no ceremony, commands, paths, numbers and errors verbatim. Every subagent you start talks caveman too: `run-model` adds the rule to every model prompt by itself, and every Agent-tool (subagent) prompt you write starts with "Invoke the `caveman` skill first and answer terse." Persisted text stays plain prose: code, comments, docs, commits, Linear, `PLAN.md`.
Goal: a roster at `~/.config/maxxfactory/models.json` (`$AUTOPILOT_CONFIG_DIR` overrides) where every entry has a tier (`level`), a `vendor`, a `subscription` and a passed smoke test, and a `bin/harness check` that reports nothing blocking. Nothing personal (accounts, plans, cooldowns, API keys) is ever written into the skill repo.
`bin/<x>` below means the `bin` directory next to this SKILL.md (`~/.claude/skills/maxxfactory-init/bin/<x>` after `install.sh`, `${CLAUDE_PLUGIN_ROOT}/skills/maxxfactory-init/bin/<x>` as a plugin).
## The policy the roster must express (README, "Tiers")
1. **Every role has its tier.** Tier 0 (frontier) plans: the planner session, pre-mortems, plan reviews and milestone reviews, with Tier 1 as the logged backup when no Tier 0 of another vendor is eligible (`"plan_tier0": false` keeps planning on Tier 1); Tier 1 (flagship) coordinates the run and writes and reviews Express changes (small, no risk flag); Tier 2 (balanced) implements, fixes and reviews each round of ticket code (implementer and reviewer always two different models); Tier 3 (fast and cheap) implements only when a project pins it (models.json or the project's tier table); Tier 4 (every Mistral model, every free model, old Gemini) only does trivial tasks, unless the owner names an exception: the roster entry then carries `owner_tier` (the owner's words) and keeps its `level`, with `no_implement` when the owner allows it for reviews only (e.g. a free model allowed as a Tier 2 reviewer); Tier 0 (frontier ceiling) is never used unless the owner asks for one run. The tier comes from the owner's tier table (`bin/autopilot_lib.py` `DEFAULT_TIER_TABLE`, overrides in `models.json` `tier_table`): never ask the owner what the table already answers. Ask only about a model the table does not know.
2. **Vendor -> CLI.** Anthropic models only through `claude`, OpenAI only through `codex`, Google only through `agy` or `gemini` (the Gemini CLI, where Antigravity does not run, such as a headless Linux server), Mistral only through `vibe`, xAI through `grok`, every other vendor through `pi` (OpenCode Go; far cheaper in tokens than opencode) or `opencode` (opencode free models and OpenRouter `:free` only). `bin/harness add-model` refuses anything else; never work around it (no Claude through Antigravity or OpenRouter, no GPT through opencode).
3. **No hand-ordered pools.** A role takes every model of its tier. At run time `run-model` draws one at random, weighted by the credit left on its account and by its subscription (paid first, free plans last), so every paid subscription is used up before its reset. Never encode preferences by hand.
4. **The coordinator's account is protected, and detected, not configured.** Whatever CLI and account the coordinator session runs on is the protected one: Claude Code is recognised by `CLAUDECODE` and its account by the session's `CLAUDE_CONFIG_DIR` (the default home when unset); another CLI by its adapter's `coordinator_env` and `account_env`; `AUTOPILOT_COORDINATOR=<cli>[/<account>]` forces it. Its models run last, for cheap roles only, and only while it keeps `coordinator_reserve` (default 30% of the 5-hour window and 20% of the weekly window). Another login of the same CLI is a normal account. Starting the coordinator from another account moves the protection there by itself.
5. **Implementer and reviewer are always different models.** Enforced at run time (fail closed). Accounts of the same model are the same reviewer; a reviewer of another vendor than the implementer is preferred when one is available.
6. **Subscriptions and free tiers only.** No paid per-token ids, no top-ups, no extra-usage credits bought or switched on by the runtime. Ask the owner once whether an account already holds extra credits they want used as a last resort; only then, with their words: `bin/harness credits <cli> <account> on --source "..." [--until DATE]` (`bin/harness credits` lists them, `off` ends it).
7. **No speed variants.** Never add a `-fast` / `build-fast` / "Fast" variant of a model family (e.g. `grok-4.7-build-fast`), whatever its tier: more expensive, no quality gain. `bin/harness add-model` refuses it, `bin/harness init` drops it, `run-model discover` skips it; only the owner can override with an explicit `--allow-fast` (never pass it on your own). "Flash" / "Flash-Lite" (Gemini, DeepSeek, GLM) are model families, not speed variants: add them normally.
## Steps
1. **Create or import the roster.**
- New machine: `bin/harness init` (copies `templates/models.json`: example models of November 2026 with their tier and vendor, no subscription).
- Existing roster in the format before the tier policy (it has `pools`): `bin/harness migrate --dry-run`, show the user what changes, then `bin/harness migrate`.
- Existing private roster to import: `bin/harness init --import <path/to/models.json>`.
2. **Discover what is really installed.** `bin/harness discover`: one line per CLI: installed (a real executable on PATH; a shell alias or function wrapping a removed binary counts as NOT INSTALLED, because `run-model` runs the binary, not the user's shell), adapter present or `NO ADAPTER`, version, roster entries; then one line per account directory on disk (e.g. `~/.codex*`) with whether it holds a login, who it is (email, plan, from the login's token claims; tokens are never printed), and the `add-account` command when it is not in the roster. A directory without a login is not an account. For a CLI that is not installed but has roster entries, tell the user now (install it, or `bin/harness set <key> excluded "not installed"`): finding out at run time costs a night.
3. **Register a CLI the runtime does not know** (rare: under rule 2 a new CLI only serves vendors without a CLI of their own). Ask the user (or read its `--help`) for the non-interactive invocation with full permissions, the model flag, stdout or an output-file flag, the variable that selects another account, a model-listing command, a usage command, and a variable the CLI sets in the processes it starts. Then `bin/harness new <name> --binary <bin> --vendor <vendor|by_model> --argv '["-p","{prompt}","--model","{model}","--yes"]' [--output file] [--account-env VAR --account-default ~/.x] [--coordinator-env VAR] [--list-cmd ...] [--usage-cmd ... --usage-regex ... --usage-groups ...] [--tokens-kind ... --tokens-path ...]`. Check it with `bin/harness adapters`.
4. **Add accounts: one standard for every harness.** The default account lives in the CLI's own home (`~/.codex`, `~/.claude`, `~/.local/share` for opencode); the next accounts live in `<default>-b`, `<default>-c`, ... and their roster keys are `<key>-b`, `<key>-c`, ... `bin/harness add-account <cli> b [--label "who@example.com"]` clones every base model of that CLI with the account's home. The user logs in once in that home. A directory with another name is renamed to the standard (`bin/harness set-home` when it was already in the roster), never registered as is.
5. **Add models.** For each model the user wants that is not in the template: `bin/harness add-model <key> --cli <cli> --model <id> [--family 'gpt-*-sol']`. The tier comes from the tier table, the vendor from the id; `--level` only for a model the table does not know (ask the owner which tier, with the README table in front of them). Give versioned ids a `family` with a `*` so `run-model discover` keeps them on the latest version. Remove template models the user does not have (`bin/harness remove <key>`).
6. **Ask once about subscriptions and plan sizes, per account.** For each paid account also record its plan's relative size as `capacity` in models.json (1 = the smallest plan; e.g. 12 for a plan with 12x its usage): draws are weighted by the remaining total usage of each subscription, credit left times capacity. Show the accounts (`bin/harness list`) and ask in one message, for each `<cli>/<account>`: paid (and the plan name), free plan, or reserved for other uses (and why). Record each answer: `bin/harness subscription <cli> <account|default> paid --plan "<plan>"`, `... free`, `... reserved --reason "<their words>"`. Reserved accounts are never used anywhere. An account the owner only wants kept out of one project goes in that project's `state.json` `exclude` instead (asked by `/maxxfactory-run` setup). Free models stay free whatever their account's plan.
7. **Detect the coordinator account.** `bin/harness whoami` prints the CLI and account this session runs on and the roster keys on it. Tell the user those keys are last resort for cheap roles only, guarded by `coordinator_reserve`. Nothing about it is written in `models.json`: each project records the account it was started from (`run-model whoami --record`) and re-detects it on resume.
8. **Smoke test every model** that is not excluded: `bin/run-model smoke <key>` (a 120 s "reply AUTOPILOT_OK" run; the coordinator's own account last, or skipped when the user wants to spare it). A model that fails is cooled down; fix the adapter or the login, `bin/run-model reset <key>`, smoke again, or remove it.
9. **Read the quotas and the latest versions.** `bin/run-model usage --apply` (every account's windows, used percentage and reset time; cools what is exhausted; records the credit left that weights the draws) and `bin/run-model discover --apply` (newer ids of every family, smoke-tested before switching). Harnesses without a usage probe say so: the runtime learns their resets from quota errors.
10. **Check the result.** `bin/harness check` prints, per role, the candidate models with tier, vendor, account, subscription, health and credit left, then every missing piece with what to do: a role with no candidate (e.g. no Tier 2 model: no ticket can be reviewed), a review role with a single vendor (works, but an outage of that vendor stops every review), no Tier 1 model of another vendor than the coordinator (no pre-mortem, no plan review), a CLI not installed, a refused entry, an unknown subscription, a coordinator account not detected. It ends with the logins (`bin/harness logins`): an account that is logged out, or whose login ends within 48 hours (Claude Code reports the date), blocks; the user logs in again with the command shown. Fix what blocks; show the user the rest. Exit 0 means nothing blocks.
11. **Linear access.** Check that this harness has Linear tools (MCP), else that `bin/access env LINEAR_API_KEY` finds it (environment, `linear_key_file` or the project's `.env`) and `bin/linear teams` answers.
12. **Permissions, so the run never stops on a prompt.** `bin/permit check` lists the runtime's rules (`templates/permissions.json`) missing from the settings. Show them and ask the user's consent to add them to the allowed commands of this machine (the user settings of this account). On their yes, run `bin/permit apply`; if the harness refuses that write (settings files are protected), the user types `! <bin>/permit apply`. Each project adds its own rules at planning (its checks and the plan's `Pre-authorized actions`). Never pre-allowed: paying for credits or a plan, deleting data, a repository or a production resource.
12b. **Tools the agents can act with.** `bin/access scan`: the ops CLIs installed and logged in (GitHub, Vercel, Cloudflare, AWS, ...) and the MCP servers connected or waiting for authentication. Tell the user which ones their projects are likely to need and are not logged in: every one fixed now is a manual step the agents will not ask for later.
12c. **Propose a server, once.** `bin/remote status`: `configured` or `declined` means the owner already answered, go on. `not asked` (exit 3): ask the owner, in one question, whether runs should also be able to go on a Linux server reached over SSH, so they continue while this machine sleeps or is closed; say what it takes (an SSH alias of their `~/.ssh/config` that logs in as root or as a sudoer, Debian or Ubuntu for the automatic setup, one fresh login per CLI account there) and that it can be added later. No: `bin/remote none` (recorded, never asked again). Yes: `bin/remote add <ssh-alias> [--user NAME]`, `bin/remote setup`, `bin/remote login` (the owner pastes each device code or URL), then `bin/remote doctor` until it exits 0 (in a project, or with `--repo <repo>`, it also checks that the project finds its tracker key there). No answer yet: go on, the question comes back at the next init. Logins are made fresh there, never copied. Google models there run through `gemini`: smoke them before adding them to the roster there.
13. **Spotlight off where the agents write (macOS).** Ask the user which folder holds their code (e.g. `~/code`), then `bin/spotlight check <that folder>`. Indexed: agents rewrite thousands of files an hour and Spotlight re-indexes every one (`mds` and `mdworker` keep the CPU and disk busy, checks slow down and flake). `bin/spotlight fix <folder>` opens System Settings > Spotlight > Search Privacy: the user adds the folder once, then check again until it passes. Worktrees are always created in `<repo>-wt`, next to the repo, so that one parent folder covers every project and every worktrees directory at once. A repo that sits directly in the home directory has no such folder: advise moving it into the code folder before planning. `/maxxfactory-plan`, `/maxxfactory-plan-more`, `/maxxfactory-run` and `/maxxfactory-continue` check it again for the project's own parent folder.
14. **Offer `pbcopyenv` (zsh on macOS).** Agents need tokens (an API key for the app under test, `LINEAR_API_KEY`, ...) and a secret pasted in the chat ends up in the conversation and in the logs. `shell/pbcopyenv.zsh` (in this repo, next to `bin/`) defines `pbcopyenv NAME`, which appends `NAME=<clipboard>` to `./.env` without printing the value; in a session the user types `! pbcopyenv MY_SUPER_TOKEN_NAME`. Skip silently when the user's shell is not zsh, `pbpaste` is missing, or `~/.zshrc` already mentions `pbcopyenv`. Otherwise explain it in two lines and ask; on a yes, append one line to `~/.zshrc`: `source <absolute path of the repo>/shell/pbcopyenv.zsh` (resolve the path through the `bin` link, never guess it; append only, never rewrite the file), and tell the user it works in new terminals and new sessions. On a no, do not ask again in this session. From then on, whenever a secret is needed, ask the user to run `! pbcopyenv <NAME>` instead of pasting it, and never print a `.env` value.
15. **Summary for the user:** the `bin/harness check` table (role -> candidates), the subscriptions recorded, the coordinator account detected, what was removed or excluded and why, the quotas right now, the Spotlight check, whether `pbcopyenv` is installed, the server (`bin/remote status`), the missing pieces, and that `/maxxfactory-plan` is the next step.
## Adapter format (for reference)
`harnesses/<cli>.json`: `name`, `binary`, `vendor` (or `by_model` to derive it from the model id), `run.argv` with `{prompt}`, `{model}`, `{out}`, `{cwd}` placeholders, `run.env`, `run.output` (`stdout` or `file`), `account_env` / `account_default` / `account_detect`, `account_login` (the file that proves a login, and optional JWT claims naming the account), `coordinator_env` (variables the CLI sets in the processes it starts, so a coordinator session running in it is detected; only Claude Code's `CLAUDECODE` is declared today), `list_models` (`command` + `regex`, `json_file`, `probe` for a CLI without a listing: next version ids are smoke-tested, or `none`), `usage` (`command` + `regex` + `groups`, `codex_sessions`, or `none`), `quota_patterns`, `waiting_patterns` (optional: the CLI's own input prompts; by default only a non-code last line after 30 s of silence counts), `tokens` (`kind` + `path`: the local log `bin/tokens` counts consumption from). The repo's `harnesses/` has one per known CLI; copy the closest one as a starting point.