Is your feature request related to a problem?
As a user authoring APM packages (.apm/ with hooks, instructions, skills, agents), there is no first-class way to verify that my package actually works before installing/compiling it into a runtime:
- Hook scripts may have syntax errors, wrong permissions, or never fire for the intended lifecycle event.
- Instruction files may have malformed frontmatter or
applyTo globs that silently match nothing.
- Skills may never be routed to because their
description/intent metadata doesn't match how users phrase requests.
Today the feedback loop is "compile, run a real agent session, notice the behavior is wrong" — slow and hard to debug. The APM repo itself has a strong internal test suite (unit / integration / acceptance / mutation), including hook execution tests, but none of this is exposed to package authors as a validation tool.
Describe the solution you'd like
A user-facing validation/test command, e.g. apm validate (or apm test), that runs against a local package and reports:
-
Contract checks (static)
- Frontmatter schema validation for
*.instructions.md, SKILL.md, *.agent.md, *.prompt.md (required fields, valid YAML).
applyTo glob sanity: warn when a pattern matches zero files in the target workspace.
- Hook manifest checks: referenced scripts exist, are executable, declare a known lifecycle event.
-
Hook dry-run (dynamic, opt-in)
- Execute hooks in a sandbox with mock event payloads; assert exit code 0 and bounded runtime.
-
Routing/golden tests (optional fixtures)
- Author-provided fixtures:
prompt -> expected skill/instruction pairs.
- Harness evaluates routing metadata deterministically (no LLM call needed for the static-matching portion) and reports which skill/instruction would be selected.
Output: human-readable summary + non-zero exit code on failure, so it's CI-friendly (authors can gate their package repos on apm validate).
Describe alternatives you've considered
- Ad-hoc pytest suites in each package repo — works, but every author reinvents frontmatter parsing and hook mocking; no shared contract with APM's compiler.
- Relying on compile-time errors — catches syntax issues but not "hook never fires" or "skill never routes".
Additional context
- Happy to contribute this incrementally: start with static contract checks (smallest slice), then hook dry-run, then routing fixtures — each as a separate single-concern PR with tests, per the contribution guide.
- Reuses existing internals where possible (package model parsing, hook execution code already covered by
tests/integration/test_integrators_hooks_execution.py).
Is your feature request related to a problem?
As a user authoring APM packages (
.apm/with hooks, instructions, skills, agents), there is no first-class way to verify that my package actually works before installing/compiling it into a runtime:applyToglobs that silently match nothing.description/intent metadata doesn't match how users phrase requests.Today the feedback loop is "compile, run a real agent session, notice the behavior is wrong" — slow and hard to debug. The APM repo itself has a strong internal test suite (unit / integration / acceptance / mutation), including hook execution tests, but none of this is exposed to package authors as a validation tool.
Describe the solution you'd like
A user-facing validation/test command, e.g.
apm validate(orapm test), that runs against a local package and reports:Contract checks (static)
*.instructions.md,SKILL.md,*.agent.md,*.prompt.md(required fields, valid YAML).applyToglob sanity: warn when a pattern matches zero files in the target workspace.Hook dry-run (dynamic, opt-in)
Routing/golden tests (optional fixtures)
prompt -> expected skill/instructionpairs.Output: human-readable summary + non-zero exit code on failure, so it's CI-friendly (authors can gate their package repos on
apm validate).Describe alternatives you've considered
Additional context
tests/integration/test_integrators_hooks_execution.py).