Files
holocron/plugins/kyberforge/skills/apm-workflow/references/compile.md
Defame1297 dac9cad912 refactor(kyberforge): move audit guidance out of the per-run rubric load
skill-audit loaded roughly 4,268 words of rubric on every run, most of it
criteria for findings a clean skill never triggers. The auditing guidance moves
into finding-criteria.md, read only when a finding is actually raised, cutting
a clean audit to about 999 words. The named-skill exemption is replaced with
properties, so the rubric stops carrying a list that ages the moment a skill
is renamed.

apm-workflow's `type:` trap sat in one flow while biting several, so it is
promoted to a common gate reachable from all of them; its claim to be
self-contained was untrue once it started routing to apm-install. skill-author's
contract had drifted from body-discipline.md and is realigned, and agent-audit's
field inventory is brought in line with the same split.
2026-08-31 08:02:19 +00:00

4.6 KiB

topic, source_keys
topic source_keys
compile
context7-microsoft-apm

Compile

apm compile                     # fails on skill/agent-only packages — see Gotchas
apm compile --clean             # zero-write sanity check; use for skill/agent-only packages
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.

Pack

apm pack --dry-run              # resolve and print; do not write
apm pack --offline              # cached refs only
apm pack --include-prerelease   # allow pre-release tags
apm pack -v                     # per-entry resolution detail
apm pack --marketplace=claude --json   # JSON output for CI pipelines

Bundles a producer package into a distributable artifact. Default to --dry-run -v first when packing something for the first time or after a dependency change — resolution errors surface before anything is written.

.mcp.json merge mechanics

apm pack reads a package's root-level .mcp.json directly — no dependencies.mcp entry in apm.yml is needed for simple passthrough. Behavior is content-aware:

  • An empty .mcp.json ({"mcpServers": {}}) is NOT included in the packed output at all.
  • A populated one gets its mcpServers content merged directly into the compiled plugin.json, but only for the claude target.
  • The copilot target's compiled plugin.json OMITS mcpServers entirely — it isn't part of Copilot's plugin manifest schema.

dependencies.mcp in apm.yml is for a different purpose — declaring a remote MCP-server package as an APM dependency — not local .mcp.json passthrough.

includes: auto and the packed bundle

includes: auto does NOT sweep generic root-level passthrough files (README.md, docs/, sources.md, config files, etc.) into the apm pack distribution bundle (build/<name>-<version>) — only .apm/ primitives, the compiled plugin.json, and the content-aware .mcp.json handling above make it into that bundle. This does not affect Claude Code's own plugin loading, which reads a plugin's working directory directly via its source: path in marketplace.json, not the apm pack bundle — but it matters for anyone relying on the packed bundle for distribution via apm install.

Run apm audit after compile/pack, not before — audit scans deployed/compiled output, not the source apm.yml manifest. Plain apm audit is not the CI-equivalent pass (that is apm audit --ci, which checks strictly more); see references/audit.md.

Publish

apm publish --package acme/my-skill --dry-run -v
apm publish --package acme/my-skill

Publishes a producer package (root containing apm.yml, .apm/, and optionally a registries: block) to a registry. Always dry-run with -v first — publishing is not trivially reversible once a version tag is claimed on a registry.

Publishing to a named registry requires apm experimental enable registries to have already run — see SKILL.md's Gotchas for the precondition and its silent-no-op failure mode.

Run

apm run <script> [--param key=value]

Executes a named script defined under scripts: in apm.yml, with --param substituting values into the script's parameters.

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.
  • 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.