Agent instructions
The agents section controls shared instruction files. capa writes to the instructions file each active provider reads: AGENTS.md for most providers, CLAUDE.md when claude-code is active, and so on: and never writes a file no active provider reads. AGENTS.md is the fallback when no active provider declares one.
When Gemini CLI shares AGENTS.md with another active provider, capa gives it a generated GEMINI.md with the same snippets, so rules targeted at other providers stay out of it. See Rules → Shared instruction files.
Base + additional
Section titled “Base + additional”| Piece | Behavior |
|---|---|
base | Optional full document. Written without capa markers; refreshed on each install |
additional | List of snippets. Each wrapped in <!-- capa:start:id --> … <!-- capa:end:id --> |
agents: base: type: github def: repo: acme/standards::docs/AGENTS.md additional: - id: deploy-notes type: inline content: | Prefer capa sh for deploy tools. Never paste secrets into chat. - id: team-local type: local path: ./docs/team-agents.mdSource types
Section titled “Source types”Base can be:
ref: <url>: remote URLtype: github/gitlabwithdef.repo(@or::, optional pin)type: localwithpath: file relative to the capabilities file (v2)
Additional snippets:
| Type | Fields |
|---|---|
inline | id, content |
remote | id, url |
github / gitlab | def.repo (id optional) |
local | id, path |
For git snippets, prefer owner/repo::path/to/file.md when you know the exact path.
Markers and cleanup
Section titled “Markers and cleanup”capa upserts and prunes additional blocks by id on every capa install. Snippets keep their position on re-install, so they don’t drift below rule blocks folded into the same file. capa clean removes all capa-owned blocks; if a file becomes empty, capa deletes it.
Do not hand-edit inside <!-- capa:start:… --> markers if you want install to keep owning that snippet: change the capabilities file instead.