Bring repository health to another repo
Check a repository against the five repository health principles, then adopt them one at a time — with Otto, or by hand with plain git.
Before you start
Nothing here rewrites history. Each practice applies to new commits and new files from the day you adopt it; old commits keep their messages and old files their length. Start with the practice the check marks worst, not with all five.
With Otto: run the check
-
Open a session in the repository
Any Otto session whose working directory is inside the repository, on a Mac or on your server.
-
Run the check
/otto:health-checkIt reads the main branch's history and the tree, changes nothing, and writes
REPO-HEALTH.mdat the repository's root. Pass--out <path>to write it somewhere else. The report is not committed; delete it or add it to.gitignore. -
Read the verdicts
Each principle gets ✅, ⚠️ or ❌ (or — when it doesn't apply, such as scopes in a repository that ships one thing), the evidence behind it, and one step to start on. First moves at the end orders the three that matter most.
-
Go deeper on the docs
For a per-directory plan to thin instruction files into an index, rules and specs, run
/otto:analyze-specs [path]. It is the detailed version of the check's third principle.
By hand: adopt the practices
Each step stands alone. Do them in the order your check — or your own reading of the repository — says hurts most.
-
Give the landing commit a why
Add a template and use it for the commit that lands on the main branch — the squash-merge message, or a local squash:
# .gitmessage type(scope): subject Why: the cause or the motivation, 1–3 lines. Not a list of edits. Proven: what you actually ran or checked. See docs/decisions/NNN-slug.md (only when a decision changed)git config commit.template .gitmessageIf you land through pull requests, put the same three parts in the pull request template and use the description as the squash commit's body.
-
Start a decisions folder
Create
docs/decisions/README.mdwith a table — number, decision, status, date — and write the next decision you make asdocs/decisions/001-<slug>.md: the decision, its rationale, what was rejected, and its consequences. A later change is a dated Addendum at the end of the same file; once there are several, open the file with a short Current state.Don't backfill history. If the repository already has one large decisions file, split it one record per heading, keep the numbers, and leave the old file as a stub that points to the folder, so old links still land.
-
Thin the instruction file
Keep the root
CLAUDE.mdorAGENTS.mdto orientation: what the repository is, its commands, and where to read more. Move always-apply rules to.claude/rules/<topic>.md, with apaths:glob in its front matter when a rule applies to one area. Move what a module guarantees to aSPEC.mdbeside it. -
Cap file length
In a JavaScript or TypeScript repository, ESLint's built-in rule is a start:
"max-lines": ["error", { "max": 500, "skipBlankLines": false, "skipComments": false }]Turn it off for the files already over the limit, list them, and remove each entry once the file is split below 500. Never trim blank lines or comments to fit; split along a seam instead.
-
Fix the scope list
If the repository ships more than one thing, write one scope per shipping unit — plus
docs,test,ciandtoolsfor what ships nowhere — and enforce it with commitlint:// commitlint.config.mjs export default { extends: ['@commitlint/config-conventional'], rules: { 'scope-enum': [2, 'always', ['app', 'api', 'worker', 'docs', 'test', 'ci', 'tools']], 'header-max-length': [2, 'always', 100], }, }A repository that ships one thing can skip scopes; keep the subject short.
You're done when the check — or a reader new to the repository — finds the why of a recent change in git log, today's state of a decision in one file, and no file it has to read in pieces.