Build · AI-assisted

Hand your domain to your AI coding agent.

KIFF derived a starting point from what your agent already does. Copy one instruction into your AI coding agent, it authors the contract in your codebase using the kiff-domains skill, verifies it, and hands it back to activate in shadow. Your codebase stays the record.

Finish with your AI coding agent

Give one instruction to your agent.

Copy the instruction below and paste it into your AI coding agent (Claude Code, Cursor, Codex, …). It installs the guard, follows the kiff-domains skill to author kiff.yaml and the executor bodies, runs kiff verify, and hands you the finished contract to activate here, as one task. Your codebase stays the record.

  1. 1 Pick the action from what your agent does
  2. 2 Hand it to your agent one instruction, below
  3. 3 Activate the verified contract, in shadow
One instruction · paste into your AI coding agent
Evolve my KIFF domain "accounts-payable" in this codebase.

Do the whole thing as one task:
1. Install the kiff-domains skill if you don't already have it, then follow it, it's the authority on modelling a KIFF domain. Skill: https://kiff.dev/skills/kiff-domains.md
2. Install the CLI: go install github.com/kiff/kiff/cmd/kiff@v0.7.0
3. Scaffold (or locate) the domain package in this repo, then complete kiff.yaml and the executor bodies:
   - govern these observed actions:
     · PAY_INVOICE (params: amount, currency), risk guess: high
     · REQUEST_APPROVAL, risk guess: medium
     · REJECT_INVOICE, risk guess: medium
   - model the states and transitions, set the allowed states per action, and mark which actions need approval.
4. Ask me only for the business decisions you can't infer from the code, thresholds, risk bands, and who approves. Don't invent them.
5. Confirm it's sound: kiff verify
6. When it passes, print the finished kiff.yaml so I can paste it at https://app.kiff.dev/dashboard/build to validate and activate in shadow.

Keep the codebase the source of truth, KIFF governs the contract, it doesn't replace your code.
Prefer to run the steps yourself?
  1. give your agent the skill: mkdir -p ~/.claude/skills/kiff-domains && curl -fsSL https://kiff.dev/skills/kiff-domains.md -o ~/.claude/skills/kiff-domains/SKILL.md - or read the skill (Cursor / Codex / Gemini install in the docs)
  2. install the CLI: go install github.com/kiff/kiff/cmd/kiff@v0.7.0
  3. ↓ descriptor.json, your derived starting point
  4. kiff scaffold -descriptor descriptor.json github.com/you/yourmodule
  5. author / refine kiff.yaml and the executor bodies with your agent (it uses the skill)
  6. confirm it's complete: kiff verify
KIFF Studio accounts-payable

This is the running version of your domain, rendered read-only. The source of truth is kiff.yaml in your repo, versioned like a docker-compose.yml. Author and evolve it with your AI agent using the kiff-domains skill, then bring it here to validate and activate.

entity + states

Invoice entity
name Invoice
workflow accounts-payable
State machine 4 states · 3 events
∅ initial receivedapprovedpaidrejected
approval_granted received → approved
payment_completed approved → paid

actions

PAY_INVOICE high
allowed in approved
parameters amount, currency
REQUEST_APPROVAL medium
allowed in received
parameters not set
REJECT_INVOICE medium
allowed in received, approved
parameters not set
kiff.yaml the versioned artifact, this lives in your repo
primitive state machine

the entity's life on rails

States are the only positions the entity can be in. Transitions move it. Actions guard on AllowedStates so a refund can't issue twice.

primitive event

what moves the entity forward

Events drive transitions. ORDER_PAID lands; the entity advances; the next action becomes reachable. Events come from your apps, never from the agent.

mechanic replay

every state change is a row

The runtime stores every event and every action. Replay the rows in order, you get the current state. No hidden variables, no caches.