From citadel
Self-tests Citadel hook pipeline in live sessions by exercising tool calls (Write, Edit, Bash, Read). Verifies hooks fired, telemetry grew, no errors. Reports HOOK HEALTH: PASS/FAIL with breakdown.
npx claudepluginhub sethgammon/citadel --plugin citadelThis skill uses the workspace's default tool permissions.
Use this when:
Tests ClaudeTracker's hooks integration end-to-end by sending 21 hook events via PowerShell script through HookBridge and verifying delivery in logs and notifications.
Audits Claude Code hooks for config validity, script structure, matchers, env vars, decisions, and tests. Run after hook creation, before releases, or for periodic checks.
Creates, validates, and refines Claude Code plugin hooks for workflow automation. Supports command hooks (shell scripts), prompt hooks (LLM decisions), event matching, decision schemas, and production safety validation.
Share bugs, ideas, or general feedback.
Use this when:
Read the current telemetry state:
.planning/telemetry/hook-timing.jsonl → count lines (baseline_timing)
.planning/telemetry/audit.jsonl → count lines (baseline_audit)
.planning/telemetry/hook-errors.log → size in bytes (baseline_errors)
If telemetry directory doesn't exist, note it (init-project may not have run).
Run these tool calls in sequence. Each exercises a different hook:
Write a temp file at .planning/verify-temp.ts:
// citadel verify probe
export const verifyProbe = true;
→ Exercises: PreToolUse (protect-files, governance), PostToolUse (post-edit)
Edit the same file — change true to false:
→ Exercises: PreToolUse (protect-files, governance), PostToolUse (post-edit)
Bash a harmless read command: echo "verify-probe"
→ Exercises: PreToolUse (governance)
Read the temp file back → Exercises: PreToolUse (protect-files — should allow, it's not .env)
Delete the temp file: rm .planning/verify-temp.ts or equivalent
→ Cleanup
After all tool calls complete, read telemetry again:
| Check | Expected | Result |
|---|---|---|
| hook-timing.jsonl grew | +2 or more lines (Write + Edit post-hooks) | PASS/FAIL |
| audit.jsonl grew | +3 or more lines (Write + Edit + Bash pre-hooks) | PASS/FAIL |
| hook-errors.log unchanged | same size as baseline | PASS/FAIL |
Output a results block:
=== HOOK HEALTH CHECK ===
hook-timing.jsonl: +N lines [PASS / FAIL]
audit.jsonl: +N lines [PASS / FAIL]
hook-errors.log: no errors [PASS / FAIL — N new errors]
HOOK HEALTH: PASS
Or if any check fails:
HOOK HEALTH: FAIL
Failing checks:
- hook-timing.jsonl did not grow: PostToolUse hooks may not be firing
→ Verify hooks are installed: node scripts/verify-hooks.js
→ Check settings.json: cat .claude/settings.json | grep PostToolUse
- audit.jsonl did not grow: governance hook may not be firing
→ Check: node hooks_src/governance.js <<< '{}'
No .planning/telemetry/ directory: Init-project may not have run. Output: "HOOK HEALTH: FAIL — .planning/telemetry/ not found. Run: node hooks_src/init-project.js"
Hooks installed but telemetry still zero: The project may have a harness.json
that disables telemetry. Check features.telemetry in .claude/harness.json.
First-time run (no baseline): If the files don't exist before the test, they should be created during the test. Treat "file created" as equivalent to "grew".
Disclosure: Creates and deletes .planning/verify-temp.ts during the test. No other files modified.
Reversibility: green — temp file deleted on completion; no persistent changes.
Trust gates: Any — no restrictions.
---HANDOFF---
- Hook pipeline: PASS / FAIL
- hook-timing.jsonl: +N lines
- audit.jsonl: +N lines
- hook-errors.log: N new errors (0 expected)
- Reversibility: green — no persistent changes; verify-temp.ts cleaned up
- Next: if FAIL, run node scripts/verify-hooks.js for deeper diagnostics
---