Use actions as the smallest validated unit of behavior, then compose execution policy with Jido.Exec and workflow tools.
- Define actions with
use Jido.Actionand clear metadata (name,description, schema). - Use Zoi-first schemas for new work; keep NimbleOptions for compatibility paths.
- Keep
run/2contracts strict:{:ok, result}or{:error, reason}. - Use
Jido.Execfor retries, timeouts, async control, and telemetry in production paths. - Keep action results deterministic where possible; isolate external IO.
- Keep
jido_actionfocused on core and generic tools; usejido_libfor vendor/API-specific packs.
- Build thin domain actions: validate input -> call domain service -> normalize output.
- Wrap external APIs/filesystem/DB calls in dedicated actions instead of inline process logic.
- Compose multi-step workflows with
Jido.InstructionandJido.Planrather than custom pipelines. - Expose tool-facing actions with stable names and schemas via
Jido.Action.Tool.
- Test validation failures, success path, and error path separately.
- For async execution, assert cleanup/timeout behavior via
Jido.ExecAPIs. - Run
mix q(mix quality) before release and keep docs/changelog in sync.
- Calling
run/2directly in production orchestration when execution policy matters. - New schema contracts without validation metadata.
- Hidden side effects that are not visible in params/context/result.
README.mdguides/AGENTS.md- https://hexdocs.pm/jido_action
- https://hexdocs.pm/usage_rules/readme.html#usage-rules