kyberforge: factory-audit check suite for hook JSON files #153

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

Part of #94.

Depends on #147
Depends on #150

Why

factory-audit audits skills and agents only. A hand-edited .apm/hooks/*.json gets no audit, and the reconstruction gotchas (event-name casing between targets, the Copilot bash + powershell split, ${CLAUDE_PLUGIN_ROOT} rewriting) are easy to get wrong.

What to build

Register hooks as a primitive in the generic flow from #147. Hooks differ from the markdown primitives: they are JSON, with no frontmatter, no description budget and no prose body.

  • A scripts/lib-checks-hooks.sh check suite, sourced from a new hooks mode in scripts/validate.sh, encoding the rules hook-author (#150) already decided are correct. Derive the rubric from that skill's references/.
  • The flow's Vale step and the description/body dimensions do not apply to hooks; the data table must express "step not applicable" rather than faking a pass. Say how in the PR.
  • A criteria file and any rubrics the flow needs, under references/.
  • A row in the primitive data table (target shape .apm/hooks/*.json, coverage line, "Run hook-author to address findings").
  • Provenance handling: JSON cannot carry frontmatter source_keys; decide whether provenance applies and record the decision.
  • tests/validate-hooks.bats.

Not in scope

  • Auditing the hook scripts that the JSON invokes.
  • Any change to the skill or agent flows or check suites.

Acceptance criteria

  • factory-audit on a valid hooks file returns PASS; on one with a wrong event-name casing or an unrewritten script-path placeholder, the finding names the target and the fix.
  • The repo's own plugins/kyberforge/.apm/hooks/hooks.json audits PASS.
  • tests/validate-hooks.bats passes, with the existing skill and agent bats suites still green.
  • Step 0 recognises .apm/hooks/*.json and the unrecognised-path message lists the new shape.
  • factory-audit metadata.version bumped (ADR-0022); description and body pass ADR-0020 budgets.
  • apm audit --ci clean.

References

  • plugins/kyberforge/docs/research/docs/microsoft-apm/hooks-primitive-schema.md
  • ADR-0019, ADR-0020, ADR-0022, ADR-0025
Part of #94. Depends on #147 Depends on #150 ## Why `factory-audit` audits skills and agents only. A hand-edited `.apm/hooks/*.json` gets no audit, and the reconstruction gotchas (event-name casing between targets, the Copilot `bash` + `powershell` split, `${CLAUDE_PLUGIN_ROOT}` rewriting) are easy to get wrong. ## What to build Register hooks as a primitive in the generic flow from #147. Hooks differ from the markdown primitives: they are JSON, with no frontmatter, no description budget and no prose body. - A `scripts/lib-checks-hooks.sh` check suite, sourced from a new `hooks` mode in `scripts/validate.sh`, encoding the rules `hook-author` (#150) already decided are correct. Derive the rubric from that skill's `references/`. - The flow's Vale step and the description/body dimensions do not apply to hooks; the data table must express "step not applicable" rather than faking a pass. Say how in the PR. - A criteria file and any rubrics the flow needs, under `references/`. - A row in the primitive data table (target shape `.apm/hooks/*.json`, coverage line, "Run hook-author to address findings"). - Provenance handling: JSON cannot carry frontmatter `source_keys`; decide whether provenance applies and record the decision. - `tests/validate-hooks.bats`. ## Not in scope - Auditing the hook scripts that the JSON invokes. - Any change to the skill or agent flows or check suites. ## Acceptance criteria - [ ] `factory-audit` on a valid hooks file returns PASS; on one with a wrong event-name casing or an unrewritten script-path placeholder, the finding names the target and the fix. - [ ] The repo's own `plugins/kyberforge/.apm/hooks/hooks.json` audits PASS. - [ ] `tests/validate-hooks.bats` passes, with the existing skill and agent bats suites still green. - [ ] Step 0 recognises `.apm/hooks/*.json` and the unrecognised-path message lists the new shape. - [ ] `factory-audit` `metadata.version` bumped (ADR-0022); description and body pass ADR-0020 budgets. - [ ] `apm audit --ci` clean. ## References - `plugins/kyberforge/docs/research/docs/microsoft-apm/hooks-primitive-schema.md` - ADR-0019, ADR-0020, ADR-0022, ADR-0025
Claude added this to the Kyberforge basics milestone 2026-10-01 06:23:58 +00:00
Claude added the Kind/Feature label 2026-10-01 06:23:58 +00:00
Sign in to join this conversation.