SKILL.md
agent-contracts Interactive Flow
Use this skill when your agent needs multi-turn interaction (ask a question, receive an answer, continue).
Recommended Building Blocks
InteractiveNodefor standard ask/process/check lifecycle- A domain slice (e.g.,
workfloworinterview) to store progress - Optional
explicitroutinghandlerwhen answers must return to the node that asked
Workflow
- Pick a domain slice (
workflow/interview) and define the minimal fields you need. - Implement an
InteractiveNode:
- preparecontext() reads domain slice - processanswer() updates domain slice from request - checkcompletion() decides when to stop - generatequestion() writes response (e.g., response_type="question")
- Add routing:
- Use rule triggers (priority 50-100) for “continue the flow” - Use terminal response types for “done”
- Debug with
decidewithtrace()when the flow loops or stalls.
Guardrails
- Keep conversation history out of state unless it is needed for routing; prefer
context_buildersummary when necessary. - Don’t store large payloads in domain slices (token/cost risk).
References (load only when needed)
docs/core_concepts.md(InteractiveNode / Explicit routing)docs/skills/official/agent-contracts-interactive-flow/references/patterns.md