arazzo-specification
Scannednpx machina-cli add skill msewell/agent-stuff/arazzo-specification --openclawArazzo Specification
Write, review, and modify Arazzo workflow specifications that describe deterministic, multi-step API workflows on top of OpenAPI.
Workflow
Authoring a New Arazzo Document
- Identify the business outcome the workflow achieves.
- Collect the OpenAPI spec(s) involved and note the
operationIds needed. - Read
references/01-overview-and-structure.mdfor document skeleton and naming. - Read
references/02-core-constructs.mdfor source descriptions, steps, parameters, request bodies, and runtime expressions. - Draft the document using the skeleton below.
- Define each step: choose
operationId(preferred),operationPath, orworkflowId. - Thread data between steps using runtime expressions and step outputs.
- Add success criteria to every step — read
references/03-criteria-flow-outputs.md. - Add failure/success actions for known failure modes (rate limits, auth expiry) — same reference.
- Extract repeated elements into
components— readreferences/04-reuse-and-composition.md. - For sub-workflow composition, read
references/04-reuse-and-composition.md. - Validate with the checklist below and recommend linting tools from
references/06-ai-agents-validation-practices.md.
Reviewing an Existing Arazzo Document
- Validate structure against the skeleton below.
- Check every item in the best practices checklist below.
- Read
references/07-pitfalls-tooling-resources.mdand scan for common pitfalls. - Verify all
operationIdreferences exist in the source OpenAPI document(s). - Verify all runtime expressions reference steps that precede them in sequence.
- Suggest linting integration (Spectral, Redocly CLI).
For AI Agent / MCP Integration
- Read
references/06-ai-agents-validation-practices.mdfor patterns on exposing Arazzo workflows as MCP tools and reducing LLM token consumption.
Document Skeleton
arazzo: "1.0.1"
info:
title: Workflow Title
version: "1.0.0"
description: What this workflow achieves.
sourceDescriptions:
- name: myApi # Descriptive name, used as operationId prefix
url: ./openapi.yaml
type: openapi
workflows:
- workflowId: my-workflow
summary: One-line purpose.
inputs:
type: object
properties:
param_name:
type: string
steps:
- stepId: first-step
description: What this step does and why.
operationId: myApi.someOperation
parameters:
- name: paramName
in: query
value: $inputs.param_name
successCriteria:
- condition: $statusCode == 200
outputs:
result_id: $response.body#/id
- stepId: second-step
operationId: myApi.anotherOperation
parameters:
- name: id
in: path
value: $steps.first-step.outputs.result_id
successCriteria:
- condition: $statusCode == 200
outputs:
workflow_result: $steps.first-step.outputs.result_id
components:
parameters: {}
inputs: {}
successActions: {}
failureActions: {}
Runtime Expression Quick Reference
| Expression | Resolves To |
|---|---|
$inputs.fieldName | Workflow input value |
$steps.stepId.outputs.name | Output from a previous step |
$statusCode | HTTP response status code |
$response.body | Full response body |
$response.body#/json/pointer | Specific field via JSON Pointer (RFC 6901) |
$response.header.name | Response header value |
$request.body#/json/pointer | Specific field in request body |
$workflows.workflowId.outputs.name | Output from another workflow |
$components.parameters.name | Reusable parameter from components |
$url / $method | Request URL / HTTP method |
Embedding in strings: Use curly braces — "Bearer {$steps.auth.outputs.token}". When the entire value is an expression, no braces needed: value: $inputs.pet_id.
JSON Pointer: #/0/id = first array element's id. #/data/customer/email = nested field. Escape / as ~1, ~ as ~0.
Operation Reference Rules
Use exactly one per step (mutually exclusive):
| Field | When to Use |
|---|---|
operationId | Preferred. Stable across path changes. Format: sourceName.operationId. |
operationPath | Third-party APIs without operationId. Format: sourceName.{jsonPointer}. |
workflowId | Invoke sub-workflow. Local: workflowId. External: $sourceDescriptions.name.workflowId. |
Key Syntax Rules
$refis for JSON Schema references (ininputsschemas only).referenceis for Arazzo's Reusable Object (in parameter/action arrays). Supportsvalueoverride.- Success criteria in an array are AND-ed. For OR, combine in one expression:
$statusCode == 200 || $statusCode == 201. dependsOndeclares prerequisites but does not invoke them.- Failure action types:
end,goto,retry(withretryAfterandretryLimit). - All field names are case-sensitive (except HTTP header names).
Best Practices Checklist
Structure
- File named
arazzo.yamlorarazzo.json. -
arazzoversion field set to"1.0.1". -
summaryanddescriptionon info, workflows, and steps.
Naming
-
workflowIds reflect business outcomes:apply-coupon, notworkflow1. -
stepIds reflect actions:search-pets, notstep1. -
sourceDescriptionnames are descriptive:payments, notapi2. - All IDs match
[A-Za-z0-9_\-]+.
Operations & Data Flow
-
operationIdpreferred overoperationPath. - Every
operationIdexists in the source OpenAPI document. - Exactly one of
operationId/operationPath/workflowIdper step. - Workflow inputs typed with JSON Schema.
- Outputs are minimal — only values consumed downstream.
- Every runtime expression references a preceding step.
Robustness
-
successCriteriadefined on every step. -
onFailureactions for rate limits (429), auth expiry (401). - Reasonable
retryAfterandretryLimitvalues. - Workflow-level
failureActionsas defaults; step-level overrides where needed.
Reusability
- Repeated parameters (auth, pagination) in
components/parameters. - Shared input schemas in
components/inputs. - Common actions in
components/successActionsandcomponents/failureActions. - Multi-step reusable sequences as sub-workflows.
Maintenance
- Arazzo versioned alongside OpenAPI specs — single documentation unit.
- Linting in CI (Spectral or Redocly CLI).
References
references/01-overview-and-structure.md— What Arazzo is, ecosystem context, document structure, first document walkthrough.references/02-core-constructs.md— Source descriptions, workflows, steps, parameters, request bodies, runtime expressions.references/03-criteria-flow-outputs.md— Success criteria, control flow (success/failure actions), outputs and data threading.references/04-reuse-and-composition.md— Reusable components and workflow composition (local and cross-document).references/05-complete-example.md— End-to-end e-commerce checkout example demonstrating all features together.references/06-ai-agents-validation-practices.md— AI agent and MCP integration patterns, validation/linting tools, best practices checklist.references/07-pitfalls-tooling-resources.md— Common pitfalls, tooling ecosystem, and learning resources.
Source
git clone https://github.com/msewell/agent-stuff/blob/main/skills/arazzo-specification/SKILL.mdView on GitHub Overview
Guides writing, reviewing, and modifying Arazzo workflow specifications built on OpenAPI for deterministic, multi-step API workflows. It covers document skeletons, runtime expressions, success criteria, data threading, reusable components, workflow composition, AI agent integration, and validation to ensure correct, scalable workflows.
How This Skill Works
Start from the YAML skeleton, identify the business outcome, collect involved OpenAPI specs, and draft steps using operationId (or operationPath/workflowId). Thread data across steps with runtime expressions, define per-step success criteria, and extract reusable components into a central components block. Validate against a provided checklist and consider linting with recommended tools.
When to Use It
- Creating a brand-new Arazzo document from scratch with a clear business outcome
- Adding new steps or sub-workflows to an existing Arazzo spec
- Reviewing an Arazzo file for structural correctness and reference integrity
- Generating API workflow definitions from OpenAPI specs
- Integrating AI agents and MCP patterns while validating with recommended practices
Quick Start
- Step 1: Identify the business outcome and collect involved OpenAPI specs
- Step 2: Draft the skeleton, define steps with operationId, and wire inputs/outputs
- Step 3: Add runtime expressions, define per-step success criteria, and run the validation checklist
Best Practices
- Start from the documented skeleton and fill in information using the provided references
- Always specify operationId (or operationPath/workflowId) for each step
- Thread data with runtime expressions and connect outputs between steps
- Attach explicit success criteria to every step and handle common failure modes
- Centralize repeated logic into components and validate all references
Example Use Cases
- Onboarding flow: authenticate, create profile, and send welcome email across services
- Order processing workflow spanning inventory check, checkout, and payment
- Refund workflow with retry, backoff, and rate-limit handling
- AI-assisted routing where an agent suggests next steps via MCP integration
- Sub-workflow composition reusing shared components for metrics collection
Frequently Asked Questions
Related Skills
creating-c4-diagrams
msewell/agent-stuff
Creates, reviews, and interprets C4 software architecture diagrams (System Context, Container, Component, Dynamic, Deployment). Produces Structurizr DSL or Mermaid diagram code following C4 model best practices. Use when creating architecture diagrams for a system, reviewing existing C4 diagrams for correctness and anti-patterns, generating Structurizr DSL workspaces, producing Mermaid C4 diagrams for READMEs, or using C4 diagrams as context for design decisions, code generation, risk analysis, or onboarding.
kotlin-functional-programming
msewell/agent-stuff
Guides writing idiomatic, functional-style Kotlin code using built-in language features. Use when asked to write, review, or refactor Kotlin code for immutability, pure functions, sealed types, error handling, collections, coroutines, or functional architecture patterns.
property-based-testing-with-kotest
msewell/agent-stuff
Writes property-based tests using Kotest's kotest-property module. Identifies testable properties, designs generators, and configures PBT for Kotlin/JVM projects. Use when writing property-based tests, creating custom Arb generators, choosing property patterns (roundtrip, invariant, idempotence, oracle), debugging shrunk counterexamples, or integrating PBT into a Kotlin test suite alongside example-based tests.
reducing-coupling
msewell/agent-stuff
Analyzes a codebase scope for coupling issues, diagnoses coupling types using the Connascence framework, and proposes a comprehensive refactoring plan with concrete code changes. Use when asked to find coupling, reduce dependencies, decouple modules, or improve modularity in a codebase.
mermaid-sequence-diagrams
msewell/agent-stuff
Generates, reviews, and fixes Mermaid sequence diagrams following syntax rules and best practices. Use when creating sequence diagrams from system descriptions, reviewing existing Mermaid sequence diagrams for correctness, fixing parse errors, or refactoring large diagrams into focused sub-diagrams. Covers participants, arrows, activations, control flow, notes, styling, and common anti-patterns.
making-invalid-states-unrepresentable
msewell/agent-stuff
Analyzes existing code and guides new type design to make invalid states unrepresentable using type system techniques such as sum types, newtypes, typestate, branded types, and parse-don't-validate. Use when reviewing code for invalid-state bugs, refactoring types to eliminate impossible states, designing domain models, or applying compile-time correctness patterns. Language-agnostic.