Skip to main content

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

/logic-discovery
How does the status invoice paymentStatusDataTypeId work?
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.

Question

Name type

  1. Abug
  2. Bfeature
  3. Cidea
  4. Drequirement
  5. Equestion
type: question

invoice paymentStatusDataTypeId

Source: MCP `flow_document_schema`, `hook_graph`. Type `question`.

ClaimLabel
Document finance-invoices/invoiceVERIFIED
Field paymentStatusDataTypeIdVERIFIED
Field is a data type, not lifecycle statusVERIFIED
Allowed valuesUNKNOWN. Ask MCP. Do not invent.
Hooks that write this fieldUNKNOWN until hook_graph returns them

This pass stops at facts. It does not write a hook-plan.

/hook-planspawn

/hook-plan
add a 'partial payment' option to invoice paymentStatusDataTypeId

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?

Question

What job is this run?

  1. Aimpacta user story that may have upstream/downstream blast
  2. Bpatcha change to the seen hook
  3. Cspawna new hook
  4. Dretireunwiring or deleting the seen hook
  5. Eexplainreading the seen stream with no change planned
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-criticREVISE

/hook-plan-critic
<ground> @finance-invoices-record-invoice-payment-hook-plan.md </ground>
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.

CheckResult
PatternHold. One write path.
Blast radiusUnderstated. Plan names journal and sales order. Graph shows extra 🔴 edges.
OverlapCompeting unique keys on payment lines are UNKNOWN.
VerdictREVISE

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

/hook-plan — reduce blast

/hook-plan
<ground> @finance-invoices-record-invoice-payment-hook-plan.md </ground>
patch. Reduce blast radius. Write paymentStatusDataTypeId only. Do not post journals. Do not update the sales order.
Question

What job is this run?

  1. Apatcha change to the seen hook
  2. Bspawna new hook
  3. Chandoff-criticaudit the hook-plan that exists

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-criticPASS

/hook-plan-critic
<ground> @finance-invoices-record-invoice-payment-hook-plan.md </ground>

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.

CheckResult
Blast radius🟡 shared data type. No journal. No sales-order write.
PatternExact. Identity forbiddens hold.
UnknownsStay questions. Not guessed fields.
VerdictPASS

After PASS, implement with @.agents/rules/hook/coder.md.

hook-coder

@.agents/rules/hook/coder.md
<ground> @finance-invoices-record-invoice-payment-hook-plan.md </ground>
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-criticERROR

/hook-critic
<ground> @record-invoice-payment.finance-invoices.hook.ts </ground>
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.

SeverityFindingSmallest correction
ERRORUnbounded list readBound the query. Do not call .all() without domain proof.
WARNINGidempotent justification is thinName the stable payment key.
NOTEComments match // -->Verb:Hold.

Do not skip a gate and then claim PASS.

hook-coder — patch

@.agents/rules/hook/coder.md
<ground> @record-invoice-payment.finance-invoices.hook.ts </ground>
Bound the list query. Name the stable payment key for idempotent: true.

Worked for 44s

Patched record-invoice-payment.finance-invoices.hook.ts.

Re-run /hook-critic.

/hook-criticPASS

/hook-critic
<ground> @record-invoice-payment.finance-invoices.hook.ts </ground>

Worked for 38s

No BLOCKER or ERROR remains. Verdict: PASS.

Run /hook-code-style for a final pass.

/hook-code-style

/hook-code-style
<ground> @record-invoice-payment.finance-invoices.hook.ts </ground>
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`.

RuleResult
H1 one class, one execute()Hold
H2 version: 2, exact patternHold
H5 ok and data togetherHold
H8 modern FlowQuery and hook APIsHold
S1 Pattern grammar orderHold

Ship

Worked for 1s

🎉 Ship.

Next steps

Open /logic-discovery for the first skill in this chain.