heimdall
AGENTS.md5 starsChanged 38 days agoMITView on GitHub
Heimdall is the watchman: it gates other people's repos. So the bar here is the bar we sell. Read this before your first edit. - No stub, placeholder, TODO, or skeleton code. A PreToolUse hook scans every Claude Code write for unfinished code shapes (empty bodies, not-implemented throws, # TODO comments) and refuses the write — but that hook only fires inside a live Claude Code session. bin/heimdall-gate-run's pre-commit phase backs it up at the git layer: it re-scans the…
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 31,774 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.
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- designmatchSkill
- heimdallSkill
- mac-deep-cleanSkill
- self-improveSkill
- stacksSkill
- system-healthSkill
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 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.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Every assertion must be falsifiable: Before you call a test done, break the thing it covers and watch it go RED, then revert and watch it …
- Distinctive: line 22
Test once, at the end: Run only the test file(s) you add or edit, once, after your changes are written.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Working in the Heimdall repo
Heimdall is the watchman: it gates other people's repos. So the bar here is the bar we sell. Read this before your first edit.
The rules that actually block you
- No stub, placeholder, TODO, or skeleton code. A
PreToolUsehook scans every Claude Code write for unfinished code shapes (empty bodies, not-implemented throws,# TODOcomments) and refuses the write — but that hook only fires inside a live Claude Code session.bin/heimdall-gate-run'spre-commitphase backs it up at the git layer: it re-scans the staged diff against the same shared shapes (bin/lib/heimdall-stub-patterns.sh), so the ban holds no matter which tool — or human — makes the commit. If you cannot implement something fully, say so — faking it is the one failure mode this repo exists to catch. - Tests are bash. One file per surface:
test/<name>.test.sh, run withbash test/<name>.test.sh. Exit 0 = green. A test printsPASS/FAILlines and a count. Follow the shape of a neighbouring test rather than inventing a harness. - Every assertion must be falsifiable. Before you call a test done, break the thing it covers and watch it go RED, then revert and watch it go GREEN. A test that cannot fail is not a gate — it is decoration.
- Test once, at the end. Run only the test file(s) you add or edit, once, after
your changes are written; the full sweep (
bash test/run-all.sh) runs once, on the final frozen tree, immediately before the landing commit — see CLAUDE.md "When the full gate runs". The break-it-and-watch-it-go-RED check above is a run on a different tree, not a repeat. - Batch before you sweep. Merge every pending agent result first, then run ONE sweep; never merge anything between a green sweep and its push, and never start a second sweep while one runs — see CLAUDE.md "When the full gate runs".
- Quality gates run before push (
heimdall-state check-quality-gates): tests green, lint clean, no untested changes. The gate is chosen per repo pushed: heimdall's own sweep repo gets that gate; a repo with.heimdall/repo-checks.jsonpasses on a green, current receipt of its own checks (bin/heimdall-repo-checks run); any other repo gets a warning. Anything uncertain gets the strict gate — CLAUDE.md "Push gate".
Environment
- bash 3.2.57 on macOS.
timeout(1)does not exist — useperl -e 'alarm N; exec @ARGV' -- <cmd>. - Tests must be hermetic: redirect
HOME, work inmktemp -d, never touch the real~/.heimdalland never reach a live control plane. - Nothing here is submitted to an external service during a test run. Local artifacts only.
Conventions
- Generated regions in tracked files live between
HEIMDALL:<NAME>:BEGIN/HEIMDALL:<NAME>:ENDmarkers and are written by a renderer, never by hand — seebin/heimdall-render-version(README version region) andbin/heimdall-init(the AGENTS.md fence below). Match that pattern; do not invent a second one. - Version truth is
.claude-plugin/plugin.json.version. Every other surface is rendered from it. - Independent work runs in parallel: batch independent tool calls into one message, and give each parallel agent its own file scope.
- One completed task = one atomic commit, conventional prefix.
CLAUDE.md carries the same conventions for Claude Code specifically. When the two
disagree, they are both wrong — fix them together.
<!-- HEIMDALL:AGENTS:BEGIN — generated by `hmd init`; edits inside this fence are overwritten on re-init -->Heimdall — this repo is gated
Heimdall is a watchman wired into git. Gates run from pre-commit and pre-push,
so every change here is checked whether or not an agent is in the loop.
hmd verdict— the last gate result for this repo, and why.hmd demo— watch a gated build run end to end.
A deny blocks the commit. git exits nonzero and a BIFRÖST block prints on
stderr naming what failed. Read the name, fix the code, commit again. HMD_SKIP=1
git commit … bypasses the gate but logs an unproven-merge receipt to
.heimdall/receipts/unproven.log — visible, never silent.
Gates are external and falsifiable — satisfying the oracle is the only path. The verdict is computed from artifacts on disk, not from your explanation, so you cannot argue your way past a gate. Rewriting or weakening the test is not a path to green; it is the exact failure the gate exists to catch.
Same gate under Cursor CLI. This file is what Cursor's agent reads at session
start too, and the pre-commit check above runs on its diffs exactly as it runs on
Claude Code's — the one difference is a stub gets caught at commit here instead of
at the write itself, since Cursor has no pre-write hook to catch it earlier.
<!-- HEIMDALL:AGENTS:END -->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.

