docs(research): refresh apm reference set to 0.39.3 (#265)
Add lockfile-and-compatibility, approvals-and-executables and migration-0-28-to-0-39 topics; update installation, cli-reference, the prompt, hooks and instructions topics for 0.39.x behaviour; label the remaining 0.28.0 observations by version. Sources: the v0.39.3 source, CHANGELOG and docs; Context7 was unavailable. Refs #265 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
1 parent
a0997cbcf7
commit
5ca2056046
12 files changed
+628
-65
No files matched your search
@@ -0,0 +1,86 @@
|
||||
---
|
||||
topic: approvals-and-executables
|
||||
source_keys:
|
||||
- apm-v0-39-3-source
|
||||
- apm-v0-39-3-changelog
|
||||
- apm-v0-39-3-docs
|
||||
---
|
||||
|
||||
How apm 0.39.3 decides whether a package's executables may be deployed. Executables means hooks, MCP servers, `bin`, LSP servers, canvas extensions and native plugins. This also covers what `apm approve` writes and which `apm audit --ci` checks enforce it. Read from the v0.39.3 source, CHANGELOG and docs, and not run. Claims are marked **source** or **doc**.
|
||||
|
||||
## The gate and its opt-in
|
||||
|
||||
- **Source:** the executables gate is on when the project `apm.yml` has an `executables:` block (even `{}`) or the deprecated `allowExecutables:` block. **Doc:** a non-empty `executables:` block in org policy also turns it on.
|
||||
- **Doc:** without an opt-in, executables deploy unconditionally. The first project approval prompts that it turns the gate on. A `--user` approval never turns it on.
|
||||
- **Source:** `allowExecutables:` is still read as an alias of `executables.allow`, warned once per run, and migrated on the next approve or deny write.
|
||||
|
||||
## Store shape
|
||||
|
||||
`apm approve` writes the project `apm.yml` under `executables: {allow, deny}` by default. `--user` writes `$APM_HOME/config.json` instead.
|
||||
|
||||
```yaml
|
||||
executables:
|
||||
allow:
|
||||
acme/agent-kit:
|
||||
hooks: { .apm/hooks/lint-on-save.json: sha256:<64 hex> }
|
||||
mcp: { kit-docs: sha256:<64 hex> }
|
||||
acme/tools: { bin: true }
|
||||
deny:
|
||||
evil/pkg: { hooks: true, mcp: true, bin: true, canvas: true, lsp: true }
|
||||
```
|
||||
|
||||
- **Source:** each package key is a version-blind identity, such as `owner/repo`, `./pkgs/x` or `local:pkgs/leaf`.
|
||||
- **Source:** values by type:
|
||||
- `hooks` and `mcp` are maps of `item: sha256:<64 hex>`. The item is the package-relative hook file path, or the MCP server name.
|
||||
- `bin`, `lsp` and `canvas` are `true`.
|
||||
- A native plugin gets a single `plugin: sha256:<hex>`.
|
||||
- **Source:** deny entries stay booleans.
|
||||
- **Source:** malformed pins are rejected. A pinned item set to `true`, or a short digest, fails with `expected 'sha256:<64 hex>'`.
|
||||
|
||||
## Grants are version-blind
|
||||
|
||||
- **Source:** an ordinary grant key has its `#version` suffix stripped before matching. So `owner/repo#1.2.0` matches any installed version of `owner/repo`, and `apm approve` folds such keys into the bare identity. This was already true in 0.28.0.
|
||||
- **Source:** the one exception is content-bound local-bundle keys of the form `name#version@sha256:<digest>`, which match only exactly.
|
||||
|
||||
## Type-level versus content-pinned grants
|
||||
|
||||
- **Source/doc:** type-level `hooks: true` and `mcp: true` still deploy any content. Each install warns once: `N executable approval(s) not pinned to content: <pkg> (<type>) ... Upstream changes deploy without review.`
|
||||
- **Source/doc:** `mcp: true` never admits a transitive MCP server.
|
||||
- **Source/doc:** re-running `apm approve <pkg>` converts a type-level grant to pins.
|
||||
- **Source:** a pinned item whose bytes change is parked as `definition-changed` and not deployed. A project pin decides alone; a user pin applies only when the project has none for that item.
|
||||
- **Source (0.38.0, #4688):** a hook pin covers everything the hook deploys:
|
||||
- the hook JSON;
|
||||
- every script it references;
|
||||
- every file the hook-bundle copier deploys from those script roots, such as helpers and nested `package.json`;
|
||||
- the Node module type.
|
||||
|
||||
It does not cover code the hook downloads at run time. Pins written before 0.38 show as changed once, so re-run `apm approve <pkg>`.
|
||||
- **Source:** pinned approvals need apm 0.37 or later on every machine. The first pinned approval prints `Teammates need APM 0.37 or later to read pinned approvals.`, and older clients reject the item form and fail closed.
|
||||
- **Doc (0.39.3):** re-run `apm approve <package>` after reinstalling a package.
|
||||
|
||||
## Transitive MCP servers
|
||||
|
||||
- **Source:** `--trust-transitive-mcp` still exists in 0.39.3 as a per-run install flag that is never saved. **Doc:** it never overrides a deny or a mismatched pin.
|
||||
- **Doc (0.37.0, #3918):** the durable replacement is `apm approve <pkg>`, with `apm.yml` committed.
|
||||
- **Doc (0.39.0):** a server trusted in 0.38 only via the flag is parked and removed on the first plain 0.39 install. Approve it to keep it.
|
||||
|
||||
## Audit checks that enforce approvals (doc)
|
||||
|
||||
| Check | Fails when |
|
||||
|---|---|
|
||||
| `config-consistency` | The lock admits an MCP server that `apm.yml` does not approve: `admitted in apm.lock.yaml but not approved in apm.yml (<reason>); run 'apm approve <pkg>' and re-run 'apm install'`. Admission is re-evaluated from `apm.yml` and org policy only, never from the lock or the user store. |
|
||||
| `hook-approval-pins` | A recorded deployed hook file no longer matches its pin; or an unrecorded file sits at a withheld package's hook path; or a merged-config entry matches such a package's hook with no ownership record. |
|
||||
| `exec-status-current` | A recorded `exec_status` differs from the current gate decision. Claude `settings.json` hooks are included. Not evaluated under `--no-policy`. |
|
||||
| `local-bundle-hooks` | A local-bundle hook entry was edited or is unrecorded. Needs the `.claude/apm-hooks.json` record. |
|
||||
|
||||
`apm install --frozen` fails on the same pin mismatches.
|
||||
|
||||
## `apm approve` and `apm deny`
|
||||
|
||||
- **Doc:** flags are `--pending`, `--all`, `--recommended`, `--list`, `--user`/`-g`.
|
||||
- **Doc:** it exits 1 when:
|
||||
- a requested package is not installed or is refused;
|
||||
- the first-approval prompt is declined;
|
||||
- a blocking org policy applies;
|
||||
- installed files differ from `apm.lock.yaml`.
|
||||
- **Source:** `apm deny [PACKAGES] --user/-g` writes deny entries.
|
||||
@@ -2,35 +2,151 @@
|
||||
topic: cli-reference
|
||||
source_keys:
|
||||
- context7-microsoft-apm
|
||||
- apm-v0-39-3-source
|
||||
- apm-v0-39-3-docs
|
||||
---
|
||||
|
||||
The command surface as of apm 0.39.3, read from source (`cli.py` and `commands/`) and the reference docs. Version-specific changes are summarized in `migration-0-28-to-0-39.md`.
|
||||
|
||||
## Command list (0.39.3, source)
|
||||
|
||||
`approve`, `audit`, `auth`, `cache`, `compile`, `config`, `deny`, `deps`, `doctor`, `experimental`, `export-patch`, `find`, `init`, `install`, `lifecycle`, `list`, `lock`, `marketplace`, `mcp`, `outdated`, `pack`, `plugin`, `policy`, `preview`, `prune`, `publish`, `run`, `runtime`, `search`, `self-update`, `targets`, `uninstall`, `unpack`, `update`, `view`.
|
||||
|
||||
There are also two hidden entries: `discover` (use the documented `apm init --discover` form) and `info`, an alias of `view`.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
apm install [PACKAGE_REF...] [OPTIONS]
|
||||
```
|
||||
|
||||
With no arguments, resolves and installs everything declared in `apm.yml` against `apm.lock.yaml`. Explicit `PACKAGE_REF` arguments (e.g. `acme/internal-tools#^1.0.0`) install and add that dependency. `apm install --update` re-resolves and accepts new upstream content even when it doesn't match the recorded lockfile hash (see troubleshooting). `apm install --target agent-skills` generates a vendor-neutral output directory for IDE-agnostic tool support instead of a harness-specific one.
|
||||
- With no arguments, apm installs everything declared in `apm.yml` against `apm.lock.yaml`.
|
||||
- Naming a `PACKAGE_REF` installs that package and adds it as a dependency.
|
||||
- `--update` re-resolves the dependencies and accepts new upstream content.
|
||||
- `--target agent-skills` produces a vendor-neutral output directory.
|
||||
|
||||
Frozen-install behaviour is in `lockfile-and-compatibility.md`.
|
||||
|
||||
Options (doc):
|
||||
|
||||
| Group | Options |
|
||||
|---|---|
|
||||
| Resolution and lockfile | `--update`, `--frozen/--no-frozen`, `--refresh`, `--accept-ref-change` |
|
||||
| Run control | `--dry-run`, `--force`, `-v`, `--dev` |
|
||||
| Scope and targets | `--root DIR`, `-t/--target`, `--runtime`, `--exclude`, `--only apm\|mcp`, `-g/--global`, `--legacy-skill-paths` |
|
||||
| Policy and security | `--policy SOURCE`, `--no-policy`, `--audit off\|warn\|block`, `--no-audit` |
|
||||
| Trust | `--trust-transitive-mcp`, `--trust-bin/--no-trust-bin` |
|
||||
| Network and transport | `--allow-insecure`, `--allow-insecure-host`, `--parallel-downloads N`, `--ssh`, `--https`, `--allow-protocol-fallback`, `--auth-first` |
|
||||
| Skill selection | `--skill`, `--as` |
|
||||
| MCP | `--mcp`, `--transport`, `--url`, `--env`, `--header`, `--mcp-version`, `--registry` |
|
||||
|
||||
Exit codes (doc):
|
||||
|
||||
| Code | Meaning |
|
||||
|---|---|
|
||||
| 0 | Success or preview |
|
||||
| 1 | Install failure. This includes frozen violations, and any reported error even with `--force`. |
|
||||
| 2 | Usage error: no target detectable, `--ssh` with `--https`, `--frozen` with `--update`, or `--root` with `--global`. |
|
||||
|
||||
## Update and outdated
|
||||
|
||||
```bash
|
||||
apm update [PACKAGES] [--yes] [--dry-run] [--verbose] [--global] [--force] [--target ...]
|
||||
apm outdated [-g] [-v] [-j N]
|
||||
```
|
||||
|
||||
**`apm update`** (source):
|
||||
- `--check` is deprecated (doc). Use `--dry-run`, or `self-update --check` instead.
|
||||
- Run outside an `apm.yml` project, bare `apm update` forwards to `self-update` with a warning (doc).
|
||||
- `apm deps update` is deprecated in favour of `apm update`.
|
||||
|
||||
**`apm outdated`** (source):
|
||||
- Options are `--global`, `--verbose` and `--parallel-checks/-j N` (default 4; 0 means sequential).
|
||||
- There is no `--json` and no package filter.
|
||||
- **Output:** a "Dependency Status" table with columns Package, Current, Wanted (only when registry rows exist), Latest, Status and Source.
|
||||
- The summary line is `<N> outdated dependency found` or `<N> outdated dependencies found`, or `Some dependencies could not be checked`.
|
||||
- Statuses in code are `up-to-date`, `outdated`, `unknown`, `origin-conflict`, `access-denied` and `not-comparable`.
|
||||
- With `-v`, the table adds the newer tags.
|
||||
- **Exit codes:** 1 on `origin-conflict` or `access-denied` (source); the docs also give 1 for no lockfile in scope. Outdated or unknown rows still exit 0.
|
||||
- Local and Artifactory dependencies are skipped, and the command is read-only.
|
||||
|
||||
## Audit
|
||||
|
||||
```bash
|
||||
apm audit # scan deployed files for hidden Unicode
|
||||
apm audit --ci # CI gate: lockfile consistency, approvals, drift replay, policy
|
||||
apm audit --file <path> # scan an arbitrary file
|
||||
apm audit --ci -f json -o r.json
|
||||
```
|
||||
|
||||
- **Options:** `--file`, `--strip`, `--dry-run`, `--no-drift`, `-v`, `--ci`, `--policy`, `--no-policy`, `--no-cache`, `--no-fail-fast`, `-f/--format text|json|sarif|markdown`, `-o/--output PATH`.
|
||||
- When `-o` is given without `-f`, the format is inferred from the file extension.
|
||||
- `markdown` is not allowed with `--ci`.
|
||||
- **Exit codes in content-scan mode** (source docstring): 0 clean, 1 critical, 2 warnings only. The docs add 3 for configuration or infrastructure errors.
|
||||
- **Exit codes in `--ci` mode:** 0 when every check passes, 1 when any fails.
|
||||
- **Text output in `--ci` mode** (source):
|
||||
- On success: `All <M> check(s) passed`.
|
||||
- On failure: `<N> of <M> check(s) failed`, with each failure as `<check>: <message>` followed by detail lines.
|
||||
- M varies with which checks apply; the list is in `migration-0-28-to-0-39.md`.
|
||||
- **Lockfile message** (source): when `apm.yml` declares dependencies but there is no lock, the detail reads `apm.yml declares dependencies but apm.lock.yaml is absent`.
|
||||
- Fail-fast is the default.
|
||||
|
||||
See `testing-and-validation.md` for CI wiring.
|
||||
|
||||
## Approve, deny and export-patch
|
||||
|
||||
```bash
|
||||
apm approve [PACKAGES] [--pending|--all|--recommended|--list] [--user|-g]
|
||||
apm deny [PACKAGES] [--user|-g]
|
||||
apm export-patch [--out DIR] [--dry-run] [-v]
|
||||
```
|
||||
|
||||
- Approvals are covered in `approvals-and-executables.md`.
|
||||
- **`export-patch` (doc):**
|
||||
- It writes one `patches/<pkg>@<ref>.patch` per package, ready for `git apply`, covering only files that were deployed verbatim.
|
||||
- It needs a lockfile and a populated `apm_modules/`, and it runs cache-only.
|
||||
- It exits 0 on success, including when there is nothing to export. It exits 1 on a missing manifest or lock, a cold cache, or an invalid `--out`.
|
||||
|
||||
## Compile
|
||||
|
||||
```bash
|
||||
apm compile
|
||||
apm compile [-t TARGET|--all] [--root DIR] [-o PATH] [--clean] [--validate] [--dry-run] [--watch] [-g]
|
||||
```
|
||||
|
||||
Generates per-target output (Claude, Copilot, etc.) from the vendor-neutral `.apm/` primitive source tree, per the `compilation:` block in `apm.yml`.
|
||||
- `apm compile` generates root context files (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`) from instructions.
|
||||
- Other options: `--single-agents`, `--chatmode`, `--no-links`, `--with-constitution/--no-constitution`, `--local-only`, `--force-instructions` (alias `--no-dedup`) and `--legacy-skill-paths`.
|
||||
- It exits 1 when org policy blocks a recorded package.
|
||||
- A hand-authored root `CLAUDE.md` or `AGENTS.md` is never overwritten (source). For the 0.38/0.39 Claude layout, see `instructions-target-mapping.md`.
|
||||
|
||||
## Pack
|
||||
|
||||
```bash
|
||||
apm pack --dry-run # resolve and print; do not write
|
||||
apm pack --offline # cached refs only
|
||||
apm pack --include-prerelease # allow pre-release tags
|
||||
apm pack -v # per-entry resolution detail
|
||||
apm pack --marketplace=claude --json # JSON output for CI pipelines
|
||||
apm pack --check-versions --check-clean --dry-run
|
||||
apm pack --format plugin # Claude Code plugin bundle (alias)
|
||||
apm pack --marketplace=claude --json
|
||||
```
|
||||
|
||||
Bundles a producer package into a distributable artifact.
|
||||
- **Options (source):**
|
||||
- `--claude-plugin`
|
||||
- `--format plugin|agent-plugin|claude|claude-plugin|apm`. With no flag the default is `claude-plugin`. `plugin` is an alias for the Claude Code plugin bundle.
|
||||
- `--target/-t`, which is deprecated and informational only.
|
||||
- `--archive` (default `.zip`) with `--archive-format zip|tar.gz`.
|
||||
- `-o`, `--dry-run`, `--force`, `-v`, `--offline`, `--include-prerelease`.
|
||||
- `--check-versions`, `--check-clean`, `--strict-metadata`.
|
||||
- `-m/--marketplace`, `--marketplace-path FORMAT=PATH`, `--json`, `--legacy-skill-paths`.
|
||||
- **Exit codes (source):**
|
||||
|
||||
| Code | Meaning |
|
||||
|---|---|
|
||||
| 0 | Success |
|
||||
| 1 | Build or runtime error |
|
||||
| 2 | Usage error |
|
||||
| 3 | `--check-versions` misalignment |
|
||||
| 4 | `--check-clean` drift |
|
||||
| 5 | `--strict-metadata` failure |
|
||||
|
||||
- `--check-clean` is read-only.
|
||||
|
||||
## Publish
|
||||
|
||||
@@ -39,17 +155,17 @@ apm publish --package acme/my-skill --dry-run -v
|
||||
apm publish --package acme/my-skill
|
||||
```
|
||||
|
||||
Publishes a producer package (root containing `apm.yml`, `.apm/`, and optionally a `registries:` block) to a registry. Always dry-run with `-v` first to see resolution detail before publishing for real.
|
||||
`apm publish` sends a producer package to a registry. Always dry-run with `-v` first.
|
||||
|
||||
## Runtime management
|
||||
|
||||
```bash
|
||||
apm runtime setup copilot # install with APM defaults
|
||||
apm runtime setup codex --version 0.20.0 # pinned version
|
||||
apm runtime setup llm --vanilla # skip APM-managed config
|
||||
apm runtime list # what's installed
|
||||
apm runtime status # which runtime `apm run` will pick
|
||||
apm runtime remove gemini -y # uninstall without prompting
|
||||
apm runtime setup copilot
|
||||
apm runtime setup codex --version 0.20.0
|
||||
apm runtime setup llm --vanilla
|
||||
apm runtime list
|
||||
apm runtime status
|
||||
apm runtime remove gemini -y
|
||||
```
|
||||
|
||||
## Run
|
||||
@@ -58,42 +174,28 @@ apm runtime remove gemini -y # uninstall without prompting
|
||||
apm run <script> [--param key=value]
|
||||
```
|
||||
|
||||
Executes a named script defined under `scripts:` in `apm.yml`, with `--param` substituting values into the script's parameters (used, for example, when the script wraps a Gemini CLI invocation).
|
||||
`apm run` executes a named script from `scripts:` in `apm.yml`. It is experimental.
|
||||
|
||||
## Audit (validation)
|
||||
|
||||
```bash
|
||||
apm audit # local: scan deployed files for hidden Unicode
|
||||
apm audit --ci # CI gate: lockfile consistency + drift replay + policy
|
||||
apm audit --file <path> # standalone: scan an arbitrary file
|
||||
```
|
||||
|
||||
See `testing-and-validation.md` for CI wiring and exit-code behavior.
|
||||
|
||||
## Marketplace
|
||||
|
||||
```bash
|
||||
apm marketplace init # add the marketplace: block to apm.yml
|
||||
apm marketplace check # validate every listed package ref resolves
|
||||
apm marketplace package add <path> --name <n> # register a local package into the marketplace
|
||||
apm marketplace add <source> [--name <n>] # register a marketplace as a consumer (see marketplace-and-registries.md for source forms)
|
||||
```
|
||||
|
||||
## Plugin scaffolding
|
||||
## Marketplace and plugin scaffolding
|
||||
|
||||
```bash
|
||||
apm marketplace init
|
||||
apm marketplace check
|
||||
apm marketplace package add <path> --name <n>
|
||||
apm marketplace add <source> [--name <n>]
|
||||
apm plugin init <name> --yes
|
||||
```
|
||||
|
||||
Scaffolds a new package's `apm.yml` + `.apm/` skeleton in the current directory.
|
||||
- Marketplace subcommands (source): `add`, `list`, `browse`, `update`, `remove`, `validate`, `init`, `migrate`, `check`, `audit`, `outdated`, and `package add|set|remove`.
|
||||
- `plugin` has only `init`.
|
||||
- `apm init --plugin` and `apm init --marketplace` were removed in 0.37 and exit 2.
|
||||
|
||||
## Config
|
||||
|
||||
```bash
|
||||
apm config set <key> <value>
|
||||
apm config get <key>
|
||||
apm config list
|
||||
apm config unset <key>
|
||||
apm experimental enable registries # required before registry.* config takes effect
|
||||
apm experimental enable registries
|
||||
```
|
||||
|
||||
Used for workstation-level settings such as private registry URLs/tokens (see `marketplace-and-registries.md`).
|
||||
@@ -3,6 +3,9 @@ topic: hooks-primitive-schema
|
||||
source_keys:
|
||||
- context7-microsoft-apm
|
||||
- apm-github-repo
|
||||
- apm-v0-39-3-source
|
||||
- apm-v0-39-3-changelog
|
||||
- apm-v0-39-3-docs
|
||||
---
|
||||
|
||||
## File location, naming, and format — confirmed `.json`, not assumed
|
||||
@@ -57,3 +60,25 @@ Differences from the Claude/source shape: flat arrays (no nested matcher-group w
|
||||
- **Dropping a target from `apm.yml`'s `targets:` list does not auto-clean its merged hook entries** unless `apm install`/reconcile logic explicitly walks the complement set (`reconcile_dropped_targets`) — a real, documented gap the code works around rather than a design guarantee; relying on "just remove the target and hooks disappear" is not safe without a fresh `apm install`.
|
||||
- **Event-casing mismatches are warnings, not errors** — a hook authored with the wrong casing for a target and no applicable rename mapping will silently not fire at runtime; APM only logs a warning at install time, it does not block the install or refuse to deploy the file.
|
||||
- **No dedicated `Hook`/`HookPrimitive` validation dataclass** exists comparable to `Instruction.validate()` — validation is distributed across `_validate_copilot_payload` (Copilot-shape-specific) and general JSON-parseability checks, not a single primitive-level contract. This mirrors the same "no independent validation model" gap already documented for the agent primitive.
|
||||
|
||||
## Changes through 0.39.3 (source, CHANGELOG and docs; not run)
|
||||
|
||||
The sections above were written against 0.28.0. The merge into `.claude/settings.json` is still the mechanism in 0.39.3. The following changed:
|
||||
|
||||
- **Filename routing is gone (0.36.0, #3613).** Filenames such as `*-<target>-hooks.json` and `hooks-<target>.json` no longer send a hook to one target only, so every hook file reaches every targeted harness.
|
||||
- To limit a hook to Claude, ship it in a package whose `apm.yml` sets `targets: [claude]`, or narrow the dependency with object-form `targets:`.
|
||||
- If dropping the routing would hand a target a file the old name kept from it, install fails for that package and names the file.
|
||||
- **Event names.** `SessionStart` and `sessionStart` both map to `SessionStart` for Claude. Copilot events that have a Claude equivalent are written to `.claude/settings.json` under the Claude name. For Copilot, `SessionStart` becomes `sessionStart`.
|
||||
- **Where ownership is recorded.** apm marks its entries with `_apm_source` while it works. On write, it moves those markers into a sidecar, `.claude/apm-hooks.json`, so `settings.json` itself carries no apm markers. On reinstall the markers are read back from the sidecar.
|
||||
- **Edited entries are kept (0.38.1, 0.39.0).**
|
||||
- When a user edits a deployed entry, apm keeps the edited copy and writes the deployed entry beside it, with a warning. A byte-identical user copy does not count as an edit.
|
||||
- Install exits 1 when an edited hook file or script blocks new content.
|
||||
- Uninstall refuses when a package's entry was edited or its sidecar record is missing.
|
||||
- **Ordering.** Entries merge in full-install order. Do not rely on order across packages. Your own entries never move.
|
||||
- **Approval.** When the executables gate is on, a hook deploys only under a grant: type-level `hooks: true`, or a per-file content pin. A pin covers the hook JSON and every file deployed with it. See `approvals-and-executables.md`.
|
||||
- **Command safety (0.39.0, #5600).** Only hook commands that stay inside the package and use no shell expansion are deployed. Shell expansion means `$(...)`, backticks, `eval`, here-docs and subshells.
|
||||
- **Settings-file lifecycle.**
|
||||
- A `.claude/settings.json` that apm created is deleted once its last entry leaves.
|
||||
- An emptied one that apm has no creation record for is kept, with a warning.
|
||||
- A hook config that is not valid JSON is never rewritten. A merge into it exits 1; a cleanup-only run warns and exits 0.
|
||||
- **Audit.** These checks cover merged Claude hook entries: `hook-approval-pins`, `exec-status-current`, `local-bundle-hooks`, `content-integrity` and `drift`. `drift` compares only apm-owned entries. `apm install --frozen` also fails when an apm-managed merged entry was edited.
|
||||
@@ -2,32 +2,85 @@
|
||||
topic: installation
|
||||
source_keys:
|
||||
- context7-microsoft-apm
|
||||
- apm-v0-39-3-docs
|
||||
- apm-v0-39-3-source
|
||||
- pypi-apm-cli
|
||||
- apm-cli-0-39-3-uv-experiments
|
||||
---
|
||||
|
||||
## Quick install (recommended)
|
||||
## Install methods (0.39.3 docs)
|
||||
|
||||
A one-line install script auto-detects the platform, downloads the latest binary, and configures the system `PATH`:
|
||||
- Quick install script. It auto-detects the platform, downloads the release binary and configures `PATH`:
|
||||
|
||||
```bash
|
||||
curl -sSL https://aka.ms/apm-unix | sh
|
||||
```bash
|
||||
curl -sSL https://aka.ms/apm-unix | sh
|
||||
```
|
||||
|
||||
On Windows use `irm https://aka.ms/apm-windows | iex`.
|
||||
- Homebrew: `brew install apm`, from the core formula. The old `microsoft/apm` tap is migrated.
|
||||
- WinGet: `winget install --id Microsoft.APM --exact --source winget`.
|
||||
- Scoop: `scoop install apm`.
|
||||
- pip: `python3 -m pip install apm-cli`. Since 0.36.0 this needs Python 3.11 or later, and the same floor applies to any Python-based install.
|
||||
- Manual binary: download the release archive and put the binary on `PATH`. Prebuilt binaries cover macOS, Linux and Windows on x86_64 and ARM64.
|
||||
|
||||
The installation doc mentions neither pipx nor uv. If no prebuilt binary fits, the installer script falls back to `pip install --user apm-cli`.
|
||||
|
||||
`apm self-update` upgrades a script install. The installer refuses to overwrite a copy owned by Homebrew or pip.
|
||||
|
||||
The docs give glibc 2.28 as the Linux minimum for the binary, but the 0.32.0 installer notes say 2.38. This conflict is unresolved; use pip if in doubt.
|
||||
|
||||
## Package facts (PyPI and source)
|
||||
|
||||
- The package is `apm-cli`, and its console entry point is `apm = apm_cli.entrypoint:main`. It needs Python 3.11 or later.
|
||||
- 0.39.3 was released 2026-12-01 as a wheel and an sdist, and 0.39.2 on 2026-11-30. Neither is yanked.
|
||||
- Runtime dependencies:
|
||||
- click, colorama, pyyaml, requests, truststore
|
||||
- python-frontmatter, llm, llm-github-models
|
||||
- toml, tomlkit, rich, rich-click
|
||||
- watchdog, GitPython, ruamel.yaml, filelock
|
||||
- websockets (below 17)
|
||||
|
||||
A full resolve came to about 63 packages.
|
||||
|
||||
## Pinning a version
|
||||
|
||||
- Script: `curl -sSL https://aka.ms/apm-unix | sh -s -- @v1.2.3`, or set `VERSION=v1.2.3`. On Windows, set `$env:VERSION` before the `irm` line.
|
||||
- pip: `pip install apm-cli==0.39.3`.
|
||||
- GitHub Action: `microsoft/apm-action@v1` with `setup-only: 'true'` and `apm-version: '<version>'`.
|
||||
- The docs give no pinning method for Homebrew, WinGet or Scoop.
|
||||
- Upstream advice: pin a **minimum** apm in CI rather than an exact one. Choose a release that reads your lockfile format, which means 0.39.2 or later for v4 locks rewritten by 0.39.2. apm has no manifest field that enforces a minimum. See `lockfile-and-compatibility.md`.
|
||||
|
||||
## Per-project pin with uv (tested, not upstream-documented)
|
||||
|
||||
apm's docs do not cover this. It was tested with uv 0.11.24 in a throwaway project outside any repo.
|
||||
|
||||
```toml
|
||||
[project]
|
||||
name = "<project>"
|
||||
version = "0.0.0"
|
||||
requires-python = ">=3.11"
|
||||
dependencies = []
|
||||
|
||||
[tool.uv]
|
||||
package = false
|
||||
|
||||
[dependency-groups]
|
||||
dev = ["apm-cli==0.39.3"]
|
||||
```
|
||||
|
||||
On Windows, the installer adds both the current directory and the bin directory to `PATH`, so it works from native shells, Git Bash, and process APIs alike.
|
||||
|
||||
## Customizing the install
|
||||
|
||||
- **Pin a specific version**: append `@vX.Y.Z` to the piped script arguments, e.g. `curl -sSL https://aka.ms/apm-unix | sh -s -- @v1.2.3`.
|
||||
- **Custom install directory**: set `APM_INSTALL_DIR` on the piped script's command, e.g. `curl -sSL https://aka.ms/apm-unix | APM_INSTALL_DIR=$HOME/.local/bin sh`.
|
||||
- **Air-gapped / GitHub Enterprise mirror**: set `GITHUB_URL` and `VERSION` env vars against a local `install.sh`, e.g. `GITHUB_URL=https://github.corp.com VERSION=v1.2.3 sh install.sh`.
|
||||
|
||||
## Alternative install methods
|
||||
|
||||
- **pip**: `pip install apm-cli` — requires Python 3.10 or higher.
|
||||
- **Manual binary**: download the platform-specific archive from the GitHub releases page, extract it, move the binary to a permanent directory, and add that directory to `PATH`.
|
||||
- With no `[build-system]`, uv installs only the dependencies and never builds the project. `package = false` keeps it that way even if a build system is added later. `uv sync` installs the `dev` group by default.
|
||||
- `uv run apm --version` reported 0.39.3. The committed `uv.lock` hashes apm-cli and every transitive dependency.
|
||||
- **Offline behaviour:**
|
||||
- `uv run --frozen --offline apm ...` worked once the uv cache was warm, even with no `.venv`.
|
||||
- It failed with an empty cache, because wheels cannot be downloaded offline.
|
||||
- So the first sync on a machine needs the network.
|
||||
- **Rejected alternatives:**
|
||||
- `uvx apm-cli@<v>` pins only apm-cli: transitive dependencies float and nothing is locked. A cache warmed by `uv add` also did not satisfy `uvx --offline`.
|
||||
- `uv tool install` is machine-global, the same drift problem as pipx.
|
||||
|
||||
## Installing agent runtimes
|
||||
|
||||
APM itself doesn't execute agents, but it can install and manage the runtimes that do, via `apm runtime setup <name>`:
|
||||
apm does not run agents itself, but it can install and manage the runtimes that do:
|
||||
|
||||
```bash
|
||||
apm runtime setup copilot # recommended default
|
||||
@@ -36,4 +89,4 @@ apm runtime setup gemini
|
||||
apm runtime setup llm
|
||||
```
|
||||
|
||||
Installing GitHub Copilot CLI through APM pulls it from the public npm registry and requires Node.js v22+ and npm v10+; no authentication is needed for the install step itself. Use `apm runtime list` to see which runtimes are currently installed and which one `apm run` will pick by default.
|
||||
Installing the GitHub Copilot CLI through apm pulls it from the public npm registry. It needs Node.js 22 or later and npm 10 or later. `apm runtime list` shows which runtimes are installed and which one `apm run` picks.
|
||||
@@ -6,6 +6,7 @@ source_keys:
|
||||
- claude-code-memory-docs
|
||||
- cursor-rules-docs
|
||||
- github-copilot-custom-instructions-docs
|
||||
- apm-v0-39-3-changelog
|
||||
---
|
||||
|
||||
Surprising behaviours and source contradictions for the instructions primitive. "Verified" means observed with the installed apm 0.28.0 in a throwaway directory outside the repo. Everything else is stated as sourced or inferred.
|
||||
@@ -78,7 +79,7 @@ An earlier version of this topic's schema file described missing `description` a
|
||||
- Runtime behaviour of Windsurf, Kiro and Antigravity on the emitted frontmatter; no downstream docs were fetched.
|
||||
- Windsurf user-scope global rules.
|
||||
- The Context7 step was unavailable (invalid API key), so the registry carries no fresh Context7 pull. Doc pages were summarised by a smaller model before reaching this file and can be lossy.
|
||||
- Apm versions other than 0.28.0 were not tested.
|
||||
- Apm versions other than 0.28.0 were not tested. 0.38.0 and 0.39.0 changed the Claude layout, moving `**`- and directory-scoped rules into `AGENTS.md` once compiled. The `.claude/rules/` items above may therefore not hold on 0.39.x. See `instructions-target-mapping.md`, "Claude layout in 0.38 and later", and `migration-0-28-to-0-39.md`.
|
||||
|
||||
## What belongs in an instruction body
|
||||
|
||||
|
||||
@@ -6,10 +6,27 @@ source_keys:
|
||||
- claude-code-memory-docs
|
||||
- github-copilot-custom-instructions-docs
|
||||
- cursor-rules-docs
|
||||
- apm-v0-39-3-source
|
||||
- apm-v0-39-3-changelog
|
||||
- apm-v0-39-3-docs
|
||||
---
|
||||
|
||||
What each target receives from an instruction file, at install time (native per-file deploy) and at compile time (folded into a root context file). Verified against apm 0.28.0 source and throwaway installs unless marked otherwise. Field syntax of the source file is in `instructions-primitive-schema.md`.
|
||||
|
||||
## Claude layout in 0.38 and later (source and CHANGELOG; not run)
|
||||
|
||||
The install table below is the 0.28.0 behaviour, where every Claude instruction went to `.claude/rules/`. Two later releases changed that.
|
||||
|
||||
- **0.38.0:** Claude instructions scoped to `**`, unscoped, scoped to `**/*`, or scoped to exactly one literal `dir/**` glob move into `AGENTS.md`, which `CLAUDE.md` imports. Run `apm install` and then `apm compile`. Any other glob stays a path-scoped rule in `.claude/rules/`, including file-type globs, wildcard directories and lists.
|
||||
- **0.39.0 (#5394):** install-only projects keep the 0.37 `.claude/rules/` layout. A routed instruction is dropped from `.claude/rules/` only once a compiled `AGENTS.md` that Claude loads already carries its exact scope and body. Until then, install keeps the rule and asks for `apm compile`.
|
||||
- **Blockers.** These keep every instruction in `.claude/rules/`, with a warning:
|
||||
- a hand-authored root `CLAUDE.md` without an `@AGENTS.md` (or `@./AGENTS.md`) import;
|
||||
- a hand-authored root `AGENTS.md` without `compilation.agents_md.mode: managed_section` and a single pair of `<!-- apm:start -->`/`<!-- apm:end -->` markers;
|
||||
- a symlinked root `AGENTS.md`.
|
||||
- **Hand-authored files are protected.** A root `AGENTS.md`, `CLAUDE.md` or `GEMINI.md` without the apm-generated marker near the top is never overwritten. `--clean` never deletes an unmarked `CLAUDE.md`, and a compile with no primitives writes nothing. The one opt-in exception is `managed_section` mode, which writes only between the markers. If the user's `CLAUDE.md` already imports `@AGENTS.md`, compile leaves it untouched.
|
||||
- **Scope limits.** User scope (`-g`) and a home-rooted project never route to `AGENTS.md`.
|
||||
- **Claude Code version.** The source notes that Claude Code 2.1.277 and later read `AGENTS.md` natively, but only while no `CLAUDE.md` exists or the `CLAUDE.md` imports `@AGENTS.md`.
|
||||
|
||||
## Two separate output paths
|
||||
|
||||
`apm install` writes native files, one per instruction, into each target's own rules directory. `apm compile` writes root context files (`CLAUDE.md`, `AGENTS.md`, `GEMINI.md`) that concatenate instruction bodies. The two overlap, which is why compile has a dedup rule (below). A skill author should treat install as the primary path for Claude Code and Copilot, and compile as the path for targets that have no native instructions directory.
|
||||
@@ -80,4 +97,4 @@ Keys: `target`, `strategy` (`distributed` or `single-file`), `single_file`, `out
|
||||
|
||||
### Relevant compile flags
|
||||
|
||||
`--validate` (parse only; see schema file for why it is a weak check), `--dry-run`, `--clean` (removes orphaned generated files, never hand-authored ones), `--target`, `--all`, `--root`, `-g`, `--local-only`, `--single-agents`, `--no-links`, `--with-constitution`, `--force-instructions`. Documented exit codes: 0 success, 1 error, 2 conflicting flags. A compile with no instruction primitives at all exits 0 in 0.28.0.
|
||||
`--validate` (parse only; see schema file for why it is a weak check), `--dry-run`, `--clean` (removes orphaned generated files, never hand-authored ones), `--target`, `--all`, `--root`, `-g`, `--local-only`, `--single-agents`, `--no-links`, `--with-constitution`, `--force-instructions`. Documented exit codes: 0 success, 1 error, 2 conflicting flags. A compile with no instruction primitives at all exits 0 in 0.28.0. In 0.39.3 it also exits 1 when org policy blocks a recorded package.
|
||||
@@ -0,0 +1,97 @@
|
||||
---
|
||||
topic: lockfile-and-compatibility
|
||||
source_keys:
|
||||
- apm-v0-39-3-source
|
||||
- apm-v0-39-3-changelog
|
||||
- apm-v0-39-3-docs
|
||||
---
|
||||
|
||||
Lockfile format, cross-version compatibility, frozen installs and ref resolution as of apm 0.39.3. Read from the v0.39.3 source, its CHANGELOG and its docs. Nothing here was run against a real project. Each claim is marked **source** (read in code) or **doc** (docs or CHANGELOG only).
|
||||
|
||||
## Lockfile versions
|
||||
|
||||
- **Source:** the supported versions are `"1"` to `"4"`. Anything else is refused before any file changes, with `Unsupported lockfile version '<v>'; supported versions: 1, 2, 3, 4` plus a `apm self-update` hint.
|
||||
- **Doc:** the bump depends on content:
|
||||
- `"4"` when any package records a `content_hash`;
|
||||
- else `"3"` when a root `replacements` table exists;
|
||||
- else `"2"` for registry or semver evidence;
|
||||
- else `"1"`.
|
||||
- **Doc:** v4 adds no fields. It only changes how `content_hash` is computed. Each file, in sorted path order, contributes its path, a NUL byte and the SHA-256 of its raw bytes; v1-v3 keep the older stream. **Source:** both digests exist and are selected per lock version.
|
||||
- **Doc:** 0.37+ verifies a v1-v3 lock as written:
|
||||
- A writable `apm install` promotes the lock to `"4"` once every package re-hashes from verified bytes.
|
||||
- `apm install --frozen`, `apm audit` and other read-only commands never promote or rewrite it.
|
||||
- **Doc:** a lockfile with invalid YAML, a non-mapping root or malformed rows fails closed.
|
||||
- **Doc (0.39.0):** the lock is parsed with libyaml, so a hand-edited lockfile with nonstandard YAML may now be rejected. Regenerate it with `apm install`.
|
||||
|
||||
## Which apm reads which lock
|
||||
|
||||
| Lock | Refused by | Read by |
|
||||
|---|---|---|
|
||||
| v1-v3 written by 0.28.0 | nothing current | 0.37+ reads as written; a writable install promotes to v4 |
|
||||
| v4 written by 0.37.0-0.39.1 | 0.36.1 and older | 0.37.0+ |
|
||||
| v4 rewritten by 0.39.2+ | 0.36.1 and older, and 0.37.0-0.39.1 (they refuse any lock from a newer apm) | 0.39.2+ |
|
||||
|
||||
Practical rule: once a lock written by 0.39.2 or later is committed, every machine that runs install or audit on it needs 0.39.2 or later. Upgrade CI and update bots first.
|
||||
|
||||
## The 0.39.2 compatibility promise (doc, warning text confirmed in source)
|
||||
|
||||
From 0.39.2, the `lockfile_version` decides compatibility, not `apm_version`.
|
||||
|
||||
- A lock written by a newer apm in a format this apm reads runs normally. The only difference is one `[!]` line on stderr per process: `apm.lock.yaml was written by APM <x>, newer than this APM <y>. Its format (lockfile_version 4) is supported, so APM continues and keeps fields it does not know.`
|
||||
- Unknown fields survive a rewrite, with exceptions:
|
||||
- A dependency row's unknown fields are dropped when its commit, hash, version, `content_hash` or `source_digest` changed.
|
||||
- A deployment row's unknown fields are dropped when its `content_hash` or owner changed.
|
||||
- Top-level unknown fields are dropped when any dependency changed.
|
||||
- `x-*` top-level keys are always kept.
|
||||
- Refused with exit 1 before any change:
|
||||
- an unsupported `lockfile_version`;
|
||||
- an unknown deployment `kind`;
|
||||
- an unknown value in a known enum field (`exec_status`, `host_type`);
|
||||
- a duplicated `apm_version` or `lockfile_version` key.
|
||||
- No-op runs leave the lockfile byte-identical, and apm never switches its own version.
|
||||
- Read support for a new format ships at least eight weeks before any release writes it.
|
||||
|
||||
**`apm audit --ci` is stricter than install.** It fails with exit 1 when the lock records fields this apm does not know (other than `x-` keys): `'apm audit --ci' cannot certify apm.lock.yaml: it was written by APM <x>, newer than this APM <y>, and it records fields this APM does not know: <names>. Nothing was changed.` In JSON or SARIF output this is a failed check named `lockfile-fields-certifiable`. Plain `apm audit` only warns. Consequence: the apm that runs `audit --ci` must be at least as new as the newest apm that writes the lock.
|
||||
|
||||
## Minimum-version advice (doc)
|
||||
|
||||
apm has no manifest field for a required or minimum apm version. The upstream advice is to "pin a minimum APM in CI, not an exact one". The minimum should be a release that reads the lock format: 0.39.2 or later in the docs' own example. Version pinning therefore lives outside `apm.yml`, in whatever installs apm.
|
||||
|
||||
## `apm install --frozen`
|
||||
|
||||
- **Doc:** requires `apm.lock.yaml`, replays its pins, and never writes the lock (since 0.34.0).
|
||||
- **Doc:** in CI (env `CI` set to anything but empty, `0` or `false`), `apm install` with a committed lock behaves like `--frozen` (0.37.0). `--no-frozen` opts out, and is the recommended form for update bots.
|
||||
- **Doc:** mutually exclusive with `--update`, positional package additions and `--mcp`. Passing `--frozen --update` is a usage error (exit 2).
|
||||
- **Doc:** fails (exit 1) before the pipeline on:
|
||||
- a missing lock (a no-op when nothing is declared);
|
||||
- a direct dependency missing from the lock;
|
||||
- changed refs or commit pins;
|
||||
- a host, provider or transport mismatch;
|
||||
- MCP declaration mismatches;
|
||||
- an MCP server the lock admits but `apm.yml` does not approve;
|
||||
- hook approval pin mismatches.
|
||||
- **Doc:** hash enforcement:
|
||||
- Since 0.36.0, every deployed file is compared with its locked hash, and since 0.37.0 this happens before anything deploys. A mismatch exits 1.
|
||||
- Since 0.39.x, it also fails when an apm-managed entry inside a merged hook config, such as `.claude/settings.json`, was edited.
|
||||
- Recovery: restore or delete the edited file or entry, run `apm install` without `--frozen`, and commit. To keep edits made to a dependency's files, export them first with `apm export-patch`.
|
||||
- **Doc:** after the pipeline, `--frozen` also checks for unrecorded files, missing files, a stale executables decision, and hash drift. `generated_at` and `apm_version` are excluded from the comparison.
|
||||
|
||||
## Exact dependency refs (0.39.0, #4970)
|
||||
|
||||
- **Source:** a dependency `ref` resolves only to `refs/heads/<ref>` or `refs/tags/<ref>`, or to itself when spelled out in full under one of those. There is no tail match and no fallback, so a ref that only partly matches a branch or tag name is refused.
|
||||
- When a ref names both a branch and a tag, the error says it is ambiguous; spell it as `refs/heads/<name>` or `refs/tags/<name>`.
|
||||
- When it names neither: `it is not a branch or tag of the origin`.
|
||||
- An abbreviated SHA the host cannot expand is refused. Use the full 40 characters.
|
||||
- **Source:** a pinned commit, whether a `#sha` ref or a locked commit, is admitted only if an origin branch or tag reaches it. A commit reachable only from a PR or a fork is refused.
|
||||
- The fast path is a branch or tag tip, found with one `ls-remote`. Otherwise apm does a commits-only fetch of heads and tags.
|
||||
- The verdict is cached in local state, never in the lockfile, so later replays work offline.
|
||||
- **Source/doc:** the first install of a pinned commit needs the network. Offline, it fails closed with `the first install of a pinned commit needs network access once`.
|
||||
- **Source:** Artifactory routes are exempt and resolve by name.
|
||||
|
||||
## Commit verdicts after an upgrade (0.39.0, #5173)
|
||||
|
||||
**Source:** reachability verdicts live in a new cache namespace (`verified-v2`), and verdicts recorded by earlier builds are never read. After upgrading, run each install online once before relying on offline or locked replays.
|
||||
|
||||
## Helper tools resolve from PATH (0.39.0)
|
||||
|
||||
**Doc:** apm's helper tools (`git`, `az`, `npm` and others) and the setup scripts it runs resolve programs only from PATH entries outside the project. This does not affect your own scripts.
|
||||
@@ -0,0 +1,88 @@
|
||||
---
|
||||
topic: migration-0-28-to-0-39
|
||||
source_keys:
|
||||
- apm-v0-39-3-changelog
|
||||
- apm-v0-39-3-source
|
||||
- apm-v0-39-3-docs
|
||||
---
|
||||
|
||||
This page lists the breaking and behaviour-changing items between apm 0.28.0, the version the rest of this reference set was first verified on, and 0.39.3. Use it to decide which "verified on 0.28.0" claims elsewhere need re-checking. Every item comes from the CHANGELOG, with source confirmation where it says **source**. None of it was run against a real project.
|
||||
|
||||
## Versions and runtime
|
||||
|
||||
- **0.36.0:** pip, pipx and uv installs need Python 3.11 or later. Standalone binaries are unaffected.
|
||||
- **0.37.0:** the lockfile moves to format v4. 0.36.1 and older refuse it. See `lockfile-and-compatibility.md`.
|
||||
- **0.39.2:** 0.37.0-0.39.1 refuse a lock that 0.39.2 rewrites. From 0.39.2, a lock written by a newer apm in a supported format only warns. 0.39.2 is therefore the practical minimum.
|
||||
|
||||
## Manifest and targets
|
||||
|
||||
- **0.29.0:** a plugin's `skills` declaration exclusively controls which skills deploy. `"skills": []` deploys none, and removing the key keeps conventional `skills/` discovery.
|
||||
- **0.31.0:** a non-dry-run `apm install` exits 1 when Agent Plugins v1 target exclusion leaves no package deployed.
|
||||
- **0.32.0:** `apm install` rejects bare `.` or `..` aliases and unsafe symlink destinations.
|
||||
- **0.37.0:**
|
||||
- The `vscode` target is deprecated in favour of `copilot`.
|
||||
- The singular `target:` key is replaced by `targets:`, and `compilation.target` is ignored. Both still work, with warnings.
|
||||
- Copilot project MCP servers move to a root `.mcp.json`.
|
||||
- The `auto-integrate` config key is removed.
|
||||
- With `default_host:` set, shorthand dependencies resolve against it.
|
||||
- **Source:** `KNOWN_TARGETS` has 17 keys: agent-skills, antigravity, claude, codex, copilot, copilot-app, copilot-cowork, cursor, gemini, grok-bot, grok-build, grok-cloud, hermes, kiro, openclaw, opencode and windsurf. `vscode` is not among them.
|
||||
- **0.39.0 (#4970):** a dependency `ref` must exactly name an origin branch or tag, and pinned commits must be reachable from one. See `lockfile-and-compatibility.md`.
|
||||
|
||||
## Install, lockfile and audit
|
||||
|
||||
- **0.34.0:** `apm install --frozen` no longer writes the lock.
|
||||
- **0.36.0 (#3654):** `--frozen` verifies every deployed file against its locked hash. Before reinstalling, export your edits with `apm export-patch`.
|
||||
- **0.37.0:**
|
||||
- In CI, `apm install` with a committed lock verifies like `--frozen`. Use `--no-frozen` to opt out.
|
||||
- `--frozen` fails before deploying on any edited deployed file.
|
||||
- **0.38.0:** a failed or interrupted install restores every file it wrote. Install refuses managed files that lack deployment evidence.
|
||||
- **0.39.0:**
|
||||
- The lock is parsed with libyaml.
|
||||
- Reachability verdicts are recorded anew, so run one online install after upgrading.
|
||||
- Helper tools resolve only from PATH entries outside the project.
|
||||
- **0.39.2:** `apm audit --ci` fails on lock fields this apm does not know.
|
||||
- **0.39.3:** outside CI, the first `apm install --frozen` after an `apm install` takes a verified fast path.
|
||||
- **Audit checks:** the baseline set has grown, so the total behind `N of M check(s) failed` is not fixed (**source**).
|
||||
- Baseline: `manifest-parse`, `manifest-missing`, `lockfile-exists`, `ref-consistency`, `deployment-ledger-owners`, `deployed-files-present`, `exec-status-current`, `no-orphaned-packages`, `lockfile-targets-current`, `skill-subset-consistency`, `config-consistency`, `native-mcp-ownership`.
|
||||
- Conditional: `native-mcp-drift` and `kept-mcp-entries`.
|
||||
- Always on: `content-integrity`, `local-bundle-hooks`, `hook-approval-pins`, `includes-consent` (advisory), and `drift`.
|
||||
|
||||
## Executables and approvals
|
||||
|
||||
- **0.37.0 (#3918):** `apm audit --ci` fails MCP servers the lock admits but `apm.yml` does not approve. Use `apm approve <pkg>` instead of `--trust-transitive-mcp`.
|
||||
- **0.37.0:** approvals can be pinned to content. Older clients reject pinned approvals.
|
||||
- **0.38.0 (#4688):** a hook pin covers every file deployed with the hook. Re-approve hook packages once.
|
||||
- **0.38.1:** `apm audit --ci` fails on merged hook entries that match a denied or unapproved package's hook and have no ownership evidence.
|
||||
- **Ordinary grants stay version-blind (source).** A `hooks: true` grant keyed `pkg#1.2.3` still matches any version. See `approvals-and-executables.md`.
|
||||
|
||||
## Hooks
|
||||
|
||||
- **0.36.0 (#3613):** hook filenames no longer route hooks to targets, so every hook file reaches every targeted harness. To limit a hook to one target, declare `targets:` in the package `apm.yml`, or narrow the dependency with object-form `targets:`. When the old routing kept a target from a file, install fails for that package and names the file.
|
||||
- **0.36.0:** Copilot hook events that have a Claude equivalent are written to `.claude/settings.json` under the Claude name.
|
||||
- **0.38.1 and 0.39.0:**
|
||||
- Edited hook entries and scripts are kept. Install exits 1 when an edited one blocks new content.
|
||||
- A `.claude/settings.json` that apm created is deleted when its last entry leaves. One that apm did not create is kept, with a warning.
|
||||
- Hooks merge in full-install order.
|
||||
- **0.39.0 (#5600):** only hook commands that stay inside the package and use no shell expansion are deployed. Shell expansion means `$(...)`, backticks, `eval`, here-docs and subshells.
|
||||
|
||||
## Prompts and commands
|
||||
|
||||
- **0.39.0 (#4910 and others):** on the Claude target, apm keeps Claude Code command keys:
|
||||
- `when_to_use`, `disable-model-invocation`, `user-invocable`, `disallowed-tools`, `effort`;
|
||||
- `context`, `agent`, `background`, `shell`.
|
||||
|
||||
`hooks` is still withheld, with a warning. In 0.28.0 only `description`, `allowed-tools`, `model`, `argument-hint` and `input` survived. See `prompt-primitive-schema.md`.
|
||||
- **0.39.0:** the dropped-keys message is shown only with `--verbose`. It is an info message, not a warning.
|
||||
|
||||
## Instructions and root context files
|
||||
|
||||
- **0.38.0:** Claude instructions scoped to `**` or to a directory move from `.claude/rules/` into `AGENTS.md`, which `CLAUDE.md` imports. A hand-authored `CLAUDE.md` needs `@AGENTS.md`.
|
||||
- **0.39.0 (#5394):** install-only projects keep the 0.37 `.claude/rules/` layout. A hand-authored root `CLAUDE.md` without the import, or a hand-authored `AGENTS.md` without managed-section markers, keeps every instruction in `.claude/rules/`, with a warning. See `instructions-target-mapping.md`.
|
||||
|
||||
## CLI
|
||||
|
||||
- **0.36.0:** `apm export-patch` is added.
|
||||
- **0.37.0:** `apm init --plugin` and `apm init --marketplace` exit 2. Use `apm plugin init` or `apm marketplace init` instead.
|
||||
- **0.37.0:** approvals are pinned to content, and `apm approve` and `apm deny` manage them.
|
||||
- **`apm outdated`:** still has no `--json`. Its summary line `<N> outdated dependency/dependencies found` is unchanged in source. Its columns are Package, Current, Wanted (registry rows only), Latest, Status and Source.
|
||||
- **`apm audit`:** supports `-f text|json|sarif|markdown` and `-o PATH`. JSON is the stable machine format. `markdown` is not allowed with `--ci`.
|
||||
@@ -7,11 +7,13 @@ source_keys:
|
||||
- apm-docs-cli-run
|
||||
- apm-docs-cli-compile
|
||||
- apm-cli-0-28-0-prompt-experiments
|
||||
- apm-v0-39-3-source
|
||||
- apm-v0-39-3-changelog
|
||||
---
|
||||
|
||||
## What this covers
|
||||
|
||||
Constraints that surprise a prompt author. Items are marked **observed** when they were reproduced on the installed apm 0.28.0 in a throwaway project with local-path packages, and **doc** when they come only from the published docs. Where an observation disagrees with a doc statement, the observation wins and the disagreement is noted. Claude Code, Cursor and Gemini runtime behaviour on the emitted files was not tested.
|
||||
Constraints that surprise a prompt author. **Version note:** every **observed** item below was observed on apm 0.28.0 and has not been re-run on 0.39.x. The changes known from the 0.39.3 source and CHANGELOG are listed under "Changed in 0.39.x" at the end. Items are marked **observed** when they were reproduced on the installed apm 0.28.0 in a throwaway project with local-path packages, and **doc** when they come only from the published docs. Where an observation disagrees with a doc statement, the observation wins and the disagreement is noted. Claude Code, Cursor and Gemini runtime behaviour on the emitted files was not tested.
|
||||
|
||||
## Discovery
|
||||
|
||||
@@ -72,3 +74,15 @@ Parameters are interpolated into any `.prompt.md` the script references and are
|
||||
## Not tested
|
||||
|
||||
The experimental targets (hermes, openclaw, copilot-cowork, grok-cloud, copilot-app), because enabling them writes global config. Claude Code, Cursor and Gemini runtime handling of the emitted files.
|
||||
|
||||
## Changed in 0.39.x (from source and CHANGELOG, not observed)
|
||||
|
||||
- On the `claude` target the Claude-native command keys are kept rather than dropped:
|
||||
- `when_to_use`, `disable-model-invocation`, `user-invocable`, `disallowed-tools`, `effort`;
|
||||
- `context`, `agent`, `background`, `shell`.
|
||||
|
||||
So the 0.28.0 drop list above (which named `agent`) no longer holds for Claude. Cursor, OpenCode, Windsurf and grok-build still drop these keys. See `prompt-primitive-schema.md`.
|
||||
- The dropped-keys message is an info line shown only with `--verbose`, so a default install no longer reports dropped keys at all.
|
||||
- Frontmatter `hooks` on a command is withheld with a warning.
|
||||
- A non-string frontmatter key (for example `1:`) skips that one command with a warning, and the other commands still install.
|
||||
- Hidden-Unicode, collision and stale-cleanup behaviour were not re-checked. 0.38 and 0.39 changed how edited deployed files are kept (see `migration-0-28-to-0-39.md`), so the "hand-edited file is silently overwritten" item above is likely stale.
|
||||
@@ -5,9 +5,26 @@ source_keys:
|
||||
- apm-github-repo
|
||||
- apm-docs-author-prompts
|
||||
- apm-docs-llms-full
|
||||
- apm-v0-39-3-source
|
||||
- apm-v0-39-3-changelog
|
||||
---
|
||||
|
||||
Per-target output, key survival and the doc inconsistencies are in `prompt-target-mapping.md` and `prompt-gotchas.md`. The published "Author a prompt" page lists five preserved keys: `description`, `input`, `allowed-tools`, `model`, `argument-hint`. Where the section below says four keys are preserved, read that as four plus `input`, which is consumed into `arguments:` on Claude. Both the page and the installed 0.28.0 source agree on this set.
|
||||
Per-target output, key survival and the doc inconsistencies are in `prompt-target-mapping.md` and `prompt-gotchas.md`.
|
||||
|
||||
**Version note.** This file was first verified on apm 0.28.0. The Claude key set changed in 0.39.0; the section "Claude command keys in 0.39.x" below is the current behaviour, read from the v0.39.3 source. In 0.28.0 the shared set was five keys: `description`, `input`, `allowed-tools`, `model`, `argument-hint`, where `input` is consumed into `arguments:` on Claude. Every other key was dropped on every Claude-family target.
|
||||
|
||||
## Claude command keys in 0.39.x
|
||||
|
||||
- **Shared keys, kept on every Claude-family target:** `description`, `allowed-tools` (alias `allowedTools`), `model`, `argument-hint` (alias `argumentHint`), `input`.
|
||||
- **Claude-native keys, kept only when the target is `claude`:**
|
||||
- `when_to_use`, `disable-model-invocation`, `user-invocable`, `disallowed-tools`, `effort`;
|
||||
- `context`, `agent`, `background`, `shell`.
|
||||
|
||||
Cursor, OpenCode, Windsurf and the other targets that reuse the command transformer still drop them.
|
||||
- **`arguments`:** an authored `arguments` is kept verbatim only on Claude, and only when the file has no `input` key at all. An `input` key always wins, even when it is empty or every name in it was rejected.
|
||||
- **`hooks`:** withheld on purpose. The command is deployed without its hooks, and install warns `frontmatter hooks withheld`. apm does not yet run command hooks through its executable-approval gate.
|
||||
- **Other keys:** still dropped. The dropped-keys message is now an info line shown only with `--verbose`, no longer an always-on warning.
|
||||
- **Consequence:** a prompt with `disable-model-invocation: true` deploys with that key to `.claude/commands/<name>.md` on 0.39.0 and later. 0.28.0 silently stripped it.
|
||||
|
||||
## File location, naming, and frontmatter
|
||||
|
||||
@@ -33,7 +50,7 @@ There is no single closed frontmatter schema — APM's P1 "no invented primitive
|
||||
**Claude Code target — real reconstruction into a slash command, with field-dropping.** There is no `prompts:` key at all in Claude's `TargetProfile.primitives` dict; instead prompts route through the shared `CommandIntegrator`, which transforms `.prompt.md` → Claude custom slash command markdown. `CommandIntegrator._transform_prompt_to_command()`:
|
||||
|
||||
- Strips the `.prompt.md` suffix from the filename to derive `command_name`.
|
||||
- Builds an entirely new frontmatter object containing **only** these preserved keys: `description`, `allowed-tools` (accepts `allowedTools` alias), `model`, `argument-hint` (accepts `argumentHint` alias).
|
||||
- Builds an entirely new frontmatter object containing **only** the preserved keys. In 0.28.0 these were `description`, `allowed-tools` (alias `allowedTools`), `model` and `argument-hint` (alias `argumentHint`). From 0.39.0 the `claude` target also keeps the Claude-native keys listed above.
|
||||
- Maps APM's `input:` list to Claude's `arguments:` list, and synthesizes `argument-hint` from it if not already set.
|
||||
- Rewrites body placeholders `${input:name}` / `${{input:name}}` to Claude's native `$name` syntax via regex substitution.
|
||||
- Computes `dropped_keys = source_frontmatter_keys - preserved_keys` and surfaces it as an install-time diagnostic warning — so `author`, `mcp`, `parameters`, and any other non-listed key are silently dropped from the compiled output but *not* silently dropped from the user's awareness (a warning fires).
|
||||
@@ -44,7 +61,7 @@ There is no single closed frontmatter schema — APM's P1 "no invented primitive
|
||||
| Target | Output path | Transform |
|
||||
|---|---|---|
|
||||
| Copilot CLI | `.github/prompts/<name>.prompt.md` | Verbatim byte copy (links resolved) |
|
||||
| Claude Code | `.claude/commands/<name>.md` | Reconstructed: only `description`/`allowed-tools`/`model`/`argument-hint`/`arguments` survive; `input:` → `arguments:`; `${input:x}` → `$x` |
|
||||
| Claude Code | `.claude/commands/<name>.md` | Reconstructed. In 0.28.0 only `description`/`allowed-tools`/`model`/`argument-hint`/`arguments` survive; from 0.39.0 the Claude-native keys survive too. `input:` → `arguments:`; `${input:x}` → `$x` |
|
||||
|
||||
Invocation surface differs correspondingly: Copilot exposes it via the prompts picker UI (select by name); Claude exposes it as `/<name> <args>` (same pattern Cursor, OpenCode, Gemini CLI, and Windsurf's workflows menu use for their own compiled copies).
|
||||
|
||||
@@ -52,6 +69,6 @@ Invocation surface differs correspondingly: Copilot exposes it via the prompts p
|
||||
|
||||
- **Input-name validation is real, not just documentation.** `_extract_input_names()` enforces `[A-Za-z][\w-]{0,63}` on every name pulled from `input:`; anything that fails is dropped from `arguments:` and reported as a warning listing up to 5 rejected names (`input: rejected N invalid name(s) ... `). A malformed `input:` entry does not fail the install — it silently loses that one argument.
|
||||
- **Filename-derived identity is security-checked.** `integrate_commands_for_target` calls `validate_path_segments(base_name, context="command filename")` specifically to reject a package shipping a `.prompt.md` file with a manipulated relative name (e.g. `../../evil.prompt.md`) that would otherwise escape the target commands directory.
|
||||
- **The dropped-key warning is the only signal a Claude-only author gets** that Cursor-specific frontmatter (`author`, `mcp`, `parameters`) never reached the deployed file — there is no error, no hard failure, and no config flag to preserve those keys for Claude; the shared transformer's preserved-key list is fixed in code (`_PRESERVED_COMMAND_KEYS`), not configurable per package.
|
||||
- **The dropped-key message is the only signal a Claude-only author gets** that Cursor-specific frontmatter (`author`, `mcp`, `parameters`) never reached the deployed file. There is no error, no hard failure, and no config flag to preserve those keys. The preserved-key lists are fixed in code (`_PRESERVED_COMMAND_KEYS`, and `_CLAUDE_NATIVE_COMMAND_KEYS` from 0.39.0); a package cannot configure them. From 0.39.0 the message appears only with `--verbose`.
|
||||
- **No dedicated `Prompt`/`PromptPrimitive` validation class exists** in `apm_cli/models/validation.py` or `apm_cli/primitives/models.py` — same gap pattern documented for the agent primitive. `apm.yml`'s `type: prompts` package-content-type ("Commands/prompts only, no instructions or skills") is validated at the package-type-detection level, not the individual-prompt level.
|
||||
- Slash commands and prompts share one source directory and one glob (`.apm/prompts/*.prompt.md`) — there is no separate `.apm/commands/` primitive; "command" is purely a per-target compiled *name* for the same source file, not a distinct authoring primitive.
|
||||
@@ -6,12 +6,15 @@ source_keys:
|
||||
- apm-docs-producer-ramp
|
||||
- apm-github-repo
|
||||
- apm-cli-0-28-0-prompt-experiments
|
||||
- apm-v0-39-3-source
|
||||
---
|
||||
|
||||
## Scope and confidence
|
||||
|
||||
This file maps one `.apm/prompts/<name>.prompt.md` source to what each apm target receives. The paths and transforms below were **observed** on apm 0.28.0 using local-path packages in a throwaway project, and cross-checked against the published docs and the installer source. Where docs and observation disagree, the observation is used and `prompt-gotchas.md` records the disagreement. Runtime behaviour in the receiving tools was not tested.
|
||||
|
||||
**Version note:** the output paths below are unchanged in the 0.39.3 source. What changed is which frontmatter keys the `claude` row keeps. From 0.39.0 it keeps the Claude-native command keys, `disable-model-invocation` among them. See `prompt-primitive-schema.md`.
|
||||
|
||||
## Output per target
|
||||
|
||||
| Target | Output path | Form |
|
||||
|
||||
@@ -92,3 +92,63 @@ Note: `releasing.md`'s `--check-clean`/`--check-versions` scope, `apm pack` exit
|
||||
- **Description:** The installed apm-cli 0.28.0 exercised with local-path throwaway packages in a scratchpad outside the repo: root-level and nested prompt discovery, manifest `type:` values, compile on prompts-only packages, per-target install output and dropped-key warnings, input-name and YAML edge cases, collision, stale-cleanup and hand-edit behaviour, hidden-Unicode scanning and audit, and `apm pack --format plugin`. Source files `command_integrator.py`, `prompt_integrator.py` and `plugin_exporter.py` were read to cross-check. Experimental targets and `apm run` were not exercised.
|
||||
- **Contributing files:** prompt-target-mapping.md, prompt-gotchas.md
|
||||
- **Status:** `extracted`
|
||||
|
||||
## apm-v0-39-3-source
|
||||
|
||||
- **URL:** https://github.com/microsoft/apm/tree/v0.39.3/src/apm_cli
|
||||
- **Description:** apm source at tag v0.39.3. Read from a local clone that `git describe` confirmed as v0.39.3, covering:
|
||||
- **lockfile and audit:** lockfile versions and hashing, the compatibility warning and `audit --ci` certification, `exact_branch_or_tag_sha`, commit reachability, libyaml loading, the audit baseline checks and output strings, and `apm outdated` options and output;
|
||||
- **approvals:** executables grants and pins, trust, and the hook fingerprint;
|
||||
- **integrators:** hook, command, agent and skill;
|
||||
- **instructions:** `claude_agents_md` and root-context protection;
|
||||
- **CLI:** the command table, init, pack, update, approve and export-patch;
|
||||
- **package metadata:** `pyproject.toml`.
|
||||
- **Contributing files:** lockfile-and-compatibility.md, approvals-and-executables.md, migration-0-28-to-0-39.md, cli-reference.md, installation.md, prompt-primitive-schema.md, prompt-gotchas.md, prompt-target-mapping.md, hooks-primitive-schema.md, instructions-target-mapping.md
|
||||
- **Status:** `extracted`
|
||||
|
||||
## apm-v0-39-3-changelog
|
||||
|
||||
- **URL:** https://github.com/microsoft/apm/blob/v0.39.3/CHANGELOG.md
|
||||
- **Description:** CHANGELOG entries from 0.29.0 to 0.39.3. They cover breaking changes and upgrade notes on lockfile v4, the 0.39.2 lock refusal, `--frozen` hashes, exact refs, commit verdicts, approvals and hook pins, hook filename routing, the Claude command keys, the AGENTS.md instruction layout, targets and CLI removals.
|
||||
- **Contributing files:** lockfile-and-compatibility.md, approvals-and-executables.md, migration-0-28-to-0-39.md, prompt-primitive-schema.md, prompt-gotchas.md, hooks-primitive-schema.md, instructions-target-mapping.md, instructions-gotchas.md
|
||||
- **Status:** `extracted`
|
||||
|
||||
## apm-v0-39-3-docs
|
||||
|
||||
- **URL:** https://github.com/microsoft/apm/tree/v0.39.3/docs/src/content/docs
|
||||
- **Description:** the docs source behind https://microsoft.github.io/apm/, read at tag v0.39.3 from the same clone. Pages used:
|
||||
- **reference:** lockfile-spec, compatibility and baseline-checks;
|
||||
- **CLI reference:** install, audit, outdated, approve, export-patch, compile, pack, marketplace and uninstall;
|
||||
- **consumer:** run-in-ci and update-and-refresh;
|
||||
- **producer:** write-primitives;
|
||||
- **getting started:** installation;
|
||||
- **spec:** the OpenAPM spec.
|
||||
|
||||
The published installation page was also fetched, and it matched.
|
||||
- **Contributing files:** lockfile-and-compatibility.md, approvals-and-executables.md, migration-0-28-to-0-39.md, cli-reference.md, installation.md, hooks-primitive-schema.md, instructions-target-mapping.md
|
||||
- **Status:** `extracted`
|
||||
|
||||
## pypi-apm-cli
|
||||
|
||||
- **URL:** https://pypi.org/pypi/apm-cli/json
|
||||
- **Description:** PyPI metadata for apm-cli: the 0.39.2 and 0.39.3 release dates, wheel and sdist availability, yank status, `requires_python >=3.11` and `requires_dist`.
|
||||
- **Contributing files:** installation.md
|
||||
- **Status:** `extracted`
|
||||
|
||||
## apm-cli-0-39-3-uv-experiments
|
||||
|
||||
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
|
||||
- **Description:** throwaway uv projects built in a scratchpad outside any repo with uv 0.11.24. They tested:
|
||||
- `uv add --dev apm-cli==0.39.3` and `uv run apm --version`;
|
||||
- the `[tool.uv] package = false` form;
|
||||
- `uv run --frozen --offline` with a warm cache and with a cold cache;
|
||||
- `uvx --offline` against a cache warmed by `uv add`.
|
||||
- **Contributing files:** installation.md
|
||||
- **Status:** `extracted`
|
||||
|
||||
## context7-microsoft-apm-0-39-3
|
||||
|
||||
- **URL:** context7:/microsoft/apm
|
||||
- **Description:** a Context7 query for apm 0.39.3 made during this refresh. It returned "Invalid API key", so no Context7 content informs the 0.39.3 material.
|
||||
- **Contributing files:** none
|
||||
- **Status:** `no content extracted`
|
||||
Reference in new issue
Block a user