Skip to content

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).

PrimitiveOne-linerPage
SkillsSelf-contained capability bundles with SKILL.md + scripts + assetsSkills
PromptsReusable prompt templates with frontmatterPrompts
InstructionsLong-lived behavior rules (style guides, conventions)Instructions and agents
AgentsPersonas with explicit scope, tools, and triggersInstructions and agents
HooksEvent handlers fired by the runtime (pre-commit, on-tool-use, …)Hooks and commands
CommandsSlash-command shortcuts the developer types into the agent UIHooks and commands
MCP serversTool-server declarations consumers can wire into their harnessMCP as a primitive
.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.hook.md
commands/
deploy.command.md

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.

  1. Skills — the densest primitive type and the one most newcomers hit first.
  2. Prompts — next-most-common; how reusable templates work.
  3. Instructions and agents — when behavior should persist across sessions.
  4. Hooks and commands — runtime extension points.
  5. 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.