companion-agents
AGENTS.md2 starsChanged 11 days agoMITView on GitHub
Rules for agents working in this repository. When a new version is released: 1. Bump the version in package.json, line 3 ("version"). This file is the source of truth for the package version. 2. Tag the release v<new-version>. Create the tag before the release, or select an already-added tag in the GitHub release form. 3. Before writing the install notes, run git diff --name-only <prev-tag> HEAD. State the correct install steps: - A change to content/, platforms/claude/, platforms/shared/, or .claude-plugin/…
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- las-pinter/persona-agentsword for word, first seen Nov 18, 2026
Other versions1 project uses a version of this.
Word for word · 1
- las-pinter/persona-agents★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
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 33,398 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
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
When a new version is released:
- Very specific: line 13
Before writing the install notes, run git diff --name-only <prev-tag> HEAD.
- Distinctive: line 37
No other file carries the package version number.
- Very specific: line 46
Only the companion writes git history.
- Distinctive: line 76
Every other plugin agent is denied all of these and every shell write the hook can see.
- Very specific: line 124
Test the code this repository runs: the Claude Code hooks and scripts, install.sh, and the content tree structure.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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
AGENTS.md
Rules for agents working in this repository.
Release ritual
When a new version is released:
- Bump the version in
package.json, line 3 ("version"). This file is the source of truth for the package version. - Tag the release
v<new-version>. Create the tag before the release, or select an already-added tag in the GitHub release form. - Before writing the install notes, run
git diff --name-only <prev-tag> HEAD. State the correct install steps:- A change to
content/,platforms/claude/,platforms/shared/, or.claude-plugin/needs the plugin update:claude plugin marketplace update companion-agents, thenclaude plugin update companion-agents@companion-agents, then a restart. - A change to
content/,platforms/pi/,platforms/shared/, or thepiblock ofpackage.jsonneeds the Pi package update:pi update --extensions, then a new session so the extension reloads. - A change to
content/,platforms/kiro/, orplatforms/shared/needs the Kiro adapter update:git pullin the clone, then./install.sh --kiro. The payload under$KIRO_HOME/companion-agents/is a copy, so a pull alone leaves the installed adapter on the old code. When the clone is gone, re-clone it first; the payload cannot update itself. - A change to
platforms/claude/settings/recommended.jsonorinstall.shalso needs./install.shfrom an updated clone.
- A change to
Files that carry a version number but do NOT track the package release:
package.jsondependency pins (thedevDependenciesblock) — dependency versions, not the package version. Do not touch them on release.package.jsonengines.node— the minimum Node.js version, not the package version. Do not touch it on release.
No other file carries the package version number.
Rules:
- No
README.mdin this repository may contain the package version number. A release must never need a README edit.
Commit rule
Only the companion writes git history. Every commit it makes starts with the
prefix ai:. The reviewer never commits.
The doctrine lives in three places:
- The settings snippet
platforms/claude/settings/recommended.json, whichinstall.shmerges into the user settings:git pushand the write actions ofgh pr,gh run, andgh releaseask. Their read actions (view,list/ls,status,diff,checks,search) pass. - The PreToolUse hook
platforms/claude/scripts/doctrine.ts, for the companion-agents agents. The command classification it uses lives inplatforms/shared/shell/and is shared with the Pi gate (platforms/pi/scripts/policy.ts) and the Kiro gate, so the adapters cannot drift apart. The companion runs any git command with no prompt when every other part of the command is inert: acdinto the session working directory or an additional working directory (the recommended settings list the notes folder as one); a plain read-only git command (status,diff,log,show, and the other local read verbs;grep,cat-file,reflog,help,remote show, a diff helper, or a runtime-shaped word stays out); a project formatter (cargo fmt,rustfmt,ruff format,black,prettier --write,gofmt -w); agrep,head,tail,wc,sort, oruniqfilter that reads a pipe with no file argument; or a quoted heredoc or single-quoted here-string that only feedsgit commit -F -. A push, agh pr/run/releasewrite, agit -coverride, an unknown git global option, an upload-pack or transport helper URL, a merge strategy, a git verb that runs another program, writes config, or reaches a remote, and any wrapped or substituted command ask, and so does a history command with an output redirect to a file. Atee, an output redirect on any other command, or acdoutside those directories removes the allowance, so Claude Code's own flow decides. Every other plugin agent is denied all of these and every shell write the hook can see. - The Kiro gate
platforms/kiro/scripts/gate.ts, forca-companionandca-reviewer. APermissionRequesthook allows a git command and a reviewed or trivial commit; anything else returns no decision, so Kiro's native prompt asks. A PreToolUse hook denies the reviewer every shell write the gate can see and every command that writes history or publishes; reading git history is allowed.
platforms/claude/README.md and platforms/kiro/README.md hold the hook
details.
Accepted risks: rebase --exec and rebase -i are allowed. git -C to
another repository is allowed on Claude Code and Pi, and the hooks and config
of that repository run; the Kiro gate asks for a commit that names another
repository, because it reads the change in the session's directory. The
additional working directories come from the settings files
(permissions.additionalDirectories), because a hook input carries only
cwd; a repository-controlled .claude/settings.json can therefore add a
directory, as it already can for Claude Code's own file access. A formatter
runs the configuration and plugins its arguments name. The Pi companion keeps
its broader local-shell allowance, so the cd rule decides the Claude and Kiro
verdicts. A python or node heredoc body runs as code that no rule reads as
commands, though the Pi floor still reads its own patterns in it (a secret
word, a gate-file redirect, a remote script piped to a shell): the Pi companion runs it with no prompt, the Pi reviewer denies it, the
Kiro companion is asked, the Kiro reviewer is allowed it, and Claude Code's own
flow decides. The Pi write-place rule resolves a write word as a literal path,
so a $VAR, a backtick, or a ~user word there is not expanded and the rule
cannot place it.
The settings ask list matches gh pr <action> prefixes, so a global flag
before the action (gh pr -R o/r merge 1) falls outside it; the doctrine hook
still asks for that command for the companion-agents agents, and a plain session
relies on Claude Code's own flow. The hook reads the word after the
sub-command as the action, so a flag there also makes a read ask
(gh pr -R o/r view 1); it fails safe.
gh workflow run and gh api carry no gate entry by owner choice, so Claude
Code's own permission flow decides them. The Kiro companion may run a node
script, so a determined companion can write the review store; the gate ignores
a record with no sub-session, but it guards against mistakes, not against the
agent itself.
Adding content
It is rare to add a theme, a persona, or a skill. The steps live in
docs/adding-content.md and are read when a task names one of them.
Tests
Test the code this repository runs: the Claude Code hooks and scripts,
install.sh, and the content tree structure. Do not write a test that
restates doctrine prose. A local imitation of Claude Code's own rule engine
proves nothing about Claude Code. A hook test never starts a real claude
process and never reads the owner's real notes folder; use the --home and
--claude argument seams.
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.

