Skip to main content

/hook-critic

Criticize a new or existing version-2 business hook. Default role is read-only.

Outcome

You hold findings ordered by severity, then a verdict. PASS only when no blocker or error remains.

Assumptions

  • A *.hook.ts exists.
  • Skill file: .agents/skills/hook-critic/SKILL.md
  • MCP tools are visible.

Non-goals

  • Do not patch unless the user changes the role from critic to implementer.
  • Do not claim success for a skipped gate.

Contract

The critic reuses style review, /hook-code-style, the selected pattern grammar, and MCP field and graph evidence.

Hook structure and cross-domain contracts are scope=IN.

Run style-reviewer pattern_review, including Pattern grammar operational checks. Treat any order hit as a BLOCKER.

Validate cited fields with flow_document_schema op=validate_fields.

Inspect hook_graph hook / upstream / downstream / references as applicable.

Syntax

/hook-critic
Ground: @apps/api/src/app/hooks/payment-log/process-bank-import/process-bank-import.payment-log.hook.ts

If the slash name does not start the skill, put @.agents/skills/hook-critic/SKILL.md on line 1.

Expected result: Findings with file, line, violated rule, and smallest correction. BLOCKERs first.

Fields

Rules to load

  1. .agents/rules/mcp.md
  2. .agents/rules/logic/thinking.md
  3. .agents/rules/hook-utils-mcp.md
  4. .agents/rules/hook-utils-forbidden-constraints.md
  5. .agents/rules/hook-utils-patterns.md
  6. .agents/rules/hook/style-reviewer.md
  7. .agents/skills/hook-code-style/SKILL.md
  8. Selected authoring specialist from .agents/rules/hook-utils-patterns.md
  9. .agents/rules/query/api.md and/or .agents/rules/query/bulk.md as used
  10. .agents/rules/hook/comment-style.md when comments are in scope

Severity

BLOCKER | ERROR | WARNING | NOTE

Verdict PASS only when no BLOCKER or ERROR remains.

Each finding names:

  • file and line
  • violated rule
  • smallest correction

Constraints

  • Pattern grammar order hits are BLOCKERs.
  • Default role is read-only.
  • Do not skip a gate and then claim PASS.

Errors

ProblemCauseAction
Tools missingMCP not registeredStop. Fix Setup.
BLOCKER on Pattern grammarexecute() order does not match the patternRevise the hook. See /hook-code-style.
Compute hook persistspattern: 'compute' with a writeReport BLOCKER. The write is not allowed.
pattern: 'hook' on calculate-then-persistWrong pattern vs update-documentReport the taxonomy miss.