Compare commits

..
Author SHA1 Message Date
Defame1297andClaude Opus 5.5 e6d680a4c5 fix(kyberforge): apply the #273 review to the apm 0.39.3 refresh
- apm-workflow and apm-orchestrate always pass --project to uv run,
  because uv run outside the project silently runs the PATH apm. The
  agent now checks that the reported version equals the pin, or is
  0.39.2 or later where nothing pins it, not only that it exits 0.
- A pin is a quoted apm-cli or apm_cli requirement plus a uv.lock,
  matching the SessionStart hook, in apm-install, uv-pin.md and
  apm-workflow.
- uv-pin.md spells the hook's exact invocation and its environment
  check, and says scripts always pass --project.
- instructions-author and its research note: a Claude rule leaves
  .claude/rules/ only when compile actually wrote it into AGENTS.md;
  install-then-compile dedups it.
- prompt-author: Kiro strips every key with a warning, not silently.
- Record the 0.39.3 executables findings in approvals-and-executables.md
  and the output-profile and type-routing facts in cli-reference.md, and
  cite those digests.
- forge's routing table notes that Kiro gets the body only.

Refs: #273

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-02 12:35:19 +00:00
Defame1297andClaude Opus 5.5 c68b67301a chore(release): bump kyberforge to 2.3.1 and delivery to 0.8.1
Patch bumps for the apm 0.39.3 refresh of their skills and docs. The
root executables.allow keys follow at full identity, the catalog moves to
0.9.2, and the marketplace is re-packed. Refresh the root apm.yml grant
comment's quote of the gate-disabled message to the 0.39.3 wording; the
rest of that comment was re-checked on 0.39.3 and holds.

Refs: #273

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-02 11:59:17 +00:00
Defame1297andClaude Opus 5.5 aaada85e26 docs(plugins): describe full-identity hook grants on apm 0.39
The kyberforge and delivery hook docs still described apm 0.28.0: a bare
kyberforge#<version> or delivery key matching, and "parked pending
approval" printed for a granted package. On 0.39.3 a bare key parks the
hook and deploys nothing with exit 0, the full
<host>/<owner>/<repo>/<path> identity is required, and the #<version>
suffix is still ignored when matching. Re-run the copilot and codex hook
placement on 0.39.3: with codex in targets, apm now creates .codex/
itself.

Refs: #273

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-02 11:59:17 +00:00
Defame1297andClaude Opus 5.5 0fb106b731 fix(kyberforge): run the repo-pinned apm from apm-workflow
apm-workflow spelled every command as bare apm, which in a repo that pins
apm with uv runs whatever is on PATH, possibly an apm that refuses the
repo's lockfile. Add a step that checks for the pin and runs
uv run --frozen apm there, and the PATH apm otherwise. apm-orchestrate's
version check now probes the same apm.

Bring the references level with apm 0.39.3: the Copilot marketplace
output profile, get_effective_type() still ignoring the declared type,
plain apm audit's exit codes, the uv form of the CI example, and audit
--ci needing an apm at least as new as the lock's writer. Bump
metadata.version to 1.0.4.

Refs: #273

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-02 11:59:17 +00:00
Defame1297andClaude Opus 5.5 b81af32425 feat(kyberforge): document the per-repo uv pin of apm in apm-install
Add a dispatch on where apm comes from: a repo that pins apm with uv, a
repo that wants the pin, or a global install. The new uv-pin reference
covers the pyproject.toml dev group, the committed uv.lock, running as
uv run --frozen apm, the one-time online sync, upgrading the pin, and why
uvx and uv tool are not used. It closes with a worked example of one
pinned and one unpinned repo.

Raise the pip floor to Python 3.11, which apm requires since 0.36.0, add
the package-manager installs, and note the 0.39.2 minimum for v4 locks.
Bump metadata.version to 1.0.2.

Refs: #273

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-02 11:59:17 +00:00
Defame1297andClaude Opus 5.5 5f9c805522 fix(kyberforge): bring prompt-author level with apm 0.39.3
apm 0.39 keeps Claude Code command keys such as disable-model-invocation
on the claude target and still drops them on cursor, opencode, windsurf
and grok-build. It withholds hooks, names dropped keys only under
--verbose, deploys a body-only prompt to Kiro, fails install on a
hand-edited deployed command, and writes nothing when a prompt carries a
critical hidden character.

Update the Gotchas, the frontmatter contract, the compatibility line, the
template and every reference. Re-cite forge's prompt-routing table on the
0.39.3 run. Bump prompt-author to 0.1.1 and forge to 1.0.6.

Refs: #273

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-02 11:59:17 +00:00
Defame1297andClaude Opus 5.5 598f88b536 fix(kyberforge): bring instructions-author level with apm 0.39.3
The skill still described apm 0.28.0. On 0.39.3 an unquoted applyTo fails
install and deploys nothing, the Claude compile writes AGENTS.md behind a
CLAUDE.md that only imports it, dedup is per instruction, unscoped rules
retire from .claude/rules/ once AGENTS.md carries them, and install skips
a hand-authored rule rather than overwriting it.

Update the Gotchas, the compatibility line and the target-mapping, schema,
verify, improve and create references, the template comment, the tests
README and the bats header. Bump metadata.version to 0.1.1.

Refs: #273

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-02 11:59:17 +00:00
Defame1297andClaude Opus 5.5 bb84e4ac13 docs(kyberforge): record the apm 0.39.3 re-run of the primitive experiments
Re-run the 0.28.0 instruction, prompt and executable-grant experiments on
the repo-pinned apm 0.39.3 in throwaway packages, and record what changed
in instructions-gotchas.md and prompt-gotchas.md. Register the run as the
apm-cli-0-39-3-experiments source so the skills refreshed under #273 can
cite it.

Refs: #273

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-02 11:59:17 +00:00
59 changed files with 551 additions and 354 deletions

No files matched your search

+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "holocron",
"description": "AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.",
"version": "0.9.1",
"version": "0.9.2",
"owner": {
"name": "Mortis",
"url": "https://git.rkdr.net/Mortis/"
@@ -10,7 +10,7 @@
{
"name": "kyberforge",
"description": "Skills and agents for creating, maintaining, and managing an apm plugin marketplace for Claude Code and GitHub Copilot.",
"version": "2.3.0",
"version": "2.3.1",
"category": "Developer Tools",
"source": "./plugins/kyberforge"
},
@@ -59,7 +59,7 @@
{
"name": "delivery",
"description": "Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.",
"version": "0.8.0",
"version": "0.8.1",
"category": "Developer Tools",
"source": "./plugins/delivery"
},
+3 -3
View File
@@ -48,16 +48,16 @@ apm_modules/
.claude/hooks/
# `apm pack` bundle output. The pre-push gate runs pack with --dry-run, so this
# only appears after a non-dry-run `apm pack` during a release; it is not repo content.
# only appears after a bare `apm pack` during a release; it is not repo content.
build/
# `apm pack`'s manifest for the *root* package. Emitted beside the marketplace
# manifest by `apm pack` run with no flags, and never tracked on any branch — the repo's
# manifest by a bare `apm pack`, and never tracked on any branch — the repo's
# own paths hide it, since the apm-pack-check-clean pre-push hook, the only
# thing that runs pack here, passes --dry-run. It is NOT write-only output:
# pack reads an existing copy back in preference to apm.yml and only rewrites
# it with --force, so a stale copy leaks an old version and config into every
# bundle. Pack releases with `uv run --frozen apm pack --force`, or delete this file first. Scoped
# bundle. Pack releases with `apm pack --force`, or delete this file first. Scoped
# to the file, not the directory: the sibling .claude-plugin/marketplace.json is
# compiled output that IS committed and must stay tracked.
/.claude-plugin/plugin.json
+20 -30
View File
@@ -80,48 +80,41 @@ repos:
- id: apm-audit-ci
name: apm audit --ci
description: Run apm's producer-side CI gate over the root manifest AND each plugin package, via scripts/apm-audit-ci.sh. On the root manifest apm 0.39.3 runs fifteen checks -- lockfile-exists, ref-consistency, deployment-ledger-owners, deployed-files-present, no-orphaned-packages, lockfile-targets-current, skill-subset-consistency, config-consistency, native-mcp-ownership, content-integrity, local-bundle-hooks, hook-approval-pins, exec-status-current, includes-consent, drift -- so it is both a hidden-Unicode scan and a drift gate that replays the install and diffs it. In a plugin package it runs two, lockfile-exists and a content-integrity row that scans no package source; the script waives lockfile-exists when that package declares dependencies, because a package is not an install root (ADR-0026). The waiver never applies to the root and never covers a second failing check. It does NOT enforce an org policy; see the comment below for why. Reference:plugins/kyberforge/.apm/skills/apm-workflow/references/audit.md
description: Run apm's producer-side CI gate over the root manifest AND each plugin package, via scripts/apm-audit-ci.sh. On the root manifest it runs ten checks -- lockfile-exists, ref-consistency, deployment-ledger-owners, deployed-files-present, no-orphaned-packages, skill-subset-consistency, config-consistency, content-integrity, includes-consent, drift -- so it is both a hidden-Unicode scan and a drift gate that replays the install and diffs it. In a plugin package it runs one, lockfile-exists, which the script waives when that package declares dependencies, because a package is not an install root (ADR-0026). The waiver never applies to the root and never covers a second failing check. It does NOT enforce an org policy; see the comment below for why. Reference:plugins/kyberforge/.apm/skills/apm-workflow/references/audit.md
entry: scripts/apm-audit-ci.sh
language: system
stages: [pre-push]
pass_filenames: false
always_run: true
# What this hook actually runs, read off apm 0.39.3's own compliance
# What this hook actually runs, read off apm 0.28.0's own compliance
# table by invoking `apm audit --ci` at the repo root and in
# plugins/lint/ (holocron#272; first done on 0.28.0, which ran ten
# root checks and one plugin check). Long form in docs/spec/gates.md,
# "apm-audit-ci".
# plugins/lint/. Long form in docs/spec/gates.md, "apm-audit-ci".
#
# * ROOT MANIFEST -- fifteen checks: lockfile-exists, ref-consistency,
# * ROOT MANIFEST -- ten checks: lockfile-exists, ref-consistency,
# deployment-ledger-owners, deployed-files-present,
# no-orphaned-packages, lockfile-targets-current,
# skill-subset-consistency, config-consistency, native-mcp-ownership,
# content-integrity, local-bundle-hooks, hook-approval-pins,
# exec-status-current, includes-consent, drift. It is a drift gate: it
# no-orphaned-packages, skill-subset-consistency, config-consistency,
# content-integrity, includes-consent, drift. It is a drift gate: it
# replays the install cache-only and diffs the scratch result against
# the working tree. Root lockfile-exists is not vacuous -- the root
# declares dependencies, so it reports `Lockfile present`.
# * PLUGIN MANIFESTS -- two checks: lockfile-exists, and a
# content-integrity row that scans no package source (it passed with
# a planted bidi override). lockfile-exists is conditional, and
# * PLUGIN MANIFESTS -- one check: lockfile-exists. Conditional, and
# vacuous while every plugin apm.yml declares
# `dependencies: {apm: [], mcp: []}`: it reports `No dependencies
# declared -- lockfile not required` and arms itself the moment one
# does not (verified by adding a git dependency to
# plugins/lint/apm.yml). Everything else in the root list is
# root-only, because
# plugins/lint/apm.yml). Everything else above is root-only, because
# only the root install has a lockfile, a deployment ledger and
# deployed files to check. Running every plugin package is what
# makes lockfile-exists reachable for them at all -- the root-only
# invocation audits the root manifest and nothing else.
# THAT ARMING NOW HAPPENS: plugins/mattpocock declares real dependencies,
# and there is no green state for it -- without a package lockfile
# lockfile-exists fails, and with one it passes and arms the rest of
# the root set, where drift then demands the dependency's skills be deployed
# lockfile-exists fails, and with one it passes and arms the other
# nine, where drift then demands the dependency's skills be deployed
# INSIDE the package. A package is not an install root, so
# scripts/apm-audit-ci.sh waives that single check for a package and
# nothing else (ADR-0026). Dropping --ci for packages would have been
# smaller and is wrong: verified on apm 0.28.0 and 0.39.3, plain `apm audit`
# smaller and is wrong: verified on apm 0.28.0, plain `apm audit`
# exits 0 on a dependency entry missing its git/path/registry field
# while --ci exits 1 naming it, and malformed-dependency detection is
# the whole reason packages are audited.
@@ -132,14 +125,13 @@ repos:
# check. Both claims were wrong. What is true is that the STANDALONE
# mode differs: plain `apm audit` (--ci refuses to combine with
# --file/--strip/--dry-run/PACKAGE) run in a plugin directory reports
# `No recognized deployed primitives found -- nothing to scan` on
# 0.39.3 (`No apm.lock.yaml found -- nothing to scan` on 0.28.0) and
# exits 0, because only the root has a lockfile.
# * MANIFEST-PARSE IS A ROW ON 0.39.3, not on 0.28.0. A dependency entry
# missing its git/path/registry field now yields a one-row table with
# a failing manifest-parse row (`Cannot parse apm.yml: ...`); 0.28.0
# failed the invocation before building the table. A parsable
# manifest gets no such row.
# `No apm.lock.yaml found -- nothing to scan` and exits 0, because
# only the root has a lockfile.
# * MANIFEST-PARSE IS NOT A CHECK in apm 0.28.0's table, and an earlier
# revision of this comment named it as one. Parsing is still
# enforced -- a dependency entry missing its git/path/registry field
# fails with `Cannot parse apm.yml` -- but it fails the invocation
# before the table is built, so it never appears as a row.
# * POLICY IS NOT ENFORCED. `apm audit --ci` discovers an org policy
# from the git remote, and apm's discovery only understands
# github.com and Azure DevOps. This repo's remote is a self-hosted
@@ -154,10 +146,8 @@ repos:
# serve one. A gate that can never go green is not a gate. Revisit if
# this repo ever gains a policy source apm can actually reach.
#
# Takes 70-90 s for the root plus every plugin through `uv run` on
# apm 0.39.3 (about 0.5 s per package on 0.28.0). Needs no network ONCE
# `uv sync --frozen` and `uv run --frozen apm install` have each run
# once -- the root marketplace has no remote package
# Costs ~0.5s per package. Needs no network ONCE `apm install` has
# populated apm_modules/ -- the root marketplace has no remote package
# entries, so the install replay is cache-only. On a FRESH CLONE there
# is no cache: deployed-files-present fails outright, and drift and
# config-consistency clone from the holocron remote. See README.md's
+3 -4
View File
@@ -28,10 +28,9 @@ Fall back to raw shell only when no skill covers it.
## Session rules
- **Do not add repo-owned keys to `.claude/settings.json`.** apm treats it as its own deployed artifact and `apm audit --ci` replays the install and diffs, so anything apm would not have written is permanent drift that fails the `apm-audit-ci` pre-push hook. A hook you want here is authored in `plugins/<name>/.apm/hooks/` and deployed by apm, never hand-written into that file. The `SessionStart` entry already in it is exactly that: kyberforge authors it in `plugins/kyberforge/.apm/hooks/hooks.json` and apm merges it in, so it is apm's own output, it is what the replay expects, and it belongs in the commit — do not strip it (ADR-0019). Machine-specific settings go in the gitignored `.claude/settings.local.json`; shared enforcement goes in `.pre-commit-config.yaml`.
- **Run apm only as `uv run --frozen apm …`.** The root `pyproject.toml` and `uv.lock` pin apm 0.39.3 (ADR-0034). A bare `apm` reaches whatever is on `PATH`, possibly an older apm that refuses the v4 `apm.lock.yaml`.
- **`apm.lock.yaml` turning up modified is expected, not a bug.** kyberforge's `SessionStart` hook keeps the install current on launch: it runs `uv run --frozen apm update --yes` and rewrites the lock in the process (ADR-0019). On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `uv run --frozen apm install`). This keeps unrelated lock churn out of the branch diff and keeps `apm pack --check-clean` consistent with the committed lock. The session then runs the older `main` that the lock records, which is accepted on a branch, and the next session start refreshes again. A checkout that apm 0.28 deployed or populated needs one-time migration steps, and its first session-start rewrite of the lock can be wrong: see `docs/spec/gates.md`, "apm-audit-ci".
- **A `.apm/` edit is not live until it is on the remote's `main`.** Root `apm.yml`'s first-party dependencies resolve from the holocron remote, unpinned against the default branch, so pushing a feature branch does not deploy it (ADR-0019). `uv run --frozen apm install` deploys from the lock; `uv run --frozen apm update` is what re-resolves refs.
- **No pre-push hook needs the network — once the two one-time online steps have run.** A new checkout runs `uv sync --frozen`, then `uv run --frozen apm install`, each online once. Root `apm.yml`'s marketplace has no remote package entries, so every hook then resolves locally. The guarantee is a property of a synced `.venv/` and a populated `apm_modules/`, not of the hook set: on a fresh clone `apm-audit-ci`'s `deployed-files-present` fails outright, and its `drift` and `config-consistency` install-replays have no cache to replay from and clone from the remote. (`docs/spec/gates.md`, "Pushing without a network").
- **`apm.lock.yaml` turning up modified is expected, not a bug.** kyberforge's `SessionStart` hook keeps the install current on launch and rewrites the lock in the process (ADR-0019). On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `apm install`). This keeps unrelated lock churn out of the branch diff and keeps `apm pack --check-clean` consistent with the committed lock. The session then runs the older `main` that the lock records, which is accepted on a branch, and the next session start refreshes again.
- **A `.apm/` edit is not live until it is on the remote's `main`.** Root `apm.yml`'s first-party dependencies resolve from the holocron remote, unpinned against the default branch, so pushing a feature branch does not deploy it (ADR-0019). `apm install` deploys from the lock; `apm update` is what re-resolves refs.
- **No pre-push hook needs the network — once `apm install` has run.** Root `apm.yml`'s marketplace has no remote package entries, so every hook resolves locally. The guarantee is a property of a populated `apm_modules/`, not of the hook set: on a fresh clone `apm-audit-ci`'s `deployed-files-present` fails outright, and its `drift` and `config-consistency` install-replays have no cache to replay from and clone from the remote. Run `apm install` once on a new checkout and the offline guarantee holds from then on (`docs/spec/gates.md`, "Pushing without a network").
- **A plugin `version:` bump that has merged to `main` gets its release tag.** Run `git fetch origin --tags`, then `scripts/tag-plugin-releases.sh`; exit 1 means a tag is missing, and `--apply` creates it locally and prints the push command. The script reads local tags only, so OK means present locally, not published: confirm with `git ls-remote --tags origin '<plugin>-v*'` before calling it done. A tag push is an irreversible publish, not a free Propose-tier push (ADR-0032): show the maintainer the exact tags and that command, and only on their explicit yes in this conversation run exactly it yourself (named tags, never `--tags` or other refs). Agents cut release tags only with the script, which never moves or deletes one; exit 2 means stop and report it to the maintainer, never hand-fix, move or delete a tag (ADR-0033).
- **This repo and Gitea are the only source of truth.** All project state, decisions, and working conventions live here. Do not use an external memory system for this project — cached state diverges from the repo and you get a split brain. Before answering any design or architecture question, check `docs/adr/` for an existing decision.
+1 -1
View File
@@ -154,4 +154,4 @@ Under the `run-tests` pre-push hook, git exported `GIT_DIR` to the hook, so a ba
## 2026-11-26 — A hook's GIT_DIR leaks through any tool that runs git
#204: pushing from a linked worktree left the shared `.git/config` with `core.bare=true` and the worktree on a detached HEAD at the lock-pinned commit. git exports an absolute `GIT_DIR` to hooks run from a linked worktree. `apm-audit-ci` ran `apm audit --ci`, and its drift replay (apm 0.28.0) runs `git init` and `git checkout` in a temp dir with an env copied from `os.environ`. The inherited `GIT_DIR` won, so both operations hit this repo instead of the temp dir. The 2026-11-13 fix did not cover this: it scrubbed the env only inside `tests/run-tests.sh`, and the apm hooks never pass through that file. Fix: `scripts/lib/clean-git-env.sh` unsets the repo-locating vars, and both `scripts/apm-audit-ci.sh` and the new `scripts/apm-pack-check-clean.sh` source it before calling apm. `tests/test-apm-hooks-git-env.sh` reproduces the leak with a stub `apm`. Rule: any hook that shells out to a tool that runs git must scrub `GIT_*` first. Scrubbing one entry point does not protect the others. *2026-12-02 (#272):* apm 0.39.3's `apm_cli/utils/git_env.py` provides `git_subprocess_env`, which strips `GIT_DIR` and the other repo-locating vars. The leak was not re-tested on 0.39.3, and the scrub stays, because the rule is about the hook, not about one tool version.
#204: pushing from a linked worktree left the shared `.git/config` with `core.bare=true` and the worktree on a detached HEAD at the lock-pinned commit. git exports an absolute `GIT_DIR` to hooks run from a linked worktree. `apm-audit-ci` ran `apm audit --ci`, and its drift replay (apm 0.28.0) runs `git init` and `git checkout` in a temp dir with an env copied from `os.environ`. The inherited `GIT_DIR` won, so both operations hit this repo instead of the temp dir. The 2026-11-13 fix did not cover this: it scrubbed the env only inside `tests/run-tests.sh`, and the apm hooks never pass through that file. Fix: `scripts/lib/clean-git-env.sh` unsets the repo-locating vars, and both `scripts/apm-audit-ci.sh` and the new `scripts/apm-pack-check-clean.sh` source it before calling apm. `tests/test-apm-hooks-git-env.sh` reproduces the leak with a stub `apm`. Rule: any hook that shells out to a tool that runs git must scrub `GIT_*` first. Scrubbing one entry point does not protect the others.
+8 -15
View File
@@ -61,26 +61,20 @@ uv run --frozen apm install
pre-commit install -t pre-commit -t commit-msg -t pre-push
```
**`uv sync --frozen`** installs the apm that `uv.lock` pins into `.venv/`.
**`uv sync --frozen`** installs the apm that `uv.lock` pins into `.venv/`. Every apm command in this repo runs as `uv run --frozen apm ...`.
**`uv run --frozen apm install`** deploys the plugins root `apm.yml` lists into `.claude/skills/` and `.claude/agents/`. Both are gitignored install output, *not* authoring source — `plugins/<name>/.apm/` remains the only place to edit. Steps 1 and 2 each need the network once per checkout; the first apm 0.39 install also records commit-reachability verdicts. The install materializes `apm_modules/` (which stays gitignored).
**Run apm only through `uv run --frozen apm`.** A bare `apm` reaches whatever is on `PATH`, possibly an older apm that refuses the v4 `apm.lock.yaml`. The global pipx apm 0.28.0 some machines carry is not used in this repo.
**An existing checkout deployed by apm 0.28 needs one more step before step 2.** Move `.claude/skills`, `.claude/agents` and `.claude/commands` aside (or delete them if they hold no edits), then run `uv run --frozen apm install`. Without that, apm 0.39 refuses to replace the 0.28-deployed files with "no trustworthy local deployment baseline", because 0.28 recorded no deployment evidence for them. apm's own message suggests a bare `apm install`; use the `uv run --frozen` form instead.
**Writing the lock from a checkout whose `apm_modules/` apm 0.28 populated needs a clean cache first.** Before any 0.39 command that writes `apm.lock.yaml` (`uv run --frozen apm update`, or an install that changes the lock), move `apm_modules/` aside and run `uv run --frozen apm install`. Otherwise apm reuses the 0.28-era third-party copies and writes a lock without their `carried_licenses` entries, which a fresh install then contradicts. kyberforge's `SessionStart` hook is such a writer: it runs `uv run --frozen apm update --yes` at session start, so it can write the bad lock before you read this. To recover, discard it with `git checkout -- apm.lock.yaml`, move `apm_modules/` aside, then run `uv run --frozen apm install`. Consuming the committed lock is unaffected and needs only the two setup steps above.
**`apm install`** deploys the plugins root `apm.yml` lists into `.claude/skills/` and `.claude/agents/`. Both are gitignored install output, *not* authoring source — `plugins/<name>/.apm/` remains the only place to edit. Both steps need the network once, and `apm install` materializes `apm_modules/` (which stays gitignored).
**Git hooks** must be wired for **all three stages**. This repo's `.pre-commit-config.yaml` has no `default_install_hook_types`, so a plain `pre-commit install` silently skips `commit-msg` (Conventional Commits) and `pre-push` (the full gate) — the `-t` flags above are not optional. The `pc-run` skill handles this and the troubleshooting around it, if you would rather not remember the flags.
## Keeping the install current
The first-party dependencies in root `apm.yml` are unpinned against the default branch, so deployed skills go stale whenever anyone merges. kyberforge's `SessionStart` hook keeps the install current automatically on launch, rewriting `apm.lock.yaml` in the process — an unexplained modification to it after opening a session is expected, not a bug. On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `uv run --frozen apm install`). The committed lock records a `main` commit too, just an older one. Discarding keeps lock churn unrelated to the branch out of its diff, and keeps the deployed tree consistent with the committed lock that `apm pack --check-clean` reads. The trade-off: the session then runs the older `main` the lock records, which is accepted on a feature branch. The discard also lasts only until the next session start, when the hook finds the lock behind `main` and refreshes again. Mechanism and rationale: `docs/adr/0019-session-start-hook-keeps-the-apm-install-current.md`.
The first-party dependencies in root `apm.yml` are unpinned against the default branch, so deployed skills go stale whenever anyone merges. kyberforge's `SessionStart` hook keeps the install current automatically on launch, rewriting `apm.lock.yaml` in the process — an unexplained modification to it after opening a session is expected, not a bug. On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `apm install`). The committed lock records a `main` commit too, just an older one. Discarding keeps lock churn unrelated to the branch out of its diff, and keeps the deployed tree consistent with the committed lock that `apm pack --check-clean` reads. The trade-off: the session then runs the older `main` the lock records, which is accepted on a feature branch. The discard also lasts only until the next session start, when the hook finds the lock behind `main` and refreshes again. Mechanism and rationale: `docs/adr/0019-session-start-hook-keeps-the-apm-install-current.md`.
Note the difference between the two commands:
- `uv run --frozen apm install` deploys from `apm.lock.yaml`. It does **not** pick up remote changes.
- `uv run --frozen apm update` re-resolves refs. This is the command that pulls in a merged `.apm/` edit.
- `apm install` deploys from `apm.lock.yaml`. It does **not** pick up remote changes.
- `apm update` re-resolves refs. This is the command that pulls in a merged `.apm/` edit.
## Running tests
@@ -103,7 +97,7 @@ pre-commit run --hook-stage pre-push --all-files
See [`docs/spec/gates.md`](docs/spec/gates.md) for what each hook enforces and why.
**Offline?** No pre-push hook needs the network **once `uv sync --frozen` and `uv run --frozen apm install` have each run once, online** (ADR-0034). Root `apm.yml`'s marketplace has no remote package entries (the last one, `mattpocock-skills`, was removed), so `apm-pack-check-clean` resolves everything from local sources, and `apm-audit-ci`'s install-replay is cache-only against a populated install. On a **fresh clone** there is no cache: `apm-audit-ci`'s `deployed-files-present` fails outright, and its `drift` and `config-consistency` checks clone from the holocron remote. The offline guarantee is a property of a synced `.venv/` and a populated `apm_modules/`, not of the hook set — run `uv sync --frozen` and `uv run --frozen apm install` once on a new checkout and it holds from then on.
**Offline?** No pre-push hook needs the network **once `uv sync --frozen` and `apm install` have each run once** (ADR-0034). Root `apm.yml`'s marketplace has no remote package entries (the last one, `mattpocock-skills`, was removed), so `apm-pack-check-clean` resolves everything from local sources, and `apm-audit-ci`'s install-replay is cache-only against a populated install. On a **fresh clone** there is no cache: `apm-audit-ci`'s `deployed-files-present` fails outright, and its `drift` and `config-consistency` checks clone from the holocron remote. The offline guarantee is a property of a populated `apm_modules/`, not of the hook set — run `uv sync --frozen` and `uv run --frozen apm install` once on a new checkout and it holds from then on.
## Editing plugin content
@@ -138,7 +132,7 @@ dependencies:
ref: git-v1.3.9
```
Then run `apm install` in your own repo. Without `ref:`, the entry tracks the default branch. To list a plugin's
Then run `apm install`. Without `ref:`, the entry tracks the default branch. To list a plugin's
releases, run `git ls-remote --tags https://git.rkdr.net/Mortis/Holocron.git '<plugin>-v*'`;
`apm outdated` also reports newer `<plugin>-v<x.y.z>` tags.
@@ -146,8 +140,7 @@ releases, run `git ls-remote --tags https://git.rkdr.net/Mortis/Holocron.git '<p
The shorthand `git.rkdr.net/Mortis/Holocron/plugins/<name>#<plugin>-v<x.y.z>` does not work on this
host. apm reads `plugins/<name>` as part of the repository path, so a real install tries to clone
`.../Holocron/plugins/<name>.git` and fails because no such repository exists (on apm 0.39.3:
"Repository Mortis/Holocron/plugins/<name> not found on git.rkdr.net"). `apm install --dry-run` does not catch
`.../Holocron/plugins/<name>.git` and fails with "Not found". `apm install --dry-run` does not catch
this. Use the object form.
### Automated updates
+7 -6
View File
@@ -1,5 +1,5 @@
name: holocron
version: 0.9.1
version: 0.9.2
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
license: MIT
@@ -55,8 +55,9 @@ dependencies:
# Turns apm's executable-trust gate ON. Without this block the gate is disabled
# and every hook, bin and MCP primitive a dependency ships deploys silently —
# verified: `apm approve --list` reports "Executable-trust gate disabled -- all
# executables deploy" until an `executables:` block exists.
# verified on 0.39.3: `apm approve --list` reports "Executable-trust gate
# disabled -- executables need no approval" until an `executables:` block
# exists.
#
# Keys are the FULL package identity apm 0.39 matches on,
# <host>/<owner>/<repo>/<path>#<version>, as `apm approve --list` prints it.
@@ -78,12 +79,12 @@ dependencies:
# remote (ADR-0019).
executables:
allow:
git.rkdr.net/Mortis/Holocron/plugins/kyberforge#2.3.0:
git.rkdr.net/Mortis/Holocron/plugins/kyberforge#2.3.1:
hooks: true
bin: true
# delivery ships the guard hook (ADR-0032 enforcement layer 2). Same
# full-identity, version-in-key convention as above, kept by the same check.
git.rkdr.net/Mortis/Holocron/plugins/delivery#0.8.0:
git.rkdr.net/Mortis/Holocron/plugins/delivery#0.8.1:
hooks: true
marketplace:
@@ -92,7 +93,7 @@ marketplace:
# top-level apm.yml description:/version: above are NOT inherited into the
# compiled output despite being used elsewhere (e.g. by `apm audit`).
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
version: 0.9.1
version: 0.9.2
owner:
name: Mortis
url: https://git.rkdr.net/Mortis/
@@ -10,12 +10,6 @@ accurate about how Claude Code's installer works; what changed is that nothing c
they governed; the symlink amendment's underlying gap is not — see ADR-0024's consequences. This
ADR's content is kept below as the historical record; it is no longer the current model.
*Amended 2026-12-02 (holocron#272): the apm 0.28.0 mechanism under Considered options holds on apm
0.39.3, checked in source. `build_plugin_manifest` still strips `("agents", "skills", "commands",
"instructions")`, and `synthesize_plugin_json_from_apm_yml` still emits only identity fields. One
addition: for the `codex` ecosystem only, 0.39.3 adds `skills` and `mcpServers` pointers after the
strip.*
---
This ADR is a follow-on correction to ADR-0015 (Microsoft APM replaces hand-authored
@@ -12,11 +12,6 @@ repo-pinned `uv run --frozen` apm, else `PATH` apm, else exit 0) instead of a ba
The "0.28.0" claims below (the correction near line 80, the `apm outdated` prose at about line 143,
and the sidecar reproduction at about line 217) are pending re-verification on 0.39.3 under #265.*
*Amended 2026-12-02 (holocron#272): those claims are re-checked on apm 0.39.3, and the results sit
beside each claim. The version-blind matching holds, but the key's name half is now the full
package identity (#271). The `apm outdated` prose holds. The sidecar reproduction was not re-run.
In this repo every apm command named below runs as `uv run --frozen apm ...` (ADR-0034).*
## Context
The pre-existing answer was `scripts/git-hooks/post-push`, which pulled the marketplace clone and
@@ -97,18 +92,6 @@ question is only what catches a missed edit.
> justified by this repo's own requirement that the key track `plugins/kyberforge/apm.yml`'s
> `version:`, not by an apm-level failure mode. `docs/spec/gates.md` carries the same correction.
> **Amendment (2026-12-02, holocron#272) — the key is now the full package identity.** The
> version-blind matching in the correction above holds on apm 0.39.3: `is_package_approved`,
> `materialize_exec_map` and `_map_grants` keep the same roles in its source. The bare
> `kyberforge#<version>` key described above no longer matches on 0.39. apm 0.39 matches a grant on
> the package identity `apm approve --list` prints, so the key is
> `git.rkdr.net/Mortis/Holocron/plugins/kyberforge#<version>` (#271). A bare key leaves the hook
> parked: the first 0.39 install drops it from `.claude/settings.json`, and root `apm audit --ci`
> still passes (spike #269). `scripts/check-executables-allow-sync.sh` therefore derives each
> expected key from root `apm.yml`'s `git:` + `path:` entry for the plugin, fails a bare key, and
> fails any `gated_*` `exec_status` in `apm.lock.yaml`. The `#<version>` half is still a repo-level
> record. `docs/spec/gates.md`, "check-executables-allow-sync", has the details.
A comment in the `executables:` block is not enough: this repo gates generated-content drift,
marketplace mirror drift and vale style drift deterministically, and a silent-staleness failure is
strictly worse than any of them. So `scripts/check-executables-allow-sync.sh` runs at pre-push,
@@ -175,10 +158,6 @@ silently and no refresh ran. With six packages merging independently, one-behind
case rather than an edge, which means the mechanism failed most often in exactly the situation it
exists for. The match is now `outdated dependenc(y|ies) found`.
> **Amendment (2026-12-02, holocron#272) — holds on apm 0.39.3.** `apm outdated --help` still lists
> no `--json` or other machine-readable flag, and `apm_cli/commands/outdated.py` still picks
> `dependency` or `dependencies` by count.
The deeper lesson is the one `post-push` already taught and this repeated: every assertion about the
hook mocked `apm`, so the suite was green while the hook could not detect the common case. Mocks
verify the code against its author's belief about the interface, never the interface. The suite now
@@ -249,12 +228,6 @@ protecting, that nothing repo-authored goes in that file, is unchanged.
> is apm output like the settings entry it describes, so it is committed for the same reason and
> changes only when the owning package is renamed or moved. `.claude/hooks/` stays ignored.
> **Amendment (2026-12-02, holocron#272) — not re-run on apm 0.39.3.** The sidecar is still
> committed, and with it root `apm audit --ci` passes all 15 checks on 0.39.3. The 0.28.0 failure
> without the sidecar was not reproduced. apm 0.38 and later refuse to replace managed files that
> lack deployment evidence, so the failure without it may now look different. That was not
> established.
**Native consumers are protected by a guard, not by the gate.** A host installing holocron through
`claude plugin install` auto-discovers `hooks/hooks.json` and does not consult apm's trust gate at
all. The script therefore exits silently when there is no `apm.lock.yaml` in the working directory,
@@ -118,12 +118,6 @@ result against the working tree, and `content-integrity` scans for hidden Unicod
the finding: both gates compare bytes, neither reads the `description` key for sense, so propagation
is still not verification.
*Amended 2026-12-02 (holocron#272): on apm 0.39.3, root `apm audit --ci` runs fifteen checks, not
ten. It adds `lockfile-targets-current`, `native-mcp-ownership`, `local-bundle-hooks`,
`hook-approval-pins` and `exec-status-current`. A plugin package runs two, with `content-integrity`
added to `lockfile-exists`. None of the new checks reads the `description` key for sense, so the
finding stands. The current list is in `docs/spec/gates.md`, "apm-audit-ci".*
**And the obligation is unbounded.** Under enumeration, adding one skill to `bin`, `git` or `gitea`
means editing two copies of a prose string on top of the version bumps and regeneration any skill
addition already owes under this repo's release policy
@@ -2,15 +2,6 @@
**Status:** Accepted (2026-09-20)
*Amended 2026-12-02 (holocron#272): re-verified on apm 0.39.3 in a scratch copy of
`plugins/mattpocock`. Without a package lock, the same line and `1 of 1 check(s) failed` appear, so
the waiver is unchanged. With one from `apm lock`, the rest of the root set arms (fourteen more
checks, not nine), and `drift` fails on 74 unintegrated files under `.agents/skills/`. Two details
below changed. A plugin package whose `lockfile-exists` passes now runs two checks, with
`content-integrity` added. Plain `apm audit` now prints `No recognized deployed primitives found --
nothing to scan`. The malformed-entry case still separates `--ci` (exit 1, now a failing
`manifest-parse` row) from plain `apm audit` (exit 0), so the rejection of dropping `--ci` stands.*
`plugins/onedev` is the first plugin package in this repo to declare a real dependency. It pins
`code.onedev.io/onedev/tod#v4.3.4` so that a consumer installing `onedev` from the holocron
marketplace picks up OneDev's eight TOD skills transitively — a `marketplace.packages` entry takes a
@@ -27,9 +27,6 @@ are packages and already resolve through the `path:` branch. The name is a conve
it assumes apm deploys the skill under the subpath's last segment, which it does today (verified on
apm 0.28.0 for `wayfinder`), and a rename upstream is caught by the pin, not by this gate.
*Amended 2026-12-02 (holocron#272): holds on apm 0.39.3. A `uv run --frozen apm install` deploys
`mattpocock/skills/skills/engineering/wayfinder#v1.3.2` to `.claude/skills/wayfinder/`.*
**Rejected: rewording the four clauses out of route notation.** Cheap, but it turns real routing
checks into SUGGESTIONs for exactly the skills most likely to be renamed upstream.
@@ -6,15 +6,6 @@
check in Context and the apm behaviour in consequence 3) are pending re-verification on 0.39.3 under
#265, once apm is pinned per repo (ADR-0034). The Decision is unchanged.*
> **Amendment (2026-12-02, holocron#272) — the 0.28.0 claims re-checked on apm 0.39.3.**
> - The tag pattern holds in source: `apm_cli/marketplace/tag_pattern.py` still lists
> `{name}-v{version}`. The synthetic-repo `apm outdated` run was not repeated.
> - Consequence 3's shorthand failure holds. A scratch install of
> `git.rkdr.net/Mortis/Holocron/plugins/lint#<tag>` fails with `Repository
> Mortis/Holocron/plugins/lint not found on git.rkdr.net`. The tag in that run did not exist, but
> the failure comes at repository resolution, before any ref is read.
> - The `rstrip(".git")` bug is fixed in 0.39.3, which uses `removesuffix(".git")`.
## Context
Issue #223. Consumers that pin a holocron package need a git tag per package version. Two consumers
@@ -92,8 +92,6 @@ different name.
apm and the version check.
4. **Re-verification is pending.** ADR-0019 and ADR-0033 state facts verified against apm 0.28.0.
They are re-checked on 0.39.3 under #265, and each carries a note saying so.
*Amended 2026-12-02 (holocron#272): done. ADRs 0017, 0019, 0021, 0026, 0029 and 0033 carry
dated notes with the 0.39.3 result for each claim.*
Related: ADR-0019, ADR-0024, ADR-0033; #245, #265; Defame1297/ansible-homelab-mono#1078;
Mortis/Kamino#499.
+1 -1
View File
@@ -19,7 +19,7 @@ project repo (local overrides)
- **Executables** (`DEPLOY_EXECUTABLES`): `providers/claude-code/statusline-command.sh` → `~/.claude/statusline-command.sh` (with `+x`)
- **Directories** (`DEPLOY_DIRS`): `core/` → `~/.claude/core/` (destination fully replaced on each deploy)
Skills are **not** deployed by `install.sh`. They are distributed as plugins and installed separately — in this repo by `uv run --frozen apm install` (the repo-pinned apm, ADR-0034) against the `dependencies.apm` entries in the root `apm.yml`, which lands them in `.claude/skills/` and `.claude/agents/` (ADR-0018). A consuming repo installs them the same way — apm is the only supported install path.
Skills are **not** deployed by `install.sh`. They are distributed as plugins and installed separately — in this repo by `apm install` against the `dependencies.apm` entries in the root `apm.yml`, which lands them in `.claude/skills/` and `.claude/agents/` (ADR-0018). A consuming repo installs them the same way — apm is the only supported install path.
`~/.claude/CLAUDE.md` is a thin adapter, not a content source. It imports `~/.agents/AGENTS.md` (always-on rules) and `governance.md` (always-on governance) and carries nothing else — the content index of on-demand instruction files sits in `core/AGENTS.md`, deployed to `~/.agents/AGENTS.md` and imported by it. All always-on content lives in `AGENTS.md` files so other providers can import the same source without duplication.
+46 -98
View File
@@ -1162,8 +1162,7 @@ plugin packages under `plugins/` — because the root-only invocation audits the
**nothing else**, and `apm-pack-check-clean` does not parse plugin `dependencies:` blocks either.
Verified: a malformed dependency entry passes
`apm pack --check-versions --check-clean --dry-run` and fails `apm audit --ci` in that package's
directory. The whole hook, the root plus every plugin package, takes 70-90 s through `uv run` on
apm 0.39.3, about 20 s of it the root audit. On apm 0.28.0 it cost about 0.5 s per package.
directory. Costs ~0.5s per package.
**Both apm hooks run the repo-pinned apm.** They source `scripts/lib/apm.sh`, the one place the
invocation is spelled: `uv run --project <repo root> --frozen apm` (ADR-0034). `--project` comes
@@ -1179,54 +1178,40 @@ pins the command, the `--project` root, the scrub and the version floor with a f
`scripts/lib/clean-git-env.sh` before anything calls `apm`, which unsets `GIT_DIR`, `GIT_WORK_TREE`,
`GIT_INDEX_FILE`, `GIT_OBJECT_DIRECTORY`, `GIT_COMMON_DIR`, `GIT_PREFIX` and
`GIT_IMPLICIT_WORK_TREE`. It deliberately keeps the config-passing vars (`GIT_CONFIG_PARAMETERS`,
`GIT_CONFIG_COUNT`), because they carry `git -c` overrides apm's remote clones may need. The reason:
`git push` from a **linked worktree** exports an absolute `GIT_DIR=<main>/.git/worktrees/<name>` to
its hooks, and from the main checkout it exports none. `drift`'s install replay (apm 0.28.0) runs
`git init` and `git checkout` in a temp dir with an env copied from `os.environ`, so the inherited
`GIT_DIR` wins. The `init` wrote `core.bare=true` into the shared `.git/config`, and the `checkout`
moved the worktree's HEAD to the lock-pinned commit (issue #204). Pre-commit runs hooks from the
worktree root, so once the vars are gone plain discovery finds the right repo. *2026-12-02
(holocron#272):* apm 0.39.3's `apm_cli/utils/git_env.py` provides `git_subprocess_env`, which strips
`GIT_DIR` and the other repo-locating vars. The leak was not re-tested on 0.39.3, and the scrub
stays as defence in depth. `tests/test-apm-hooks-git-env.sh` pins this for both hooks.
`GIT_CONFIG_COUNT`), because they carry `git -c` overrides apm's remote clones may need. The reason: `git push` from a **linked worktree** exports an
absolute `GIT_DIR=<main>/.git/worktrees/<name>` to its hooks, and from the main checkout it exports
none. `drift`'s install replay (apm 0.28.0) runs `git init` and `git checkout` in a temp dir with an
env copied from `os.environ`, so the inherited `GIT_DIR` wins. The `init` wrote `core.bare=true` into
the shared `.git/config`, and the `checkout` moved the worktree's HEAD to the lock-pinned commit
(issue #204). Pre-commit runs hooks from the worktree root, so once the vars are gone plain
discovery finds the right repo. `tests/test-apm-hooks-git-env.sh` pins this for both hooks.
**What it actually runs is asymmetric**, and the two manifest classes are not comparable. Verified by
running `apm audit --ci` (apm 0.39.3, holocron#272; first done on 0.28.0) at the repo root and in
`plugins/lint/`, reading the check names straight off its own compliance table:
running `apm audit --ci` (apm 0.28.0) at the repo root and in `plugins/lint/`, reading the check
names straight off its own compliance table:
On the **root** manifest, **15 checks**: `lockfile-exists`, `ref-consistency`,
On the **root** manifest, **10 checks**: `lockfile-exists`, `ref-consistency`,
`deployment-ledger-owners`, `deployed-files-present`, `no-orphaned-packages`,
`lockfile-targets-current`, `skill-subset-consistency`, `config-consistency`,
`native-mcp-ownership`, `content-integrity`, `local-bundle-hooks`, `hook-approval-pins`,
`exec-status-current`, `includes-consent`, `drift`. apm 0.28.0 ran ten of these; the five it lacked
are `lockfile-targets-current`, `native-mcp-ownership`, `local-bundle-hooks`, `hook-approval-pins`
and `exec-status-current`.
`skill-subset-consistency`, `config-consistency`, `content-integrity`, `includes-consent`, `drift`.
On each **plugin** manifest, **2 checks**: `lockfile-exists` and `content-integrity` (0.28.0 ran
only `lockfile-exists`). The plugin-level `content-integrity` row scans no package source: on 0.39.3
it still passed with a bidi override planted in a scratch copy of `plugins/lint`. When
`lockfile-exists` fails, the table holds that one row alone. `lockfile-exists` is conditional, and
vacuous while every plugin `apm.yml` declared `dependencies: {apm: [], mcp: []}` — it reports `No
dependencies declared -- lockfile not required`. An earlier revision of this section said it would
arm the moment one did not. **It has armed.** `plugins/onedev` was the first plugin package to
declare a real dependency — it pinned `code.onedev.io/onedev/tod#v4.3.4` — and was removed on
2026-11-11; `plugins/mattpocock` carries the same shape (pinned third-party skills, no primitives of
its own) and the check fires on it for real. Everything else in the root list is root-only, because
it is the root install that has a lockfile, a deployment ledger and deployed files to check.
On each **plugin** manifest, **1 check**: `lockfile-exists`. Conditional, and vacuous while every
plugin `apm.yml` declared `dependencies: {apm: [], mcp: []}` — it reports `No dependencies declared
-- lockfile not required`. An earlier revision of this section said it would arm the moment one did
not. **It has armed.** `plugins/onedev` was the first plugin package to declare a real dependency — it
pinned `code.onedev.io/onedev/tod#v4.3.4` — and was removed on 2026-11-11; `plugins/mattpocock`
carries the same shape (pinned third-party skills, no primitives of its own) and the check fires on
it for real. Everything else in the list above is root-only, because it is the
root install that has a lockfile, a deployment ledger and deployed files to check.
**A plugin package that declares dependencies has no green state, so the hook waives exactly one
failure.** Verified against apm 0.28.0 in `plugins/onedev/` (since removed; the behaviour is the
same for any package that declares dependencies), and again on apm 0.39.3 in a scratch copy of
`plugins/mattpocock` (holocron#272):
failure.** Verified against apm 0.28.0 in `plugins/onedev/` (since removed; the behaviour is the same for any package that declares dependencies):
- **Without a package `apm.lock.yaml`**, `lockfile-exists` fails — `apm.yml declares dependencies but
apm.lock.yaml is absent` — reported as `1 of 1 check(s) failed`. Unchanged on 0.39.3.
apm.lock.yaml is absent` — reported as `1 of 1 check(s) failed`.
- **With one**, generated by `apm lock` in the package directory, `lockfile-exists` passes and
thereby arms the rest of the root check set; `drift` then fails reporting unintegrated files at
`.agents/skills/<name>/...`, i.e. demanding the dependency's skills be *deployed inside the
package*. On 0.28.0 that was nine more checks and 8 files from onedev; on 0.39.3 it is fourteen
more checks and 74 files from mattpocock. `apm lock` also leaves an `apm_modules/` tree inside the
package.
thereby arms the other nine checks; `drift` then fails reporting **8 unintegrated files** at
`.agents/skills/<name>/SKILL.md`, i.e. demanding the dependency's skills be *deployed inside the
package*. `apm lock` also leaves an `apm_modules/` tree inside the package.
The cause is that apm treats any directory holding both `apm.yml` and `apm.lock.yaml` as an **install
root**, and a plugin package is not one. `scripts/apm-audit-ci.sh` therefore waives `lockfile-exists`
@@ -1234,52 +1219,27 @@ and nothing else, and only for a non-root manifest: it asserts the string `1 of
so any second failing check changes the count and the run fails normally, and output it does not
recognise fails closed. The root manifest is never waived. Recorded as ADR-0026.
**Dropping `--ci` for package directories was considered and rejected.** It is the smaller change
and it is wrong. Verified on apm 0.28.0, and again on 0.39.3 (holocron#272), against a scratch
package whose dependency entry carried no `git`/`path`/`registry` field: `apm audit --ci` exits 1
naming the field, while plain `apm audit` exits 0. Plain `apm audit` printed `No apm.lock.yaml found
-- nothing to scan` on 0.28.0 and prints `No recognized deployed primitives found -- nothing to
scan` on 0.39.3. Malformed-dependency detection is the reason this section gives for auditing
packages at all, and a package *with* dependencies is the only kind that can carry a malformed
dependency entry — so dropping `--ci` would discard the check precisely where it earns its keep.
**Dropping `--ci` for package directories was considered and rejected.** It is the smaller change and
it is wrong. Verified on apm 0.28.0 against a scratch package whose dependency entry carried no
`git`/`path`/`registry` field: `apm audit --ci` exits 1 naming the field, while plain `apm audit`
prints `No apm.lock.yaml found -- nothing to scan` and exits 0. Malformed-dependency detection is the
reason this section gives for auditing packages at all, and a package *with* dependencies is the only
kind that can carry a malformed dependency entry — so dropping `--ci` would discard the check
precisely where it earns its keep.
**Known weak point: the waiver matches on apm's stdout.** An apm upgrade that rewords either line
turns the waiver off. That fails the push rather than hiding a defect; re-verify against the new
output and update the patterns rather than widening them.
**`manifest-parse` is a named check on apm 0.39.3, and was not one on 0.28.0.** On 0.28.0 a
dependency entry missing its `git`/`path`/`registry` field failed the invocation with `Cannot parse
apm.yml` before the table was built. On 0.39.3 the same entry produces a one-row table, a failing
`manifest-parse` row reading `Cannot parse apm.yml: Invalid APM dependency ...`, and `1 of 1
check(s) failed` (holocron#272). The waiver does not cover it: that row lacks the `declares
dependencies but apm.lock.yaml is absent` line the waiver also requires. A parsable manifest gets no
`manifest-parse` row, which is why it is missing from both lists above.
**`manifest-parse` is not a named check** in apm 0.28.0's output, and an earlier revision of this
section listed it as one. Parsing is still enforced — a dependency entry missing its
`git`/`path`/`registry` field fails with `Cannot parse apm.yml` — but it fails the invocation before
the table is built rather than appearing as a row in it.
**The hook needs a completed `apm install`.** `deployed-files-present` checks the install output on
disk, so on a fresh clone it fails with `<N> deployed file(s) missing` (303 on 0.28.0; the count
follows the lock) and takes the push with it. That is not a defect in the gate; it is the gate
correctly reporting that nothing has been installed yet. Before the first push from a new checkout,
run `uv sync --frozen` and then `uv run --frozen apm install`, each once and online. Without the
first, the hooks' plain `uv run --frozen` performs that sync itself, which needs the network. An
older checkout whose `.claude/skills`, `.claude/agents` and `.claude/commands` were deployed by apm
0.28 moves those three directories aside before that first 0.39 install. Otherwise apm refuses to
replace the files with `no trustworthy local deployment baseline`, because 0.28 recorded no
deployment evidence for them. apm's message suggests a bare `apm install`; run the `uv run --frozen`
form instead.
**A lock written over a 0.28-populated `apm_modules/` is wrong, and this gate family catches it
late.** Before any 0.39 command that writes `apm.lock.yaml` (`uv run --frozen apm update`, or an
install that changes the lock) in a checkout whose `apm_modules/` apm 0.28 populated, move
`apm_modules/` aside and run `uv run --frozen apm install`. Otherwise apm reuses the 0.28-era
third-party copies and writes a lock without their `carried_licenses` entries. A fresh install then
adds the LICENSE files, the cached content hash no longer matches the lock, and
`apm-pack-check-clean` fails with `does not match the content hash recorded in apm.lock.yaml`
(found under #272, fixed on #271 by regenerating the lock from a fresh install). Only writing the
lock is affected: consuming the committed lock needs only the two setup steps. kyberforge's
`SessionStart` hook is such a writer: it runs `uv run --frozen apm update --yes` at session start,
so in a checkout apm 0.28 populated it can write the bad lock before anyone reads this. To recover,
discard it with `git checkout -- apm.lock.yaml`, move `apm_modules/` aside, then run
`uv run --frozen apm install`.
disk, so on a fresh clone it fails with `303 deployed file(s) missing` and takes the push with it.
That is not a defect in the gate; it is the gate correctly reporting that nothing has been installed
yet. Run `apm install` before the first push from a new checkout.
It does **not** enforce an org policy. apm discovers one from the git remote and only understands
github.com and Azure DevOps, so against this repo's self-hosted Gitea remote it prints:
@@ -1299,12 +1259,10 @@ that can never go green is not a gate. Revisit only if this repo gains a policy
or hash drift detected` — so the root invocation already covers it and nothing needs adding. What
remains true is that the *standalone* mode is different: plain `apm audit` (`--ci` refuses to combine
with `--file`/`--strip`/`--dry-run`/`PACKAGE`) run in a plugin directory reports
`No recognized deployed primitives found -- nothing to scan` on 0.39.3 (`No apm.lock.yaml found --
nothing to scan` on 0.28.0) and exits 0, because only the root has a lockfile and deployed files.
Plugin manifests are not Unicode-scanned. 0.39.3 does add a `content-integrity` row in a plugin
directory, but it scans no package source (see above). That holds because no package carries an
`apm.lock.yaml`. One would arm the rest of the root check set, a scanning `content-integrity` among
them, which is the state ADR-0026 rules out rather than a second scan worth having.
`No apm.lock.yaml found -- nothing to scan` and exits 0, because only the root has a lockfile.
Plugin manifests get `lockfile-exists` and nothing else; they are not Unicode-scanned. That holds
because no package carries an `apm.lock.yaml` — one would arm the other nine checks, `content-integrity`
among them, which is the state ADR-0026 rules out rather than a second scan worth having.
### `check-executables-allow-sync`
@@ -1334,10 +1292,6 @@ executables, since a third-party dependency can be parked too. A missing lock is
`apm-audit-ci`'s `lockfile-exists`. It is a line scan of the shape apm writes, not a YAML parse.
The rest of this section describes the 0.28.0 matching that the version-blind behaviour comes from.
*2026-12-02 (holocron#272):* the functions it names are still in apm 0.39.3's source with the same
roles. `materialize_exec_map` still stores each key under its version-blind name, and `_map_grants`
documents ordinary grants as version-blind. What changed is the name half of the key, which is now
the full identity described above.
apm gates a package's `hooks/` and `bin/` on root `apm.yml`'s `executables.allow`
(`apm_cli/security/executables.py`). `is_package_approved` is itself an exact dictionary lookup, but
@@ -1410,11 +1364,7 @@ drift after the fact, not by a derived gate.
## Pushing without a network
No pre-push hook needs the network **once two one-time online steps have run in this checkout**:
`uv sync --frozen`, which installs the apm that `uv.lock` pins into `.venv/`, then
`uv run --frozen apm install`, which populates `apm_modules/` and the deployed tree. Every apm
call in the hooks goes through the pinned invocation in `scripts/lib/apm.sh` (ADR-0034); after the
first sync, its implied `uv` sync is a no-op that needs no network. Every entry
No pre-push hook needs the network **once `apm install` has populated `apm_modules/`**. Every entry
in root `apm.yml`'s `marketplace.packages[]` resolves from a local `./plugins/<name>` path, so
`apm-pack-check-clean` never calls `git ls-remote`.
@@ -1424,10 +1374,8 @@ replay the install to diff scratch against the working tree, and that replay is
`[>] Replaying install (cache-only)` — which is exactly why it costs no network here. On a **fresh
clone** there is no cache to replay from, so the replay clones from the holocron remote and those two
checks fail offline, with `deployed-files-present` already failing for the same reason (see
`apm-audit-ci` above). The offline guarantee is a property of a synced `.venv/` and a populated
`apm_modules/`, not of the hook set: run `uv sync --frozen` and `uv run --frozen apm install` once
on a new checkout and it holds from then on. Run apm only in that pinned form here: a bare `apm`
reaches whatever is on `PATH`, possibly an older apm that refuses the v4 `apm.lock.yaml`.
`apm-audit-ci` above). The offline guarantee is a property of a populated `apm_modules/`, not of the
hook set: run `apm install` once on a new checkout and it holds from then on.
## Plugin release tags are not a gate
+1 -1
View File
@@ -1,5 +1,5 @@
name: delivery
version: 0.8.0
version: 0.8.1
description: Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.
author:
name: Mortis
+10 -6
View File
@@ -152,7 +152,7 @@ The script tells runtimes apart by where apm deployed it:
|---|---|---|
| `.claude/hooks/` | Claude Code | Output is `hookSpecificOutput.permissionDecision`. `onFailure: block` makes a crash or timeout block the call (Claude Code ≥ 2.1.295). Verified live on 2.1.326. |
| `.github/hooks/scripts/` | Copilot CLI | Output is top-level `permissionDecision` plus a reason. A non-zero exit denies, but a **timeout lets the call through**. The TUI auto-approves `ask` (ADR-0032 accepted risk). apm writes the entry in Claude's nested shape with `command`/`timeout`, and Copilot's docs accept both keys but don't document the nested group, so it is **unverified** until a Copilot account exists. |
| `.codex/hooks/` | Codex | `ask` is unsupported, so the guard denies with exit 2 and the reason on stderr. apm deploys only if `.codex/` already exists, and Codex skips project hooks until a human trusts them. Codex resolves the relative command from the session cwd, so a session started in a subdirectory may not find the script. |
| `.codex/hooks/` | Codex | `ask` is unsupported, so the guard denies with exit 2 and the reason on stderr. apm deploys it when the consuming project targets `codex`; with `codex` in `targets:`, apm 0.39.3 creates `.codex/` itself. Codex skips project hooks until a human trusts them. Codex resolves the relative command from the session cwd, so a session started in a subdirectory may not find the script. |
| anywhere else | unknown | Treated like Codex: odd jobs are denied, with exit 2. The payload's shape (`toolName` or `tool_name`) picks only how the payload is read, never the runtime. |
## What a consuming repo needs
@@ -160,18 +160,22 @@ The script tells runtimes apart by where apm deployed it:
- `python3` on PATH. The script uses the standard library only. Without python3 the hook cannot
start, which blocks every tool call on Claude Code and Copilot. That's deliberate.
- An `executables.allow` grant for the package in the repo's `apm.yml`, when that repo turns on apm's
executable-trust gate:
executable-trust gate. On apm 0.39 the key is the package's full identity, as
`apm approve --list` prints it:
```yaml
executables:
allow:
delivery:
git.rkdr.net/Mortis/Holocron/plugins/delivery:
hooks: true
```
apm 0.28.0 prints "parked pending approval" even when the grant matches (holocron#208). Check that
the hook actually deployed by looking for `guard.py` under `.claude/hooks/delivery/` and the
`PreToolUse` entry in `.claude/settings.json`. Don't rely on the install exit code.
A bare `delivery` key, which apm 0.28.0 matched, no longer does: under 0.39.3 the hook is parked
("parked pending approval"), nothing deploys, and install still exits 0. A `#<version>` suffix on
the key is ignored when matching. Check that the hook actually deployed by looking for `guard.py`
under `.claude/hooks/delivery/` and the `PreToolUse` entry in `.claude/settings.json`. Don't rely
on the install exit code. apm 0.28.0 also printed "parked pending approval" when the grant matched
(holocron#208); 0.39.3 does not.
- Host hardening is documented, not shipped (ADR-0032 layer 3). Examples are Claude permission
deny rules, sandbox `denyRead` on the vault password file, and managed settings with
`allowManagedHooksOnly` so the guard cannot be switched off.
@@ -13,7 +13,7 @@ You are the orchestrator for apm package/marketplace operations. Your one job is
You resolve the package root once per dispatched operation (the directory containing that package's `apm.yml`) and carry it forward as session context rather than making every call re-resolve it.
**Scope:** this orchestrator routes `apm-workflow`'s five concerns only — configure/scaffold, marketplace, install, compile/pack/publish, audit. It does not route `apm-install` (binary install, agent-runtime setup) — that's a one-time machine bootstrap, not a per-package, fan-out-able operation, and has no orchestrator counterpart. Confirm `apm --version` succeeds before dispatching any operation; if it fails, tell the caller to run `apm-install` first rather than attempting recovery here.
**Scope:** this orchestrator routes `apm-workflow`'s five concerns only — configure/scaffold, marketplace, install, compile/pack/publish, audit. It does not route `apm-install` (binary install, agent-runtime setup) — that's a one-time machine bootstrap, not a per-package, fan-out-able operation, and has no orchestrator counterpart. Confirm the repo's apm reports a usable version before dispatching any operation: `uv run --project <repo root> --frozen apm --version` in a repo that pins apm with uv, `apm --version` otherwise (`apm-workflow` Step 2 says how to tell). Always pass `--project`: `uv run` outside the project silently falls back to the `PATH` apm. Exit 0 is not enough. The version must equal the repo's pin, or be 0.39.2 or later where nothing pins it, because an older apm refuses a v4 lockfile. If the check fails, tell the caller to run `apm-install` first rather than attempting recovery here.
## Hard rules
@@ -43,7 +43,7 @@ These are non-negotiable regardless of `confirm` or any skill-local override:
1. Validate the request structure and check if `operation` is known
2. Check the request against the Hard rules above (publish confirmation, marketplace-add direction, `type:` delegation, audit-vs-audit-ci, registries precondition) — refuse outright on violation, independent of `confirm`
3. If `operation` is `publish`: require `confirm: true`, dispatch `--dry-run -v` first regardless, surface that output, else fail with structured "requires explicit confirmation" error
4. Verify `apm --version` succeeds; if not, fail with a diagnostic pointing to `apm-install`
4. Verify the repo's apm version (pinned: `uv run --project <repo root> --frozen apm --version`, which must equal the pin; otherwise `apm --version`, which must be 0.39.2 or later); if not, fail with a diagnostic pointing to `apm-install`
5. Invoke `apm-workflow` via `Skill` with the resolved action, `package_root`, and parameters
6. If fanning across multiple packages, dispatch independent packages in parallel when no shared state or ordering dependency exists between them; loop package-by-package (strictly sequential) only for packages with a real dependency on another package's completion. Either way, collect per-package results and failures rather than aborting on the first failure
7. Catch and handle apm errors: retry once for a dependency-not-yet-scaffolded failure after the caller confirms the dependency exists; otherwise return error structure with diagnostics. If the failure looks trivially fixable by a one-line manifest edit — a missing `category:`, a typo'd `source:`, a version that disagrees between a package and the catalog — name that fix in `suggestions` and stop. Do not apply it yourself and do not self-dispatch an `edit-config` to apply it
@@ -6,20 +6,33 @@ description: >
authoring, publishing, auditing, or dependency installation for an apm
package -> `apm-workflow`.
metadata:
version: "1.0.1"
version: "1.0.2"
category: apm
source_keys:
- context7-microsoft-apm
- apm-v0-39-3-docs
- apm-cli-0-39-3-uv-experiments
---
## Gotchas
- apm never executes an agent itself — it only installs and manages the runtimes that do. Installing apm alone leaves the user with a package manager and no working agent CLI, so Step 2 is required whenever the user actually wants one; skip it only when they explicitly want the package manager alone.
- apm never executes an agent itself — it only installs and manages the runtimes that do. Installing apm alone leaves the user with a package manager and no working agent CLI, so Step 3 is required whenever the user actually wants one; skip it only when they explicitly want the package manager alone.
- `apm runtime setup copilot` needs Node.js v22+ and npm v10+ already on `PATH`; apm will not install them for you.
- In a repo that pins apm with uv, the `PATH` apm is not the repo's apm and may refuse its lockfile. Never upgrade the global apm to fix one repo: other repos may depend on its version.
## Step 1 — Install the apm CLI
## Step 1 — Choose where apm comes from
If `apm --version` already answers and the user is not pinning or upgrading, skip to Step 2.
| Condition | Method | Where |
|---|---|---|
| The repo pins apm: `pyproject.toml` has a quoted `apm-cli` or `apm_cli` requirement, beside a `uv.lock` | Per-repo pin. Use or upgrade it, never the global apm | `references/uv-pin.md` |
| The user wants apm fixed per repo, and uv is available | Per-repo pin. Set it up | `references/uv-pin.md` |
| Anything else: a machine-wide apm, a CI image, no uv | Global install | Step 2 |
Unsure which row applies: read the worked example closing `references/uv-pin.md`.
## Step 2 — Install the global apm CLI
If `apm --version` already answers and the user is not pinning or upgrading, skip to Step 3.
Default:
@@ -29,16 +42,17 @@ curl -sSL https://aka.ms/apm-unix | sh
Escape hatches — combine as needed:
- **Pin a version** — append `@vX.Y.Z` to the piped script's arguments: `curl -sSL https://aka.ms/apm-unix | sh -s -- @v1.2.3`.
- **Pin a version** — append `@vX.Y.Z` to the piped script's arguments: `curl -sSL https://aka.ms/apm-unix | sh -s -- @v1.2.3`. Pick 0.39.2 or later for a repo whose `apm.lock.yaml` an apm 0.39.2 or later wrote; older versions refuse it.
- **Custom install directory** — set `APM_INSTALL_DIR` on the piped script's command: `curl -sSL https://aka.ms/apm-unix | APM_INSTALL_DIR=$HOME/.local/bin sh`.
- **Air-gapped mirror / GitHub Enterprise** — an air-gapped host cannot reach `aka.ms` at all, so get `install.sh` onto the box and run it from disk instead of piping. Point it at the mirror with `APM_RELEASE_BASE_URL` and pin `VERSION`: `APM_RELEASE_BASE_URL=https://mirror.corp/apm VERSION=v1.2.3 sh install.sh`; add `APM_RELEASE_METADATA_URL` instead if you leave `VERSION` unset. `GITHUB_URL` is the GitHub Enterprise host, not a release mirror. All four are ordinary environment variables that also work through the pipe — running from disk is a network constraint, not a script one.
- **pip** — `pip install apm-cli` requires Python 3.10+. Not on an externally-managed (PEP 668) Python such as Debian or Ubuntu, where it hard-fails with `error: externally-managed-environment`; use pipx below. The quick-install script has no Python prerequisite, so prefer it unless the environment is pip-first.
- **Air-gapped mirror / GitHub Enterprise** — an air-gapped host cannot reach `aka.ms` at all, so get `install.sh` onto the box and run it from disk instead of piping. Point it at the mirror with `APM_RELEASE_BASE_URL` and pin `VERSION`: `APM_RELEASE_BASE_URL=https://mirror.corp/apm VERSION=v1.2.3 sh install.sh`; add `APM_RELEASE_METADATA_URL` instead if you leave `VERSION` unset. `GITHUB_URL` is the GitHub Enterprise host, not a release mirror.
- **pip** — `pip install apm-cli` requires Python 3.11+ (since apm 0.36.0), and so does every other Python-based install. Not on an externally-managed (PEP 668) Python such as Debian or Ubuntu, where it hard-fails with `error: externally-managed-environment`; use pipx below. The quick-install script has no Python prerequisite, so prefer it unless the environment is pip-first.
- **pipx** — `pipx install apm-cli` on those PEP 668 environments. Same PyPI package, but pipx builds an isolated venv and exposes `apm` on `PATH`.
- **Package managers** — `brew install apm`, `winget install --id Microsoft.APM --exact --source winget` or `scoop install apm`. The apm docs give no way to pin a version through them.
- **Manual** — download the platform archive from the GitHub releases page, extract, and place the binary on `PATH`.
Verify with `apm --version`.
## Step 2 — Install or manage an agent runtime
## Step 3 — Install or manage an agent runtime
Default:
@@ -46,7 +60,7 @@ Default:
apm runtime setup copilot
```
Other targets: `apm runtime setup codex`, `apm runtime setup gemini`, `apm runtime setup llm`.
Other targets: `apm runtime setup codex`, `apm runtime setup gemini`, `apm runtime setup llm`. In a repo that pins apm, spell each of these as `uv run --project <repo root> --frozen apm runtime …`.
- `apm runtime list` — show installed runtimes.
- `apm runtime status` — show which runtime `apm run` will pick by default.
@@ -15,3 +15,27 @@
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md
- **Contributing files:** (none)
- **Status:** `referenced`
## apm-v0-39-3-docs
- **URL:** https://github.com/microsoft/apm/tree/v0.39.3/docs/src/content/docs
- **Description:** The apm docs source at tag v0.39.3: the installation page (install methods, the Python 3.11 floor, version pinning, the package-manager installs) and the lockfile compatibility pages (which apm reads which lock, the minimum-version advice, `apm audit --ci` refusing unknown lock fields).
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/installation.md)
- **Contributing files:** SKILL.md, references/uv-pin.md
- **Status:** `extracted`
## apm-cli-0-39-3-uv-experiments
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
- **Description:** Throwaway uv 0.11.24 projects pinning apm-cli 0.39.3: the `[tool.uv] package = false` form, `uv run --frozen --offline` with a warm and a cold cache, and `uvx --offline` against a cache warmed by `uv add`. Grounds the per-repo pin, its offline behaviour and the rejection of uvx and `uv tool`.
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/installation.md)
- **Contributing files:** SKILL.md, references/uv-pin.md
- **Status:** `extracted`
## pypi-apm-cli
- **URL:** https://pypi.org/pypi/apm-cli/json
- **Description:** PyPI metadata for apm-cli: `requires_python >=3.11` and the runtime dependencies the uv lock pins.
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/installation.md)
- **Contributing files:** references/uv-pin.md
- **Status:** `extracted`
@@ -0,0 +1,99 @@
---
source_keys:
- apm-cli-0-39-3-uv-experiments
- apm-v0-39-3-docs
- pypi-apm-cli
---
# Pinning apm per repo with uv
Reached from `SKILL.md` Step 1. apm has no `apm.yml` field for a minimum apm version, and upstream
advises pinning apm outside the manifest. A uv pin gives every checkout of the repo the same apm
and the same transitive dependencies, whatever is installed globally. apm's docs do not describe
this method. It was tested with uv 0.11.24 and apm-cli 0.39.3.
## Set up the pin
1. Add this `pyproject.toml` at the repo root:
```toml
[project]
name = "<repo>-tooling"
version = "0.0.0"
requires-python = ">=3.11"
dependencies = []
[tool.uv]
package = false
[dependency-groups]
dev = ["apm-cli==0.39.3"]
```
- There is no `[build-system]`, and `package = false` keeps uv from ever building the project,
so uv installs only the `dev` group. `uv sync` installs that group by default.
- `>=3.11` is apm-cli's own floor.
- Pin with `==`. Choose 0.39.2 or later. Older versions refuse a lockfile that 0.39.2 or later
rewrote.
- If the repo already has a `pyproject.toml` for a real Python project, add `apm-cli==<version>`
to a dependency group there. Do not add `package = false` to a project that builds.
2. Run `uv lock`. Commit `pyproject.toml` and `uv.lock`, and gitignore `.venv/`. The lock hashes
apm-cli and every transitive dependency.
3. On each checkout, run `uv sync --frozen` once. The first sync on a machine needs the network,
because a cold uv cache cannot download wheels offline.
4. Run `uv run --project . --frozen apm install` from the repo root. The first install with apm 0.39 or later also needs the
network once, to record commit verdicts.
5. Check the version with `uv run --project . --frozen apm --version`.
## Run it
- Spell every apm command in the repo as `uv run --project <repo root> --frozen apm <args>`. `--frozen` runs from
`uv.lock` as committed and never re-resolves it. It still syncs the environment to the lock
first. After the one-time sync that costs nothing, and when a pull moves the pin it brings the
environment up to the new version.
- Scripts always pass `--project <repo root>`. Without it, `uv run` from a directory outside the repo finds no project and silently runs the `PATH` apm. The same happens under a nested `pyproject.toml`.
- Offline, `uv run --project <repo root> --frozen --offline apm …` works once the uv cache is warm, even with no
`.venv`. With a cold cache it fails.
- A hook with a short timeout must never sync. kyberforge's SessionStart hook runs
`uv run --project <root> --frozen --no-sync --offline apm`, after checking that
`${UV_PROJECT_ENVIRONMENT:-<root>/.venv}` exists, because even `--no-sync` creates an empty one.
## Upgrade the pin
Change the `==` version, then run `uv lock` and `uv sync --frozen`, and commit both files. Then
follow apm's own upgrade notes for the versions crossed. Every machine and CI job that runs
`apm install` or `apm audit --ci` on the repo's lockfile needs an apm at least as new as the one
that last wrote it. `apm audit --ci` fails on lockfile fields it does not know.
## Why not uvx or `uv tool`
- **`uvx apm-cli@<version>`** pins only apm-cli. Its transitive dependencies float between runs and
nothing is locked. A cache warmed by `uv add` also did not satisfy `uvx --offline`.
- **`uv tool install apm-cli`** is machine-global, the same drift as a global pipx install under
another name.
uv installs the apm tool and nothing else. Packages, skills and agents still come from
`apm install`.
## Worked example: one pinned repo, one unpinned
**Repo A pins apm.** The user asks to install the repo's apm dependencies. The root
`pyproject.toml` has `dev = ["apm-cli==0.39.3"]`, and `uv.lock` sits beside it.
1. Detect the pin: a quoted `apm-cli` or `apm_cli` requirement in `pyproject.toml`, and a `uv.lock` beside it:
`grep -Eq "[\"']apm[-_]cli" pyproject.toml && test -f uv.lock`.
2. Run `uv sync --frozen`, the first time on this checkout.
3. Run `uv run --project . --frozen apm --version`. It prints 0.39.3.
4. Run `uv run --project . --frozen apm install`.
Wrong moves: a bare `apm install`, because the `PATH` apm may be 0.28.0, which refuses the v4 lock.
`pipx upgrade apm-cli`, because that changes every repo on the machine. `uvx apm-cli@0.39.3
install`, because its dependencies are unlocked.
**Repo B does not pin apm.** It has no `pyproject.toml` naming `apm-cli`, or no `uv.lock`.
1. Run `apm --version`. If nothing answers, install apm globally (`SKILL.md` Step 2).
2. If apm is older than the repo's lock needs (0.39.2 or later for a lock 0.39.2 or later wrote),
upgrade the global apm, or propose a per-repo pin. Do not add the pin unasked: it is a repo
change the user should approve.
3. Run `apm install`.
@@ -5,16 +5,18 @@ description: >
the dependencies it declares, or an apm marketplace — even when the user does
not say "apm". Not the apm binary or an agent runtime -> `apm-install`.
metadata:
version: "1.0.3"
version: "1.0.4"
category: apm
source_keys:
- context7-microsoft-apm
- apm-cli-0-39-3-uv-experiments
---
## Gotchas
- MCP server secrets in `apm.yml` (headers, env vars) must use `${VAR}` indirection, never literal values, so they resolve at install or runtime and are never committed.
- `apm experimental enable registries` must run before a `registries:` block or `registry.*` config takes effect anywhere — configure, install or publish. Without it, declaring one silently does nothing: no error, no warning.
- `uv run` outside the uv project silently runs the `PATH` apm instead: from outside the repo it reported 0.28.0 where the repo pinned 0.39.3. Hence `--project` in Step 2.
- `apm.yml`'s `type:` selects which primitives are processed and is never checked against what `.apm/` holds, so `apm install` and `apm compile` can exit 0 having shipped none of the ones you expected. Set it to cover every primitive the package ships, and confirm the deployed output, not the exit code. Mechanics: `references/configure.md`.
## Step 1 — Dispatch
@@ -29,6 +31,15 @@ metadata:
Read the reference file matching the resolved flow — it carries that flow's own traps, and names a sibling file wherever one flow genuinely depends on another's detail.
## Step 2 — Execute
## Step 2 — Choose the apm command
Follow the matched reference file's instructions. Report back which `apm` command(s) were run (or drafted, if the user asked for a plan rather than execution) and their outcome.
The references spell every command as bare `apm`. Before running one, check whether the repo pins apm: a `pyproject.toml` at the repo root carrying a quoted `apm-cli` or `apm_cli` requirement, with a `uv.lock` beside it.
- **Pinned:** run each command as `uv run --project <repo root> --frozen apm <args>`. Run `uv sync --frozen` once per checkout first; the first sync needs the network. A bare `apm` there runs whatever is on `PATH`, which may be older than the repo's pin and refuse its lockfile.
- **Not pinned:** use the `apm` on `PATH`. If it is missing, or refuses the repo's lockfile as too new, hand off to `apm-install`.
Installing apm, or adding or moving the pin, belongs to `apm-install`.
## Step 3 — Execute
Follow the matched reference file's instructions. Report back which `apm` command(s) were run (or drafted, if the user asked for a plan rather than execution), spelled as invoked, and their outcome.
@@ -4,6 +4,9 @@ source_keys:
- context7-microsoft-apm
- context7-websites-code-claude
- claude-code-plugins-docs
- apm-v0-39-3-source
- apm-v0-39-3-docs
- apm-cli-0-39-3-uv-experiments
---
## `apm audit`
@@ -14,7 +17,7 @@ apm audit --ci # CI gate: lockfile consistency + drift replay + pol
apm audit --file <path> # standalone: scan an arbitrary file
```
Exit code `0` on success, `1` on any violation — composes as a normal CI gate step. It does not replace general lint/test/security-scan CI steps, it sits alongside them.
`apm audit --ci` exits `0` when every check passes and `1` when any fails, so it composes as a normal CI gate step. Plain `apm audit` exits `0` when clean, `1` on a critical finding and `2` on warnings only. It does not replace general lint/test/security-scan CI steps, it sits alongside them.
## Policy checks
@@ -46,6 +49,10 @@ jobs:
`-f sarif --output <file>` emits SARIF for GitHub Code Scanning's inline PR annotations.
In a repo that pins apm with uv, replace the `pip install` step with `uv sync --frozen` and run each apm step as `uv run --project . --frozen apm …` from the checkout root, so CI runs the repo's own apm.
The apm that runs `apm audit --ci` must be at least as new as the newest apm that wrote `apm.lock.yaml`: it fails on lockfile fields it does not know, where plain `apm audit` only warns.
## Frozen installs
`apm install --frozen` fails instead of silently re-resolving if the lockfile is out of date — the CI equivalent of `npm ci` vs `npm install`. Use in any CI job that must not be allowed to drift the lockfile.
@@ -2,6 +2,7 @@
topic: compile
source_keys:
- context7-microsoft-apm
- apm-cli-0-39-3-experiments
---
## Compile
@@ -12,7 +13,7 @@ apm compile --clean # zero-write sanity check; use for skill/agent-o
apm compile --clean --dry-run # pure preview, no writes
```
Compiles `.apm/instructions/` + `.apm/agents/*.agent.md` primitives into consumer-side context files (AGENTS.md/CLAUDE.md CONTEXT files) for the deployment target, per the `compilation:` block in `apm.yml`. This is the consumer/deployment side — it is NOT the producer of `plugin.json`/`marketplace.json`; that's `apm pack`'s job (below). Run `apm compile` after any change to `.apm/instructions/`/`.apm/agents/` content or to `compilation:`/`targets:` in `apm.yml`. To author an instructions file, use `instructions-author` — it covers which fields each target drops. `apm compile` never reads `.apm/prompts/`; to author a prompt file, use `prompt-author` — verification there is a throwaway `apm install`.
Compiles `.apm/instructions/` + `.apm/agents/*.agent.md` primitives into consumer-side context files (AGENTS.md/CLAUDE.md CONTEXT files) for the deployment target, per the `compilation:` block in `apm.yml`. For the `claude` target, apm 0.38 and later write the instructions into `AGENTS.md` and a `CLAUDE.md` that only imports it (`@AGENTS.md`). This is the consumer/deployment side — it is NOT the producer of `plugin.json`/`marketplace.json`; that's `apm pack`'s job (below). Run `apm compile` after any change to `.apm/instructions/`/`.apm/agents/` content or to `compilation:`/`targets:` in `apm.yml`. To author an instructions file, use `instructions-author` — it covers which fields each target drops. `apm compile` never reads `.apm/prompts/`; to author a prompt file, use `prompt-author` — verification there is a throwaway `apm install`.
## Pack
@@ -63,5 +64,5 @@ Executes a named script defined under `scripts:` in `apm.yml`, with `--param` su
## Gotchas
- Plain `apm compile` HARD-FAILS with exit 1 and `No instruction files found in .apm/ directory` on any package that has skills/agents but no `.apm/instructions/` content — the common case for a skill-only or skill+agent package. Use `apm compile --clean` as the zero-write sanity-check substitute: it sets `allow_empty=True` internally and exits 0 cleanly with zero writes; add `--dry-run` for a pure preview. `compile` ≠ `pack` — see above.
- Plain `apm compile` HARD-FAILS with exit 1 and `No instruction files found in .apm/ directory` (re-run on apm 0.39.3) on any package that has skills/agents but no `.apm/instructions/` content — the common case for a skill-only or skill+agent package. Use `apm compile --clean` as the zero-write sanity-check substitute: it sets `allow_empty=True` internally and exits 0 cleanly with zero writes; add `--dry-run` for a pure preview. `compile` ≠ `pack` — see above.
- `claude plugin validate --strict` auto-scans every `.md` file directly under a compiled plugin's `agents/` directory and treats it as an agent definition requiring frontmatter, independent of any manifest declaration (an empirically observed Claude Code platform behavior, not an `apm` mechanic). A non-agent `.md` file (notes, provenance record, README) that ends up under `.apm/agents/` in the source tree will still fail validation once compiled to the `claude` target. Keep such files outside `.apm/agents/` (e.g. at the package root), regardless of what `apm.yml` declares.
@@ -2,6 +2,7 @@
topic: configure
source_keys:
- context7-microsoft-apm
- apm-v0-39-3-source
---
## Scaffolding a new package
@@ -90,6 +91,6 @@ apm config set registry.corp-main.default true
## Gotchas
- `apm.yml`'s `type:` field validates nothing about `.apm/`. It selects processing: `instructions` compiles to AGENTS.md only, `skill` installs a native skill only, `prompts` emits commands only, `hybrid` does both (see `apm_cli/models/validation.py`, `PackageContentType`). apm checks only that the value parses to one of those four strings; no check anywhere compares it against the primitives actually on disk, and no mismatch diagnostic exists. A package declaring `type: instructions` while shipping `.apm/skills/` therefore raises no error — the mismatch resolves silently, either by omitting that primitive from the install/compile output or, in apm 0.28.0 where `get_effective_type()` routes off the on-disk layout and never reads the declared field, by ignoring the declared value outright. Both directions are silent: `apm install` and `apm compile` can exit 0 having shipped none of the primitives you expected. Set `type:` to cover every primitive the package ships, and confirm the deployed output rather than the exit code.
- `apm.yml`'s `type:` field validates nothing about `.apm/`. It selects processing: `instructions` compiles to AGENTS.md only, `skill` installs a native skill only, `prompts` emits commands only, `hybrid` does both (see `apm_cli/models/validation.py`, `PackageContentType`). apm checks only that the value parses to one of those four strings; no check anywhere compares it against the primitives actually on disk, and no mismatch diagnostic exists. A package declaring `type: instructions` while shipping `.apm/skills/` therefore raises no error — the mismatch resolves silently, either by omitting that primitive from the install/compile output or, in apm 0.28.0 and still in 0.39.3, where `get_effective_type()` routes off the detected package layout and never reads the declared field, by ignoring the declared value outright. Both directions are silent: `apm install` and `apm compile` can exit 0 having shipped none of the primitives you expected. Set `type:` to cover every primitive the package ships, and confirm the deployed output rather than the exit code.
- `apm experimental enable registries` must run before any `registry.*` config takes effect. Declaring a `registries:` block or running `apm config set registry.*` without it silently does nothing — no error, no warning.
- `apm plugin init <name>` run with a positional name argument, from inside a directory already named `<name>`, creates a wrongly-nested `<name>/<name>/` subdirectory — it treats the positional arg as "create a new project directory named X," not "confirm the current directory is X." Fix: omit the positional argument entirely when already cd'd into the target package directory — run `apm plugin init --yes --target claude,copilot` instead.
@@ -5,6 +5,7 @@ source_keys:
- context7-websites-code-claude
- claude-code-plugins-docs
- apm-github-repo
- apm-v0-39-3-source
---
## Building a marketplace from a producer repo
@@ -114,6 +115,6 @@ hook.
## Gotchas
- `apm marketplace add` and `apm marketplace package add` point in opposite directions and are easy to conflate: `add` registers someone else's catalog for you to *consume*; `package add` registers a package by remote reference (`owner/repo`, host URL, or full URL) into a marketplace you are *building*. `package add` does not accept a local path — register a local package by hand-editing `marketplace.packages[]`, as above.
- Only `claude` and `codex` marketplace output profiles exist in apm 0.28.0 — confirmed via source (`apm_cli/marketplace/output_profiles.py`: `MARKETPLACE_OUTPUTS = {claude: ..., codex: ...}`, nothing else). There is no native Copilot marketplace output; `apm pack` will not generate one. A repo needing a Copilot-consumable marketplace manifest must maintain it separately by other means.
- The marketplace output profiles depend on the apm version. apm 0.39.3 has three, `claude` (`.claude-plugin/marketplace.json`), `codex` (`.agents/plugins/marketplace.json`) and `copilot` (`.github/plugin/marketplace.json`), confirmed in `apm_cli/marketplace/output_profiles.py`. apm 0.28.0 had only `claude` and `codex`, so an older apm cannot emit a Copilot marketplace manifest. Add the output under `marketplace.outputs` only once every apm that packs the repo has it.
- A package/plugin `name` compiling to the `claude` target must avoid Claude Code's reserved name prefixes/values — `anthropic-*`, `claude-*`, `agent-skills`, `official-claude-plugins` — otherwise the compiled `.claude-plugin/marketplace.json` is rejected by Claude Code's validator. This is a Claude Code platform constraint, independent of how the manifest gets authored.
- Removing a package from `marketplace.packages[]` in `apm.yml` and re-packing changes the public/consumed catalog. Confirm with the user in conversation before removing the entry and running `apm pack` — this is a normal `apm.yml` edit (not a distinct apm-orchestrate operation with its own gate), so the confirmation is conversational, the same as any other consequential manifest edit.
@@ -11,7 +11,7 @@
## apm-github-repo
- **URL:** https://github.com/microsoft/apm
- **Description:** APM's own Python source (`src/apm_cli/`), read directly for schema and compile-mapping ground truth where Context7's doc snippets were thin. Backs the marketplace output-profile claim (`apm_cli/marketplace/output_profiles.py` — only `claude` and `codex` profiles exist, so there is no native Copilot marketplace output) and the `apm pack --check-clean`/`--check-versions` semantics.
- **Description:** APM's own Python source (`src/apm_cli/`), read directly for schema and compile-mapping ground truth where Context7's doc snippets were thin. Backs the `apm pack --check-clean`/`--check-versions` semantics, and the 0.28.0 marketplace output profiles (`claude` and `codex` only).
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md
- **Contributing files:** references/marketplace.md
- **Status:** `extracted`
@@ -39,3 +39,35 @@
- **Research doc:** plugins/kyberforge/docs/research/docs/claude-code-plugins/sources.md
- **Contributing files:** (none)
- **Status:** `referenced`
## 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 the pinned install: the three marketplace output profiles in `marketplace/output_profiles.py`, `get_effective_type()` in `integration/skill_package_routing.py` still routing off the detected package layout, and the `apm audit` exit codes.
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/cli-reference.md)
- **Contributing files:** references/marketplace.md, references/configure.md, references/audit.md
- **Status:** `extracted`
## apm-v0-39-3-docs
- **URL:** https://github.com/microsoft/apm/tree/v0.39.3/docs/src/content/docs
- **Description:** apm docs at tag v0.39.3: `apm audit --ci` refusing lockfile fields it does not know, so the auditing apm must be at least as new as the lock's writer.
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/lockfile-and-compatibility.md)
- **Contributing files:** references/audit.md
- **Status:** `extracted`
## apm-cli-0-39-3-uv-experiments
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
- **Description:** Throwaway uv projects pinning apm-cli 0.39.3. Grounds the pinned invocation `uv run --project <repo root> --frozen apm` in `SKILL.md` Step 2 and in the CI note, and the need for one online `uv sync --frozen` per machine.
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/installation.md)
- **Contributing files:** SKILL.md, references/audit.md
- **Status:** `extracted`
## apm-cli-0-39-3-experiments
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
- **Description:** The repo-pinned apm-cli 0.39.3 run in throwaway packages outside the repo (holocron#273): the Claude compile writing a `CLAUDE.md` that imports `AGENTS.md`, and a skills-only package's plain compile still exiting 1 while `--clean` exits 0.
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/instructions-gotchas.md)
- **Contributing files:** references/compile.md
- **Status:** `extracted`
@@ -6,7 +6,7 @@ description: >
skill -> `skill-author`. Not a named agent -> `agent-author`. Not a named
plugin -> `apm-workflow`.
metadata:
version: "1.0.5"
version: "1.0.6"
category: factory
source_keys:
- claude-code-subagents-docs
@@ -4,7 +4,7 @@ source_keys:
- context7-websites-code-claude
- claude-code-memory-docs
- apm-docs-author-prompts
- apm-cli-0-28-0-prompt-experiments
- apm-cli-0-39-3-experiments
- claude-code-slash-commands
---
@@ -37,7 +37,7 @@ place only where its single-file, multi-target shape is the point.
| The content is | Route |
|---|---|
| A single-file command that should also reach Copilot, Cursor, Gemini or OpenCode | Prompt file (`prompt-author`) |
| A single-file command that should also reach Copilot, Cursor, Gemini or OpenCode (Kiro gets the body only) | Prompt file (`prompt-author`) |
| A command that needs `references/` or `scripts/`, or that other skills or the model must be able to call | Skill (`skill-author`), declared hand-invoked |
| A Claude-only command with no such need | Skill (`skill-author`), because the vendor steers new commands there |
@@ -32,11 +32,11 @@
- **Contributing files:** references/author-routes.md
- **Status:** `extracted`
## apm-cli-0-28-0-prompt-experiments
## apm-cli-0-39-3-experiments
- **URL:** https://pypi.org/project/apm-cli/0.28.0/
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-target-mapping.md)
- **Description:** The installed apm-cli 0.28.0 exercised in throwaway packages. Grounds the same table: which targets receive a prompt file.
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-gotchas.md)
- **Description:** The repo-pinned apm-cli 0.39.3 run in throwaway packages (holocron#273), re-running the 0.28.0 prompt experiments. Grounds the same table: Copilot, Cursor, Gemini and OpenCode each receive a prompt file as a command. Kiro now receives the body only, and Codex and Antigravity still receive nothing.
- **Contributing files:** references/author-routes.md
- **Status:** `extracted`
@@ -5,21 +5,23 @@ description: >
(`.apm/instructions/*.instructions.md`). Not read-only review ->
`factory-audit`. Not skills -> `skill-author`. Not agents -> `agent-author`.
Not AGENTS.md -> `agentsmd-author`.
compatibility: Requires the apm CLI; behaviour verified against apm 0.28.0.
compatibility: Requires the apm CLI, 0.39.2 or later; behaviour verified against apm 0.39.3.
allowed-tools: Bash Read Write Edit
metadata:
version: "0.1.0"
version: "0.1.1"
category: factory
source_keys:
- apm-docs-site
- apm-cli-0-28-0-experiments
- apm-cli-0-39-3-experiments
- apm-v0-39-3-source
- claude-code-memory-docs
---
## Gotchas
- Claude Code drops `description`; only Copilot, grok-build and Cursor keep it. Write a body that explains itself.
- Quote every `applyTo`. An unquoted `**/*.py` fails to parse, compile skips the file, and `apm install` still deploys it with no `paths:`, so it loads in every session. Install prints the parse warning once and exits 0.
- Quote every `applyTo`. An unquoted `**/*.py` is a YAML alias error: `apm install` exits 1 and deploys nothing, while `apm compile` drops the file and still exits 0.
- On Claude a rule leaves `.claude/rules/` only once a compile has actually written it into `AGENTS.md`, which `CLAUDE.md` imports. Install-then-compile dedups it, so it stays. Where a rule loads from is in `references/target-mapping.md`.
## Step 1 — Dispatch
@@ -40,7 +42,7 @@ Gates on every file, whichever flow wrote it:
- **One topic per file.** Two topics are two files.
- **Scope.** Omit `applyTo` only for a rule that must load in every session, and tell the user it then costs context at every launch.
- **Source.** Flat in `.apm/instructions/`, named `<stem>.instructions.md`. Anything nested or misnamed is ignored or never installed.
- **Stem.** It becomes the deployed filename, and install overwrites a hand-authored rule of the same name on most targets without a prompt. Check for a collision before choosing it.
- **Stem.** It becomes the deployed filename. Install skips a hand-authored file at that path and deploys nothing there, and `--force` overwrites it. Check for a collision before choosing it.
- **Body.** Concrete, checkable bullets, paths in backticks, nothing assuming another file is loaded, under 200 lines. If unsure the content is a rule rather than a procedure or something to enforce, read `references/content.md`.
If a field, glob or location is in question, read `references/schema.md`. If the question is which target keeps which field, or what compile does, read `references/target-mapping.md`.
@@ -2,8 +2,8 @@
# Delete these comments once filled in; Copilot receives this file verbatim.
description: "FILL IN: one line on what this rule covers. Only Copilot, grok-build and Cursor keep it."
applyTo: "FILL IN: quoted glob, e.g. **/*.py"
# applyTo is always quoted: an unquoted ** is a YAML alias error and the rule
# deploys unscoped. Several globs: "**/*.css,**/*.scss". Delete the line only
# applyTo is always quoted: an unquoted ** is a YAML alias error and apm
# install fails. Several globs: "**/*.css,**/*.scss". Delete the line only
# for a rule that must load in every session.
---
# FILL IN: one topic per file
@@ -1,7 +1,7 @@
---
source_keys:
- apm-docs-site
- apm-cli-0-28-0-experiments
- apm-cli-0-39-3-experiments
---
# Creating a new instructions file
@@ -18,7 +18,7 @@ Confirm, and ask the user for anything missing:
## Step 1 — Check the stem
Install overwrites a hand-authored file at `.claude/rules/<stem>.md`, `.cursor/rules/<stem>.mdc`, `.windsurf/rules/<stem>.md`, `.kiro/steering/<stem>.md` and `.agents/rules/<stem>.md` without a prompt. List those paths in the consuming project and choose another stem on any hit.
Install skips a hand-authored file at a deployed path, such as `.claude/rules/<stem>.md` or `.github/instructions/<stem>.instructions.md`, so the new rule never deploys there; `--force` would overwrite the hand-authored one. For each target in `targets:`, list its path from `references/target-mapping.md` in the consuming project and choose another stem on any hit.
## Step 2 — Scaffold
@@ -1,7 +1,7 @@
---
source_keys:
- apm-docs-site
- apm-cli-0-28-0-experiments
- apm-cli-0-39-3-experiments
---
# Improving an existing instructions file
@@ -16,13 +16,16 @@ Read the file whole. Signals are grill output, audit findings, inline feedback,
| Symptom | Cause | Fix |
|---|---|---|
| A scoped rule loads in every Claude session | `applyTo` is unquoted or malformed, so install deployed no `paths:` | Quote it, then confirm with `references/verify.md` |
| Compile warns "Failed to parse" | Broken frontmatter YAML | Repair the YAML; do not delete the field |
| The rule is in `CLAUDE.md` but not `.claude/rules/` | The file is nested under `.apm/instructions/` | Move it up to the flat directory |
| Install exits 1 with "Rejected frontmatter", or compile warns "Failed to parse" | Broken frontmatter YAML, most often an unquoted `applyTo` | Repair or quote it; do not delete the field |
| A rule meant to be scoped loads in every Claude session | `applyTo` is missing, or apm 0.28.0 installed it unquoted with no `paths:` | Add or quote it, then confirm with `references/verify.md` |
| The rule is in `AGENTS.md` but not `.claude/rules/`, and it is scoped to file types | The file is nested under `.apm/instructions/` | Move it up to the flat directory |
| An unscoped rule left `.claude/rules/` | apm moved it into `AGENTS.md`, which `CLAUDE.md` imports | Expected; confirm `CLAUDE.md` holds `@AGENTS.md` |
| Compile warns "applyTo ... matched no files" | The glob matches nothing in this project | Fix the glob, or confirm the files do not exist yet |
| The rule appears nowhere | The name lacks `.instructions.md` | Rename it |
| Claude ignores guidance written in `description` | Claude Code drops `description` | Move the substance into the body |
| A hand-written rule vanished after install | The stem collided with a deployed name | Restore it from version control and rename the source stem |
| The same rule reaches the agent twice | Cursor, Windsurf, Kiro and Grok get both a native file and an `AGENTS.md` copy | State it to the user; it is apm behaviour, not a defect in the file |
| The rule did not deploy and install printed "files skipped -- local files exist" | The stem collides with a hand-written file at the deployed path | Rename the source stem. `--force` would overwrite the hand-written file |
| A hand-written rule vanished after install | `--force`, or apm 0.28.0, overwrote it | Restore it from version control and rename the source stem |
| The same rule reaches the agent twice | When compile also writes `AGENTS.md` for a target with no dedup, Cursor, Windsurf, Kiro and Grok get both a native file and an `AGENTS.md` copy | State it to the user; it is apm behaviour, not a defect in the file |
Cases not in the table: read `references/target-mapping.md`.
@@ -2,20 +2,20 @@
source_keys:
- apm-docs-site
- apm-github-repo
- apm-cli-0-28-0-experiments
- apm-cli-0-39-3-experiments
- claude-code-memory-docs
---
# The instructions source file
Verified against apm 0.28.0. Reached from `SKILL.md` Step 2 when a frontmatter field, a glob or the file's location is in question.
Verified against apm 0.39.3. Reached from `SKILL.md` Step 2 when a frontmatter field, a glob or the file's location is in question.
## Location and name
`.apm/instructions/<name>.instructions.md`, flat. The double extension is the discovery key and the stem is the primitive's name; there is no `name` field.
- A plain `.md` in that directory is ignored by both `apm compile` and `apm install`.
- A file in a subdirectory is folded into compiled root files by compile but never deployed by install, so it reaches `CLAUDE.md` and `AGENTS.md` and no native rules directory.
- A file in a subdirectory is folded into compiled root files by compile but never deployed by install, so it reaches `AGENTS.md` and no native rules directory.
- The stem becomes the deployed filename: `<stem>.md`, `<stem>.mdc`, or `<stem>.instructions.md`, by target.
## Frontmatter
@@ -32,7 +32,7 @@ Only `description` and `applyTo` carry meaning. `author` and `version` are parse
- A YAML sequence is joined into the same comma form.
- Brace alternation is never split: `"**/*.{css,scss},**/*.py"` is two patterns.
- A literal comma in a pattern is `\,`; a literal backslash is `\\`.
- Always quote the value. An unquoted `**/*.py` is a YAML alias error; see `SKILL.md` Gotchas for what apm then does.
- Always quote the value. An unquoted `**/*.py` is a YAML alias error, and install then fails; see `SKILL.md` Gotchas.
## Body
@@ -43,8 +43,8 @@ Plain markdown. Official guidance: bullets over prose, one topic per file (`pyth
`Instruction.validate()` yields three findings, all demoted to warnings: missing `description`, missing `applyTo` ("will apply globally") and empty content. A broken relative link in the body is a fourth, also non-fatal.
- A real `apm compile` prints them. `apm compile --validate` prints none of them and exits 0 even for a file with all three problems; it exits 1 only when the package has no instructions at all.
- `apm install` prints none.
- `apm install` prints none, and deploys such a file.
- `apm audit --ci` checks lockfile, deployed-file presence, content hash and hidden Unicode, not instruction content.
- A file whose frontmatter does not parse is skipped by compile ("Failed to parse") but still deployed by install.
- A file whose frontmatter does not parse is skipped by compile ("Failed to parse", exit 0) and fails install: `apm install` exits 1 with "Rejected frontmatter in <file>" and commits nothing.
No standalone instructions validator exists, so enforcement is this skill's checks and `references/verify.md`.
@@ -2,6 +2,8 @@
source_keys:
- apm-docs-site
- apm-github-repo
- apm-cli-0-39-3-experiments
- apm-v0-39-3-source
- apm-cli-0-28-0-experiments
- claude-code-memory-docs
- github-copilot-custom-instructions-docs
@@ -26,12 +28,28 @@ source_keys:
- **Contributing files:** references/schema.md
- **Status:** `extracted`
## apm-cli-0-39-3-experiments
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/instructions-gotchas.md)
- **Description:** The repo-pinned apm-cli 0.39.3 run in throwaway packages (holocron#273): unquoted and broken frontmatter failing install, the Claude compile writing a `CLAUDE.md` that imports `AGENTS.md`, per-instruction dedup, an unscoped rule's retirement from `.claude/rules/`, hand-authored collisions skipped, stale cleanup, per-target transforms, validation severity and discovery asymmetry. The bats suite in `tests/` re-runs four of these on every push.
- **Contributing files:** SKILL.md, references/schema.md, references/target-mapping.md, references/verify.md, references/create.md, references/improve.md
- **Status:** `extracted`
## apm-v0-39-3-source
- **URL:** https://github.com/microsoft/apm/tree/v0.39.3/src/apm_cli
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/instructions-target-mapping.md)
- **Description:** apm source at tag v0.39.3: which Claude instruction scopes route to `AGENTS.md`, and the blockers that keep every instruction in `.claude/rules/` (a hand-authored `CLAUDE.md` without the import, a hand-authored `AGENTS.md` without managed-section markers, a symlinked `AGENTS.md`).
- **Contributing files:** SKILL.md, references/target-mapping.md
- **Status:** `extracted`
## apm-cli-0-28-0-experiments
- **URL:** https://pypi.org/project/apm-cli/0.28.0/
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/instructions-gotchas.md)
- **Description:** The installed apm-cli 0.28.0 package plus throwaway install, compile and audit experiments confirming validation severity, unquoted-glob handling, discovery asymmetry, dedup and overwrite behaviour.
- **Contributing files:** SKILL.md, references/schema.md, references/target-mapping.md, references/verify.md, references/create.md, references/improve.md
- **Description:** The installed apm-cli 0.28.0 package plus throwaway install, compile and audit experiments. Superseded by `apm-cli-0-39-3-experiments` wherever the two were both run; still the only source for the user-scope deploy rule and the 0.28.0 behaviours the skill names as history.
- **Contributing files:** references/target-mapping.md
- **Status:** `extracted`
## claude-code-memory-docs
@@ -1,5 +1,7 @@
---
source_keys:
- apm-cli-0-39-3-experiments
- apm-v0-39-3-source
- apm-cli-0-28-0-experiments
- apm-docs-site
- claude-code-memory-docs
@@ -9,11 +11,11 @@ source_keys:
# What each target receives
Verified against apm 0.28.0 and throwaway installs. Reached from `SKILL.md` Step 2 when the question is which target keeps which field. Source-file syntax is in `references/schema.md`.
Verified against apm 0.39.3 in throwaway installs, except where a line says otherwise. Reached from `SKILL.md` Step 2 when the question is which target keeps which field. Source-file syntax is in `references/schema.md`.
## Two output paths
`apm install` writes one native file per instruction into each target's rules directory. `apm compile` writes root context files that concatenate instruction bodies, grouped by `applyTo`. Treat install as the primary path for Claude Code and Copilot, and compile as the path for targets with no native instructions directory.
`apm install` writes one native file per instruction into each target's rules directory. `apm compile` writes root context files that concatenate instruction bodies, grouped by `applyTo`. Treat install as the primary path for Copilot and the other rule-directory targets, and compile as the path for targets with no native instructions directory. Claude uses both; see below.
## Install: deployed path and transform
@@ -21,14 +23,23 @@ Verified against apm 0.28.0 and throwaway installs. Reached from `SKILL.md` Step
|---|---|---|
| copilot | `.github/instructions/<n>.instructions.md` | Verbatim copy |
| claude | `.claude/rules/<n>.md` | `applyTo` becomes a `paths:` list; `description` dropped; no frontmatter at all without `applyTo` |
| cursor | `.cursor/rules/<n>.mdc` | `applyTo` becomes `globs`; `description` kept; no `alwaysApply` written |
| cursor | `.cursor/rules/<n>.mdc` | `applyTo` becomes `globs`, one comma-separated string even for several patterns; `description` kept; no `alwaysApply` written |
| windsurf | `.windsurf/rules/<n>.md` | `trigger: glob` plus `globs`, or `trigger: always_on`; `description` dropped |
| kiro | `.kiro/steering/<n>.md` | `inclusion: fileMatch` plus `fileMatchPattern`, or `inclusion: always`; `description` dropped |
| antigravity | `.agents/rules/<n>.md` | `trigger: glob` plus `globs`, or no frontmatter; `description` dropped |
| antigravity | `.agents/rules/<n>.md` | `trigger: glob` plus `globs`, or `trigger: always_on`; `description` dropped |
| grok-build | `.grok/rules/<n>.instructions.md` | Verbatim copy |
| codex, gemini, opencode and the rest | none | Reach instructions only through compile |
Cursor, Windsurf and Antigravity do not deploy at user scope; Kiro and the rest do.
At user scope Cursor, Windsurf and Antigravity do not deploy, and Kiro and the rest do. That is from the 0.28.0 source and was not re-run.
## Claude: `.claude/rules/` or `AGENTS.md`
apm 0.38 and later split Claude's instructions between the two.
- Install deploys each instruction to `.claude/rules/`, unless a compiled `AGENTS.md` already carries it.
- Compile writes the bodies into `AGENTS.md` and a `CLAUDE.md` that holds only `@AGENTS.md`, leaving out any instruction already in `.claude/rules/`.
- A rule moves out of `.claude/rules/` only when compile actually wrote it into `AGENTS.md`: compile ran before install, `--force-instructions` was passed, or the compile also served a target with no dedup. The next install then deletes the `.claude/rules/` copy ("Retired ... AGENTS.md now carries it"). Install-then-compile dedups every deployed rule, so they all stay in `.claude/rules/`, and compile-then-install never deploys the unscoped rule there. The source also routes a rule scoped to `**`, `**/*` or exactly one literal `dir/**` this way. File-type globs such as `**/*.py`, wildcard directories and lists stay in `.claude/rules/`.
- From the source, not run: these keep every instruction in `.claude/rules/`, with a warning: a hand-authored root `CLAUDE.md` without an `@AGENTS.md` import; a hand-authored root `AGENTS.md` without `compilation.agents_md.mode: managed_section` and one pair of `<!-- apm:start -->`/`<!-- apm:end -->` markers; a symlinked `AGENTS.md`. Compile never overwrites a hand-authored root file. User scope never routes to `AGENTS.md`.
## Field survival
@@ -42,22 +53,23 @@ For Claude Code the body's first line or heading is the only descriptive text th
## Ownership and overwrite
- Claude, Cursor, Windsurf, Kiro and Antigravity treat each deployed file as apm-owned: install replaces a hand-authored file at the same path without a prompt. Copilot and grok-build skip an unmanaged file ("local files exist, not managed by APM") until `apm install --force`.
- Removing or renaming a source makes the next install delete the file it deployed for Claude, Copilot, Cursor, Windsurf and Kiro. Antigravity and grok-build leave the old file behind in 0.28.0, so delete it by hand.
- Every rule target skips a hand-authored file at a deployed path: install prints "files skipped -- local files exist, not managed by APM", deploys nothing there and exits 0. `apm install --force` overwrites the hand-authored file. apm 0.28.0 overwrote it silently on Claude, Cursor, Windsurf, Kiro and Antigravity.
- Removing or renaming a source makes the next install delete the file it deployed, on every rule target.
## Compile
- `--target claude` writes `CLAUDE.md`; Gemini writes `GEMINI.md` and `AGENTS.md`; every other target writes `AGENTS.md`.
- Compile skips instructions already deployed natively, for Claude, Copilot and Antigravity only, and the skip is all-or-nothing: if any instruction has a same-stem file in `.claude/rules/`, compile omits every instruction from `CLAUDE.md`, including a new one never deployed. With rules populated, `--target claude` exits 0, prints "produced no output files" and writes nothing. `--force-instructions` (alias `--no-dedup`) overrides.
- Cursor, Windsurf, Kiro and Grok have no dedup: compile writes `AGENTS.md` that repeats rules the tool already loads natively. Codex, Gemini and OpenCode get no native file, so the compiled root file is their only copy.
- A package with no instruction primitives (skills only) makes plain `apm compile` exit 1 with "No instruction files found"; `apm compile --clean` exits 0.
- `--target claude` writes `AGENTS.md` plus a `CLAUDE.md` that imports it. Gemini writes `GEMINI.md`, which also imports `AGENTS.md`. Every other target writes `AGENTS.md`.
- For a Claude-only compile, an instruction already deployed to `.claude/rules/` is left out of `AGENTS.md`, one instruction at a time. A nested or newly added one is still compiled. When every instruction is deployed, compile exits 0 and writes no `CLAUDE.md`. `--force-instructions` (alias `--no-dedup`) includes them all.
- A compile that also serves a target with no dedup, such as codex, writes every instruction into `AGENTS.md`. Cursor, Windsurf, Kiro and Grok then get each rule twice: natively and through `AGENTS.md`.
- Compile warns "applyTo for '<n>' matched no files" when a pattern matches nothing in the project, and places that instruction at the root.
- A package with skills but no instruction primitives makes plain `apm compile` exit 1 with "No instruction files found"; `apm compile --clean` exits 0.
## Native format facts
- Claude Code reads `.claude/rules/**/*.md` recursively. `paths` is the only field it reads, as a list or a comma-separated string; other fields are ignored. A rule without `paths` loads at every launch. Frontmatter that fails to parse is ignored and the rule loads without `paths`.
- Claude Code reads `.claude/rules/**/*.md` recursively. `paths` is the only field it reads, as a list or a comma-separated string; other fields are ignored. A rule without `paths` loads at every launch. Frontmatter that fails to parse is ignored and the rule loads without `paths`. Claude Code reads `AGENTS.md` only while no `CLAUDE.md` exists or `CLAUDE.md` imports it.
- Copilot path-specific files need `applyTo` as a quoted comma-joined string; `excludeAgent` is the only other documented key. Repository-wide instructions are the separate `.github/copilot-instructions.md`.
- Cursor ignores a plain `.md` in `.cursor/rules`. A rule with only a `description` is "Apply Intelligently", not always-on.
## Unverified
Cursor's handling of a YAML-list `globs`, Copilot's handling of unknown frontmatter keys, and runtime behaviour on Windsurf, Kiro and Antigravity. Say so rather than asserting any of them.
Copilot's handling of unknown frontmatter keys, and runtime behaviour on Windsurf, Kiro and Antigravity. Say so rather than asserting any of them.
@@ -1,11 +1,11 @@
---
source_keys:
- apm-cli-0-28-0-experiments
- apm-cli-0-39-3-experiments
---
# Verifying a file in a throwaway package
Reached from `SKILL.md` Step 3. Run step 2 outside the repo: `apm install` writes `apm_modules/`, `apm.lock.yaml` and a rules directory, and install overwrites hand-authored rule files without warning.
Reached from `SKILL.md` Step 3. Run step 2 outside the repo: `apm install` writes `apm_modules/`, `apm.lock.yaml` and a rules directory. In a repo that pins apm with uv, spell each `apm` below as `uv run --project <repo root> --frozen apm`, so the check runs the repo's apm and not the one on `PATH`.
1. From the package root, a real compile. `--validate` hides the missing-`description`, missing-`applyTo` and empty-body warnings and exits 0 whenever the package has an instruction, so it verifies nothing:
@@ -25,8 +25,8 @@ Reached from `SKILL.md` Step 3. Run step 2 outside the repo: `apm install` write
(cd "$d" && apm install && cat .claude/rules/<name>.md)
```
3. The deployed file must open with `paths:` listing the intended globs. No frontmatter block at all means `applyTo` was missing or did not parse: the rule would load in every session.
3. Install must exit 0. Exit 1 with "Rejected frontmatter" means the YAML did not parse, usually an unquoted `applyTo`. The deployed file must open with `paths:` listing the intended globs. No frontmatter block at all means `applyTo` was missing: the rule loads in every session.
4. Once rules sit in `.claude/rules/`, `apm compile --target claude` writes no `CLAUDE.md` and still exits 0, so an exit-code check proves nothing. To inspect the compiled root file, pass `--force-instructions`.
4. Once every rule sits in `.claude/rules/`, `apm compile --target claude` writes no `CLAUDE.md` and still exits 0, so an exit-code check proves nothing. To inspect the compiled `AGENTS.md`, pass `--force-instructions`. The `CLAUDE.md` it writes holds only `@AGENTS.md`.
Delete the directory afterwards. Report only what was observed; Cursor's list-form `globs` and the Windsurf, Kiro and Antigravity runtimes stay unverified.
Delete the directory afterwards. Report only what was observed; the Windsurf, Kiro and Antigravity runtimes stay unverified.
@@ -1,12 +1,12 @@
# tests/
- **`new-instructions.bats`** — covers `scripts/new-instructions.sh` (name validation, package walk-up, no-package refusal, no-op on an existing file, template placeholders) and the apm behaviour the skill's gotchas rest on, run against throwaway packages: a filled scaffold compiles into `CLAUDE.md` and installs into `.claude/rules/` with `description` dropped, compile writes nothing once rules are installed, an unquoted `applyTo` installs unscoped, and `--validate` hides the warnings a real compile prints.
- **`new-instructions.bats`** — covers `scripts/new-instructions.sh` (name validation, package walk-up, no-package refusal, no-op on an existing file, template placeholders) and the apm behaviour the skill's gotchas rest on, run against throwaway packages: a filled scaffold compiles into `AGENTS.md` behind a `CLAUDE.md` that imports it, and installs into `.claude/rules/` with `description` dropped; compile writes nothing once rules are installed; an unquoted `applyTo` fails install and deploys nothing; and `--validate` hides the warnings a real compile prints.
## Dependencies
The test file loads `bats-support` and `bats-assert` from the repo root's `tests/test_helper/`, and runs on the repo's bats submodule at `tests/bats/`. The first `bash tests/run-bats.sh` initialises the submodules.
The apm tests need the `apm` CLI on `PATH` and skip when it is absent. They assert apm 0.28.0 behaviour, so a failure after an apm upgrade is a finding about the skill's gotchas, not a flaky test.
In this repo the apm tests run the repo-pinned apm (`uv run --frozen apm`, through `scripts/lib/apm.sh`) and fail when it is unavailable; run `uv sync --frozen` first. Outside this repo they use the `apm` on `PATH` and skip when it is absent. They assert apm 0.39.3 behaviour, so a failure after an apm upgrade is a finding about the skill's gotchas, not a flaky test.
From the repo root:
@@ -191,7 +191,7 @@ need_apm() {
# re-pinned to the repo's 0.39.3 (#271), where three behaviours changed: compile
# --target claude writes a CLAUDE.md that imports AGENTS.md, an unquoted applyTo
# fails install closed, and compile warns when applyTo matches no file. The
# skill's own text still describes 0.28.0 in places; see #271's report.
# skill's text was brought level with 0.39.3 under #273.
# ---------------------------------------------------------------------------
@test "filled scaffold compiles for the Claude target: CLAUDE.md imports AGENTS.md, which drops the description" {
@@ -5,23 +5,24 @@ description: >
(`.apm/prompts/*.prompt.md`). Not read-only review -> `factory-audit`.
Not skills -> `skill-author`. Not agents -> `agent-author`. Not
instructions -> `instructions-author`.
compatibility: Requires the apm CLI; behaviour verified against apm 0.28.0.
compatibility: Requires the apm CLI, 0.39.2 or later; behaviour verified against apm 0.39.3.
allowed-tools: Bash Read Write Edit
metadata:
version: "0.1.0"
version: "0.1.1"
category: factory
source_keys:
- apm-docs-author-prompts
- apm-docs-llms-full
- apm-docs-producer-ramp
- apm-github-repo
- apm-cli-0-28-0-prompt-experiments
- apm-cli-0-39-3-experiments
- apm-v0-39-3-source
---
## Gotchas
- `apm compile` never reads prompt files, and `--validate` ignores them even when malformed. A prompt file is verified only by a throwaway `apm install`.
- Unsupported frontmatter keys are dropped, loudly on the Claude family and silently on Gemini, which keeps only `description`. Codex, Kiro and Antigravity deploy nothing and print nothing.
- Unsupported frontmatter keys are dropped quietly: the Claude family names them only under `apm install --verbose`, and Gemini keeps only `description` and says nothing. Kiro strips every key, with a warning naming them. Codex and Antigravity deploy nothing and print nothing.
- `input:` descriptions are discarded: only the names survive, as `arguments:`. Duplicate names are not caught.
## Step 1 — Dispatch
@@ -42,7 +43,7 @@ Gates on every file, whichever flow wrote it:
- **Source.** A single file named `<stem>.prompt.md` in `.apm/prompts/`, flat. Anything nested, uppercase or named plain `.md` is silently ignored.
- **Stem.** Kebab-case. It becomes the deployed command name, and apm skips a hand-written file of the same name unless `--force` is passed. Check for a collision before choosing it.
- **Frontmatter.** `description`, plus `input`, `allowed-tools`, `model` or `argument-hint` only when needed. No other keys: they are dropped, and `source_keys` would warn on every install.
- **Frontmatter.** `description`, plus `input`, `allowed-tools`, `model` or `argument-hint` only when needed. A Claude Code command key such as `disable-model-invocation` survives on the `claude` target only, from apm 0.39.0, and is dropped on every other target; add one only when the command needs it on Claude. Never `hooks`: apm withholds it. No other keys, `source_keys` included: they are dropped.
- **Arguments.** Declare `input:` names and use `${input:name}` in the body, or use a literal `$ARGUMENTS`, never both.
- **Body.** Written as an instruction to the model, self-contained, and clear about what it produces. If unsure the content is a prompt file rather than a skill, a rule or something to enforce, read `references/content.md`.
@@ -11,6 +11,8 @@ input:
# allowed-tools: Bash(git status:*) Read
# model: FILL IN
# argument-hint: "<target>" # synthesised from input: when omitted
# Claude only (apm 0.39+), dropped on every other target:
# disable-model-invocation: true
---
FILL IN: an instruction to the model, written so it works with nothing else loaded.
@@ -1,7 +1,7 @@
---
source_keys:
- apm-docs-author-prompts
- apm-cli-0-28-0-prompt-experiments
- apm-cli-0-39-3-experiments
---
# Creating a new prompt file
@@ -1,7 +1,7 @@
---
source_keys:
- apm-docs-author-prompts
- apm-cli-0-28-0-prompt-experiments
- apm-cli-0-39-3-experiments
---
# Improving an existing prompt file
@@ -18,15 +18,20 @@ Read the file whole. Apply the signals that triggered this flow (`SKILL.md` Step
|---|---|---|
| The command does not exist after install | The file is nested, uppercase (`.PROMPT.md`) or a bare `.md`, so discovery ignored it | Move it flat into `.apm/prompts/` and name it `<stem>.prompt.md` |
| The command is missing and install warned "malformed or over-budget YAML frontmatter" | Broken frontmatter, so Claude and Gemini skipped the file | Repair the YAML |
| Install warned "frontmatter keys not supported … dropped" | The file carries keys the Claude family does not keep | Remove them, or accept that only Copilot keeps them |
| `apm install --verbose` reported "frontmatter keys not supported … dropped" | The file carries keys that target does not keep | Remove them, or accept that only Copilot keeps them |
| `disable-model-invocation` or another Claude Code command key is missing from `.claude/commands/` | The apm that installed it is older than 0.39, which dropped those keys | Install with apm 0.39.2 or later |
| A Claude Code command key is missing from the Cursor or OpenCode command | Only the `claude` target keeps those keys | State it to the user; it is apm behaviour |
| Install warned "frontmatter hooks withheld" | The file sets `hooks`, which apm does not deploy on commands | Remove it, or move the hook into a hook package |
| An argument is missing from `arguments:` | The name failed `[A-Za-z][A-Za-z0-9_-]{0,63}` and install warned `input: rejected` | Rename it |
| An argument appears twice | Duplicate names are not caught | Remove the duplicate |
| `arguments:` lists `name` and `description` | An `input:` item had `name:` and `description:` keys, and each key became an argument | Use plain names, or one `{name: description}` pair per item |
| The body shows `$ARGUMENTS` or `$0` next to named arguments | `input:` and a literal placeholder were both written | Use one style |
| The Gemini command ignores `model` or `allowed-tools` | Gemini keeps only `description` and the body, silently | State it to the user; it is apm behaviour |
| Nothing deployed for Codex, Kiro or Antigravity | Those targets have no prompt surface | State it to the user |
| Nothing deployed for Codex or Antigravity | Those targets have no prompt surface | State it to the user |
| The Kiro prompt has no frontmatter | Kiro's prompt surface keeps the body only | State it to the user |
| Install exited 1 with "Kept … modified since APM deployed it" | A deployed command was edited by hand | Move it aside, or export the edit with `apm export-patch`, then reinstall |
| A hand-written command was not replaced | apm skips unmanaged files | Rename the stem, or use `apm install --force` knowingly |
| Install failed with exit 1 and a security error | Tag characters or a bidi override in the file; the Claude-family command is withheld even with `--force`, while the Copilot copy and Gemini TOML may still be written | Remove the hidden characters |
| Install failed with exit 1 and a security error | Tag characters or a bidi override in the file. Nothing is written; with `--force` the Copilot copy and Gemini TOML are, but the Claude-family command is still withheld | Remove the hidden characters |
Cases not in the table: read `references/target-mapping.md`.
@@ -2,12 +2,14 @@
source_keys:
- apm-docs-author-prompts
- apm-github-repo
- apm-v0-39-3-source
- apm-cli-0-39-3-experiments
- apm-cli-0-28-0-prompt-experiments
---
# The prompt source file
Verified against apm 0.28.0. Reached from `SKILL.md` Step 2 when a field, a placeholder or the file's location is in question.
Verified against apm 0.39.3, except the root-file and odd-name rules under "Location and name", last run on 0.28.0. Reached from `SKILL.md` Step 2 when a field, a placeholder or the file's location is in question.
## Location and name
@@ -31,9 +33,16 @@ No closed schema; apm passes or drops keys per target.
| `model` | Model override |
| `argument-hint` (alias `argumentHint`) | Hint text; synthesised as `<a> <b>` from `input` when omitted |
### Claude Code command keys
From apm 0.39.0 the `claude` target keeps Claude Code's own command keys: `when_to_use`, `disable-model-invocation`, `user-invocable`, `disallowed-tools`, `effort`, `context`, `agent`, `background` and `shell`. Every other target that gets a command file (cursor, opencode, windsurf, grok-build) drops them, and Gemini and Kiro drop them with the rest. apm 0.28.0 dropped them on Claude too, so a command relying on one needs apm 0.39.2 or later wherever it is installed.
- An authored `arguments:` is kept on Claude only when the file has no `input:` key at all.
- `hooks` is withheld: the command deploys without it, and install warns `frontmatter hooks withheld`.
Input names must match `[A-Za-z][A-Za-z0-9_-]{0,63}`. An invalid name is dropped with a warning and the install still succeeds; duplicates are neither removed nor warned about.
The Copilot App workflow keys `interval`, `schedule_hour` and `schedule_day` mark a prompt file as a scheduled workflow that the command integrator skips. Do not use them in a plain prompt file. The VS Code keys `agent`, `tools` and `name` survive on Copilot only.
The Copilot App workflow keys `interval`, `schedule_hour` and `schedule_day` mark a prompt file as a scheduled workflow that the command integrator skips. Do not use them in a plain prompt file. The VS Code keys `tools` and `name` survive on Copilot only. `agent` also survives on Claude, as a Claude Code command key with its own meaning there.
## Body placeholders
@@ -4,6 +4,8 @@ source_keys:
- apm-docs-llms-full
- apm-docs-producer-ramp
- apm-github-repo
- apm-v0-39-3-source
- apm-cli-0-39-3-experiments
- apm-cli-0-28-0-prompt-experiments
---
@@ -41,10 +43,26 @@ source_keys:
- **Contributing files:** SKILL.md, references/schema.md
- **Status:** `extracted`
## apm-v0-39-3-source
- **URL:** https://github.com/microsoft/apm/tree/v0.39.3/src/apm_cli
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-primitive-schema.md)
- **Description:** apm source at tag v0.39.3: the Claude-native command keys kept only on the `claude` target (`_CLAUDE_NATIVE_COMMAND_KEYS`), the `arguments` rule, and `hooks` being withheld.
- **Contributing files:** SKILL.md, references/schema.md, references/target-mapping.md
- **Status:** `extracted`
## apm-cli-0-39-3-experiments
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-gotchas.md)
- **Description:** The repo-pinned apm-cli 0.39.3 run in throwaway packages (holocron#273): Claude-native keys on claude versus cursor and opencode, the `--verbose` dropped-keys line, `hooks` withheld, per-target output including Kiro, malformed YAML, input names, collisions, hand-edited deployed files, hidden-character scanning, and compile ignoring prompts.
- **Contributing files:** SKILL.md, references/create.md, references/improve.md, references/schema.md, references/target-mapping.md, references/verify.md
- **Status:** `extracted`
## apm-cli-0-28-0-prompt-experiments
- **URL:** https://pypi.org/project/apm-cli/0.28.0/
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-gotchas.md)
- **Description:** The installed apm-cli 0.28.0 exercised in throwaway packages: discovery, manifest type, compile on prompts-only packages, per-target output and warnings, input-name and YAML edge cases, collisions, cleanup, hidden-Unicode scanning and packing.
- **Contributing files:** SKILL.md, references/create.md, references/improve.md, references/schema.md, references/target-mapping.md, references/verify.md
- **Description:** The installed apm-cli 0.28.0 exercised in throwaway packages. Superseded by `apm-cli-0-39-3-experiments` wherever both were run; still the only source for root-level discovery, odd filenames, user-scope paths, packing, and BOM, NBSP and bidi scanning.
- **Contributing files:** references/schema.md, references/target-mapping.md
- **Status:** `extracted`
@@ -2,12 +2,14 @@
source_keys:
- apm-docs-author-prompts
- apm-docs-llms-full
- apm-cli-0-39-3-experiments
- apm-v0-39-3-source
- apm-cli-0-28-0-prompt-experiments
---
# What each target receives
Verified against apm 0.28.0 in throwaway installs; runtime behaviour in the receiving tools was not tested. Reached from `SKILL.md` Step 2. Source syntax is in `references/schema.md`.
Verified against apm 0.39.3 in throwaway installs, except the user-scope paths and packing, last run on 0.28.0. Runtime behaviour in the receiving tools was not tested. Reached from `SKILL.md` Step 2. Source syntax is in `references/schema.md`.
## Install is the only path
@@ -20,7 +22,8 @@ Verified against apm 0.28.0 in throwaway installs; runtime behaviour in the rece
| cursor, opencode, grok-build | `.cursor/commands/`, `.opencode/commands/`, `.grok/commands/` `<n>.md` | Same transform as claude |
| windsurf | `.windsurf/workflows/<n>.md` | Same transform |
| gemini | `.gemini/commands/<n>.toml` | `description` and `prompt` only, silently |
| codex, kiro, antigravity, agent-skills | none | Exit 0, no warning |
| kiro | `.kiro/prompts/<n>.md` | Body only; every frontmatter key stripped, with a warning naming them |
| codex, antigravity, agent-skills | none | Exit 0, no warning |
At user scope (`apm install -g`) claude, gemini and cursor deploy to their home commands directories and Copilot to `~/.copilot/prompts/`. The experimental targets (hermes, openclaw, copilot-cowork, grok-cloud, copilot-app) need a flag and are untested.
@@ -33,9 +36,11 @@ At user scope (`apm install -g`) claude, gemini and cursor deploy to their home
| `allowed-tools` | kept (ignored by Copilot) | kept | dropped silently |
| `model` | kept | kept | dropped silently |
| `argument-hint` | kept | kept or synthesised | dropped silently |
| any other key | kept | dropped, with a warning naming the keys | dropped silently |
| Claude Code command keys (`disable-model-invocation` and the rest, `references/schema.md`) | kept | kept on `claude` only; dropped on cursor, opencode, windsurf and grok-build | dropped silently |
| `hooks` | kept | withheld on `claude`, with a warning; dropped elsewhere | dropped silently |
| any other key | kept | dropped; named only under `apm install --verbose` | dropped silently |
The Claude command file holds only `allowed-tools`, `argument-hint`, `arguments`, `description` and `model`, sorted, with no trailing newline.
The Claude command file holds the shared keys (`allowed-tools`, `argument-hint`, `arguments`, `description`, `model`) plus any Claude Code command keys, sorted. Cursor's and the other Claude-family files hold the shared keys only.
## Body placeholders by target
@@ -49,13 +54,14 @@ Claude Code natively supports `$ARGUMENTS`, zero-based `$N` and named `$name` fr
## Ownership and cleanup
- A hand-written file at a deployed path is skipped ("not managed by APM", exit 0); `--force` overwrites. Editing a deployed file and reinstalling silently overwrites it.
- Removing a prompt file from the package and reinstalling deletes the deployed files. A hand-edited one is kept with a "delete manually" message.
- Zero-width characters, BOM and NBSP warn and the file deploys to every target. Tag characters and bidi overrides are critical: install exits 1 and the Claude-family command is withheld, but the Copilot byte copy and Gemini TOML may still be written. `--force` makes the exit code 0 and changes nothing else.
- A hand-written file at a deployed path is skipped ("not managed by APM", exit 0); `--force` overwrites.
- A deployed file edited by hand blocks the next install that would change it: install exits 1 with "Kept ... it was modified since APM deployed it" and commits nothing. Move the file aside, or export the edit with `apm export-patch`.
- Removing a prompt file from the package and reinstalling deletes the deployed files. A hand-edited one is kept, with a warning.
- A zero-width space warns and the file deploys to every target. A tag character is critical: install exits 1 and writes nothing on any target. `--force` exits 0 and writes the Copilot copy and Gemini TOML, but still withholds the Claude-family command. BOM, NBSP and bidi overrides were last tested on 0.28.0, as warning, warning and critical.
## Packing
`apm pack --format plugin` copies `.apm/prompts/x.prompt.md` to `commands/x.md` unchanged and skips root-level prompts. Installing that bundle copies files verbatim, so `input:` survives untransformed and Copilot receives `.github/commands/`.
Last run on 0.28.0. `apm pack --format plugin` copies `.apm/prompts/x.prompt.md` to `commands/x.md` unchanged and skips root-level prompts. Installing that bundle copies files verbatim, so `input:` survives untransformed and Copilot receives `.github/commands/`.
## Unverified
@@ -1,11 +1,11 @@
---
source_keys:
- apm-cli-0-28-0-prompt-experiments
- apm-cli-0-39-3-experiments
---
# Verifying a file in a throwaway package
Reached from `SKILL.md` Step 3. `apm compile` and `apm compile --validate` never read prompts, so they verify nothing. Install is the only check. Run it outside the repo: `apm install` writes `apm_modules/`, `apm.lock.yaml` and a commands directory.
Reached from `SKILL.md` Step 3. `apm compile` and `apm compile --validate` never read prompts, so they verify nothing. Install is the only check. Run it outside the repo: `apm install` writes `apm_modules/`, `apm.lock.yaml` and a commands directory. In a repo that pins apm with uv, spell each `apm` below as `uv run --project <repo root> --frozen apm`, so the check runs the repo's apm and not the one on `PATH`.
1. Deploy the prompt where nothing else can be overwritten:
@@ -14,12 +14,12 @@ Reached from `SKILL.md` Step 3. `apm compile` and `apm compile --validate` never
printf 'name: scratch\nversion: 0.1.0\ntype: prompts\ntargets:\n - claude\n' > "$d/apm.yml"
mkdir -p "$d/.apm/prompts" "$d/.claude"
cp <package-root>/.apm/prompts/<name>.prompt.md "$d/.apm/prompts/"
(cd "$d" && apm install && cat .claude/commands/<name>.md)
(cd "$d" && apm install --verbose && cat .claude/commands/<name>.md)
```
2. Read every warning install prints. A line starting "frontmatter keys not supported … dropped" lists keys that did not survive; "input: rejected" names an invalid argument; "Skipped command … malformed" means the file did not parse and no command exists.
2. Read every warning and info line install prints. `--verbose` is what makes apm name dropped keys: a line "frontmatter keys not supported … dropped" lists keys that did not survive, and "frontmatter hooks withheld" means `hooks` was removed; "input: rejected" names an invalid argument; "Skipped command … malformed" means the file did not parse and no command exists.
3. The deployed file must contain `description` and, if `input:` was written, an `arguments:` list matching it. Body placeholders should read `$name`, not `${input:name}`. A missing file means the install skipped it.
3. The deployed file must contain `description`, every Claude Code command key the source set, such as `disable-model-invocation`, and, if `input:` was written, an `arguments:` list matching it. A missing command key means the apm that ran is older than 0.39. Body placeholders should read `$name`, not `${input:name}`. A missing file means the install skipped it.
4. For another target, add it to `targets:` and `cat` its deployed path from `references/target-mapping.md`. Gemini prints no warning for what it drops, so read its `.toml`.
+1 -1
View File
@@ -1,5 +1,5 @@
name: kyberforge
version: 2.3.0
version: 2.3.1
description: Skills and agents for creating, maintaining, and managing an apm plugin marketplace for Claude Code and GitHub Copilot.
author:
name: Mortis
+17 -10
View File
@@ -70,15 +70,21 @@ tracked in a `.claude/apm-hooks.json` sidecar, so an uninstall removes them with
hand-authored hooks. Both `.claude/hooks/` and the sidecar are gitignored install output.
Note that apm's **executable-trust gate is off** unless the consuming project's `apm.yml` has an
`executables:` block — without one, package hooks deploy with no prompt. The grant is
**version-blind**: apm also matches an allow key such as `kyberforge#<version>` by its bare package
name, so a version bump on one side does not stop the hook deploying (verified against apm 0.28.0;
the correction is recorded in ADR-0019 and `docs/spec/gates.md`). This repo still keeps each key at
`<name>#<version>` as a record of which version was reviewed, and `check-executables-allow-sync` is
the pre-push gate that holds every plugin shipping `.apm/hooks/` or `bin/` to that.
`executables:` block — without one, package hooks deploy with no prompt. An allow key must be the
package's **full identity**, `<host>/<owner>/<repo>/<path>`, as `apm approve --list` prints it, for
example `git.rkdr.net/Mortis/Holocron/plugins/kyberforge`. apm 0.39 no longer matches the bare
`kyberforge#<version>` form that 0.28.0 accepted: under 0.39.3 that key parks the hook ("parked
pending approval"), deploys nothing and exits 0 (spike #269, re-run under #273). The grant is still
**version-blind**: apm strips a `#<version>` suffix before matching, so a key at one version admits
any other, and a version bump on one side does not stop the hook deploying. This repo keeps each key
at `<identity>#<version>` as a record of which version was reviewed, and
`check-executables-allow-sync` is the pre-push gate that holds every plugin shipping `.apm/hooks/` or
`bin/` to that.
apm 0.28.0 prints "parked pending approval" for a granted package even when it deploys the hook
(holocron#208). Check for the deployed script and settings entry, not the warning.
A matching type-level grant (`hooks: true`) deploys the hook, and every install then warns that the
approval is "not pinned to content". apm 0.28.0 printed "parked pending approval" even for a granted
package (holocron#208); 0.39.3 prints it only when the hook really was not deployed. Either way, check
for the deployed script and settings entry, not the exit code.
## The SessionStart hook
@@ -149,14 +155,15 @@ hook.
An earlier version of this section said Copilot loads no hooks from an apm package, because nothing
pointed Copilot at a hooks file and apm wrote only a Claude-shaped definition. That no longer holds:
apm 0.28.0 shapes and deploys hooks per target itself, with no `plugin.json` pointer involved.
apm shapes and deploys hooks per target itself, with no `plugin.json` pointer involved. The table
below was observed on 0.28.0 and re-run on 0.39.3 (holocron#273).
Sources: `docs/research/infra-packages/enforcement-hooks.md` on the `research/enforcement-hooks`
branch, and the [delivery guard hook](https://git.rkdr.net/Mortis/Holocron/issues/190) work.
| Target | Where apm writes the hook | Status |
|---|---|---|
| `copilot` | One file per hook, `.github/hooks/<pkg>-<name>.json`, with the script under `.github/hooks/scripts/<pkg>/.apm/hooks/`. Event names are renamed to camelCase and `version: 1` is added. | **Unverified.** Entries keep Claude's nested matcher group with `command`/`timeout`. Copilot's docs accept `command`/`timeout` as aliases for `bash`/`powershell`, but don't document the nested group, so whether Copilot CLI runs the hook is untested until a Copilot account exists. |
| `codex` | Merged into `.codex/hooks.json`, with the script under `.codex/hooks/<pkg>/.apm/hooks/`. Claude's event names and shape are kept. | apm skips the target unless `.codex/` already exists, and Codex runs project hooks only after a human trusts them. |
| `codex` | Merged into `.codex/hooks.json`, with the script under `.codex/hooks/<pkg>/.apm/hooks/` and ownership in `.codex/apm-hooks.json`. Claude's event names and shape are kept. | With `codex` in `targets:`, apm 0.39.3 creates `.codex/` and deploys; whether it skips an auto-detected codex target with no `.codex/` was not re-run. Codex runs project hooks only after a human trusts them. |
Only enabled targets get a hook: this repo's root `apm.yml` targets `claude` alone, so nothing lands
in `.github/hooks/` or `.codex/` here. VS Code's Copilot reads both `.github/hooks/` and
@@ -4,6 +4,7 @@ source_keys:
- apm-v0-39-3-source
- apm-v0-39-3-changelog
- apm-v0-39-3-docs
- apm-cli-0-39-3-experiments
---
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**.
@@ -84,3 +85,12 @@ executables:
- a blocking org policy applies;
- installed files differ from `apm.lock.yaml`.
- **Source:** `apm deny [PACKAGES] --user/-g` writes deny entries.
## Observed on 0.39.3 (holocron#273)
Run with the repo-pinned apm 0.39.3 in a throwaway project, with a local `./pkg` dependency shipping one SessionStart hook.
- **No `executables:` block.** `apm approve --list` prints `Executable-trust gate disabled -- executables need no approval (org policy still applies)`, and the hook deploys (`hooks[+:gate-disabled]`).
- **Bare-name grant.** An allow key `pkg#1.0.0`, which is not the package identity `./pkg`, parks the hook: install prints `1 package(s) have executable primitives parked pending approval; install completed without deploying them`, deletes the previously deployed script, writes no `.claude/settings.json` entry and exits 0. `apm approve --list` shows `hooks[x:default-deny]`.
- **`#version` is ignored.** An allow key `./pkg#9.9.9` admits the installed `./pkg` at 1.0.0: the hook deploys and install exits 0.
- In this repo, the full-identity type-level grants deploy both hooks, and every install warns `executable approvals are not pinned to content`.
@@ -199,3 +199,13 @@ apm config list
apm config unset <key>
apm experimental enable registries
```
## Marketplace outputs and package-type routing (source, re-read under holocron#273)
- `apm_cli/marketplace/output_profiles.py` registers three marketplace output profiles in `MARKETPLACE_OUTPUTS`:
- `claude`, writing `.claude-plugin/marketplace.json`;
- `codex`, writing `.agents/plugins/marketplace.json`, which requires a `category` on every package;
- `copilot`, writing `.github/plugin/marketplace.json`.
apm 0.28.0 had only `claude` and `codex`.
- `get_effective_type()` in `apm_cli/integration/skill_package_routing.py` derives the content type from the detected package type: a Claude skill, hybrid, skill bundle or marketplace plugin routes as a skill, and everything else as instructions. It never reads the `type:` declared in `apm.yml`, as in 0.28.0.
@@ -7,9 +7,10 @@ source_keys:
- cursor-rules-docs
- github-copilot-custom-instructions-docs
- apm-v0-39-3-changelog
- apm-cli-0-39-3-experiments
---
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.
Surprising behaviours and source contradictions for the instructions primitive. The section "Re-run on 0.39.3" at the end records what changed when the experiments were repeated on the repo-pinned apm 0.39.3; where it disagrees with an earlier section, it wins. "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.
## Verified failure modes
@@ -91,3 +92,17 @@ From the Claude Code memory docs (`claude-code-memory-docs`): instructions reach
- Something that must happen at a fixed point (before every commit) or must be blocked is a hook or a `permissions.deny` entry, never an instruction: "Settings rules are enforced by the client regardless of what Claude decides to do. CLAUDE.md instructions shape Claude's behavior but are not a hard enforcement layer."
- Two instructions that contradict each other make Claude pick one arbitrarily, across user and project files and across rules.
- Under 200 lines per file; one topic per file.
## Re-run on 0.39.3 (holocron#273)
Observed with the repo-pinned apm 0.39.3 in throwaway packages outside the repo.
- **Unquoted or broken frontmatter fails install.** `applyTo: **/*.py` unquoted, or `description: [broken`, makes `apm install` exit 1 with `Rejected frontmatter in <file>` and deploy nothing. No transaction change is committed. Compile still prints `Failed to parse`, skips the file and exits 0; `--validate` counts it out. The silent widening above no longer happens on install.
- **Claude compile layout.** `apm compile --target claude` writes `AGENTS.md` with the instruction bodies and a `CLAUDE.md` that holds only `@AGENTS.md` under the generated header. Compile also warns `applyTo for '<name>' matched no files` when a pattern matches nothing in the project.
- **Dedup is per instruction.** Compile omits only the instructions already deployed to `.claude/rules/`. A nested or newly added instruction still reaches `AGENTS.md`, and when every instruction is deployed no `CLAUDE.md` is written. `--force-instructions` puts all of them in. When the compile also serves a target with no dedup (codex), `AGENTS.md` carries every instruction.
- **Unscoped rules move to `AGENTS.md` only when compile wrote them there.** Install deploys an unscoped rule to `.claude/rules/<n>.md` with no frontmatter, and a later compile dedups it, so it stays. It moves only when compile actually wrote it into `AGENTS.md`: compile before install, `--force-instructions`, or a no-dedup target in the same compile. The next install then deletes that file and prints `Retired .claude/rules/<n>.md: AGENTS.md now carries it for Claude Code`. A `**/*.py` rule stays in `.claude/rules/`.
- **Hand-authored collisions are skipped on Claude too.** A hand-written `.claude/rules/<n>.md` or `.github/instructions/<n>.instructions.md` is kept, with `files skipped -- local files exist, not managed by APM`, exit 0. `apm install --force` overwrites it. The 0.28.0 silent overwrite on Claude is gone.
- **Stale cleanup covers every rule target.** Renaming a source deletes the old file on antigravity, claude, copilot, cursor, grok-build, kiro and windsurf.
- **Per-target transforms.** Unchanged from 0.28.0 except: Cursor writes several patterns as one comma-separated `globs:` string, not a list; Antigravity writes `trigger: always_on` for an unscoped rule.
- **Empty package.** With no `.apm/` content, plain compile exits 1 with `No APM content found to compile`. With skills but no instructions it is still `No instruction files found in .apm/ directory`, exit 1. `--clean` exits 0 in both.
- **Unchanged:** `--validate` hides the warnings a real compile prints; a nested file is compiled but never deployed; `description` is dropped on Claude.
@@ -9,6 +9,7 @@ source_keys:
- apm-cli-0-28-0-prompt-experiments
- apm-v0-39-3-source
- apm-v0-39-3-changelog
- apm-cli-0-39-3-experiments
---
## What this covers
@@ -86,3 +87,15 @@ The experimental targets (hermes, openclaw, copilot-cowork, grok-cloud, copilot-
- 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.
## Re-run on 0.39.3 (holocron#273)
Observed with the repo-pinned apm 0.39.3 in throwaway packages outside the repo. Where this disagrees with the sections above, it wins.
- **Claude-native keys.** `disable-model-invocation`, `when_to_use`, `user-invocable` and `effort` reached `.claude/commands/<n>.md`. Cursor and OpenCode dropped them. `author` and `mcp` were dropped everywhere but Copilot.
- **Dropped-keys message.** Printed only with `--verbose`, as an info line naming the dropped keys and the target's supported set. A default install says nothing about them.
- **`hooks`** in a prompt's frontmatter is withheld on Claude with a `frontmatter hooks withheld` warning, and the command still deploys.
- **Kiro now receives prompts**, at `.kiro/prompts/<n>.md` with every frontmatter key stripped and a warning naming them. Codex, Antigravity and agent-skills still deploy nothing, silently.
- **Hand-edited deployed files.** Editing `.claude/commands/<n>.md` and reinstalling after a source change makes install exit 1 with `Kept ... it was modified since APM deployed it`, and nothing is committed. Removing the source keeps the edited file with a warning and cleans the others.
- **Hidden characters.** A tag character makes install exit 1 with nothing written on any target. `--force` exits 0 and writes the Copilot copy and Gemini TOML, but still withholds the Claude command. A zero-width space warns and deploys.
- **Unchanged:** compile ignores prompts; `--validate` counts none; malformed YAML skips the command with a warning; an invalid input name is rejected with a warning and duplicates pass; a hand-written file at a deployed path is skipped until `--force`; `input:` becomes `arguments:`; Gemini keeps `description` and the body, and prepends `Arguments: {{args}}` to a body using `$0`.
@@ -146,6 +146,16 @@ Note: `releasing.md`'s `--check-clean`/`--check-versions` scope, `apm pack` exit
- **Contributing files:** installation.md
- **Status:** `extracted`
## apm-cli-0-39-3-experiments
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
- **Description:** The repo-pinned apm-cli 0.39.3 (`uv run --frozen apm`) run in throwaway packages in a scratchpad outside the repo, under holocron#273. It re-ran the 0.28.0 instruction and prompt experiments:
- **instructions:** the Claude compile layout, per-instruction dedup, an unscoped rule's retirement from `.claude/rules/`, unquoted and broken frontmatter on install and compile, hand-authored collisions, stale cleanup, the per-target transforms for ten targets, and the empty-package compile;
- **prompts:** Claude-native key survival on claude versus cursor and opencode, the `--verbose` dropped-keys message, `hooks` withholding, malformed YAML, input names, collisions, hand-edited deployed files, the Kiro prompt surface and hidden-character scanning;
- **executables:** a bare-name grant parking a hook, a full-identity grant with a different `#version` deploying it, and the gate-disabled message.
- **Contributing files:** instructions-gotchas.md, prompt-gotchas.md, approvals-and-executables.md
- **Status:** `extracted`
## context7-microsoft-apm-0-39-3
- **URL:** context7:/microsoft/apm
+5 -8
View File
@@ -22,8 +22,7 @@
# * no apm.lock.yaml in the package -> `lockfile-exists` fails with
# "apm.yml declares dependencies but apm.lock.yaml is absent"
# * an apm.lock.yaml in the package -> `lockfile-exists` passes and thereby
# arms the rest of the root check set (nine more on apm 0.28.0, fourteen
# on 0.39.3), and `drift` then fails demanding the
# arms the other nine checks, and `drift` then fails demanding the
# dependency's skills be DEPLOYED inside the package
# (plugins/<pkg>/.agents/skills/...), which is meaningless for a package
# and additionally litters it with an apm_modules/ tree
@@ -36,12 +35,10 @@
# WHAT IS DELIBERATELY NOT WAIVED
#
# Dropping `--ci` in package directories would have been the smaller change and
# is WRONG. Verified on apm 0.28.0, and again on 0.39.3 (#272), against a
# scratch package whose dependency entry carried no git/path/registry field:
# `apm audit --ci` exits 1 naming the field (a failing manifest-parse row on
# 0.39.3), while plain `apm audit` exits 0 with "nothing to scan" ("No
# recognized deployed primitives found" on 0.39.3, "No apm.lock.yaml found"
# on 0.28.0). Malformed-dependency detection is the reason gates.md gives
# is WRONG. Verified on apm 0.28.0 against a scratch package whose dependency
# entry carried no git/path/registry field: `apm audit --ci` exits 1 naming the
# field, while plain `apm audit` prints "No apm.lock.yaml found -- nothing to
# scan" and exits 0. Malformed-dependency detection is the reason gates.md gives
# for auditing packages at all, and a package WITH dependencies is the only kind
# that can carry a malformed dependency entry -- so the check would have been
# discarded precisely where it earns its keep.
+1 -2
View File
@@ -40,8 +40,7 @@ fi
# mirror's deletion reaches the default branch and `apm update` runs, apm
# deploys from `.apm/` directly, `tests/` dirs and all. Nothing in apm filters
# them -- its deploy-time copytree ignore callback (`ignore_non_content()` in
# apm_cli/security/gate.py, 0.28.0; still so on 0.39.3, which also drops
# generated Python bytecode) drops symlinks and the .apm-pin marker and
# apm_cli/security/gate.py, 0.28.0) drops symlinks and the .apm-pin marker and
# nothing else. Every `<skill>/tests/*.bats` file under plugins/ would then
# land at .claude/skills/<name>/tests/ and be discovered and run a second time,
# which is ADR-0024 consequence 2 arriving here. Keeping the exclusion now is
+1 -4
View File
@@ -7,10 +7,7 @@
# drift replay runs `git init` / `git checkout` in a temp dir with an env copied
# from os.environ, so the inherited GIT_DIR wins: `git init` wrote
# core.bare=true into the shared .git/config, and a later checkout moved the
# worktree's HEAD to the lock-pinned commit. apm 0.39.3's
# apm_cli/utils/git_env.py provides git_subprocess_env, which strips GIT_DIR
# and the other repo-locating vars; the leak was not re-tested on 0.39.3, and
# this suite keeps the hooks' own scrub pinned as defence in depth (#272).
# worktree's HEAD to the lock-pinned commit.
#
# The stub `apm` below reproduces that pattern -- record GIT_DIR, then `git init`
# and `git checkout` inside a fresh `mktemp -d` -- and each hook script is run