Skip to main content

Implement and review

Write the hook after hook-plan critic PASS. Then review the .ts.

Outcome

The hook file matches the approved hook-plan. A critic lists BLOCKERs first.

Sequence

hook-plan --plan.md--> hook-plan-critic --PASS--> hook-coder --*.ts--> hook-critic

Do not mix two skills in one message.

Criticize the hook-plan

/hook-plan-critic

Ground:
@payment-log-process-bank-import-hook-plan.md

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

Verdict PASS, REVISE, or REJECT. The critic does not write the next artifact.

If the verdict is not PASS, revise the hook-plan. Do not implement.

Implement

Call the rule path. hook-coder is not a skill.

@.agents/rules/hook/coder.md

Ground:
@payment-log-process-bank-import-hook-plan.md
warning

hook-coder warns if a *-hook-plan.md exists without critic PASS. That warning is not a BLOCKER yet.

The implementer rule does not load .agents/rules/logic/thinking.md.

Expected result: One *.hook.ts. No extra files.

New create-document

The new hook is a neighbor of procurement/create-purchase-order. After hook-plan critic PASS:

@.agents/rules/hook/coder.md

Ground:
@procurement-create-drop-ship-purchase-order-hook-plan.md

Scaffold with create_hook. No extra files.

Review the hook

/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.

Guards-before-mutation, callee contract, Pattern grammar. BLOCKERs first.

Taxonomy

finance-journal-templates/update-journal-template is pattern: 'hook' but calculate-then-persist (update-document shape).

/hook-critic

Ground:
@apps/api/src/app/hooks/finance-journal-templates/update-journal-template/update-journal-template.finance-journal-templates.hook.ts

Is `pattern: 'hook'` correct vs `update-document`?

Purity

finance-fiscal-periods/compute-fiscal-period-metrics is pattern: 'compute' / patternScore: 80 but it patches fiscalPeriod.

/hook-critic

Ground:
@apps/api/src/app/hooks/finance-fiscal-periods/compute-fiscal-period-metrics/compute-fiscal-period-metrics.finance-fiscal-periods.hook.ts

Compute forbids persist. Report BLOCKERs.

Import / replay

data-import-ai/import-routings (pattern: 'import', idempotent: false, skipSession + skipEvent).

/hook-critic

Ground:
@apps/api/src/app/hooks/data-import-ai/import-routings/import-routings.data-import-ai.hook.ts

Review replay, skipSession justification, and silent row skips.

Style

The style skill is not a planner. Use it with hook-coder or hook-critic. Pattern grammar owns execute() order.

@.agents/skills/hook-code-style/SKILL.md

Pattern grammar owns execute() order, not the generic 7-step pipeline.
Confirm `procurement/delete-purchase-order` stays identity → state → delete.

If a problem occurs

ProblemCauseAction
Extra filesPrompt asked for more than the hookCall hook-coder again with no extra files
Implement with no PASSCritic not run or not PASSRun /hook-plan-critic. Treat the warn as a signal.
BLOCKER on Pattern grammarexecute() order does not match the patternCall the style skill. Then revise the hook.
Compute hook persistspattern: 'compute' with a patchReport BLOCKER. Do not treat the write as allowed.

Next