| name | apm-usage |
| description | Select a reviewed APM CLI version, then set up, pin, deploy, audit, and update APM-managed agent dependencies safely. Use when creating or editing apm.yml or apm.lock.yaml, choosing or installing APM, adding an Agent Skill, plugin, or MCP dependency, validating a pinned deployment, or preparing a cooldown-aware update proposal. |
APM Usage
Keep agent context reproducible and reviewable. Select the newest reviewed APM
release that has completed the seven-day cooldown; filesystem location and
local recency do not establish eligibility. Require full commit pins, lockfile
hashes, and review for every changed third-party dependency.
1. Inspect before changing
-
Locate apm.yml, apm.lock.yaml, apm-policy.yml, existing agent
directories, and repository guidance. Read apm_version and
lockfile_version from an existing lockfile before running a mutating APM
command; treat them as compatibility evidence, not an instruction to keep an
older CLI forever.
-
Read the bootstrap manifest. Its version is
the newest APM release whose provenance, artifacts, checksums, publication
date, and seven-day cooldown this Skill has reviewed. Do not prefer a newer
local current, PATH, project-local, or legacy executable merely because
it is easier to find.
-
Inventory apm on PATH, project-local copies, and locations reported by
the current official installation documentation and the platform's command
resolver. Record each resolved executable and --version; path precedence
does not override cooldown eligibility.
Select the manifest version when it is already installed and invoke an
off-PATH copy by absolute path. Do not modify PATH to satisfy one repository
task. If the selected version is absent, use the verified temporary-artifact
flow in section 2 instead of installing it implicitly.
-
If the lockfile records a newer APM version than the latest eligible version,
do not silently downgrade, rewrite, install, or audit the project. Report the
compatibility blocker and require either a reviewed bootstrap refresh after
cooldown or a documented maintainer exception for that exact version.
-
If the selected eligible version is newer than the lockfile generator,
follow the official lockfile migration guidance. Capture the pre-command
lockfile, run apm install as an explicit migration step, and separate
schema-only churn from dependency, hash, target, or deployed-file changes.
Restore and stop if an allegedly read-only or frozen command rewrites the
lockfile unexpectedly.
-
If apm.yml exists, preserve it. Do not run apm init --yes, because it
overwrites an existing manifest.
-
If no manifest exists, inspect the repository's agent targets and run
interactive apm init from the project root. Select only the targets the
project actually uses; review the generated apm.yml before adding deps.
-
Treat the CLI and agent dependencies as supply-chain-sensitive code. Check the
repository policy and any organization policy before proceeding.
2. Obtain the selected eligible APM version safely
Reuse an installed copy only when its exact version matches the selected
reviewed release. Do not run an unpinned installer or apm self-update merely
to obtain whatever version is newest upstream.
Treat installation, self-update, PATH changes, and replacement of the active
APM binary as user-environment changes. A request to maintain one repository
does not authorize them.
Read the bootstrap manifest, then consult the
current official installation guide,
apm self-update reference,
and installer source in the
official APM repository. Do not reproduce
their commands, paths, environment variables, or installer behavior in this
Skill: those are upstream-owned and may change. The manifest remains this
Skill's source of truth for the reviewed version, release date, artifacts, and
SHA-256 values.
When the selected version is not installed:
- Download the exact official release archive named in the bootstrap manifest
to a unique operating-system temporary directory. Verify its hard-coded
SHA-256 before extraction, extract the complete bundle, and invoke the
packaged executable by absolute path. Do not add it to PATH, copy a shim,
place it in the repository, or alter the active APM installation.
- Confirm
--version exactly matches the manifest. If the official artifact
is not portable on the current platform, cannot preserve its adjacent
runtime files, or fails integrity verification, stop instead of inventing an
installation layout or choosing an ineligible version.
- Remove only the validated task-specific temporary directory after the work
finishes. Record the archive source, expected and observed SHA-256,
executable path, and version in the handoff.
- If the user explicitly requests a persistent installation, then consult the
current official sources above and use their documented version-pin and
integrity mechanisms. Let the official installer own its layout. Do not
alter PATH or replace an active binary without explicit authorization for
those specific environment changes.
- For an enterprise mirror, use HTTPS, set
APM_NO_DIRECT_FALLBACK=1, and
verify that the mirror serves the identical reviewed artifact and checksum.
Do not treat this as a substitute for review of the artifact.
2.1 Propose a bootstrap-version refresh
Do not change the bootstrap manifest automatically. Use this proposal flow:
- Record the current and candidate tags, release URLs, publication dates,
platform assets, SHA-256 values, and the candidate cooldown date. Start with
the newest candidate that has completed the cooldown, not merely the newest
published or locally installed version.
- Treat cooldown as a minimum gate, not adoption approval. Review provenance,
release notes, installer and artifact integrity, and compatibility from the
current official sources. Require explicit maintainer approval.
- Run
uv run --no-project --no-config --locked --script <apm-usage-skill>/scripts/propose_bootstrap_update.py
to isolate the locked helper from the consumer repository's uv configuration
and collect an eligible candidate without changing files. Attach its JSON
output to the proposal.
- After approval, obtain the candidate through section 2's temporary
artifact flow and run representative lock, frozen-install, audit, and
deployed-output checks without changing the active installation or PATH.
A reproducible resolver, lock migration, install, audit, or output failure
rejects the candidate even after cooldown; keep the current bootstrap and
record the evidence instead of trying a newer unreviewed release.
- If the candidate passes, run the same isolated command with
--write --confirm-version <candidate>. It updates only
references/apm-bootstrap.json and refuses an unconfirmed or mismatched
version. Review the manifest diff before committing.
Do not use apm self-update to perform this refresh.
Reference sources
3. Add an Agent Skill or dependency
Use this staged workflow for every remote skill, prompt, agent, plugin, hook,
or MCP dependency:
- Identify the exact source repository, optional virtual subdirectory,
release/tag, and full 40-character commit SHA. Review the source, its
release history, declared capabilities, transitive dependencies, and changes
that could execute code or add MCP access.
- Verify from an authoritative source that the adopted content is at least
seven days old. For a virtual subdirectory in a monorepo, identify the last
commit that changed that subdirectory at the selected ref and calculate the
cooldown from that commit, not from an unrelated later commit elsewhere in
the repository. If its age, provenance, or required hash cannot be verified,
stop and report the blocker. Do not bypass the cooldown without a documented
maintainer exception.
- Before committing a third-party skill, determine its license from an
authoritative upstream license file or policy. Add or update the
repository-root
THIRD_PARTY_NOTICES.md with its source repository and
virtual path, full commit SHA, license identifier and canonical text or URL,
plus any supplied copyright or NOTICE text. Do not put this record in an
APM-managed target directory such as .agents/skills/. Treat a missing or
unclear license or required notice as a blocker unless a maintainer records
an explicit exception.
- Add the dependency to
apm.yml with the full commit SHA, never a default
branch, latest, or an unbounded range. Keep MCP entries under the same
review gate and do not put tokens in tracked YAML.
- Run
apm lock to resolve and download without deploying to agent targets.
Review apm.lock.yaml: each dependency must resolve to the expected commit
and carry its content hash. Commit the manifest and lockfile together.
- Run
apm install --frozen only after that review. It must reproduce the
reviewed lockfile and must not resolve a new dependency. Never use
--force, --allow-insecure, or an insecure HTTP source unless an explicit
documented exception authorizes it.
- Run
apm audit --ci after deployment. Fix lockfile, integrity, drift, or
policy findings rather than suppressing them. Add apm install --frozen and
apm audit --ci to the project's existing CI when the user requests CI
enforcement.
3.1 Maintain a packaged Skill collection
Apply this section only when a repository publishes Skill copies in both an
authoring target such as .agents/skills/ and a package directory such as
.apm/skills/.
- Identify the canonical source and each distributed copy. Use a supported
generator when one exists; otherwise update every copy in the same change.
- Compare relative file sets and content hashes before release. A missing,
extra, or different file is a release blocker, not a cosmetic discrepancy.
- After
apm install --frozen, record the installer-reported target and
verify the named Skill at that actual target, rather than assuming a
configured or conventional directory was used.
- If
apm audit --ci resolves a different target root, do not call the audit
a pass or failure without direct evidence. Record the discrepancy, verify
the installed file and lockfile hashes directly, and report the observed
behavior for follow-up.
- After deployment, review the staged diff as well as the working tree. An
installer can rewrite unchanged text with a different line ending; stage
only the expected manifest, lockfile, canonical, and deployed outputs, then
use
git diff --cached --check and a content review to distinguish a real
generated-file delta from line-ending noise.
4. Propose updates; do not silently apply them
Pinned dependencies stay unchanged until a maintainer approves an update.
Create an update proposal, issue, or pull request with no deployment changes
first:
- Run
apm outdated and apm update --dry-run to discover candidates
without writing files.
- For each candidate, record the current and proposed tag and full commit
SHA, upstream release URL and date, SHA-256/content-hash changes, source
review summary, new transitive dependencies, and any MCP, hook, permission,
or target-output changes.
- State the earliest eligible adoption date: release date plus seven full
days. Keep the proposal open until that date and explicit maintainer
approval; a newer upstream release restarts its own cooldown.
- After approval, run interactive
apm update for only the approved package.
Review the plan before accepting it, then review the apm.yml,
apm.lock.yaml, and deployed-file diff. Run apm audit --ci and commit the
result. Re-check the upstream license and notices; update the matching
THIRD_PARTY_NOTICES.md entry in the same commit when the source, virtual
path, commit, license, or attribution changes.
- In CI and ordinary repeat installs, keep using
apm install --frozen.
Update discovery and update application must remain separate actions.
5. Reconcile third-party notices
Before handoff, reconcile THIRD_PARTY_NOTICES.md with the reviewed lockfile:
- For every third-party skill whose files are committed from an APM target,
keep one current notice entry with the source, selected virtual path, locked
SHA, license, and required attribution.
- When removing a dependency, run
apm prune and confirm its deployed files
are gone before removing its notice entry. Retain the notice when a copy or
derivative remains in the repository.
- Treat a changed license, copyright, or NOTICE file as an adoption-review
change, not a metadata-only update. Resolve it before deploying the new
version.
Completion checklist
apm.yml is present and was not overwritten accidentally.
- The selected APM CLI was the newest reviewed release that completed the
seven-day cooldown; its absolute path and version were recorded.
- No PATH, active APM installation, or other user-environment state changed
without explicit authorization.
- Any lock-format migration was explicit and reviewed separately from resolved
dependency changes; unexpected lockfile writes were restored and reported.
- Every remote dependency is pinned to a reviewed full commit SHA.
apm.lock.yaml is committed and contains the expected resolved commits and
content hashes.
- Each adopted release, or the last change to a selected virtual subdirectory,
met the seven-day cooldown or has a documented maintainer-approved exception.
- Each committed APM-deployed third-party skill has one current
THIRD_PARTY_NOTICES.md entry, including its license and required notices;
removed skills have no stale entry unless a copy remains.
- Packaged collections have matching canonical and distributed file sets and
content hashes; the named installed Skill was checked at the
installer-reported target.
- Deployment used
apm install --frozen; apm audit --ci passed in the
verified target context, or any target-resolution discrepancy is documented
with direct installation and lockfile evidence.
- Updates have a reviewable, cooldown-aware proposal before application.