Get the FREE Ultimate OpenClaw Setup Guide →

arazzo-specification

Scanned
npx machina-cli add skill msewell/agent-stuff/arazzo-specification --openclaw
Files (1)
SKILL.md
7.9 KB

Arazzo 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

  1. Identify the business outcome the workflow achieves.
  2. Collect the OpenAPI spec(s) involved and note the operationIds needed.
  3. Read references/01-overview-and-structure.md for document skeleton and naming.
  4. Read references/02-core-constructs.md for source descriptions, steps, parameters, request bodies, and runtime expressions.
  5. Draft the document using the skeleton below.
  6. Define each step: choose operationId (preferred), operationPath, or workflowId.
  7. Thread data between steps using runtime expressions and step outputs.
  8. Add success criteria to every step — read references/03-criteria-flow-outputs.md.
  9. Add failure/success actions for known failure modes (rate limits, auth expiry) — same reference.
  10. Extract repeated elements into components — read references/04-reuse-and-composition.md.
  11. For sub-workflow composition, read references/04-reuse-and-composition.md.
  12. Validate with the checklist below and recommend linting tools from references/06-ai-agents-validation-practices.md.

Reviewing an Existing Arazzo Document

  1. Validate structure against the skeleton below.
  2. Check every item in the best practices checklist below.
  3. Read references/07-pitfalls-tooling-resources.md and scan for common pitfalls.
  4. Verify all operationId references exist in the source OpenAPI document(s).
  5. Verify all runtime expressions reference steps that precede them in sequence.
  6. Suggest linting integration (Spectral, Redocly CLI).

For AI Agent / MCP Integration

  • Read references/06-ai-agents-validation-practices.md for 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

ExpressionResolves To
$inputs.fieldNameWorkflow input value
$steps.stepId.outputs.nameOutput from a previous step
$statusCodeHTTP response status code
$response.bodyFull response body
$response.body#/json/pointerSpecific field via JSON Pointer (RFC 6901)
$response.header.nameResponse header value
$request.body#/json/pointerSpecific field in request body
$workflows.workflowId.outputs.nameOutput from another workflow
$components.parameters.nameReusable parameter from components
$url / $methodRequest 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):

FieldWhen to Use
operationIdPreferred. Stable across path changes. Format: sourceName.operationId.
operationPathThird-party APIs without operationId. Format: sourceName.{jsonPointer}.
workflowIdInvoke sub-workflow. Local: workflowId. External: $sourceDescriptions.name.workflowId.

Key Syntax Rules

  • $ref is for JSON Schema references (in inputs schemas only).
  • reference is for Arazzo's Reusable Object (in parameter/action arrays). Supports value override.
  • Success criteria in an array are AND-ed. For OR, combine in one expression: $statusCode == 200 || $statusCode == 201.
  • dependsOn declares prerequisites but does not invoke them.
  • Failure action types: end, goto, retry (with retryAfter and retryLimit).
  • All field names are case-sensitive (except HTTP header names).

Best Practices Checklist

Structure

  • File named arazzo.yaml or arazzo.json.
  • arazzo version field set to "1.0.1".
  • summary and description on info, workflows, and steps.

Naming

  • workflowIds reflect business outcomes: apply-coupon, not workflow1.
  • stepIds reflect actions: search-pets, not step1.
  • sourceDescription names are descriptive: payments, not api2.
  • All IDs match [A-Za-z0-9_\-]+.

Operations & Data Flow

  • operationId preferred over operationPath.
  • Every operationId exists in the source OpenAPI document.
  • Exactly one of operationId / operationPath / workflowId per step.
  • Workflow inputs typed with JSON Schema.
  • Outputs are minimal — only values consumed downstream.
  • Every runtime expression references a preceding step.

Robustness

  • successCriteria defined on every step.
  • onFailure actions for rate limits (429), auth expiry (401).
  • Reasonable retryAfter and retryLimit values.
  • Workflow-level failureActions as defaults; step-level overrides where needed.

Reusability

  • Repeated parameters (auth, pagination) in components/parameters.
  • Shared input schemas in components/inputs.
  • Common actions in components/successActions and components/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

  1. Step 1: Identify the business outcome and collect involved OpenAPI specs
  2. Step 2: Draft the skeleton, define steps with operationId, and wire inputs/outputs
  3. 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

Add this skill to your agents

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.

Sponsor this space

Reach thousands of developers