npx skills add): that installs a capability summary fetched from a URL; the blocks below are written locally into your repo by buttons init and by button mutations.
1. The instruction block — buttons init --agent
buttons init --agent <target> writes a Buttons instruction section into the file each coding agent reads, wrapped in <!-- BUTTONS:START --> / <!-- BUTTONS:END --> markers. Re-running init finds those markers and replaces the section in place, so your other content is never clobbered.
Target (--agent) | File written | How |
|---|---|---|
cursor | .cursor/rules/buttons.mdc | Standalone MDC rule file (frontmatter + body), written whole |
claude | CLAUDE.md | BUTTONS:START/END section appended/updated in place |
cline | .clinerules | BUTTONS:START/END section |
copilot | .github/copilot-instructions.md | BUTTONS:START/END section |
agents-md | AGENTS.md | BUTTONS:START/END section (cross-agent convention) |
openclaw | AGENTS.md | BUTTONS:START/END section |
hermes | AGENTS.md | BUTTONS:START/END section |
Cursor is the exception: its
.mdc file is standalone and rewritten whole. Every other target shares the BUTTONS:START/END contract, so the block is idempotent — safe to re-run and safe to sit next to your own instructions in the same file.buttons init also always writes a .buttons/AGENTS.md reference guide (Buttons’ own onboarding doc for the folder) and a .buttons/.gitignore. That reference file belongs to Buttons and is overwritten on every init.
2. The button list — ## Buttons in this project
Inside a project-local git repo, Buttons keeps a live list of the project’s buttons in the repo-root AGENTS.md, wrapped in <!-- BUTTONS:LIST:START --> / <!-- BUTTONS:LIST:END --> markers. It’s refreshed automatically after every button mutation — buttons create, buttons delete, buttons add, and buttons import — so an agent reading AGENTS.md always sees the current set without running a command first.
- Press-ranked. Buttons are ordered most-pressed-first (ties broken alphabetically for stable diffs), so the buttons an agent actually uses float to the top.
- Capped at 20. The 20 most-pressed buttons render with their descriptions; any beyond that collapse to a single comma-separated line pointing at
buttons listfor the full set. This keepsAGENTS.mdscannable in workspaces with hundreds of buttons.
BUTTONS:LIST markers: the next mutation regenerates the block.
Related
- buttons init — create the
.buttons/dir and install instruction blocks - skill.md — the hosted
npx skills addcapability summary (a different mechanism) - Folder structure — where
.buttons/AGENTS.mdand per-buttonAGENTS.mdlive