Skip to content

Your First Package

This tutorial walks you through creating an APM package from scratch, publishing it, and installing it in another project.

Terminal window
apm init my-coding-standards
cd my-coding-standards

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

Create a coding standard that applies to all Python files:

Terminal window
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`
EOF

Create a reusable slash command:

Terminal window
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 sanitization
2. Authentication and authorization checks
3. Sensitive data exposure
4. SQL injection and XSS vulnerabilities
Provide specific line numbers and suggested fixes.
EOF

Edit apm.yml to describe your package:

name: my-coding-standards
version: 1.0.0
description: Team coding standards and security prompts

Push to a git repository:

Terminal window
git init
git add .
git commit -m "Initial APM package"
git remote add origin https://github.com/you/my-coding-standards.git
git push -u origin main

In any project:

Terminal window
apm install you/my-coding-standards

APM automatically:

  • Downloads the package to apm_modules/
  • Copies instructions to .github/instructions/
  • Copies prompts to .github/prompts/
  • Updates apm.yml with the dependency

Generate the compiled context files:

Terminal window
apm compile

This produces AGENTS.md (for Copilot, Cursor, Codex) and CLAUDE.md (for Claude) with all your instructions optimized for each agent.