Run the pipeline
Walk one defect from discovery to hook review.
The hooks in this walk are real version: 2 paths. Copy each block. Paste the block as the user message for that stage.
Outcome
You hold an approved hook-plan, then a changed *.hook.ts, then a hook-critic review.
Starting state
- A posted invoice was voided.
- The sales order still shows the old
orderLines[].quantityInvoiced. - Start from
finance-invoices/void-invoice(pattern: 'hook'). - That hook runs guards.
- It detaches the bill of lading.
- It sets status
void. - It reverses the journal.
- It calls
inventory-management/update-shipping-and-invoicing-statuses.
discovery(bug) → plan(bug) → plan-critic → hook-plan → hook-plan-critic → coder → hook-critic
Do not paste this whole walk into one message. Do not mix two skills in one message.
Procedure
1. Discover the defect
/logic-discovery
type: bug
After voiding a posted invoice, the sales order still shows the old
`orderLines[].quantityInvoiced`. Trace expected vs actual from
`finance-invoices/void-invoice`. Stop at the divergence. No cause, no fix.
If /logic-discovery does not start the skill, put @.agents/skills/logic-discovery/SKILL.md on line 1.
Checkpoint: The answer names expected vs actual. It does not name a cause. It does not name a fix.
2. Plan the workspace
Do not name a job. Do not name a plan type. Do not put blast words in this message.
/logic-plan
Problem:
want: void of a posted invoice reduces orderLines[].quantityInvoiced on the sales order
got: the sales order still shows the old quantityInvoiced
void updates the invoice but sales-order reconciliation is skipped when bill-of-lading detach throws.
Ground:
finance-invoices/void-invoice
inventory-management/update-shipping-and-invoicing-statuses
Checkpoint: The skill asks what job this run is. You see only the live jobs for this intake.
3. Select the job and the plan type
- Select the live job in the question box. For a smallest fix to the current system, select
patch. - If the skill asks for plan type, select
bug.
Technical blast radius comes from hook_graph after the job is bound. Confirm business impact yourself.
Checkpoint: The skill writes {slug}-plan.md. This walk uses tasks/void-invoice-so-qty-plan.md.
4. Criticize the workspace plan
/logic-plan-critic
Plan:
@tasks/void-invoice-so-qty-plan.md
Checkpoint: The verdict is PASS, REVISE, or REJECT. If the verdict is not PASS, revise the plan. Do not start hook-plan.
5. Plan the one hook
The first message holds paths only.
/hook-plan
Ground:
finance-invoices/void-invoice
- Select
patchin the question box. - Send the change in the next message.
Plan the change to finance-invoices/void-invoice from the approved
logic-plan. Pattern stays hook unless classification proves otherwise.
Grammar order. Unknowns as questions. Do not edit the hook.
Checkpoint: The skill writes finance-invoices-void-invoice-hook-plan.md. It does not edit the hook.
6. Criticize the hook-plan
/hook-plan-critic
Ground:
@finance-invoices-void-invoice-hook-plan.md
Checkpoint: Verdict PASS. If the verdict is not PASS, revise the hook-plan. Do not implement.
7. Implement the hook
@.agents/rules/hook/coder.md
Ground:
@finance-invoices-void-invoice-hook-plan.md
hook-coder warns if a *-hook-plan.md exists without critic PASS. That warning is not a BLOCKER yet.
Checkpoint: The skill writes void-invoice.finance-invoices.hook.ts. It does not write extra files.
8. Review the hook
/hook-critic
Ground:
@apps/api/src/app/hooks/finance-invoices/void-invoice/void-invoice.finance-invoices.hook.ts
Checkpoint: BLOCKERs are listed first: guards before mutation, callee contract, Pattern grammar.
Next
- Other discovery types: Discover facts
- First-message slots: Plan the workspace
- One-hook slots: Plan one hook
- More implement and review prompts: Implement and review