totem
AGENTS.md18 starsChanged 52 days agoApache-2.0View on GitHub
Canonical source of truth for how AI coding agents behave in this repository. Following the AGENTS.md convention, mmnto-ai/totem consolidates tool-specific instruction files into this single AGENTS.md; thin per-tool redirect files point each tool here. Team-only instructions for this repository ride a private doctrine package and are never committed here. Totem is a local-first toolkit that keeps AI-agent work queryable, enforceable, and derivable as plain files in your codebase. Lead with enforcement (totem lint and the gate engine), not recall; derivation…
- Reads credentials
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 32,671 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 repository13 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- review-loopSkill
- review-replySkill
- signoffSkill
- signonSkill
- postmergeSkill
- preflightSkill
- prepushSkill
- review-loopSkill
- review-replySkill
- signoffSkill
- signonSkill
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 14
Run totem status for health.
- Very specific: line 15
Never guess architecture: Before modifying a core system, run totem search <system>.
- Very specific: line 16
Before writing code, call search_knowledge describing what you are changing.
- Very specific: line 17
Do not push speculative fixes: run totem lint locally and front-load every check before the first push.
- Very specific: line 22
Before pushing: your formatter, then totem lint (the enforcement floor), then totem review where configured (advisory lanes, never a merge …
- Very specific: line 23
After a PR merges: totem lesson extract <pr> --yes.
- Very specific: line 25
After roughly 15 turns of code changes: run totem status, re-query the knowledge index for the system you are modifying, and state your …
- Very specific: line 30
If this repository uses review bots: review triggers are the maintainer's to post, never an agent's.
- Distinctive: line 49
Not mechanically enforced.
- Very specific: line 60
Update AI_PROMPT_BLOCK in init-templates.ts when changing reflexes, hooks or prompts.
≈ “Common” is an estimate: at least 1 in 5 of the 41,581 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
Totem: Agent Instructions
Canonical source of truth for how AI coding agents behave in this repository. Following the AGENTS.md convention, mmnto-ai/totem consolidates tool-specific instruction files into this single AGENTS.md; thin per-tool redirect files point each tool here. Team-only instructions for this repository ride a private doctrine package and are never committed here.
What Totem is
Totem is a local-first toolkit that keeps AI-agent work queryable, enforceable, and derivable as plain files in your codebase. Lead with enforcement (totem lint and the gate engine), not recall; derivation (totem status, totem orient) and the queryable index serve it.
<!-- totem:agents-floor:start --><!-- Managed by `totem init`: the span between these markers is refreshed in place; everything outside it is yours. -->Session start
- Run
totem statusfor health. - Never guess architecture. Before modifying a core system, run
totem search <system>. - Before writing code, call
search_knowledgedescribing what you are changing. - Do not push speculative fixes: run
totem lintlocally and front-load every check before the first push. - Cold start (no session hook injected orientation): derive it with
totem orient, after/signon's seat and assignment-mail steps where that skill is installed.
Working rules
- Before pushing: your formatter, then
totem lint(the enforcement floor), thentotem reviewwhere configured (advisory lanes, never a merge gate). - After a PR merges:
totem lesson extract <pr> --yes. - Never bypass a quality gate without a ticket. No
--no-verify,totem-ignore,eslint-disable,@ts-ignore, skipped tests, or ignore patterns added to pacify CI; a suppression carries a ticket reference. - After roughly 15 turns of code changes: run
totem status, re-query the knowledge index for the system you are modifying, and state your architectural assumption. - Controller, not implementer. Delegate build-and-test cycles to background agents; keep this thread for decisions.
Review bots
If this repository uses review bots: review triggers are the maintainer's to post, never an agent's. Reply to findings through /review-reply, one dispositions comment per round, and never cite a commit before it is pushed.
Installed skills
Where totem init installs the /signon, /signoff, /review-reply and /review-loop skills, every later totem init refreshes each one's managed span and keeps what you add below its end marker.
<!-- totem:agents-floor:end -->Essentials
- pnpm only (never npm/yarn). Use
pnpm dlx(nevernpx). TypeScript strict mode. mainis protected. Feature branches + PRs. Never amend commits on feature branches. UseCloses #NNNin PR descriptions.kebab-case.tsfiles,err(nevererror) in catch blocks, no empty catches.- Named constants for magic numbers. Zod at system boundaries only.
- NEVER put secrets in config files.
.envonly. - Totem is NOT zero-user. Ships in production for downstream consumers beyond this repo's dogfood. Breaking changes need migration paths, not just "fix in next major."
Totem workflow
Not mechanically enforced. Follow because it reduces review noise.
- Before coding:
/preflight <issue>. Create a feature branch. - Before pushing:
pnpm run format→totem lint→totem review→ verify the compile manifest is current. - Open PRs Ready, not Draft.
- This repository uses review bots. The review-bots conduct in the managed span above applies here.
Contributor principles
<!-- totem-ignore-next-line -->- Update
AI_PROMPT_BLOCKininit-templates.tswhen changing reflexes, hooks or prompts. - Gemini Code Assist (GCA) decline: add a lesson with the
review-guidancetag and update.gemini/styleguide.md§ 6. - Changesets: write
.changeset/files by hand. Usepnpm run version(never barepnpm version).
Repository skills
Beside the installed ones: /preflight <issue> (spec + search before coding), /prepush (format + lint + review before push), /postmerge <prs> (extract lessons after merge). Skills also live under .agents/skills/ for agents that read that path; totem init writes them beside the .claude/skills/ copies wherever an .agents/ directory exists at the init cwd, equal inside the markers with each file's own extension tail below the end marker (mmnto-ai/totem#2788, landed by mmnto-ai/totem#2899).
Agent bus
<!-- totem:agent-bus role="bus" seat="totem-claude" declared="2026-07-16" primary="totem-claude" since="2026-08-14" -->The marker above declares this repository's agent-bus binding, the one totem doctor --parity reads. It is the one agent identifier this file carries; its move into a committed config file is mmnto-ai/totem#2866.
Detailed docs
- Architecture · Contributing · Agent workflow · Gemini styleguide
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.

