Your First Package
This tutorial walks you through creating an APM package from scratch, publishing it, and installing it in another project.
Prerequisites
Section titled “Prerequisites”- APM installed (Installation guide)
- A GitHub account and a repository to publish to
1. Scaffold the Package
Section titled “1. Scaffold the Package”apm init my-coding-standardscd my-coding-standardsThis creates:
my-coding-standards/├── apm.yml # Package manifest└── .apm/ ├── instructions/ # Coding standards (.instructions.md) ├── prompts/ # Slash commands (.prompt.md) ├── skills/ # Agent skills (SKILL.md) ├── agents/ # Personas (.agent.md) └── hooks/ # Event handlers (.json)2. Add an Instruction
Section titled “2. Add an Instruction”Create a coding standard that applies to all Python files:
cat > .apm/instructions/python.instructions.md << 'EOF'---applyTo: "**/*.py"---# Python Standards- Use type hints for all function parameters and return values- Follow PEP 8 style guidelines- Write docstrings for all public functions- Prefer `pathlib.Path` over `os.path`EOF3. Add a Prompt
Section titled “3. Add a Prompt”Create a reusable slash command:
cat > .apm/prompts/security-audit.prompt.md << 'EOF'---description: Run a security audit on the current file---Review this code for common security issues:1. Input validation and sanitization2. Authentication and authorization checks3. Sensitive data exposure4. SQL injection and XSS vulnerabilitiesProvide specific line numbers and suggested fixes.EOF4. Update the Manifest
Section titled “4. Update the Manifest”Edit apm.yml to describe your package:
name: my-coding-standardsversion: 1.0.0description: Team coding standards and security prompts5. Publish
Section titled “5. Publish”Push to a git repository:
git initgit add .git commit -m "Initial APM package"git remote add origin https://github.com/you/my-coding-standards.gitgit push -u origin main6. Install in Another Project
Section titled “6. Install in Another Project”In any project:
apm install you/my-coding-standardsAPM automatically:
- Downloads the package to
apm_modules/ - Copies instructions to
.github/instructions/ - Copies prompts to
.github/prompts/ - Updates
apm.ymlwith the dependency
7. Optional: Compile for Other Tools
Section titled “7. Optional: Compile for Other Tools”If you use tools beyond GitHub Copilot, Claude, Cursor, and OpenCode (which read deployed primitives natively), generate compiled instruction files:
apm compileThis produces AGENTS.md (for Codex, Gemini) and CLAUDE.md for tools that need a single instructions file. Copilot, Claude, and Cursor users can skip this step — OpenCode users need apm compile only if their packages include instructions (OpenCode reads AGENTS.md for those).
Next Steps
Section titled “Next Steps”- Add skills to your package
- Set up dependencies on other packages
- Distribute as a standalone plugin — see Plugin authoring and Pack & Distribute
- Explore the CLI reference for more commands