repo-fit
AGENTS.md3 starsChanged 59 days agoMITView on GitHub
A small, balanced foundation for any repository, technical or notes, for Claude Code and Codex. Version is in VERSION. Maintainer: Jimmy Sadek. Read README.md for the commands and CHANGELOG.md for what changed. Status: the organizing parts below (map, plan, standing rules, fit check) shipped in 0.7.0. The record of how: claudedocs/2026-10-05-redesign-checklist.md.
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Measure, then add: Add a piece only after a measured gap.
- Very specific: line 19
Read first: detect, then audit.
- Distinctive: line 25
Do not save audit or detect output about real repos here.
- Very specific: line 31
Before you commit: run node --test (no dependencies, about 40 seconds).
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
repo-fit · Working agreements for every assistant
A small, balanced foundation for any repository, technical or notes, for Claude Code and Codex. Version is in VERSION. Maintainer: Jimmy Sadek. Read README.md for the commands and CHANGELOG.md for what changed.
Scope guard (the maintainer's decisions, 29 Sep 2026, revised 5 Oct 2026)
Status: the organizing parts below (map, plan, standing rules, fit check) shipped in 0.7.0. The record of how:
claudedocs/2026-10-05-redesign-checklist.md.
- An organizer in plain files. repo-fit maps a repo, organizes it, connects it and keeps it fit. It borrows a second brain's organizing mechanics (a map, index pages, an inbox, an archive, a fit check) in plain Markdown, folders and Git. No search engine, embeddings, database or service. Never claim more than the scripts really do.
- Progressive disclosure. The always-loaded lines stay few and point to
MAP.md. The map has one line per area. Each area has one index page, one line per note. Any note is at most two steps from the map. People see one screen first and details on request. Scripts build and check the map and index pages; search is the fallback, never the map. - Same logic, tailored to each repo. Not one-size-fits-all. Detect the machine and the repo first (CLIs, logins, Git host, existing tools, rule files, folder names), then propose. Reuse the repo's own folder names; add only
inbox/andarchive/. Repos without Git are supported. Never force GitHub, Node, Obsidian or any tool. Never install a missing tool or log in for the user. Updating a tool the user already has is allowed only throughtools, under the rules below. Offer a host feature only when the remote is that host and its CLI is logged in there. - Plain words for every user. Everything a user reads (skill, command output, briefing, generated pages, README) is written for non-technical, non-native English readers: what it does, the intention and why, briefly. Internal terms never reach users without plain words.
- Two front doors: a new repo gets the Starter kit. An existing repo gets detected, mapped, and organized through one plan the user approves after seeing before, after and why.
- Guidance stays current. Claims about Claude Code, Codex and models live in
guidance/, dated, sourced and refreshed. Never state a vendor fact from memory. - Measure, then add. Add a piece only after a measured gap. Success is the fixture outcome scores, not only "nothing broke". Keep the always-loaded core block small.
Rules for changing other repos
- Read first:
detect, thenaudit. Both are read-only. - Before the first change, a safety snapshot: Git is checked (or its install command given to the person), and the folder's unsaved files are saved in a Git commit on a private reference (
refs/repo-fit/snapshots/<time>), never on a branch. The branch, the staging area and the files stay exactly as they are, and a normalgit pushdoes not send it. The receipt andundoname it. The snapshot is part of the one yes, also in repos that say "commit only when asked": it commits nothing to their branches. In a folder without Git, Git is started only on its own separate yes (--git-init); until then nothing changes, or the person chooses--no-snapshotand repo-fit's own undo. Never push. (Decided 5 Oct, built in slice 4b; Git start revised by the maintainer 21 Oct 2026; private reference instead of a branch commit decided 25 Oct 2026.) - Changes go through
apply(dry run, diff, backup, receipt, undo). Each change needs the user's yes to what they saw: one plan (before, after and why) or one batch. A standing rule the user approved ("screenshots go todocs/screenshots/") may file matching inbox items alone, with a receipt line and undo. - Moves and archives happen only inside an approved plan, batch or standing rule. Code, and files the code loads, never move (deep mode, decided 25 Oct 2026: they may, on its own branch only, after that sweep's yes; sweep 1 still moves none). Merging the text of notes always asks. Nothing is ever deleted: archive instead. Secrets and big files are never automated. Adding a remote goes only through
connect: an empty private repo, never a push. - Updating a tool goes only through
tools --update ... --apply, runs only the tool's own updater, and happens without asking only if the user opted in withprefsand the need is real. - Respect a repo's own rules. Example: a repo that says "commit only when asked" runs with
--autosave off --hooks briefand without the core rules block. - Do not save audit or detect output about real repos here. This repo may become public.
How to work here
- Branch
dev. The user's branch guard blocks commits onmainandmaster. Commit locally. Never push unasked. - Node only, no dependencies. Test on throwaway copies. A pilot on a real repo needs the user's approval for the exact files.
- Before you commit: run
node --test(no dependencies, about 40 seconds). Every bug you fix gets a test that fails without the fix. Then update README, CHANGELOG and the guidance if the change touches them. - Reports go in
claudedocs/.
Where things are
| Path | What |
bin/repo-fit.mjs | The command: init, status, update, detect, audit, map, organize, apply, skip, undo, connect, tools, prefs, guidance check |
lib/ | detect, audit, adapt (what a repo already has: own checks, hooks, caps, protected paths, rule conflicts), apply, organize (the plan and screen), deep (deep mode: the sweeps, their plan checks, and the apply on its own branch in a separate working copy), core (renders the core block with the repo's paths), connect, tools, versions, prefs. Not copied into repos |
scripts/playbook/ | brief, check, autosave, map, move (the safe move engine), file (files inbox items by standing rules), lib. Copied into every repo, version-stamped |
kits/ | Starter kit and per-tool files |
core/AGENTS.core.md | The managed rules block |
guidance/ | Dated notes from official sources, and the refresh routine |
SKILL.md | The setup interview (at the root, so npx skills add installs the whole tool as one skill) |
claudedocs/ | Research reports and the search data behind them |
dev/ | Maintainer tools, not shipped: transcript-check (live runs), fixtures, score and measure (outcome scores on synthetic test folders; node dev/measure.mjs --ref 3fed971 is the 0.6.0 starting score) |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

