Claude Code Multi-Agent Workflow Scripts
Write Claude Code workflow scripts with explicit agent handoffs, bounded execution, validated outputs, and failure handling.
Before & after
Same prompt, same agent — the only difference is the skill.
You can orchestrate multiple agents in a workflow. Each agent would handle its own task, and you'd need to pass the results from one to the next. You'd typically set up an initial prompt, have the first agent run, capture its output, then feed that to the second agent, and so on. A workflow file would let you script this, but you'd need to define the agents, their instructions, and how data flows between them. It's a bit complex to set up initially.
WORKFLOW SCRIPT (.claude/workflows/competitor-strategy.js)
module.exports = {
name: 'Competitor Strategy Pipeline',
steps: [
{
name: 'research-agent',
type: 'agent',
subagent_type: 'general-purpose',
prompt: 'Research our top 3 competitors. For each: pricing model, target market, product features, recent launches, funding/valuation, customer sentiment. Return structured JSON.',
timeout: 300000
},
{
name: 'analyze-agent',
type: 'agent',
subagent_type: 'general-purpose',
prompt: 'Compare this competitor research against our positioning. Identify 5 strategic gaps and 3 opportunities. Output: ranked list with confidence scores.',
input: { competitor_data: '{{ steps.research-agent.output }}' },
timeout: 240000
},
{
name: 'memo-agent',
type: 'agent',
subagent_type: 'general-purpose',
prompt: 'Draft a strategy memo (C-level brief) based on competitor gaps and our opportunities. Include: executive summary, market analysis, 3 strategic recommendations with resource estimates, next 90-day roadmap.',
input: { analysis: '{{ steps.analyze-agent.output }}' },
timeout: 180000
}
],
fan_out: false,
timeout: 900000,
output_format: 'final_step'
};
RUN: workflow competitor-strategy
OUTPUT: Structured memo with research + analysis embedded as appendixAbout this skill
Your agents work separately, but the workflow loses context, merges incompatible answers, or keeps retrying without finishing. This skill turns repeatable tasks into JavaScript workflows with explicit inputs, validated handoffs, bounded execution, and useful failure reports. It checks the installed Claude Code workflow interface before writing integration code.
What it does
- Implements fan-out, sequential pipelines, bounded repair loops, and reviewer panels.
- Gives each fresh-context agent the exact inputs, constraints, and output contract it needs.
- Defines join behavior when one reviewer fails, returns malformed output, or misses its deadline.
- Prevents concurrent agents from overwriting the same files and separates proposed changes from integration.
- Adds stable result ordering, duplicate handling, execution limits, and resumable checkpoints where appropriate.
- Supplies mock-based checks for malformed responses, partial failures, exhausted loops, and uncertain timeouts.
What you get
A complete JavaScript workflow with its input/output contract, execution limits, and verification status. When the installed workflow API is unavailable, you get an implementation with an explicit adapter boundary and a precise description of the remaining integration requirement.
Best for
Developers using Claude Code to repeat code reviews, research passes, implementation pipelines, or repair-and-check cycles across fresh-context agents.
SKILL.md preview
---
name: claude-code-multi-agent-workflow-scripts
description: Implements JavaScript workflows for Claude Code using explicit agent contracts, bounded orchestration, validated joins, and runtime compatibility checks. Use when the user says "build a Claude Code workflow", "write a workflow script", "fan out three reviewers", "chain agents together", "my agents keep losing context", "my workflow loops forever", or "turn this task into a repeatable agent pipeline".
---
# Claude Code Multi-Agent Workflow Scripts
… (sign up to view the full skill)More development skills
View all Development skills →Performance Bottleneck Profiling: Node, Python, Go
Classifies a slowdown, gives exact profiler commands, reads the output, and proves the fix with same-conditions p95/p99 numbers.
Feature Scaffolding with Working Tests
Turn a short feature spec into code, runnable tests, and integration wiring that match your existing project.
Feature Flag Rollouts and Kill Switches
Design staged flag rollouts, verify rollback paths, and audit flag debt with explicit defaults, gates, and retirement plans.
Microcontroller Firmware and RTOS Engineering
Build and debug MCU firmware with bounded ISR/RTOS timing, safe DMA ownership, and measured power budgets.