Turn a codebase into a factory you map, understand and automate, one area at a time.
Factomation is an agent skill for Claude Code, Codex, Cursor and other hosts that read SKILL.md files. It is built
for legacy codebases, where nobody left knows why things are the way they are.
It borrows the loop from factory games: explore a bit, build a bit, upgrade, explore further. You never map everything before you start improving things. The work is real engineering: the factory words are just a shared vocabulary.

Upgrade. Each area has an automation tier: how much an agent may change there without asking.
| Tier | Name | The area has | Agent may |
|---|---|---|---|
| 0 | by hand | no map, or no tests | read and map |
| 1 | burner | a verified map; tests pin today’s behaviour | small changes you review |
| 2 | assembler | checks that run automatically | keep-or-revert upgrades alone |
| 3 | bots | enforced budgets for speed, size, errors | unattended hill climbs |
Upgrading an area means adding the checks that let more work run by itself. Fixing issues happens inside an area, at the tier it allows. The current bottleneck always goes first.
/hillclimb <id>: one change, one measurement, keep or revert, until it hits the target..factomation/log.md. Repeated corrections become rules, enforced in
code, types, lint or tests where possible. Lessons that apply to every codebase are proposed back to this repo,
only with your approval.Factory.html: the map, the bottleneck, three questions for you, recommended hill climbs, findings and upgrades.
It is built for a phone. See the demo (download it and open it in a browser).The win condition, the rocket, is yours to set: for example “invoices, payments and the API reach assembler tier, and month-end runs in under 10 minutes”.
npx skills add gurdeepbajwa/factomation
Or in Claude Code, as a plugin:
/plugin marketplace add gurdeepbajwa/factomation
/plugin install factomation@factomation
Or clone it into your skills folder:
git clone https://github.com/gurdeepbajwa/factomation ~/.agents/factomation
ln -s ~/.agents/factomation/skills/* ~/.claude/skills/
The report check (scripts/check-report.mjs) needs Playwright. Everything else needs only
git, bash and Node 18 or newer.
/factomation map this codebase
how does an invoice get sent?
/factomation what should we upgrade next?
/factomation rebuild the report
/hillclimb month-end-time
On the first run it creates .factomation/ at the repo root and asks for your win condition and scope.
skills/factomation/
SKILL.md entry point: vocabulary, the session loop, the rules
playbooks/ explore · questions · upgrade · report · reflect
references/ tiers, evidence rules, the .factomation/ layout, report.json schema
scripts/ hotspots.sh, areas.sh, build-report.mjs, check-report.mjs
templates/ config.md, log.md, areas.tsv, hillclimb.md
skills/hillclimb/
SKILL.md the keep-or-revert loop for one metric
references/ benchmark checklist
examples/demo/ a made-up legacy app's report.json and Factory.html
LEARNINGS.md lessons merged back from real codebases
.factomation/ lives in your repository. Nothing is sent anywhere by this skill. The reflect playbook only ever
proposes a lesson upstream after it strips project details and you approve the exact text.
Ideas borrowed, with thanks:
MIT