ai-workflow / dotfiles
CLAUDE.md9 starsChanged 8 months agoMITView on GitHub
The file
We split this CLAUDE.md into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
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
- Very specific: line 4
Always verify work before claiming completion: run lint/build/tests and check outputs against the stated design or spec references.
- Distinctive: line 5
Before saying you're done, run lint, typecheck, and tests, and paste the tail of each output.
- Distinctive: line 9
Commit messages use conventional commits: feat:, fix:, refactor:, chore:, test:, docs:, security:
- Distinctive: line 16
Before implementing UI work, always load and reference the Paper design source.
- Distinctive: line 19
Prefer refactoring existing files over creating new ones.
- Very specific: line 22
Check you are in the correct project directory and that it is a git repo before running commit/PR/bootstrap commands.
- Distinctive: line 31
After merge: delete the branch (local + remote) and remove the worktree.
- Distinctive: line 36
No unnecessary abstractions - keep code as simple as it can be
- Distinctive: line 37
No speculative features or premature generalization
- Distinctive: line 42
Keep PRs focused: one concern per PR, under 200 lines of non-test diff when possible (see Trunk-Based Workflow above for slicing rules and …
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
Global Defaults
Verification
- Always verify work before claiming completion: run lint/build/tests and check outputs against the stated design or spec references.
- Before saying you're done, run lint, typecheck, and tests, and paste the tail of each output. If anything fails, fix and re-run.
Workflow
- Spec first, code second - read the spec before implementing
- Commit messages use conventional commits: feat:, fix:, refactor:, chore:, test:, docs:, security:
- Split commits by logical concern; each commit leaves the codebase working
- Security-sensitive changes require /sec-review before PR
- Writer/reviewer pattern — ALWAYS trigger a fresh reviewer. This is an obligation, not just a prohibition. "Don't review your own code" is true but insufficient: once an implementation is on a branch, actively spawn a reviewer with clean context — a subagent that did not write the code, or a fresh session. Do this every time, unprompted. Never skip it because the diff is small, test-only, or "obviously fine".
- Merging is gated on me, not on the review passing. Default: after the review, report the findings and stop — I merge. Merge autonomously only when I have said so for that specific piece of work ("autonomous", "you can merge", "merge if it passes",
/autopilot,/factory). That authorization is per-task and never carries to the next one.
UI Work
- Before implementing UI work, always load and reference the Paper design source; do not proceed without it.
File Conventions
- Prefer refactoring existing files over creating new ones; ask before introducing parallel docs/configs.
Git Workflow
- Check you are in the correct project directory and that it is a git repo before running commit/PR/bootstrap commands.
- Sync with the remote before starting work:
git fetch originat the start of every session and before each new task/phase, and check for divergence from the tracking branch — the user works from parallel sessions/machines, so the remote may have moved. If histories have diverged, reconcile before building (published history wins by default); never force-push over unseen remote commits.
Trunk-Based Workflow
mainis trunk; always deployable. No long-liveddeveloporrelease/*branches.- Branches are short-lived (hours to ~2 days). Name them by type:
feat/<slug>,fix/<slug>,refactor/<slug>,docs/<slug>,chore/<slug>,test/<slug>,perf/<slug>,security/<slug>. - One branch = one PR = one vertical slice. Target ≤200 lines of diff excluding tests — count source lines only. Test lines never count toward the budget, so never trim or skip tests to fit. If larger, split before opening the PR.
- Large features ship as N independently mergeable slices off
main, not stacked on each other. If a slice isn't user-ready, merge it behind a feature flag somainstays deployable. - Worktrees live outside the repo (e.g.,
../<repo>-<slug>) to keepgit statusclean. If kept inside, add the directory to.gitignore. - After merge: delete the branch (local + remote) and remove the worktree. Never reuse a merged branch.
- Canonical feature flow:
/spec→ (slice if >200 lines) →/issues(file milestones + issues on GitHub) →/feature <spec>→ review the diff →/commit→/pr→ fresh reviewer (subagent or fresh session) — always, never optional → report findings → merge (mine to call unless I declared the task autonomous) → delete branch + worktree. - Full guide (why, how, recipes, FAQ):
docs/TRUNK_BASED_WORKFLOW.mdin the ai-workflow repo.
Code Quality
- No unnecessary abstractions - keep code as simple as it can be
- No speculative features or premature generalization
- Validate at system boundaries (user input, external APIs), trust internal code
- Tests must cover verification criteria from the spec
PR Structure
- Keep PRs focused: one concern per PR, under 200 lines of non-test diff when possible (see Trunk-Based Workflow above for slicing rules and feature-flag expectations)
- PR description must include: summary, link to spec, security checklist, test plan
Context Management
- /clear between unrelated tasks
- /compact when context gets heavy mid-task
- /rewind when an approach fails after 2 corrections
Toolkit (available skills)
- Core skills installed under
~/.claude/skills/:/prd,/architecture,/tdd,/security,/adr,/rfc,/spec,/roadmap,/issues,/feature,/fix,/commit,/pr,/review,/autopilot,/factory,/new-project,/sec-review,/design,/verify-design. - For stack-aware code review, use Anthropic's official
code-reviewskill (fromclaude-code-plugins). The previous custom/code-reviewwas deprecated after a benchmark showed no detection lift over baseline at ~1.5× cost. Language guides in~/.claude/reviews/are loaded on demand by/review,/feature,/fix. - Skill sources, installer, and maintenance rules live in the
ai-workflowrepo. Maintenance instructions only apply when working inside that repo — see its project-levelCLAUDE.md.
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.

