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. Compile
Section titled “7. Compile”Generate the compiled context files:
apm compileThis produces AGENTS.md (for Copilot, Cursor, Codex) and CLAUDE.md (for Claude) with all your instructions optimized for each agent.
Next Steps
Section titled “Next Steps”- Add skills to your package
- Set up dependencies on other packages
- Explore the CLI reference for more commands