Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/watt-mind/factory/factory-nextgit clone --depth 1 https://github.com/watt-mind/factoryWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00011 | $0.00787 |
| Opus 5 | $0.00005 | $0.00394 |
| Sonnet 5 | $0.00002 | $0.00157 |
| Haiku 4.5 | $0.00001 | $0.00079 |
Grade A, and why
factory-next scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pick one next step in the factory loop for the current repository — diagnose by default, run only when asked.
The mechanical routing lives in factory next, which reads the same queue snapshot as factory queue. Do not re-derive gates from Linear yourself.
1. Resolve repo
Default: match the current working directory against config/repos.yaml. $ARGUMENTS may name a repo (bj29) or pass flags (--apply, --orchestrated, --include-sweep, --harness pi).
2. Diagnose
From the factory checkout (or any cwd with factory on PATH):
factory state --repo <repo>
factory next --repo <repo> $ARGUMENTS
Show session history from factory state (what ran earlier in this harness window), then constraint, recommend, because, and any also alternates from factory next. Both record events to ~/.factory/state/events.jsonl — recommend on every next run, start on --apply.
If budgetBlocked is set, stop — no new agent stages today.
3. Apply (only when $ARGUMENTS contains --apply)
One bounded stage, then stop. Do not loop until idle — that is the supervisor's job, not /factory-next.
- If the recommendation is a slash command (
/factory-merge,/factory-triage,/factory-work, …), run that command's skill/body in this session — one pass, default caps (5triage,3 at a timework,10unblock). - If
--orchestratedis present and the recommendation istickorreconcile, run the printedexecline instead. - If the recommendation is
(wait)with no command, report why and do not spawn work.
Alternatively, delegate execution to the script:
factory next --repo <repo> --apply [--orchestrated] [--harness <harness>] $OTHER_FLAGS
Use the script path when running headless via run-agent.sh; use the slash command path when you are already in an interactive harness.
4. Report
State what ran (or what was recommended), the queue constraint in one line, and anything waiting on a human (blocked holds — suggest factory digest --repo <repo>).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 72 lines · 11 tokens per session scan A 26d5a4f03b30
factory-next is a command published in the GitHub repository watt-mind/factory (10 stars, last pushed 2d ago), licensed Apache-2.0. It adds 11 tokens to every session and 787 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
release
Prepare, cut, and verify a warren release — tracker audits, version bump, CHANGELOG curation, ROADMAP update, push, then watch the pipeline through to published artifacts.
commit-all
Stage and commit all current changes with a single message. Auto Git Push will pick up and push to origin within 30s.
check
Run the full local quality gate — TypeScript check, build, dependency audit (prod-only), skill registry validate. Fast pre-commit / pre-suggestdeploy sweep.
app-init
Start a new mobile app project — runs requirements intake, then CEO vision, then PRD + architecture in parallel.
app-learn
Mine a shipped app's conventions into the living House Knowledge Base — adds net-new learnings to knowledge/.md, harvests its failures into knowledge/failure-corpus.md, and flags conflicts for human decision.
app-status
Show the current state of the project — vision, sprint goal, board, blockers, daily report.