kyberforge: add hook-author skill for .apm/hooks/*.json #150

Open
opened 2026-10-01 06:23:35 +00:00 by Claude · 0 comments
Collaborator

Part of #94.

Why

apm-workflow/references/configure.md says hook subdirectories "must be created manually as content is migrated into them". There is no template, script or reference for .apm/hooks/*.json anywhere in kyberforge. forge/SKILL.md already says a hook "has no route here" and hands the user elsewhere, so the author is left without help.

The research doc plugins/kyberforge/docs/research/docs/microsoft-apm/hooks-primitive-schema.md records per-target reconstruction gotchas an author would get wrong by hand:

  • Copilot's version: 1 and camelCase field naming versus Claude's shape, plus the bash + powershell script split.
  • Event-name casing remaps between compile targets.
  • ${CLAUDE_PLUGIN_ROOT} placeholder rewriting in script paths.

What to build

A new hook-author skill, shaped like agent-author:

  • SKILL.md with a trigger description that states its domain boundary (ADR-0021) and routes review-only requests to factory-audit.
  • assets/templates/ with a minimal .apm/hooks/*.json in the nested-wrapper shape.
  • references/ covering event-name casing, script-path placeholders and the Copilot field differences. Cite the research doc through source_keys and references/sources.md.
  • scripts/new-hook.sh scaffolder and tests/new-hook.bats, following agent-author.
  • Replace the "must be created manually" sentence in apm-workflow/references/configure.md with a pointer to the new skill.
  • Replace the "hook has no route" line in forge/SKILL.md with a real routing-table row.

Not in scope

  • Auditing hook files. That is the audit issue for hooks, which depends on this one.
  • Hook scripts themselves (the shell the JSON invokes).

Acceptance criteria

  • plugins/kyberforge/.apm/skills/hook-author/ exists with SKILL.md, assets/, references/, scripts/, tests/.
  • Scaffolded output compiles for both the Claude and Copilot targets, and the casing remap and path placeholder rewrite are demonstrated in a test or fixture.
  • metadata.version set per ADR-0022; description and body pass ADR-0020 budgets (scripts/skill-size-check.sh).
  • forge/SKILL.md has a route to it; the configure.md sentence is replaced.
  • factory-audit run on the new skill returns PASS.
  • apm audit --ci clean; bats tests pass.
  • The repo's own SessionStart hook (authored in plugins/kyberforge/.apm/hooks/hooks.json, ADR-0019) is not changed by this work.

References

  • plugins/kyberforge/docs/research/docs/microsoft-apm/hooks-primitive-schema.md
  • plugins/kyberforge/.apm/skills/agent-author/ as the structural model
  • ADR-0019, ADR-0020, ADR-0021, ADR-0022
Part of #94. ## Why `apm-workflow/references/configure.md` says hook subdirectories "must be created manually as content is migrated into them". There is no template, script or reference for `.apm/hooks/*.json` anywhere in kyberforge. `forge/SKILL.md` already says a hook "has no route here" and hands the user elsewhere, so the author is left without help. The research doc `plugins/kyberforge/docs/research/docs/microsoft-apm/hooks-primitive-schema.md` records per-target reconstruction gotchas an author would get wrong by hand: - Copilot's `version: 1` and camelCase field naming versus Claude's shape, plus the `bash` + `powershell` script split. - Event-name casing remaps between compile targets. - `${CLAUDE_PLUGIN_ROOT}` placeholder rewriting in script paths. ## What to build A new `hook-author` skill, shaped like `agent-author`: - `SKILL.md` with a trigger description that states its domain boundary (ADR-0021) and routes review-only requests to `factory-audit`. - `assets/templates/` with a minimal `.apm/hooks/*.json` in the nested-wrapper shape. - `references/` covering event-name casing, script-path placeholders and the Copilot field differences. Cite the research doc through `source_keys` and `references/sources.md`. - `scripts/new-hook.sh` scaffolder and `tests/new-hook.bats`, following `agent-author`. - Replace the "must be created manually" sentence in `apm-workflow/references/configure.md` with a pointer to the new skill. - Replace the "hook has no route" line in `forge/SKILL.md` with a real routing-table row. ## Not in scope - Auditing hook files. That is the audit issue for hooks, which depends on this one. - Hook scripts themselves (the shell the JSON invokes). ## Acceptance criteria - [ ] `plugins/kyberforge/.apm/skills/hook-author/` exists with `SKILL.md`, `assets/`, `references/`, `scripts/`, `tests/`. - [ ] Scaffolded output compiles for both the Claude and Copilot targets, and the casing remap and path placeholder rewrite are demonstrated in a test or fixture. - [ ] `metadata.version` set per ADR-0022; description and body pass ADR-0020 budgets (`scripts/skill-size-check.sh`). - [ ] `forge/SKILL.md` has a route to it; the `configure.md` sentence is replaced. - [ ] `factory-audit` run on the new skill returns PASS. - [ ] `apm audit --ci` clean; bats tests pass. - [ ] The repo's own `SessionStart` hook (authored in `plugins/kyberforge/.apm/hooks/hooks.json`, ADR-0019) is not changed by this work. ## References - `plugins/kyberforge/docs/research/docs/microsoft-apm/hooks-primitive-schema.md` - `plugins/kyberforge/.apm/skills/agent-author/` as the structural model - ADR-0019, ADR-0020, ADR-0021, ADR-0022
Claude added this to the Kyberforge basics milestone 2026-10-01 06:23:35 +00:00
Claude added the Kind/Feature label 2026-10-01 06:23:35 +00:00
Sign in to join this conversation.