Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/microsoft/apm/architecturegit clone --depth 1 https://github.com/microsoft/apmWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02689 | $0.02689 |
| Opus 5 | $0.01345 | $0.01345 |
| Sonnet 5 | $0.00538 | $0.00538 |
| Haiku 4.5 | $0.00269 | $0.00269 |
Grade A, and why
apm architecture.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Architecture discipline: one canonical owner per decision
APM is a pipeline of durable facts (targets, lock state, install outcomes, compiled output, hook shapes, credentials, deployment provenance). Most reliability bugs in this codebase have one shape: the SAME decision was computed or enforced in more than one place, so a fix on one path silently missed a sibling path. The cure is structural, not case-by-case.
The rule
Every durable decision, vocabulary, outcome, write, or contract has exactly ONE canonical owner. Every call site routes THROUGH that owner instead of re-deriving the answer locally.
- A "decision" is anything a reader must be able to trust is computed identically everywhere: the accepted target set, whether an install succeeded, the on-disk shape of a hook, the integrity hash of a deployed file, the resolved credential for a host.
- Adding a second place that computes or enforces the same decision is a "split authority" and is a defect even if it currently agrees -- it WILL drift the next time one side is patched.
Existing canonical owners -- route through these, do not re-derive
The Owner path selectors column is executable contract data. The
shepherd-driver owner-touch gate parses it directly; do not copy these
selectors into another table or script. Keep selectors repository-relative,
semicolon-delimited, and specific to the file(s) that own the fact.
| Decision / fact | Canonical owner | Owner path selectors |
|---|---|---|
| Accepted target vocabulary | core/target_catalog.py | src/apm_cli/core/target_catalog.py |
| Effective install target selection | core/target_detection.py (EffectiveTargetDecision) | src/apm_cli/core/target_detection.py |
| Effective package target authorization | install/target_filter.py (resolve_effective_package_targets) | src/apm_cli/install/target_filter.py |
| MCP target-selection precedence | integration/mcp_integrator_install.py (_resolve_target_runtimes) | src/apm_cli/integration/mcp_integrator_install.py |
| Legacy MCP runtime ownership-key migration | install/mcp/ownership.py (migrate_legacy_project_target_servers) | src/apm_cli/install/mcp/ownership.py |
| Behavioral test taxonomy classification | module-level pytestmark (taxonomy inventory verifies) | tests/quality/taxonomy_inventory_plugin.py; tests/quality/test_test_taxonomy.py |
| Host + credential resolution | core/auth.py (AuthResolver), core/host_providers.py | src/apm_cli/core/auth.py; src/apm_cli/core/host_providers.py |
| Runtime descriptors | runtime/registry.py | src/apm_cli/runtime/registry.py |
| User-facing output / diagnostics | CommandLogger / console owner | src/apm_cli/core/command_logger.py; src/apm_cli/utils/console.py |
| Compiled-output writes (atomic) | CompiledOutputWriter | src/apm_cli/compilation/output_writer.py |
| Deployment provenance / state | deployment_ledger.py | src/apm_cli/core/deployment_ledger.py |
| Target-scoped deployed-file contraction | install/manifest_reconcile.py (reconcile_target_deployed_files) | src/apm_cli/install/manifest_reconcile.py |
| Install success / failure outcome | the canonical install-outcome path | src/apm_cli/install/outcome.py |
| Resolution replacement activation | install/resolution_staging.py (ResolutionStagingSession) | src/apm_cli/install/resolution_staging.py |
| Frozen install mutation eligibility | install/service.py (InstallService) | src/apm_cli/install/service.py |
| Authorized deployable source paths | install/deployable_source_plan.py (DeployableSourcePlan) | src/apm_cli/install/deployable_source_plan.py |
| Symlink-component containment and strict percent-encoded URL-path decoding | utils/path_security.py (has_symlink_component, decode_url_path_segments) | src/apm_cli/utils/path_security.py |
| Install invocation option defaults | install/request.py (InstallRequest) | src/apm_cli/install/request.py; src/apm_cli/commands/install.py |
| Neutral hook source grammar, per-target native shape, and shared-config APM-owned drift projection | hook_contract.py (HOOK_COMMAND_KEYS, parse_hook_source, _entries_to_ir), per-target renderers, hook_ownership.py (project_apm_owned_hook_entries) | src/apm_cli/hook_contract.py; src/apm_cli/integration/hook_ir.py; src/apm_cli/integration/hook_native_formats.py; src/apm_cli/integration/hook_integrator.py; src/apm_cli/integration/hook_ownership.py |
| Plugin-root hook command vocabulary + parsing | integration/hook_command_paths.py | src/apm_cli/integration/hook_command_paths.py |
| File-level deploy / sync / cleanup | BaseIntegrator (see integrators.instructions.md) | src/apm_cli/integration/base_integrator.py |
| Windows stable executable path | install.ps1 ($currentDir / $currentExe) | install.ps1 |
| Git repository cache-key normalization | cache/url_normalize.py (normalize_repo_url / cache_shard_key) | src/apm_cli/cache/url_normalize.py |
| Self-update release -> installer ref + VERSION | commands/self_update.py (_ResolvedSelfUpdateRelease) | src/apm_cli/commands/self_update.py |
| Dependency comparison identity vs display-cased materialization path | models/dependency/identity.py + materialization.py + DependencyReference | src/apm_cli/models/dependency/identity.py; src/apm_cli/models/dependency/materialization.py; src/apm_cli/models/dependency/reference.py |
| Cached policy shape | policy/discovery.py (_policy_to_dict via _serialize_policy; ADO_POLICY_PROJECT; ADO_POLICY_REPOSITORY) | src/apm_cli/policy/discovery.py |
| Post-uninstall dependency reachability | deps/reachability.py (compute_forward_reachable_keys) | src/apm_cli/deps/reachability.py |
| CI audit scratch materialization | install/audit_replay.py (prepare_ci_audit_replay) | src/apm_cli/install/audit_replay.py |
| GitHub API throttle classification | deps/github_rate_limit.py | src/apm_cli/deps/github_rate_limit.py |
| Git ref freshness and cache eligibility | deps/tiered_ref_resolver.py (RefFreshnessPolicy) | src/apm_cli/deps/tiered_ref_resolver.py |
| Git semver preflight eligibility and resolution | install/helpers/ref_reuse.py (is_git_semver_resolution_eligible / maybe_resolve_git_semver) | src/apm_cli/install/helpers/ref_reuse.py |
| Root vs dependency MCP declaration scope | integration/mcp_config_view.py (CurrentMcpConfigView) | src/apm_cli/integration/mcp_config_view.py |
| MCP package launcher selection and argv shape (container and non-container) | adapters/client/base.py (MCPClientAdapter) | src/apm_cli/adapters/client/base.py |
| Dependency CLI identifier parsing + uninstall selection | models/dependency/selection.py (via DependencyReference) | src/apm_cli/models/dependency/selection.py |
| JetBrains Copilot MCP config path | adapters/client/intellij.py | src/apm_cli/adapters/client/intellij.py |
| Copilot CLI MCP config paths | adapters/client/copilot.py | src/apm_cli/adapters/client/copilot.py |
| Marketplace tag-pattern validation and expansion | marketplace/tag_pattern.py | src/apm_cli/marketplace/tag_pattern.py |
| Local marketplace package-version manifest precedence | marketplace/version_check.py (_read_local_version) | src/apm_cli/marketplace/version_check.py |
| applyTo normalization and hidden-tool placement | utils/patterns.py (normalize_apply_to); compilation/context_optimizer.py (ContextOptimizer) | src/apm_cli/utils/patterns.py; src/apm_cli/compilation/context_optimizer.py |
| Effective marketplace output path | marketplace/output_profiles.py (resolve_effective_output_path) | src/apm_cli/marketplace/output_profiles.py |
| Bootstrap project-name validation and fallback | core/project_name.py (resolve_bootstrap_project_name) | src/apm_cli/core/project_name.py |
| Marketplace raw-structure diagnostics | marketplace/models.py parser; validator.py consumes them | src/apm_cli/marketplace/models.py; src/apm_cli/marketplace/validator.py |
| Catalog-only marketplace manifest materialization | deps/_shared.py (materialize_marketplace_manifest) | src/apm_cli/deps/_shared.py |
| Agent Plugins v1 contract interpretation, component discovery, and portable manifest authority | agent_plugins/loader.py (load_agent_plugin, _load_apm_configuration) | src/apm_cli/agent_plugins/loader.py; src/apm_cli/agent_plugins/ir.py |
| Agent Plugin producer portable-surface admission | bundle/agent_plugin_exporter.py (_require_portable_agent_plugin) | src/apm_cli/bundle/agent_plugin_exporter.py |
| APMPackage interpreted-manifest construction | models/apm_package.py (APMPackage.from_mapping) | src/apm_cli/models/apm_package.py |
| Agent Plugin compatibility package projection | agent_plugins/projection.py (project_agent_plugin_package) | src/apm_cli/agent_plugins/projection.py; src/apm_cli/models/validation.py |
| Network host literal parsing and loopback classification | utils/net.py (parse_host_address, is_loopback_host) | src/apm_cli/utils/net.py |
| Legacy plugin declared-skill membership and plugin-root placeholder expansion | deps/plugin_parser.py (_map_plugin_artifacts, normalized_plugin_skill_sources, resolve_plugin_root_placeholders) | src/apm_cli/deps/plugin_parser.py; src/apm_cli/integration/skill_integrator.py |
| User-root scoped instruction eligibility | integration/targets.py (TargetProfile.include_scoped_in_user_root_context) | src/apm_cli/integration/targets.py |
| Native Agent Plugin registration admission (Copilot target + client capability) | copilot_plugins/capability.py (resolve_native_registration_capability, admits_native_plugin) | src/apm_cli/copilot_plugins/capability.py |
| APM-owned Copilot marketplace catalog, settings entries, and ownership ledger | copilot_plugins/registrar.py (synchronize_copilot_plugins, resync_native_plugins) | src/apm_cli/copilot_plugins/registrar.py; src/apm_cli/copilot_plugins/settings.py; src/apm_cli/copilot_plugins/catalog.py |
| Frontmatter BOM decoding and bounded YAML parsing | utils/yaml_io.py (load_frontmatter, _BoundedYAMLHandler) | src/apm_cli/utils/yaml_io.py |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday Changed · +1 lines · +31 tokens per session 7ab9944e0106
- yesterday First seen · 124 lines · 2,658 tokens per session scan A 1464599396f2
apm architecture.instructions.md is an instructions file published in the GitHub repository microsoft/apm (3,668 stars, last pushed yesterday), licensed MIT. It adds 2,689 tokens to every session, about $0.0134 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
aru AGENTS.md
Instructions for narumiruna/aru, covering repository guidance, scope and authority, communication & documentation, code style and project map.
skillport AGENTS.md
Instructions for gotalab/skillport, covering agent guidelines & context, 1. core principles (10-second recall), 2. project context, architecture and directory structure.
odin-codex-plugin AGENTS.md
Instructions for OutlineDriven/odin-codex-plugin, covering codex coding agent adherences, token-efficient cli output, tool hierarchy, core system & file ops and search & discovery.
copilot-setting AGENTS.md
AGENTS.md instructions for zexion7873/copilot-setting, covering copilot-setting — agent guide, communication language, repository purpose, validation commands and architecture.
loadout reactjs.instructions.md
ReactJS Engineering Instructions.
loadout tauri.instructions.md
Tauri Engineering Instructions.