← Back to research
·6 min read·company

Shopify Roast

Shopify's open-source Ruby DSL for structured AI workflows — orchestrate LLMs, coding agents, and shell commands with declarative syntax.

Key takeaways

  • Open-source Ruby gem for structured AI workflows — chain LLMs, agents, and commands
  • Philosophy: non-determinism is the enemy of reliability for AI agents
  • Built-in Claude Code integration for local coding agent with filesystem access

FAQ

What is Shopify Roast?

A Ruby-based DSL (domain-specific language) for creating structured AI workflows. It chains 'cogs' — building blocks for LLMs, shell commands, and coding agents — into reliable automation.

How is Roast different from other agent frameworks?

Roast mixes deterministic steps (shell commands, linters) with non-deterministic AI steps, keeping agents on track through structure rather than letting them run unconstrained.

Does Roast work with Claude Code?

Yes. The 'agent' cog runs Claude Code CLI with full filesystem access, enabling local coding agents within structured workflows.

Executive Summary

Shopify Roast is an open-source Ruby gem for creating structured AI workflows. Rather than building a full coding agent, Roast provides orchestration primitives ("cogs") that chain LLM calls, shell commands, coding agents, and custom Ruby together. The philosophy: non-determinism is the enemy of reliability — structure keeps agents on track. Now at v1.0 preview with an active community.

AttributeValue
CompanyShopify
TypeOpen-source Ruby gem
LicenseMIT
Version1.0 preview
Installgem install roast-ai

Product Overview

Roast lets developers orchestrate AI workflows by combining "cogs" — building blocks that interact with LLMs, run code, execute commands, and process data. The key insight is that AI should only be invoked for parts of problems it's best suited for, within a deterministic structure.

Core Cogs

CogDescriptionExample
chatCloud LLM calls (OpenAI, Anthropic, Gemini)Summarization, analysis
agentLocal coding agents with filesystem accessClaude Code CLI integration
rubyCustom Ruby code executionBusiness logic, transformations
cmdShell commands with output captureGit operations, linting
mapCollection processing (serial/parallel)Batch operations
repeatIteration until conditions metConvergence loops
callReusable workflow invocationModular composition

Quick Example

# analyze_codebase.rb
execute do
  # Get recent changes
  cmd(:recent_changes) { "git diff --name-only HEAD~5..HEAD" }

  # AI agent analyzes the code
  agent(:review) do
    files = cmd!(:recent_changes).lines
    <<~PROMPT
      Review these recently changed files for potential issues:
      #{files.join("\n")}
      
      Focus on security, performance, and maintainability.
    PROMPT
  end

  # Summarize for stakeholders
  chat(:summary) do
    "Summarize this for non-technical stakeholders:\n\n#{agent!(:review).response}"
  end
end

Run with: bin/roast execute analyze_codebase.rb


Technical Architecture

Roast builds on Raix, Shopify's Ruby library for AI components (similar to AI SDK for JavaScript).

Workflow Structure

execute do
  ├── Deterministic cogs (cmd, ruby)
  ├── AI cogs (chat, agent)
  ├── Control flow (map, repeat)
  └── Composition (call)
end
    ↓
Outputs flow between cogs
    ↓
Structured, predictable result

Configuration

AspectOptions
Chat providersOpenAI, Anthropic, Gemini
Agent backendClaude Code CLI
ExecutionSerial or parallel (map cog)
Output formatsPer-cog configuration

Key Technical Details

AspectDetail
LanguageRuby 3.0+
DependenciesRaix (AI components), Claude Code CLI (for agent cog)
Workflow syntaxRuby DSL (v1.0); YAML deprecated (v0.x)
ParallelismConfigurable via map cog
StateOutput from one cog flows to next

Strengths

  • Open source — MIT-licensed Ruby gem freely available; full source code on GitHub
  • Multi-agent orchestration — Chain LLM calls, coding agents, shell commands, custom Ruby in single workflow
  • Serial and parallel execution — Map operations with configurable parallelism
  • Composable — Modular scopes with parameters enable workflow reuse
  • Claude Code integrationagent cog runs Claude Code CLI with full filesystem access
  • Deterministic structure — AI invoked only where needed, within predictable framework

Cautions

  • Ruby-specific — Ecosystem limited to Ruby shops; no Python/JavaScript equivalents
  • Requires Claude Codeagent cog depends on external CLI installation
  • Workflow complexity — DSL learning curve for non-trivial pipelines
  • v1.0 transition — Breaking changes from v0.x YAML syntax; migration required
  • Not a full agent — Orchestration primitives, not autonomous agent with reasoning

Competitive Positioning

vs. Other Approaches

SystemDifferentiation
Stripe MinionsMinions are autonomous agents; Roast is workflow orchestration
LangChainRoast is Ruby-native; LangChain is Python/JS
TemporalRoast is AI-focused; Temporal is general workflow
Agent frameworksRoast structures agents; doesn't replace them

When to Use Roast

  • Use Roast when: You need structured AI workflows mixing deterministic and LLM steps
  • Use full agents when: You need autonomous reasoning over complex problems
  • Use LangChain when: Your team is Python/JavaScript, not Ruby

Ideal Customer Profile

Good fit:

  • Ruby-on-Rails shops (Shopify, Basecamp ecosystem)
  • Teams wanting structured AI workflows, not autonomous agents
  • Workflows mixing shell commands, APIs, and LLM calls
  • Need for reproducible, testable AI pipelines

Poor fit:

  • Python/JavaScript teams (no direct equivalent)
  • Need for fully autonomous agent reasoning
  • Simple single-LLM-call use cases (overkill)
  • No existing Claude Code setup

Installation & Usage

gem install roast-ai

Or in Gemfile:

gem 'roast-ai'

Requirements:

  • Ruby 3.0+
  • API keys for AI provider (OpenAI/Anthropic)
  • Claude Code CLI installed (for agent cog)

Viability Assessment

FactorAssessment
Open Source HealthStrong (Shopify backing, active development)
DocumentationGood (tutorial, examples, API docs)
CommunityGrowing (GitHub activity)
Production UseYes (Shopify internal + external adopters)
Long-term OutlookPositive (v1.0 shows commitment)

Roast represents Shopify's investment in AI workflow tooling. The progression from v0.x YAML to v1.0 Ruby DSL shows active development and response to user feedback.


Bottom Line

Shopify Roast is the reference implementation for structured AI workflows in Ruby. The key philosophy — non-determinism is the enemy of reliability — positions Roast as orchestration layer, not replacement for agents.

Key insight: AI should be invoked only for parts of problems it's best suited for, within deterministic structure.

Use for: Multi-step AI workflows mixing LLM calls, shell commands, and coding agents.

Don't use for: Autonomous agent reasoning, non-Ruby stacks, simple single-call use cases.

Recommended for: Ruby teams building AI automation, Shopify ecosystem developers, engineers wanting structured approach to AI workflows.

Not recommended for: Python/JS teams, organizations needing fully autonomous agents.

Outlook: Roast fills a gap in the Ruby AI ecosystem. Expect growing adoption among Rails shops as AI workflow automation becomes standard practice.


Research by Ry Walker Research • methodology

Disclosure: Author is CEO of Tembo, which offers agent orchestration as an alternative to building in-house.