Skip to content

Manifest Schema

Normative reference: This page describes the CLI’s v0.3 working draft. OpenAPM v0.1, Section 4 defines the normative contract; proposed amendment 0.1.48 selects a corrected dependency/MCP schema. Review, publication and supporting CLI release remain separate steps. See schema identity and status.

Version
0.3 (Working Draft)
Date
2026-05-20
Editors
Daniel Meppiel (Microsoft)
Repository
https://github.com/microsoft/apm
Format
YAML 1.2

This is a Working Draft. It may be updated, replaced, or made obsolete at any time. It is inappropriate to cite this document as other than work in progress.

This specification defines the manifest format (apm.yml) used by the Agent Package Manager (APM). Feedback is welcome via GitHub Issues.


The apm.yml manifest declares the full closure of agent primitive dependencies, MCP servers, scripts, compilation settings, consumer-side policy controls, and (optionally) marketplace authoring metadata for a project. It is the contract between package authors, runtimes, and integrators: any conforming resolver can consume this format to install, compile, run, and pack agentic workflows.


The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.

A conforming manifest is a YAML 1.2 document that satisfies all MUST-level requirements in this specification. A conforming resolver is a program that correctly parses conforming manifests and performs dependency resolution as described herein.


A conforming manifest MUST be a YAML mapping at the top level with the following shape:

apm.yml
$schema: <uri> # OPTIONAL contract selector
name: <string> # REQUIRED
version: <string> # REQUIRED
description: <string>
author: <string>
license: <string>
targets: <list<enum>> # 'target:' is deprecated
type: <enum>
scripts: <map<string, string>>
includes: <enum | list<string>>
registries: <map<string, RegistryEntry> & {default?: <string>}>
default_host: <string> # OPTIONAL; host for shorthand deps, see 3.15
dependencies:
apm: <list<ApmDependency>>
mcp: <list<McpDependency>>
lsp: <list<LspDependency>>
devDependencies:
apm: <list<ApmDependency>>
mcp: <list<McpDependency>>
lsp: <list<LspDependency>>
compilation: <CompilationConfig>
policy: <PolicyConfig>
marketplace: <MarketplaceConfig> # OPTIONAL; marketplace authoring
replace: <list<ReplacementRule>> # candidate; explicit selector required
marketplaces: <list<MarketplaceEntry>> # user manifest or root project; see 3.14
executables: <ExecutablesConfig> # OPTIONAL; dependency executable trust, see apm approve
lifecycle: <LifecycleConfig> # OPTIONAL; lifecycle scripts
x-[a-z][a-z0-9-]*: <any> # OPTIONAL vendor extensions

Two fields are REQUIRED at parse time: name and version. All other fields are OPTIONAL. A top-level key MUST NOT appear twice; the CLI refuses such a manifest (for example two dependencies: blocks left by a merge) before changing any file, naming the key and both lines. YAML anchors and aliases (&name, *name) are refused the same way, naming the file and line (req-mf-020). Unknown top-level keys MUST be preserved by writers. The CLI keeps keys matching x-[a-z][a-z0-9-]* and warns, without failing, on any other unknown top-level key. See Extension keys.

The standard $schema key selects the manifest contract; omission selects APM’s current working draft. The corrected OpenAPM v0.1 candidate uses https://microsoft.github.io/apm/specs/schemas/manifest-v0.1.48.schema.json. Adopt that explicit URL only after the resource is published and with a CLI version that recognizes it; its presence in this reference does not announce either event. Unknown identities fail closed, not back to the working draft. Explicit OpenAPM v0.1 uses the normative string-or-object registries map, not the working draft’s named map plus default selector.

Both older URLs, manifest-v0.1.schema.json and manifest-v0.1.41.schema.json, keep their original IDs and bytes. Validators pinned to them still reject Git objects with path, registry objects with both id and registry, and self-defined MCP objects with registry: false. The corrected candidate accepts those existing forms in both dependencies and devDependencies, while checking source identity conflicts, required fields, field types and MCP transport/command/URL rules. It retains the alias-aware shape; it does not add dependency features or bypass runtime, local-path, target, experimental-feature or policy checks.

Schema-less manifests remain working drafts, not implicit opt-ins to this published-contract subset. There is no published working-draft schema to assign automatically to all apm.yml files.

The marketplace: block is the source for apm pack’s marketplace output. Repositories that do not publish a marketplace omit it entirely. See Section 7.

The executables: block holds allow and deny maps keyed by package. hooks and mcp map each hook file or server name to a sha256:<64 hex> fingerprint; plugin pins a native plugin’s whole root to one fingerprint; true approves a type for any content. apm approve writes it; see Store format.

Newly initialised projects (apm init) are scaffolded by the CLI; see apm init for the templates.


Typestring
RequiredMUST be present
DescriptionPackage identifier. Free-form string (no pattern enforced at parse time). Convention: alphanumeric, dots, hyphens, underscores. Normalised to kebab-case in the compiled marketplace.json — see 7.2.
Typestring
RequiredMUST be present
Pattern^\d+\.\d+\.\d+ (semver; pre-release/build suffixes allowed)
DescriptionSemantic version. A value that does not match the pattern SHOULD produce a validation warning (non-blocking).
Typestring
RequiredOPTIONAL
DescriptionBrief human-readable description. Inherited by the marketplace: block when not overridden.
Typestring
RequiredOPTIONAL
DescriptionPackage author or organization.
Typestring
RequiredOPTIONAL
DescriptionSPDX license expression (e.g. MIT, Apache-2.0, (MIT OR Apache-2.0)) declaring the package license.

The value is recorded verbatim into a consumer’s lockfile as declared_license at resolve time, syntax-validated offline against the bundled SPDX id set, and surfaced by apm lock export. Special tokens (UNLICENSED, SEE LICENSE IN <file>) and unrecognized strings are accepted and recorded as a named license — a declaration is never rejected and never blocks packing or publishing. APM records what the manifest declares; it never reads or concludes a license from LICENSE file text. When omitted, the SBOM marks the component unknown — CycloneDX omits the license entry and SPDX writes the literal NOASSERTION — and apm pack / apm publish print an actionable nudge (the authoring path only).

Typetarget: string or list<string>; targets: list<string> (a scalar is accepted as one-item compatibility input)
RequiredOPTIONAL
DefaultAuto-detect from filesystem signals (see below). apm compile -g instead writes every supported user-scope target when both fields are omitted.
Allowed valuescopilot, claude, grok-build, cursor, opencode, codex, gemini, antigravity, windsurf, kiro, hermes, grok-bot, agent-skills

Controls which output targets are generated during compilation, installation, and packing. Accepts a single string or a YAML list. Unknown values MUST raise a parse error at load time, naming the offending token.

A vendor target id of the form x-<vendor>-<name> (for example x-acme-foo) parses (req-tg-004). APM registers no vendor handlers: your project apm.yml prints one warning naming each such id, and APM deploys only the other targets. --target x-... is refused with exit 2.

Deprecated: all. Manifests published before the canonical target catalog could declare all, meaning “no restriction”. The value is deprecated: parsers treat a field containing all as if the field were omitted (auto-detect / --target decide; any sibling targets listed alongside all are ignored, though they are still validated) and emit a deprecation warning once per run. Remove the field to keep this behavior permanently; all will become a hard parse error in a future release.

The exception is target: all on its own: apm install and apm compile select every supported target, and compilation.target policy judges that full set.

For project-scope commands, when both fields are omitted, APM auto-detects from the documented filesystem signals. Once set, the field is authoritative.

# Single target
targets: [copilot]
# Multiple targets (flow-list form)
targets: [claude, copilot]
# Multiple targets (block-list form, equivalent)
targets:
- claude
- copilot

When a list is specified, only those targets are compiled, installed, and packed; no output is generated for unlisted targets.

Use targets: with a YAML list in new manifests. A scalar remains accepted as a one-item compatibility input. Declaring both fields is a parse error. The deprecated target: key still works. vscode is a deprecated alias of copilot in either form: it selects exactly what copilot selects, including the project MCP file (root .mcp.json), is recorded as copilot in apm.lock.yaml, and prints one warning per run (apm.yml: replace `vscode` with `copilot`). agents remains a CLI-only alias. MCP-only and experimental --target values such as intellij and copilot-app are not manifest targets: apm install rejects them in apm.yml before writing any file.

ValueEffect
copilotEmits AGENTS.md at the project root (and per-directory files in distributed mode).
claudeEmits CLAUDE.md at the project root.
grok-buildEmits AGENTS.md and deploys to .grok/rules/, .grok/agents/, .grok/commands/, .grok/skills/.
cursorEmits to .cursor/rules/, .cursor/agents/, and .agents/skills/.
opencodeEmits AGENTS.md, .opencode/agents/, .opencode/commands/, and .agents/skills/.
codexEmits AGENTS.md and deploys skills to .agents/skills/, agents to .codex/agents/.
geminiEmits GEMINI.md and deploys to .gemini/commands/, .agents/skills/, .gemini/settings.json.
antigravityEmits AGENTS.md and deploys rules, skills, hooks, and MCP config under .agents/.
windsurfEmits AGENTS.md and deploys to .windsurf/rules/, .agents/skills/, .windsurf/workflows/, .windsurf/hooks.json.
kiroEmits AGENTS.md and deploys to .kiro/steering/, .kiro/skills/, .kiro/hooks/, .kiro/settings/mcp.json.
agent-skillsDeploys Agent Skills under .agents/skills/.
hermesEmits AGENTS.md and deploys skills to .agents/skills/. Explicit-only; see hermes.
grok-botDeploys skills to agent-data/workflows/. Explicit-only; see grok-bot.
Typeenum<string>
RequiredOPTIONAL
DefaultNone (behaviour driven by package content; synthesized plugin manifests use hybrid).
Allowed valuesinstructions, skill, hybrid, prompts

Declares how the package’s content is processed during install and compile. Today behaviour is driven by package content (presence of SKILL.md, component directories, etc.); this field is reserved for future explicit overrides.

ValueBehaviour
instructionsCompiled into AGENTS.md only. No skill directory created.
skillInstalled as a native skill only. No AGENTS.md output.
hybridBoth AGENTS.md compilation and skill installation.
promptsCommands/prompts only. No instructions or skills.
Typemap<string, string>
RequiredOPTIONAL
KeyScript name (free-form string).
ValueShell command string.

Named commands executed via apm run <name>. The script body MUST support --param key=value substitution ({key} placeholders in the command string are replaced before execution).

The script name start is the default invoked by a bare apm run (no name given) and SHOULD be present in publishable packages so consumers have a one-command entry point.

scripts:
start: "copilot -p 'README.prompt.md'"
review: "copilot -p 'code-review.prompt.md'"
impl: "copilot -p 'implement-feature.prompt.md'"
Typestring (literal auto) or list<string>
RequiredOPTIONAL
DefaultUndeclared (legacy implicit auto-publish; flagged by apm audit).
Allowed valuesauto or a list of paths relative to the project root.

Records consent to publish local content during deployment and controls local content selection when producing plugin bundles with apm pack. This field does not select the source layout: .apm/ presence makes the APM-native layout authoritative, while its absence preserves supported plugin-native root sources. Three forms are supported:

  1. Undeclared (field omitted). Legacy implicit consent for content in the selected source layout. apm audit emits an includes-consent advisory whenever local content is deployed under this form.
  2. includes: auto. Explicit consent to publish all local content from the selected source layout. No path enumeration required. Default for newly initialised projects.
  3. includes: [<path>, ...]. Explicit consent list for deployment and the exhaustive allow-list for plugin packing. Listed paths may be under .apm/ or a plugin-native root directory. Missing, unsafe, symlinked, or unpackable paths stop apm pack; no implicit source fallback occurs. During apm install, the list satisfies explicit-consent policy but does not filter integrator discovery.
# Form 1: undeclared (legacy; audit advisory)
# includes: <omitted>
# Form 2: explicit auto-publish (default for new projects)
includes: auto
# Form 3: explicit path list (strongest governance)
# includes:
# - .apm/instructions/
# - .apm/skills/my-skill/

For plugin packing, includes: is allow-list only. There is no exclude: form. To keep maintainer-only primitives out of shipped artifacts, author them outside the selected source layout and reference them via a local-path devDependency. See Dev-only Primitives.

Compile discovery independently stops at nested Git repositories and linked worktrees. This active-checkout boundary applies whether includes is auto, an explicit list, or omitted.

When policy.manifest.require_explicit_includes is true (see Policy reference), only form 3 passes; auto and undeclared are rejected at install/audit time by the explicit-includes check (not at YAML parse time).

Typemap<string, string>
RequiredOPTIONAL
DescriptionConsumer-side controls for org policy discovery and verification. All sub-keys are optional; defaults preserve current fail-open install behaviour.
policy:
fetch_failure_default: warn # warn | block (default warn)
hash: "sha256:<hex>" # optional consumer-side pin on the org policy bytes
hash_algorithm: sha256 # sha256 (default) | sha384 | sha512
Sub-keyTypeDefaultAllowed valuesSemantic
fetch_failure_defaultstringwarnwarn, blockPosture when no enforceable policy is available (fetch failures or no-policy outcomes). warn keeps installs unblocked; block opts into fail-closed semantics for both apm install and apm audit --ci. With apm audit --ci --policy org, it applies only to fetch failures; absent, no_git_remote, and empty pass through. An explicit apm audit --ci --policy <path|url|owner/repo> always fails closed and ignores this field.
hashstringunset<algo>:<hex-digest>Pin on the raw bytes of the fetched leaf org policy. Verified before YAML parsing; mismatch is always fail-closed regardless of fetch_failure_default.
hash_algorithmstringsha256sha256, sha384, sha512Digest algorithm for policy.hash. Inferred from the <algo>: prefix when present. MD5 and SHA-1 are rejected at parse time.

Under apm install -g, these keys are read from the user manifest ($APM_HOME/apm.yml, default ~/.apm/apm.yml), never from ~/apm.yml. User scope has no git remote, so it discovers no org policy (outcome no_git_remote).

Full semantics (network failure matrix, hash pin verification, policy precedence) live in the Policy reference.

Typemap<string, RegistryEntry> with optional default: <string> key
RequiredOPTIONAL
DescriptionDeclares REST-based APM registries for the project. Strictly additive - absent or empty block leaves Git resolution unchanged unless a default registry is configured in ~/.apm/config.json. URLs from all layers are merged at install time; see the Registries guide.
registries:
jf-skills:
url: https://artifactory.example.com/artifactory/api/skills/jf-skills-local
default: jf-skills # OPTIONAL - name of one of the configured entries
Sub-keyTypeRequiredConstraintSemantic
<name>RegistryEntryat least one when block is non-emptyNon-empty string. Use letters, digits, ., _ and - so apm config set registry.<name>.* can address itRegistered registry.
<name>.urlstringREQUIRED per entryMUST start with https:// or http://; no trailing slash requiredBase URL the client appends /v1/... paths to.
<name>.insecurebooleanOPTIONALtrue onlyAllows an http:// URL to a non-local host. Without it, http:// is a parse error unless the host is loopback or an RFC 1918 private address.
defaultstringOPTIONALMUST name one of the configured entriesWhen set, plain string-shorthand APM deps and object-form deps without an explicit registry: key route through this registry. Project value wins over registry.<name>.default in ~/.apm/config.json.

Unknown keys under a registry entry MUST be rejected at parse time (typo guard); x- extension keys are ignored.

Effective default registry: project registries.default if present; otherwise the registry marked "default": true in ~/.apm/config.json (via apm config set registry.<name>.default true). Only one default is active at a time.

For full client semantics - auth, lockfile fields, and routing rules - see the Registries guide. For the wire contract servers implement, see the Registry HTTP API.

Any top-level key matching x-[a-z][a-z0-9-]* is a vendor extension. The CLI keeps these keys, in declaration order, on the parsed package. It does not validate or interpret the values. Normative contract: req-ext-001 and req-ext-003.

When a dependency’s apm.yml declares keys matching x-[a-z][a-z0-9-]*, apm lock records them on that dependency’s entry in apm.lock.yaml under extensions. The field is omitted when the dependency declares none, so existing lockfiles stay unchanged.

An x- key inside an object-form dependencies.apm[] entry is also kept and ignored; any other unknown key in such an entry fails the parse.

Any other unknown top-level key is ignored. The CLI prints one warning that names each ignored key and does not fail because of that key. An install dry-run reports the source manifest’s warning once, not again for its prospective dependency edit. Warning paths use forward slashes on Windows too. Rename the key to match x-[a-z][a-z0-9-]* to keep it, or remove it.

name: my-package
version: 1.0.0
x-team: platform
x-internal:
ticket: ABC-1

This is an unratified implementation candidate, not an extension to the released OpenAPM schemas. A feature-capable development build requires the exact $schema identity https://microsoft.github.io/apm/specs/schemas/manifest-source-replacements-v1.schema.json whenever replace is present, including an empty list. This URI is a candidate contract selector. Its proposed schema is staged with proposal 0.1.54; neither ratification nor a first supported release is claimed. Existing manifests without replace keep their current contract.

FieldShapeMeaning
replaceList of rulesConsumer-root rules; not inherited from dependencies.
for{git: <explicit-host Git locator>, path?: <package subdirectory>}Exact normalized host, endpoint, repository and subpath. No ref, alias, wildcard, single-file primitive, registry or marketplace selector.
with (local){path: <local path>}Complete source substitution, anchored to the consumer manifest.
with (Git){git: <explicit HTTPS/SSH URL or SCP-style locator>, path?: <subdirectory>, ref: <ref>}Complete source/ref substitution. ref is required; omitted path means repository root. HTTP, owner/repo shorthand and scheme-free host/repo shorthand are rejected.

Unknown rule fields and duplicate normalized selectors fail. Original alias, skill/target subset and dev-selection semantics are preserved. Rules bind original requirements before graph selection; selected sources are not chained through other rules. Their own dependency declarations are new requirements. Cycles and ambiguous materialization slots fail rather than selecting a winner. An unused rule warns without reading its source, but remains part of frozen comparison.

The explicit selector is essential: older readers can silently ignore an additive replace key. Verified v0.25.0, v0.32.0 and v0.33.0 readers reject this selector and lock version "3"; v0.24.1 does not. Rejection is not feature support, and untested clients are not qualified. See the usage and compatibility warning.


Typelist<MarketplaceEntry>
RequiredOPTIONAL
ScopeThe user manifest ($APM_HOME/apm.yml, default ~/.apm/apm.yml) and the root project apm.yml. A dependency’s apm.yml that contains the key is refused at install.
DescriptionIn the user manifest: marketplaces that apm install -g registers for discovery. It registers missing entries, updates changed ones, and removes entries it registered earlier that are no longer listed. Registrations made with apm marketplace add are never overwritten or removed. In the root project: the marketplaces that project’s marketplace: <name> entries resolve through, with no registration; the map is never registered, wins over a same-named registration and over a lock row recorded from another catalog (apm install --frozen refuses that row), and is the only set of names a transitive marketplace: <name> may use.
marketplaces:
- name: acme
source: https://github.com/acme-org/agent-marketplace#v1.2.0
- name: internal
source: git@gitea.example.com:platform/marketplace.git
ref: v3.0.0
Sub-keyTypeRequiredConstraint
namestringREQUIREDLetters, digits, ., _ and -; unique (case-insensitive) in the list. Used as PKG@NAME.
sourcestringREQUIREDAny SOURCE form accepted by apm marketplace add. No --host equivalent; use a full URL for non-default hosts. Local paths must be absolute or start with ~/.
refstringOPTIONALSame as --ref. Cannot be combined with a #ref in source.

Unknown entry keys are rejected. Declaring a marketplace does not install packages or grant trust; org policy marketplace.allow can restrict project declarations. See Declare marketplaces in your user manifest and Declare marketplaces in a project.

Typestring (bare hostname, e.g. gitlab.com)
RequiredOPTIONAL
DefaultThe GITHUB_HOST environment variable, or github.com when it is unset.
DescriptionHost that shorthand owner/repo dependencies in this manifest resolve against. When APM writes a dependency into this manifest, it shortens URLs on this host to owner/repo and keeps the FQDN of every other host.
default_host: gitlab.com
dependencies:
apm:
- acme/standards # https://gitlab.com/acme/standards
- github.com/acme/skills # host-qualified entries are unaffected

The value MUST be a bare hostname: no scheme, port, or path. Each manifest uses its own value, so a dependency’s apm.yml without default_host: falls back to the default above, not to the consumer’s value. Normative contract: req-mf-019.


Typeobject
RequiredOPTIONAL
Known keysapm, mcp, lsp

Contains three OPTIONAL lists: apm for agent primitive packages, mcp for MCP servers, and lsp for LSP servers. Each list entry is either a string shorthand or a typed object. Additional keys MAY be present for future dependency types; conforming resolvers MUST ignore unknown keys for resolution but MUST preserve them when reading and rewriting manifests.


4.1. dependencies.apm — list<ApmDependency>

Section titled “4.1. dependencies.apm — list<ApmDependency>”

Each element MUST be one of two forms: string or object.

Grammar (ABNF-style):

dependency = url_form / shorthand_form / local_path_form
url_form = ("https://" / "http://" / "ssh://git@" / "git@") clone-url
shorthand_form = [host [":" port] "/"] owner "/" repo ["/" virtual_path] ["#" ref]
local_path_form = ("./" / "../" / "/" / "~/" / ".\\" / "..\\" / "~\\") path

A local_path_form that begins with .\, ..\ or ~\ is normalised to POSIX form on read: .\pkg, ..\pkg and ~\pkg resolve, lock and deploy exactly like ./pkg, ../pkg and ~/pkg on every platform, and pass the same checks. Windows drive-letter (C:\pkg) and UNC (\\server\share) paths are not normalised.

The host:port shorthand resolves as HTTPS. SSH custom ports require the ssh:// URL form.

When a default registry is configured - via registries.default in apm.yml or registry.<name>.default true in ~/.apm/config.json - plain shorthand_form entries with a #<selector> route through that registry instead of Git.

clone-url MAY include a :port segment on https://, http://, and ssh://git@ forms (e.g. ssh://git@host:7999/owner/repo.git). The SCP shorthand git@host:path cannot carry a port - : is the path separator in that form. When a port is present, APM preserves it across all clone attempts: the SSH attempt uses ssh://host:PORT/... and the HTTPS fallback uses https://host:PORT/... (same port on both protocols). For HTTPS custom-port dependencies, APM writes the scheme-free shorthand host:PORT/owner/repo[#ref] to apm.yml and can parse that form on the next run. The shorthand port :443 normalizes to no port.

SegmentRequiredPatternDescription
hostOPTIONALFQDN (e.g. gitlab.com)Git host. Defaults to the manifest’s default_host, else GITHUB_HOST, else github.com.
portOPTIONAL1-65535Non-default port on ssh://, https://, http:// clone URLs. Also accepted in HTTPS shorthand as host:PORT/owner/repo; :443 normalizes to no port. Not expressible in SCP shorthand.
owner/repoREQUIRED2+ path segments of [a-zA-Z0-9._~-]+ on non-Azure-DevOps hosts; [a-zA-Z0-9._\- ]+ (allows spaces, not tilde) on Azure DevOpsRepository path. GitHub uses exactly 2 segments. Non-GitHub hosts MAY use nested groups (e.g. gitlab.com/group/sub/repo). Tilde supports Bitbucket Data Center personal-repo segments (/scm/~user/repo.git) and Sourcehut ~user paths.
virtual_pathOPTIONALPath segments after repoSubdirectory or file within the repo. See Section 4.1.3.
refOPTIONALBranch, tag, or commit SHAGit reference. Commit SHAs matched by ^[a-f0-9]{7,40}$. Semver tags matched by ^v?\d+\.\d+\.\d+.

A git ref names a branch or tag of the source repository exactly (refs/heads/<ref> or refs/tags/<ref>); a name that is both a branch and a tag needs the full form. A tail match (feature for team/feature) and names that are no branch or tag, such as head, pull/7/head or refs/pull/7/head, are refused. A commit SHA (including a lockfile commit) must be reachable from a branch or tag; the first install of a commit that is not a tip checks this once over the network, and an offline first install fails closed.

Examples:

dependencies:
apm:
# GitHub shorthand (default host); each line shows a syntax variant
- microsoft/apm-sample-package # latest (lockfile pins commit SHA)
- microsoft/apm-sample-package#v1.0.0 # release tag; the lockfile pins the commit
- microsoft/apm-sample-package#main # branch ref (may change over time)
# Non-GitHub hosts (FQDN preserved)
- gitlab.com/acme/coding-standards
- bitbucket.org/team/repo#main
# Full URLs
- https://github.com/microsoft/apm-sample-package.git
- http://github.com/microsoft/apm-sample-package.git
- git@github.com:microsoft/apm-sample-package.git
- ssh://git@github.com/microsoft/apm-sample-package.git
# Custom ports (e.g. Bitbucket Datacenter, self-hosted GitLab)
- ssh://git@bitbucket.example.com:7999/project/repo.git
- https://git.internal:8443/team/repo.git
- git.internal:8443/team/repo#main # HTTPS shorthand: accepted and written by APM
# Virtual packages
- ComposioHQ/awesome-claude-skills/brand-guidelines # subdirectory
- contoso/prompts/review.prompt.md # single file
# Azure DevOps
- dev.azure.com/org/project/_git/repo
# Local path (development only)
- ./packages/my-shared-skills # relative to project root
- ../sibling-repo/my-package # parent directory

REQUIRED when the shorthand is ambiguous (e.g. direct nested-group repos with virtual paths). NOT required for nested-group deps that route through a registry proxy (explicit host/artifactory/<key>/... FQDN, or bare shorthand under PROXY_REGISTRY_URL + PROXY_REGISTRY_ONLY=1): the install-time boundary probe HEAD-walks candidate splits against the proxy and locks in the first one whose archive responds. See Registry proxy guide.

FieldTypeRequiredPattern / ConstraintDescription
gitstringREQUIRED (remote)HTTPS URL, SSH URL, or FQDN shorthandClone URL of the repository. Required for remote dependencies.
pathstringOPTIONAL / REQUIRED (local)Relative path within the repo, or local filesystem pathWhen git is present: subdirectory or file (virtual package). When git is absent: local filesystem path (must start with ./, ../, /, or ~/).
refstringOPTIONALBranch, tag, or commit SHAGit reference to checkout.
aliasstringOPTIONAL^[a-zA-Z0-9._-]+$; excludes exactly . and ..Names the destination directory, not the source; local ../ paths remain supported. Valid: .safe, safe., foo..bar, my-skill.v2. Migration.
typestringOPTIONAL (remote Git only)gitlabTreat a bespoke hostname as self-managed GitLab.
allow_insecurebooleanOPTIONAL (remote Git only)true or falseManifest-side approval for an http:// dependency; the install command still requires its separate insecure-host opt-in.
skillslist<string>OPTIONALNon-empty skill names, or ["*"] alone ("*" cannot be mixed with names; no globs)Installs only the selected skills from a dependency that exposes selectable skills. ["*"] installs every skill the package ships, including skills added in later releases. At project scope a selection deploys a Claude-format plugin’s skills loose instead of as a native plugin; with -g it parks the plugin, and an Agent Plugin stays native.
targetslist<string>OPTIONALTarget slugs. Stable: copilot, claude, grok-build, cursor, kiro, opencode, gemini, antigravity, codex, windsurf, agent-skills, hermes, grok-bot. Experimental: grok-cloud, openclaw, copilot-cowork, copilot-app. vscode is accepted as a deprecated alias and recorded as copilot.Restricts which install targets receive this dependency’s target-scoped primitives. Omitted = all active install targets. Effective reach = install targets INTERSECT this list; agent-skills is also accepted by the grok-bot target.

Unknown object-form fields are rejected. On a Git object, version reports an actionable error to use ref for a branch, tag, or commit; version belongs to registry and marketplace dependency objects.

targets: on a dependency is intersected with the active install targets (--target, config default, package-level targets:, or auto-detect). Listing a harness the install did not select does not add it; omitting targets: means the dependency reaches every active install target. An empty list targets: [] is rejected at parse time — omit the key to mean “all”.

apm_modules/ paths do not include the host, so acme/tool and gitlab.example.com/acme/tool (or two dependencies with the same alias:) would share apm_modules/acme/tool. Install fails before fetching and names both declarations; remove one, or set alias: on one of them.

When several manifests declare the same dependency (your apm.yml and one or more parent packages), APM installs it once. Each declaration’s skills: reach only that declaration’s targets:: a skill deploys to a harness only when one declaration selects both, and a declaration that omits a field selects everything on it. Order of declaration does not matter. apm.lock.yaml records the unions as skill_subset and target_subset (canonical target names), plus subset_pairings when needed. If the declarations use different alias: values, the shallowest declaration wins and APM prints a warning.

- git: my-team/review-hooks
targets: [copilot, claude]

Remote dependency (git URL plus sub-path):

- git: https://gitlab.com/acme/repo.git
path: instructions/security
ref: v2.0
alias: acme-sec

ref: accepts either a literal git ref (main, v2.0, a 40-char commit SHA) or a semver range (^1.2.0, ~1.4, >=2.0 <3, 1.5.x). When ref: is a semver range, APM resolves it against the remote’s tags at install time, matching against v{version}, {name}--v{version} and {name}-v{version} patterns (with {version} as a bare-tag fallback) and selecting the highest tag that satisfies the range.

The lockfile records the original constraint, the resolved_tag, the resolved version, the resolved_commit, and a resolved_at timestamp so subsequent installs replay the same tag deterministically — only apm update or a manifest change re-resolves. When no remote tag satisfies the range, APM surfaces NoMatchingTagError with the inspected patterns.

Local path dependency (development only):

- path: ./packages/my-shared-skills
- path: ./ai/agents/xyz.agent.md

Local path: and string entries accept directory packages or one file ending in .agent.md, .instructions.md, or .prompt.md. Single-file packages contain only that file; companion assets require a directory package. Relative paths resolve against the declaring local package. User-scope installs require absolute or expanded ~/... paths, and single-file symlinks are rejected.

When the declaring package came from a remote repo, path: remains scoped to that same repo only. The resolved path must stay inside the parent’s cloned repo root; APM expands it to the same remote host/repo and fetches it at the commit the parent package resolved at, so the lockfile pins each such file to its parent’s commit. Absolute paths, paths that escape the repo root, and cross-repo local paths are rejected.

Monorepo sibling reference (git: parent):

# In agents/pkg-a/apm.yml inside org/monorepo
- git: parent
path: skills/shared

The literal sentinel git: parent is valid only inside a transitively resolved package whose clone coordinates are known to the resolver. APM expands parent to the consumer’s host, repo_url, and resolved ref, with virtual_path set from path. The lockfile records the expanded coordinates: parent MUST NOT appear as durable identity (repo_url / source). path is REQUIRED for git: parent and is normalised to a single relative path; absolute paths and .. traversal are refused. Only git, path, ref, and alias are accepted on this form. When ref is omitted the parent’s resolved ref is inherited.

For before/after manifests and a feature-branch review workflow, see Make sibling dependencies follow the review branch.

Marketplace dependency (resolved at install time):

- name: sec-check
marketplace: acme-plugins
- name: secrets-vault
marketplace: acme-plugins
version: "~2.1.0"
FieldTypeRequiredPattern / ConstraintDescription
namestringREQUIRED^[a-zA-Z0-9._-]+$Plugin identifier within the marketplace.
marketplacestringREQUIRED^[a-zA-Z0-9._-]+$Registered marketplace name.
versionstringOPTIONALSemver range or exact version (e.g. ~2.1.0, ^2.0, >=1.4, 2.1.0)Version constraint resolved against git tags on the marketplace repository. When omitted the marketplace entry’s default ref is used.

The marketplace key is mutually exclusive with git, path, registry, and id; combining them raises a parse error. Unknown keys in a marketplace entry are rejected. During dependency resolution the resolver calls resolve_marketplace_plugin(). A plugin entry that declares registry plus a semver version becomes a registry-sourced dependency using its declared owner/repo repository identity; apm install plugin@catalog writes it to apm.yml in registry form (id, registry, version), and its lock row replays from the exact version, resolved_url and resolved_hash, with no commit. Other entries become concrete Git coordinates (owner/repo, ref, and optional virtual path).

When version is a semver range or bare version number (for example ~2.1.0, ^2.0, or 2.1.0), the resolver uses the plugin source’s tag_pattern. apm pack emits that effective pattern from the package’s tag_pattern override, then marketplace.build.tagPattern. Marketplace files created before this field existed fall back to the legacy {name}--v{version} consumer convention. A pattern must contain exactly one {version} placeholder; {name} is optional. Unsupported or malformed patterns, and ranges or bare versions with no matching tags, fail without falling back to a raw ref. Pre-release versions are excluded from range resolution; target them explicitly as raw git refs. Raw refs such as v2.0.0, main, or a commit SHA bypass tag resolution.

source.tag_pattern is validated while the catalog is loaded. One malformed pattern makes apm marketplace add or apm marketplace update reject the entire marketplace, so consumers never resolve against a partially accepted catalog.

Resolution failures stop the install instead of silently skipping the dependency. The lockfile records the resolved coordinates and pinned commit, not the marketplace placeholder. Later installs, including --frozen, replay those coordinates without contacting the marketplace while name, marketplace and version are unchanged; apm update resolves again. The exception is a package whose MCP or LSP servers the lock records but which has no apm_modules/ copy: install reads the marketplace for it, because only the marketplace holds those inline server definitions. Unresolved marketplace dependencies cannot compute install paths or serialize back to apm.yml.

Registry dependency (whole package or virtual sub-path):

# Whole package via the default registry
- id: acme/toolkit
version: ^2.0.0
# Whole package routed to a named registry
- registry: jf-skills # OPTIONAL - defaults to the effective default registry
id: acme/toolkit # REQUIRED - owner/repo identity at the registry
version: ^2.0.0 # REQUIRED - opaque version selector (semver when supported)
# Virtual package (sub-path inside a published package)
- registry: jf-skills
id: acme/prompt-pack
path: prompts/review.prompt.md # OPTIONAL - omit to install the whole package
version: 1.4.0
alias: review # OPTIONAL
# Skill and target subset install from a registry package
- id: acme/toolkit
registry: jf-skills
version: ^2.0.0
skills: [deploy, lint] # OPTIONAL - install only named skills (same as git-longhand)
targets: [claude] # OPTIONAL - restrict deployment targets

id: (or registry:) and git: are mutually exclusive on the same entry. version: MUST be a non-empty string - opaque selectors such as stable, main, or commit pins are valid; semver ranges (^1.2.3) are interpreted as ranges when the registry publishes semver-tagged versions. Range selection skips pre-release versions unless the range itself names a pre-release on the same major.minor.patch (for example >=1.2.0-alpha <1.3.0 admits 1.2.0-beta but not 1.3.0-beta); an exact version: such as 1.3.0-beta.1 still selects that release. When registry: is omitted, a default registry MUST be configured - in project apm.yml or via registry.<name>.default true in ~/.apm/config.json; APM hard-fails otherwise.

A dependency MAY target a subdirectory or a file within a repository rather than the whole repo. Conforming resolvers MUST classify virtual packages using the following rules, evaluated in order:

KindDetection ruleExample
Filevirtual_path ends in .prompt.md, .instructions.md, or .agent.mdowner/repo/prompts/review.prompt.md
Subdirectoryvirtual_path does not match any file extension aboveowner/repo/skills/security

Classification is by extension only, never by path segment. A path like owner/repo/collections/security (no extension) is a Subdirectory: the on-disk shape (APM package with apm.yml, skill bundle, or plugin) is resolved at fetch time by probing for apm.yml first.

Removed (#1094): the legacy .collection.yml / .collection.yaml virtual-package form is no longer supported. Convert any such reference to an apm.yml with a dependencies: section, then reference the resulting subdirectory as a regular subdirectory virtual package.

Conforming writers MUST normalise entries to canonical form on write. github.com is the default host and MUST be stripped; all other hosts MUST be preserved as FQDN.

InputCanonical form
https://github.com/microsoft/apm-sample-package.gitmicrosoft/apm-sample-package
git@github.com:microsoft/apm-sample-package.gitmicrosoft/apm-sample-package
gitlab.com/acme/repogitlab.com/acme/repo

4.2. dependencies.mcp — list<McpDependency>

Section titled “4.2. dependencies.mcp — list<McpDependency>”

Each element MUST be one of two forms: string or object.

A plain registry reference: io.github.github/github-mcp-server.

FieldTypeRequiredConstraintDescription
namestringREQUIRED^[a-zA-Z0-9@_][a-zA-Z0-9._@/:=-]{0,127}$; no .. segments; neither the name nor the config key it is written under (a registry name owner/server writes under server) may be __proto__, constructor or prototype (any case)Server identifier (registry name or custom name).
transportenum<string>Conditionalstdio, sse, http, streamable-httpTransport protocol. REQUIRED when registry: false. Values are MCP transport names, not URL schemes; remote variants connect over HTTPS.
envmap<string, string>OPTIONALEnvironment variable overrides. Values may contain ${VAR} or ${env:VAR} references; see Section 4.2.4.
argsdict or listOPTIONALDict for overlay variable overrides (registry); list for positional args (self-defined).
versionstringOPTIONALPin to a specific server version.
registrybool or stringOPTIONALDefault: true (public registry)false = self-defined (private) server. String = custom registry URL.
packageenum<string>OPTIONALnpm, pypi, ociPackage manager type hint.
headersmap<string, string>OPTIONALCustom HTTP headers for remote endpoints. Same variable syntax as env.
toolslist<string>OPTIONALDefault: ["*"]Restrict which tools are exposed.
urlstringConditionalEndpoint URL. REQUIRED when registry: false and transport is http, sse, or streamable-http.
commandstringConditionalSingle binary path; no embedded whitespace unless args is also presentBinary path. REQUIRED when registry: false and transport is stdio.
enabledany JSON valueOPTIONALOpenCode onlyPassed unchanged to OpenCode’s opencode.json entry. When omitted, APM keeps its existing true default. APM does not validate the value; OpenCode interprets it. In the OpenCode 2 mcp.servers layout, false becomes disabled: true, true writes no field, and other values warn and leave the file unchanged; see OpenCode 2 configuration. Other targets ignore this field.
targetslist<string>OPTIONALNon-empty; known target namesTargets that receive this server: effective reach is the install targets intersected with this list. Omitted = every install target. No overlap = skipped with a warning. Never written to native config. A --target install keeps the server in other targets it lists; an untargeted server follows --target. Dropping a target from this list, or from the manifest targets:, removes the server there on the next install. In project scope claude and copilot share .mcp.json, so naming either one makes the server visible to both.

Any additional keys not listed above are preserved as extra passthrough fields and round-tripped verbatim into the generated target manifests. This allows harness-specific configuration (e.g. Claude Code’s oauth block for remote-MCP OAuth client config) to be declared in apm.yml and appear in the generated config without modification. A warning is emitted at parse time naming each non-standard key.

Two guardrails apply:

  • Reserved keys are rejected. A passthrough key whose name collides with a modeled field above — name, transport/type, command, url, headers, env, args, tools, version, registry, package, enabled, targets — or with an adapter-owned field (http_headers, env_http_headers, bearer_token_env_var, environment, id, httpUrl, serverUrl) is dropped with a warning. This prevents a passthrough value from shadowing or redirecting a modeled field. Extra keys also never overwrite a value the target adapter set itself. The top-level enabled field is the OpenCode-only exception: it is forwarded only to OpenCode, and an extra.enabled value remains reserved.
  • Extra keys broadcast to every target. Passthrough keys are written uniformly into the generated config for all installed harnesses, not just the one that understands them. A Claude Code oauth block (clientId/callbackPort), for example, is emitted into every target’s server entry; harnesses that do not recognise the key ignore it. Per-harness scoping is tracked as a future enhancement (see issue #1806).

A future release may require passthrough keys to be nested under an explicit extra: block and stop auto-capturing bare top-level keys (fail-closed), via a deprecation path. See issue #1806.

4.2.3. Validation Rules for Self-Defined Servers

Section titled “4.2.3. Validation Rules for Self-Defined Servers”

When registry is false, the following constraints apply:

  1. transport MUST be present.
  2. If transport is stdio, command MUST be present.
  3. If transport is http, sse, or streamable-http, url MUST be present.
  4. If transport is stdio, command MUST be a single binary path with no embedded whitespace. APM does not split command on whitespace; use args for additional arguments. A path that legitimately contains spaces (e.g. /opt/My App/server) is allowed when args is also provided (including an explicit empty list args: []), signaling the author has taken responsibility for the shape.
dependencies:
mcp:
# Registry reference (string)
- io.github.github/github-mcp-server
# Registry with overlays (object)
- name: io.github.github/github-mcp-server
tools: ["repos", "issues"]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Self-defined server (object, registry: false)
- name: my-private-server
registry: false
transport: stdio
command: ./bin/my-server
args: ["--port", "3000"]
env:
API_KEY: ${{ secrets.KEY }}
# Self-defined remote server with harness-specific extra keys
- name: slack
registry: false
transport: http
url: https://mcp.slack.com/mcp
oauth:
clientId: "<pre-registered-client-id>"
callbackPort: 3118

4.2.4. Variable References in headers and env

Section titled “4.2.4. Variable References in headers and env”

Values in headers and env may contain three placeholder syntaxes. APM resolves them per-target so secrets stay out of generated config files where possible.

For recognized GitHub MCP servers, automatic authentication follows the same target capability: runtime-capable targets write a native reference to the selected token environment variable, while literal-only targets retain their existing automatic-token behavior. A manifest-supplied nonempty string Authorization value takes precedence over automatic authentication. See Token injection: GitHub MCP server for the selection order and guidance for repairing existing generated configurations.

SyntaxSourceJetBrains CopilotCopilot / KiroCodex / GeminiCursor
${VAR}host environmentTranslated to ${env:VAR}Native; passed through verbatimenv: resolved at install time from env (or interactive prompt). Codex headers: see note belowTranslated to ${env:VAR}; resolved by Cursor at runtime
${env:VAR}host environmentNative; passed through verbatimTranslated to ${VAR}env: resolved at install time from env (or interactive prompt). Codex headers: see note belowNative; passed through verbatim and resolved at runtime
${input:<id>}user promptNot supported; use ${VAR} or ${env:VAR} insteadNot supported; use ${VAR} or ${env:VAR} insteadNot supported; use ${VAR} or ${env:VAR} insteadNot supported; use ${VAR} or ${env:VAR} instead
<VAR> (legacy)host environmentTranslated to ${env:VAR}Translated to ${VAR}Resolved at install time (kept for back-compat)Translated to ${env:VAR}; resolved by Cursor at runtime
  • JetBrains Copilot has native ${env:VAR} interpolation in mcp.json; APM normalizes ${VAR} and legacy <VAR> to ${env:VAR}.
  • Copilot (project .mcp.json and user mcp-config.json) and Kiro have native ${VAR} interpolation in their MCP config files; APM normalizes ${env:VAR} and legacy <VAR> to ${VAR}.
  • Codex and Gemini have no runtime interpolation for env, so APM resolves ${VAR}, ${env:VAR}, and the legacy <VAR> there at install time using os.environ (or an interactive prompt when missing). Resolved values are not re-scanned, so a value containing literal ${...} text is preserved.
  • Claude Code expands ${VAR} and ${VAR:-default} in command, args, env, url and headers of the project-scoped .mcp.json when it starts a server. An unset variable without a default stays as literal text, and claude mcp list warns about it. At project scope APM keeps these references, normalizing ${env:VAR} and legacy <VAR> to ${VAR}, keeps static values as authored, and never writes referenced values into .mcp.json or apm.lock.yaml. Reinstall replaces values an earlier APM release expanded into .mcp.json when APM can confirm it wrote them; otherwise the entry is kept and install names the affected fields. User-scope installs (-g, ~/.claude.json) keep resolving references at install time. See MCP variable compatibility for every harness.
  • Cursor resolves ${env:VAR} references at runtime. APM translates ${VAR} and legacy <VAR> into that native form in env, args, and headers, so referenced values are not written into the project-local Cursor config. This normalization does not cover command or url; their existing behavior is unchanged.
  • Codex headers are the exception. Codex does read a remote server’s headers from the environment, through dedicated fields rather than from inside http_headers, which it documents as static values. APM writes Authorization: "Bearer ${VAR}" as bearer_token_env_var and a value that is exactly ${VAR} as env_http_headers; Codex resolves both at server start, so no token is written to config.toml. A value Codex cannot express that way — literal text around the reference, or a shell-style default such as ${VAR:-} — is skipped with a warning instead of being written as static text.
  • OpenCode translates ${VAR}, ${env:VAR}, and legacy <VAR> to native {env:VAR} in remote headers, local environment (manifest env), and command arguments. Already-native references, authored static values, command executables, and URLs stay unchanged. Registry env overlays preserve authored values only for declared, emitted keys. Export referenced variables when launching OpenCode: APM writes references, not their resolved values. Keep secrets out of authored static values. See OpenCode config substitution.
  • Recommended: Use ${VAR} or ${env:VAR} in all new manifests - they work on every target that supports remote MCP servers. <VAR> is legacy.
  • Registry-backed servers - APM auto-generates input prompts from registry metadata only for required variables. Optional variables do not generate prompts or runtime config entries when no value is available. If a user has already edited an optional value in runtime config, reinstall preserves that value rather than overwriting it.

APM does not evaluate GitHub Actions templates (${{ ... }}). Codex skips remote headers containing them with a warning.

Existing Codex configurations: An unchanged apm install preserves an already-configured server, including literal placeholders written by older APM versions. For an APM-managed server, switch its header declaration between the equivalent ${VAR} and ${env:VAR} spellings, then rerun the original install command with the same scope and targets. This intentional declaration change reapplies the affected server; review and back up any manual edits to that entry first. Unrelated servers and settings are preserved.

dependencies:
mcp:
- name: my-server
registry: false
transport: http
url: https://my-server.example.com/mcp/
headers:
Authorization: "Bearer ${MY_SECRET_TOKEN}" # bare env-var
X-Tenant: "${env:TENANT_ID}" # env-prefixed

4.3. dependencies.lsp — list<LspDependency>

Section titled “4.3. dependencies.lsp — list<LspDependency>”

LSP (Language Server Protocol) server dependencies give supported runtimes real-time code intelligence — diagnostics, go-to-definition, and type information. APM currently writes LSP config for Claude Code, GitHub Copilot CLI and OpenCode while keeping this manifest schema runtime-neutral.

Each element MUST be one of two forms: string or object.

A plain server name reference: gopls. String-form entries carry only a name and are resolved from transitive packages or plugin .lsp.json files. They bypass strict validation (no command or extensionToLanguage required).

FieldTypeRequiredConstraintDescription
namestringREQUIRED^[a-zA-Z0-9@_][a-zA-Z0-9._@/:=-]{0,127}$; no .. segments; not __proto__, constructor or prototype (any case)Server identifier.
commandstringREQUIREDNo .. path segmentsBinary to execute (must be on $PATH or a relative path).
extensionToLanguagemap<string, string>REQUIREDNon-empty dictMaps file extensions to LSP language identifiers (e.g. ".go": "go").
argslist<string>OPTIONALCommand-line arguments for the server.
transportenum<string>OPTIONALstdio, socketCommunication transport. Defaults to stdio.
envmap<string, string>OPTIONALEnvironment variables set when starting the server.
initializationOptionsanyOPTIONALOptions passed to the server during LSP initialization.
settingsanyOPTIONALSettings passed via workspace/didChangeConfiguration.
workspaceFolderstringOPTIONALWorkspace folder path for the server.
startupTimeoutintOPTIONALMax time (ms) to wait for server startup.
shutdownTimeoutintOPTIONALMax time (ms) to wait for graceful shutdown.
restartOnCrashboolOPTIONALWhether to automatically restart on crash.
maxRestartsintOPTIONALMaximum restart attempts before giving up.

Both command and extensionToLanguage are REQUIRED in the object form. A missing or empty value for either is a validation error.

  1. name MUST match the pattern above and MUST NOT contain .. path segments.
  2. command MUST be a string and MUST NOT contain .. path traversal.
  3. transport, when present, MUST be stdio or socket.
  4. extensionToLanguage MUST be a non-empty dict mapping string keys to string values.

Manifest keys use camelCase (extensionToLanguage, initializationOptions, workspaceFolder, startupTimeout, shutdownTimeout, restartOnCrash, maxRestarts). Snake_case aliases are accepted on input for ergonomics but camelCase is canonical.

dependencies:
lsp:
# String form
- gopls
# Object form
- name: pyright
command: pyright-langserver
args: ["--stdio"]
extensionToLanguage:
".py": python
".pyi": python
transport: stdio
env:
PYTHONPATH: "./src"
startupTimeout: 10000
- name: rust-analyzer
command: rust-analyzer
extensionToLanguage:
".rs": rust
restartOnCrash: true
maxRestarts: 3

apm install writes LSP server configs to detected runtime targets. Claude Code uses the lspServers section in .claude/skills/apm-lsp/.claude-plugin/plugin.json at project scope or ~/.claude/skills/apm-lsp/.claude-plugin/plugin.json at user scope. GitHub Copilot CLI uses .github/lsp.json at project scope or ~/.copilot/lsp-config.json at user scope. OpenCode uses the lsp key of opencode.json or ~/.config/opencode/opencode.json; it skips socket servers and does not write startupTimeout, shutdownTimeout, restartOnCrash, maxRestarts, workspaceFolder or settings (see OpenCode limitations). See Install LSP servers for output formats and lifecycle details.


Typeobject
RequiredOPTIONAL
Known keysapm, mcp, lsp

Development-only dependencies installed locally but excluded from plugin bundles produced by apm pack (plugin format is the default). Uses the same structure as dependencies.

devDependencies:
apm:
- owner/test-helpers
- owner/lint-rules#v2.0.0

Created automatically by apm plugin init. Use apm install --dev to add packages:

Terminal window
apm install --dev owner/test-helpers

Once this section contains an APM or MCP dependency, the root apm.yml becomes eligible and direct installs select the APM package layout over a co-located plugin.json. Keep the section empty when direct installs should select the plugin layout.

Plain apm install (no flag) deploys both dependencies and devDependencies. There is no --omit=dev flag today; the dev/prod separation kicks in at apm pack (plugin format, the default). The local-content scanner uses .apm/ when present, otherwise supported plugin-native root directories; it does not consult the devDep marker. To keep maintainer-only primitives out of shipped artifacts, author them outside the selected source layout and reference them via a local-path devDependency. See Dev-only Primitives.

Local-path devDependency example:

devDependencies:
apm:
- path: ./dev/skills/release-checklist

The compilation key is OPTIONAL. It controls apm compile behaviour. All fields have sensible defaults; omitting the entire section is valid.

FieldTypeDefaultConstraintDescription
targetenum<string>unsetSame values as Section 3.6Deprecated and ignored. apm compile always uses the targets resolved from --target, targets: (Section 3.6), or auto-detection. APM warns when the project or user manifest sets it; remove it. A future release will reject it.
strategyenum<string>distributeddistributed, single-filedistributed generates per-directory target files (e.g. AGENTS.md, CLAUDE.md). single-file generates one monolithic file at output.
single_fileboolfalseLegacy alias. When true, overrides strategy to single-file.
outputstringAGENTS.mdFile pathCustom output path for the compiled file.
chatmodestringunsetChatmode filter for compilation.
resolve_linksbooltrueResolve relative Markdown links in primitives.
source_attributionboolfalseInclude the cosmetic compile annotations — source-file origin comments, the APM version comment, and the generated-by footer — in compiled output (opt-in). Applies to every compile target, including AGENTS.md targets.
excludelist<string> or string[]Glob patternsDirectories to skip during compilation (e.g. apm_modules/**).
placementobjectunsetPlacement tuning. See Section 6.1.
agents_mdobjectunsetAGENTS.md output tuning. See Section 6.2.
FieldTypeDefaultDescription
min_instructions_per_fileint1Minimum instruction count to warrant a separate AGENTS.md file.
compilation:
strategy: distributed
source_attribution: true
exclude:
- "apm_modules/**"
- "tmp/**"
placement:
min_instructions_per_file: 1

Controls how apm compile writes AGENTS.md output files. All fields are OPTIONAL; omitting the entire sub-object keeps full-file replacement for APM-generated files. An unmarked AGENTS.md, at the project root or in a distributed subdirectory, is retained with a warning. Use managed_section mode to update an APM-owned block inside that hand-authored file. In distributed compile mode, managed-section behavior applies to every generated AGENTS.md outside nested Git repositories.

FieldTypeDefaultConstraintDescription
modeenum<string>fullfull, managed_sectionfull replaces the entire APM-generated file on every compile but retains unmarked project-root files. managed_section replaces only the block between start_marker and end_marker, leaving surrounding content untouched. New distributed placements are created with a managed block for later recompiles.
start_markerstring<!-- apm:start -->Non-empty, distinct from end_markerOpening HTML comment that delimits the APM-managed block. Required in the output file when mode: managed_section.
end_markerstring<!-- apm:end -->Non-empty, distinct from start_markerClosing HTML comment that delimits the APM-managed block. Required in the output file when mode: managed_section.

Both markers must appear exactly once in every existing managed target file; a missing or duplicate marker raises ManagedSectionError rather than silently overwriting content. Compile excludes primitives and distributed placements in a nested Git repository (a .git directory or gitfile), including descendants of that repository. Use apm compile --dry-run to preview the same eligible placement set before writing files.

See apm compile for how compilation treats existing context files.

compilation:
agents_md:
mode: managed_section
start_marker: "<!-- apm:start -->"
end_marker: "<!-- apm:end -->"

The OPTIONAL marketplace: block declares the metadata apm pack needs to emit a Claude-Code-compatible plugin marketplace (marketplace.json). It is read by apm marketplace subcommands and ignored by everything else. Repositories that do not publish a marketplace omit it entirely.

The block was previously a standalone marketplace.yml file (still loadable for back-compat); the in-apm.yml form is canonical and is what apm marketplace init scaffolds.

Three keys are inherited from the top-level manifest unless explicitly overridden inside marketplace::

KeyInherited from
nametop-level name
descriptiontop-level description
versiontop-level version

Overrides exist for the rare case where the published marketplace identity differs from the package identity. Inherited values are omitted from the generated marketplace.json per the Claude-Code convention.

FieldTypeRequiredDefaultDescription
namestringOPTIONAL (override)inheritedOverride of top-level name. Normalised to kebab-case (lowercase, non-alphanumeric -> hyphen) in the compiled marketplace.json for Copilot App compatibility; the raw value is retained internally and, for Codex, as interface.displayName.
descriptionstringOPTIONAL (override)inheritedOverride of top-level description.
versionstringOPTIONAL (override)inheritedOverride of top-level version. Validated as semver.
ownerOwnerREQUIRED—Marketplace publisher identity. See Section 7.3.
sourceBasestringOPTIONALunsetHTTPS git base that relative packages[].source values compose onto. See Section 7.5.
outputstringOPTIONAL.claude-plugin/marketplace.jsonShorthand for claude.output; the claude block wins when both are set.
outputsmapOPTIONAL{claude: {}}Marketplace formats to emit: claude, codex, copilot. Each entry may set path. The list form ([claude, codex]) still parses; apm pack and apm marketplace check print a deprecation warning. See Publish to a marketplace.
claude / codex / copilot{output: string}OPTIONAL.claude-plugin/marketplace.json / .agents/plugins/marketplace.json / .github/plugin/marketplace.jsonPer-format output path. Wins over outputs.<name>.path.
versioning{strategy: enum}OPTIONALlocksteplockstep, tag_pattern, or per_package. See Versioning strategies.
metadataobjectOPTIONAL{}Free-form metadata forwarded verbatim to marketplace.json (e.g. homepage, support).
buildBuildOPTIONALtagPattern: "v{version}"Build configuration for resolving package refs. See Section 7.4.
packageslist<Package>OPTIONAL[]Packages exposed in the marketplace. See Section 7.5.

Unknown keys inside marketplace: are rejected at parse time.

FieldTypeRequiredDescription
namestringREQUIREDOwner display name (org or person).
emailstringOPTIONALContact email.
urlstringOPTIONALOwner homepage.
marketplace:
owner:
name: contoso
url: https://github.com/contoso
email: maintainers@contoso.example
FieldTypeDefaultDescription
tagPatternstringv{version}Pattern used to construct git tags for packages. MUST contain exactly one {version}; {name} is optional. Per-package overrides live on packages[].tag_pattern.

Each entry MUST be a mapping. Unknown keys are rejected.

FieldTypeRequiredDescription
namestringREQUIREDPackage identifier as it appears in the marketplace.
sourcestringREQUIREDOne of: <owner>/<repo> (remote on the default host), <host.tld>/<owner>/<repo> (remote on a non-default host such as GitHub Enterprise or self-hosted GitLab — shorthand), https://<host.tld>/<path>/<to>/<repo>[.git] (full URL form with two or more repository path segments on any supported host, including github.com; a trailing .git is stripped), ./<path> (local), or a relative path when marketplace.sourceBase is set. Must match the source pattern; path traversal (..) is refused, and URL forms with userinfo (user@host), ports, query strings, or non-https schemes are rejected.
subdirstringOPTIONALSubdirectory inside the source repo. Path-traversal-validated. Ignored for local sources.
versionstringConditionalSemver range (e.g. ^1.0.0, ~2.1.0, >=3.0). Stored as a string; resolution happens at pack time. REQUIRED for remote packages unless ref is given; when omitted in that case, the displayed version can fall back to the package’s own apm.yml (see note below).
refstringConditionalExplicit git ref (SHA, tag, or branch). Overrides version range when both are present. REQUIRED for remote packages unless version is given.
tag_patternstringOPTIONALPer-package override of build.tagPattern. Same placeholder rule.
include_prereleaseboolfalseWhether semver pre-release tags are eligible for resolution.
descriptionstringOPTIONALPass-through to marketplace.json; falls back to the package’s own apm.yml when omitted (see note below).
homepagestringOPTIONALPass-through to marketplace.json.
tagslist<string>OPTIONALPass-through to marketplace.json. Limited to 50 tags, 100 chars each.
keywordslist<string>OPTIONALAlias merged into tags (deduplicated).
authorstring or objectOPTIONALEither a non-empty string (treated as name) or an object with name (REQUIRED), email, url.
licensestringOPTIONALPass-through (SPDX identifier).
repositorystringOPTIONALPass-through.
categorystringConditionalPass-through to marketplace.json for both the Claude and Codex outputs when set. REQUIRED when marketplace.outputs includes codex.

Remote packages MUST declare at least one of version or ref. Local packages (sources beginning with ./) skip git resolution and have no version requirement.

When description is omitted, or when a remote entry has no displayable version, apm pack reads the matching field from the referenced package’s own apm.yml and uses it in the generated marketplace.json. Remote GitHub-class packages (github.com, GHES, or authenticated GHE Cloud) are fetched over HTTPS (skipped under --offline and for other hosts); local packages are read from disk under the project root. A description or display version set on the packages[] entry still wins. For remote packages, semver ranges such as ^1.0.0 are used for resolution, not emitted as the displayed version, so the package apm.yml version is emitted when available.

The first three source forms target a remote git host. The second names a non-default host (e.g. GitHub Enterprise or self-hosted GitLab) as a shorthand; the third is a full HTTPS URL on any supported host, including github.com, with an optional .git suffix normalized away. Path traversal (..) in local paths, userinfo (user@host), ports, query strings, and non-https URL schemes are rejected at parse time.

When sourceBase is set, relative package sources compose onto that base. For example, sourceBase: https://gitlab.corp.example.com/platform/agent-marketplace plus source: review emits https://gitlab.corp.example.com/platform/agent-marketplace/review. This includes two-segment owner/repo values and deeper relative paths; only host-prefixed sources, full HTTPS URLs, and local ./ sources are overrides that ignore sourceBase. Without sourceBase, existing owner/repo behavior is unchanged and single-segment relative sources are rejected.

sourceBase works with any supported host. An Azure DevOps base such as sourceBase: https://dev.azure.com/contoso/platform/_git plus source: agent-skills emits https://dev.azure.com/contoso/platform/_git/agent-skills; the dev.azure.com host is preserved through to the consumer, which resolves it as an Azure DevOps dependency rather than rewriting it onto the default host.

A relative source may use arbitrary path depth. A value whose leading segments form a host-prefixed shape (<host.tld>/<owner>/<repo>) or a full https:// URL is always treated as a per-entry override and ignores sourceBase. A value that looks like it is trying to name a host (a dotted, FQDN-like first segment) but does not form a valid override shape is rejected at parse time rather than silently composed onto the base — this avoids a confused-deputy footgun. To target a different host, use an explicit host-prefixed override or a full https:// URL instead of a relative source.

sourceBase must start with https://, use a FQDN host, include at least one path segment, and omit userinfo, ports, query strings, fragments, and a trailing .git. Path segments may percent-encode UTF-8 bytes, such as My%20Projects. Empty, ., .., malformed escapes, encoded separators, and recursive encodings are refused. Full HTTPS packages[].source paths follow the same safe percent-encoding rules. APM keeps the encoded URL in generated output while using decoded ADO coordinates for repository and authentication lookup.

Non-default hosts — GitHub Enterprise, self-hosted GitLab, and Azure DevOps — authenticate via the standard APM token chain — see the authentication guide for the per-host-class lookup order. A token resolved for one host class is never forwarded to another. ADO_APM_PAT, for example, is offered only to Azure DevOps Services and to Azure DevOps Server hosts explicitly trusted through ADO_HOST or APM_ADO_HOSTS.

marketplace:
# name, description, version inherit from top-level apm.yml
owner:
name: contoso
url: https://github.com/contoso
# Optional: packages can name repos relative to this git base.
sourceBase: https://gitlab.corp.example.com/platform/agent-marketplace
output: .claude-plugin/marketplace.json
metadata:
homepage: https://contoso.example/marketplace
build:
tagPattern: "v{version}"
packages:
- name: code-review
source: code-review # resolves under sourceBase
version: "^1.0.0"
description: AI code-review skills
tags: [review, quality]
- name: pinned-helper
source: contoso/pinned-helper # also resolves under sourceBase
ref: main # explicit ref overrides version
tag_pattern: "pinned-helper-v{version}"
- name: local-tool # local-path package
source: ./packages/local-tool
description: Vendored tool
- name: enterprise-agents # GHE shorthand
source: ghe.corp.example.com/platform/agents
version: "^0.3.0"
- name: gitlab-helper # full URL form
source: https://gitlab.corp.example.com/team/helper.git
ref: v1.2.0

The legacy standalone marketplace.yml (top-level keys, no marketplace: wrapper) is still loadable but deprecated; new repositories SHOULD use the in-apm.yml form scaffolded by apm marketplace init.


After successful dependency resolution, a conforming resolver MUST write a lockfile capturing the exact resolved state. The lockfile MUST be a YAML file named apm.lock.yaml at the project root and SHOULD be committed to version control.

The full lockfile schema is specified in the Lockfile specification. At a minimum, every resolver MUST record lockfile_version, dependencies[].repo_url, dependencies[].resolved_commit, and dependencies[].deployed_files so subsequent installs are reproducible and apm uninstall can remove every placed file.

Resolver behaviour:

  1. First install — Resolve all dependencies, write apm.lock.yaml.
  2. Subsequent installs — Read apm.lock.yaml, use locked commit SHAs. A resolver SHOULD skip download when the local checkout already matches.
  3. --update flag — Re-resolve from apm.yml, overwrite the lockfile.

Any runtime adopting this format (e.g. GitHub Agentic Workflows, CI systems, IDEs) MUST implement these steps:

  1. Parse — Read apm.yml as YAML. Validate the two REQUIRED fields (name, version) and the dependencies object shape.
  2. Resolve dependencies.apm — For each entry, clone or fetch the git repo (respecting ref), locate the .apm/ directory (or virtual path), and extract primitives.
  3. Resolve dependencies.mcp — For each entry, resolve from the MCP registry or validate self-defined transport config per Section 4.2.3.
  4. Transitive resolution — Resolved packages MAY contain their own apm.yml with further dependencies, forming a dependency tree. Resolvers MUST resolve transitively. Conflicts are merged at instruction level (by applyTo pattern), not file level.
  5. Write lockfile — Record exact commit SHAs and deployed file paths in apm.lock.yaml per Section 8 and the Lockfile specification.

name: my-project
version: 1.0.0
description: AI-native web application
author: Contoso
license: MIT
targets: [claude, copilot]
type: hybrid
includes: auto
scripts:
start: "copilot -p 'README.prompt.md'"
review: "copilot -p 'code-review.prompt.md'"
impl: "copilot -p 'implement-feature.prompt.md'"
dependencies:
apm:
- microsoft/apm-sample-package#v1.0.0
- gitlab.com/acme/coding-standards#main
- git: https://gitlab.com/acme/repo.git
path: instructions/security
ref: v2.0
mcp:
- io.github.github/github-mcp-server
- name: my-private-server
registry: false
transport: stdio
command: ./bin/my-server
env:
API_KEY: ${{ secrets.KEY }}
lsp:
- name: pyright
command: pyright-langserver
args: ["--stdio"]
extensionToLanguage:
".py": python
".pyi": python
devDependencies:
apm:
- owner/test-helpers
compilation:
strategy: distributed
exclude:
- "apm_modules/**"
placement:
min_instructions_per_file: 1
policy:
fetch_failure_default: warn
marketplace:
owner:
name: contoso
url: https://github.com/contoso
packages:
- name: code-review
source: contoso/code-review
version: "^1.0.0"
tags: [review, quality]

VersionDateChanges
0.12026-03-06Initial Working Draft.
0.22026-05-10Added Section 7 (Marketplace authoring block). Documented scripts.start as the default apm run entry point. Cross-links updated to reference CLI paths. ASCII-only enforcement.
0.32026-05-20Added Section 4.3 (dependencies.lsp). LSP servers as a third dependency kind. Updated document structure, devDependencies known keys, and Appendix A.
0.42026-06-11Added marketplace.sourceBase and Section 7.5 source composition semantics.

Copyright (c) Microsoft Corporation. General documentation: CC-BY-4.0. Software, code examples and OpenAPM: Apache-2.0. See scope and exclusions.