/hook-code
writes a version-2 business hook
It does not load thinking.md. It does not become /hook-plan, /logic-plan, or /hook-critic.
Ground a hook-plan
<ground> holds {collection}-{slug}-hook-plan.md. Critic PASS is the usual gate. A missing PASS is a WARNING, not a BLOCKER.
Ground a hook file
<ground> holds a *.hook.ts path. A seen hook file is the write target.
Skill path
If the slash name does not start the skill, put the skill file on line 1.
Examples
Thought1s
Follow coder.md. Do not load thinking.md. Do not recopy coder.md.
The hook-plan is the contract. Do not invent identities. New scaffolds go through MCP create_hook.
Path-load /hook-code-style before write. Then tell the user to run /hook-critic.
Worked for 2m 6s
Wrote record-invoice-payment.finance-invoices.hook.ts.
One class. One execute(). ok + data. Pattern grammar order.
Run /hook-critic.
record-invoice-payment.finance-invoices.hook.ts
Implementer: `/hook-code` path-loads `.agents/rules/hook/coder.md`. Code is written.
Path: apps/api/src/app/hooks/finance-invoices/record-invoice-payment/record-invoice-payment.finance-invoices.hook.ts
The hook-plan file is the contract. The .ts file is the artifact. context.md is written with the hook.
Patch a seen hook
Worked for 44s
Patched record-invoice-payment.finance-invoices.hook.ts.
Re-run /hook-critic.
Hold the hook file
The skill path-loads .agents/rules/hook/coder.md. It does not recopy that file.
Done is all of:
- one version-2
*.hook.ts context.md- a report (pattern, files, MCP evidence, replay and transaction, verification, residual risks)
New hooks use MCP create_hook. Do not scaffold by hand. Do not edit generated barrels or interface registries.
Do not edit framework-hooks/ or system-hooks/ without administrator approval.
UNKNOWN on a required identity, field, status, key, or relationship blocks the write.
If a *-hook-plan.md exists and /hook-plan-critic has not returned PASS, the skill warns and asks whether to proceed.
If MCP tools are missing, stop. Fix Setup.
| Problem | Cause | Action |
|---|---|---|
| Tools missing | MCP not registered | Stop. Fix Setup. |
UNKNOWN identity | A name was guessed | Ask. Do not write .ts. |
Plan with no PASS | Critic skipped | WARNING. Confirm before you proceed. |
| Pattern grammar reorder | execute() order does not match the pattern | BLOCKER. Bind the selected pattern order. |
| Manual scaffold | create_hook skipped | Call MCP create_hook. Then edit the scaffold. |
Next steps
When the hook file exists, run /hook-critic.