fix(primitive-author): annotate tier moves and route package config

- annotate the research Must demoted to hook Should 12; narrow Must 5 note
- extend Must 6 to scripts run via an interpreter -c string
- add a fallback dispatch row and comma-joined --target guidance
- fall back when agentsmd-author is not installed
- add the apm-workflow boundary; pin upstream apm source URL

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkT7RSDwDbmrM9T34b6sTi
This commit is contained in:
2026-09-29 08:00:26 +00:00
parent 36723ae3fc
commit fd86ee42f4
5 changed files with 28 additions and 18 deletions

View File

@@ -68,7 +68,7 @@ Must:
else fails the Copilot install outright. The file contributes at least one entry, and every
entry carries at least one handler: an empty list or a handler-less entry deploys nothing, with
only a warning.
4. Every event is one each target the package deploys to fires, after apm's rename for that target
4. Every event is one that each target the package deploys to fires, after apm's rename for that target
(`_HOOK_EVENT_MAP`; no `targets:` means every target). Write Claude's PascalCase names
(`PreToolUse`, `PostToolUse`, `UserPromptSubmit`, `SessionStart`, `Stop`, …), which apm renames
for each target its map covers. A name the map does not cover deploys verbatim with no warning,
@@ -84,10 +84,11 @@ Must:
the path itself, and no space. When quoting, quote the whole token —
`"${PLUGIN_ROOT}/scripts/my-hook.sh"`, never `"${PLUGIN_ROOT}"/scripts/x.sh`: apm rewrites
`${PLUGIN_ROOT}` only when a path separator follows it directly, and only up to the next space
or quote, so a split quote is left unrewritten and a spaced path is cut short. This is stricter
than the research's Should, as with Must 6: either defect fails every time the hook fires. A
missing script is only a warning at install time.
6. A script run directly as the command's first token is executable. This is stricter than the
or quote, so a split quote is left unrewritten and a spaced path is cut short. The quoting and
space rules are stricter than the research's Should, as with Must 6: either defect fails every
time the hook fires. A missing script is only a warning at install time.
6. A script run directly as the command's first token, or as the first token of an interpreter's
`-c` command string (`bash -c "${PLUGIN_ROOT}/x.sh"`), is executable. This is stricter than the
research's Should: without it the hook fails every time it fires. A script passed to an
interpreter (`bash ${PLUGIN_ROOT}/x.sh`) needs no executable bit.
@@ -105,5 +106,5 @@ Should:
12. No filename that routes by target. Case-insensitively, apm routes a stem of exactly
`hooks-<target>` and any stem ending `<target>-hooks` — bare (`claude-hooks`), prefixed
(`x-claude-hooks`) or combined (`claude-codex-hooks`, the union). That routing is deprecated and
reach belongs to `targets:` (see Gate); the research allows it only when deprecated routing is
intended.
reach belongs to `targets:` (see Gate). The research files this as a Must; it is a Should here
because only the author can say deprecated routing is intended.