Author primitives
A package’s .apm/ directory contains primitives. Each primitive type is an opinion about how a piece of agent context should be authored once and projected onto every supported target (Copilot, Claude, Cursor, OpenCode, Codex, Gemini, Windsurf, Kiro, and Agent Skills).
Primitive types
Section titled “Primitive types”| Primitive | One-liner | Page |
|---|---|---|
| Skills | Self-contained capability bundles with SKILL.md + scripts + assets | Skills |
| Prompts | Reusable prompt templates with frontmatter | Prompts |
| Instructions | Long-lived behavior rules (style guides, conventions) | Instructions and agents |
| Agents | Personas with explicit scope, tools, and triggers | Instructions and agents |
| Hooks | Event handlers fired by the runtime (pre-commit, on-tool-use, …) | Hooks and commands |
| Commands | Slash-command shortcuts the developer types into the agent UI | Hooks and commands |
| MCP servers | Tool-server declarations consumers can wire into their harness | MCP as a primitive |
On-disk layout
Section titled “On-disk layout”.apm/ skills/ my-skill/ SKILL.md scripts/ references/ assets/ prompts/ review.prompt.md instructions/ style.instructions.md agents/ cli-logging-expert.agent.md hooks/ pre-commit.jsonCommands ship as prompts (.apm/prompts/*.prompt.md); there is no separate .apm/commands/ directory. See Hooks and commands.
Every primitive type follows the same pattern: a markdown file (or directory containing a primary markdown file) with frontmatter declaring its name and its trigger conditions. apm compile reads .apm/, applies any policy, and writes per-target output to the right directories on the target’s filesystem.
Recommended reading order
Section titled “Recommended reading order”- Skills — the densest primitive type and the one most newcomers hit first.
- Prompts — next-most-common; how reusable templates work.
- Instructions and agents — when behavior should persist across sessions.
- Hooks and commands — runtime extension points.
- MCP as a primitive — when your package needs to bring along a tool server.
When you’re ready to ship, continue to Compile and Pack a bundle.