Examples
Each example is one conversation. Each skill is one message. Complete Setup before the first MCP call.
Each example starts with the call graph for that conversation.
Chaining
Find a field, plan one hook, criticize the plan, write TypeScript, then criticize the hook.
hook-coder is the rule .agents/rules/hook/coder.md. It is not a skill. Critics do not write the next artifact.
/logic-discovery
Thought1s
The user named a field. Start from MCP, not the filesystem.
Map the document, the data type, and the hooks that write it.
Worked for 1m 8s
paymentStatusDataTypeId is a data-type field on finance-invoices/invoice. It is not the invoice lifecycle status.
MCP names the data type. Do not guess the allowed values.
Name type
invoice paymentStatusDataTypeId
Source: MCP `flow_document_schema`, `hook_graph`. Type `question`.
| Claim | Label |
|---|---|
Document finance-invoices/invoice | VERIFIED |
Field paymentStatusDataTypeId | VERIFIED |
Field is a data type, not lifecycle status | VERIFIED |
| Allowed values | UNKNOWN. Ask MCP. Do not invent. |
| Hooks that write this field | UNKNOWN until hook_graph returns them |
This pass stops at facts. It does not write a hook-plan.
/hook-plan — spawn
The first message does not name a job. Empty <ground> is success. Discovery facts stay in this conversation.
Thought1s
The first message named a situation. It did not name a job. Pass 0 is local intake. Do not call MCP.
Fill seen and kind. Then ask which live job this run is.
Worked for 10s
What job is this run?
What job is this run?
Thought4s
spawn is a Pass 2 job. Call MCP. Bind one LogicHookPattern. Map execute() to Pattern grammar.
Do not emit hook source. Do not change invoice lifecycle status.
Worked for 1m 40s
Wrote finance-invoices-record-invoice-payment-hook-plan.md. Job spawn.
Pattern, evidence ledger, decorator fields, execute() phases, result contract, replay, transaction, error policy, downstream calls, open questions.
Run /hook-plan-critic.
finance-invoices-record-invoice-payment-hook-plan.md
Source: MCP after job `spawn`. Grain: one new hook. No `*.hook.ts`.
Add a partial value to paymentStatusDataTypeId when the paid amount is greater than zero and less than the invoice total.
Open: journal posting, sales-order paid flags, and caller blast are not bound.
Do not emit hook source in this pass.
/hook-plan-critic — REVISE
Thought1s
The critic is read-only. Re-query hook_graph. Do not rewrite the plan. Do not implement.
Worked for 1m 12s
Findings with plan section and MCP evidence.
Verdict: REVISE.
Verdict
Source: live MCP `hook_graph`. The hook-plan file is unchanged.
| Check | Result |
|---|---|
| Pattern | Hold. One write path. |
| Blast radius | Understated. Plan names journal and sales order. Graph shows extra 🔴 edges. |
| Overlap | Competing unique keys on payment lines are UNKNOWN. |
| Verdict | REVISE |
If the verdict is not PASS, revise the hook-plan. Do not call hook-coder.
/hook-plan — reduce blast
What job is this run?
Worked for 48s
Patched finance-invoices-record-invoice-payment-hook-plan.md. Job patch.
Grain is the invoice payment data type only. Downstream journal and sales-order writes are out of scope.
Run /hook-plan-critic.
/hook-plan-critic — PASS
Worked for 52s
Verdict: PASS.
No blocker remains. Blast radius is local to finance-invoices/invoice paymentStatusDataTypeId.
PASS
Live MCP `hook_graph`. Hook-plan file unchanged in this pass.
| Check | Result |
|---|---|
| Blast radius | 🟡 shared data type. No journal. No sales-order write. |
| Pattern | Exact. Identity forbiddens hold. |
| Unknowns | Stay questions. Not guessed fields. |
| Verdict | PASS |
After PASS, implement with @.agents/rules/hook/coder.md.
hook-coder
Thought1s
hook-coder is a rule. It is not a skill. Follow the hook-plan. Do not invent identities.
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: `.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.
/hook-critic — ERROR
Thought1s
Default role is read-only. Do not patch.
Validate cited fields with flow_document_schema. Inspect hook_graph.
Worked for 1m 20s
Findings with file, line, violated rule, and smallest correction. BLOCKERs first.
One ERROR: list query is not bounded.
Verdict is not PASS.
hook-critic findings
Source: live MCP `flow_document_schema` and `hook_graph`. Default role: read-only.
| Severity | Finding | Smallest correction |
|---|---|---|
ERROR | Unbounded list read | Bound the query. Do not call .all() without domain proof. |
WARNING | idempotent justification is thin | Name the stable payment key. |
NOTE | Comments match // -->Verb: | Hold. |
Do not skip a gate and then claim PASS.
hook-coder — patch
Worked for 44s
Patched record-invoice-payment.finance-invoices.hook.ts.
Re-run /hook-critic.
/hook-critic — PASS
Worked for 38s
No BLOCKER or ERROR remains. Verdict: PASS.
Run /hook-code-style for a final pass.
/hook-code-style
Thought1s
Style-only work is usually scope=OUT. Still emit the thinking.md audit line.
Pattern grammar owns execute() order. Observed code is evidence, not authority.
Worked for 24s
H1–H12 hold. Soft rules S1–S5 hold.
Version-2 shape is complete.
Final pass
Authority: runtime types, MCP, selected pattern, then `/hook-code-style`.
| Rule | Result |
|---|---|
H1 one class, one execute() | Hold |
H2 version: 2, exact pattern | Hold |
H5 ok and data together | Hold |
| H8 modern FlowQuery and hook APIs | Hold |
| S1 Pattern grammar order | Hold |
Ship
Worked for 1s
🎉 Ship.
Next steps
Open /logic-discovery for the first skill in this chain.