Use these rules when generating code that depends on Jidoka.
Agent Authoring
- Prefer
use Jidoka.Agentwith the Spark DSL for application-authored agents. - Keep
agent,tools, andcontrolsas the only author-facing DSL sections. - Use plain instruction strings; do not introduce dynamic system prompt DSL.
- Use
Jidoka.agent!/1orJidoka.Agent.Spec.new!/1only when constructing specs directly in tests or tooling.
Runtime
- Use
Jidoka.chat/3for a simple one-turn text result. - Use
Jidoka.turn/3when callers need the fullJidoka.Turn.Result, journal, state, events, or hibernation snapshot. - Use
Jidoka.session/2orJidoka.Sessionfor durable, multi-turn flows. - Use injected runtime capabilities in tests instead of live provider calls.
Tools And Operations
- Use Jido actions for local tools.
- Use
ash_resource,browser,mcp_tools,subagent,handoff, andworkflowonly when those operation sources are needed. - Mark unsafe, non-idempotent operations with
idempotency: :unsafe_once. - Attach operation controls to unsafe operations before release code reaches production.
Data Contracts
- Model persistent structures with Zoi-backed structs.
- Preserve version fields for imports, snapshots, and sessions.
- Avoid
String.to_atom/1on imported or runtime data. - Keep provider clients, stores, process ids, and credentials out of
Jidoka.Agent.Spec.
Jido Relationship
- Do not delegate the core agent loop to
Jido.AI.ReAct. - Keep Jidoka's Runic workflow spine as the owner of model/operation turns.
- Use Jido for process hosting, actions, signals, and ecosystem integrations.