chain

A workflow designer for connecting several tool steps into one process. It covers steps that run one after another, at the same time, or only when certain conditions are met.

In plain words
What is it for?
Use it to plan multi-step automation, pass results between tools, run independent tasks in parallel, or repeat a step until a check succeeds.
Why use it?
It helps prevent complex tool workflows from losing data or failing silently between steps. It also defines what should happen when a step fails.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/sharpdeveye/maestro/chain
Any agent
npx skills add sharpdeveye/maestro --skill chain
Clone the repo
git clone --depth 1 https://github.com/sharpdeveye/maestro

Made for: Claude Code, Codex.

Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 602 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.00602
Opus 5 $0.00012 $0.00301
Sonnet 5 $0.00005 $0.00120
Haiku 4.5 $0.00002 $0.00060

Measured yesterday against content hash 8c0bd8954ba2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

chain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

source/skills/chain/SKILL.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MANDATORY PREPARATION

Invoke /agent-workflow — it contains workflow principles, anti-patterns, and the Context Gathering Protocol. Follow the protocol before proceeding — if no workflow context exists yet, you MUST run /teach-maestro first. Consult the tool-orchestration reference in the agent-workflow skill for composition patterns and error handling.


Design tool chains that do complex work reliably. A chain is only as strong as its weakest link.

Chain Patterns

Sequential: A → B → C (each step depends on the previous) Parallel: [A, B, C] → Merge (independent steps run simultaneously) Conditional: A → (if X then B, else C) → D (branching based on results) Iterative: A → Check → (if not done) → A again (loop until convergence)

Chain Design Process

For each chain, define:

## Chain: [Name]

### Steps
1. [Tool A] — [what it does] — Input: [schema] — Output: [schema]
2. [Tool B] — [what it does] — Input: [output of step 1] — Output: [schema]
3. [Tool C] — [what it does] — Input: [output of step 2] — Output: [schema]

### Data Flow
Step 1 output.field_a → Step 2 input.source_data
Step 2 output.results → Step 3 input.items

### Error Handling
Step 1 failure → [retry 3x, then return error]
Step 2 failure → [return partial results from step 1]
Step 3 failure → [retry with simplified input]

### Constraints
Max total execution time: 60s
Max retries per step: 3

Chain Validation

  • Data schemas are compatible between connected steps
  • Every step has error handling
  • Total chain timeout is set
  • Maximum iteration count is set for loops
  • Partial results are handled (what if step 2 of 4 fails?)

Recommended Next Step

After building the chain, run /fortify to add error handling at each step, then /evaluate to test the full pipeline.

NEVER:

  • Build chains without defining data contracts between steps
  • Create loops without maximum iteration counts
  • Skip error handling at any step (the chain breaks at the weakest link)
  • Assume output of step N is always valid input for step N+1
  • Build long chains when a single prompt could handle the task

Read the full file on GitHub · 72 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 72 lines · 24 tokens per session scan A 8c0bd8954ba2

Subscribe to this mod's changes

chain is a skill published in the GitHub repository sharpdeveye/maestro (415 stars, last pushed 4mo ago), licensed MIT. It adds 24 tokens to every session and 602 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agent-self-scheduling

Schedule AI agent runs with cron, loops, or external clocks while avoiding unsafe tight autonomous timers.

sickn33/agentic-awesome-skills · 24 tokens

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

agnt-gg/agnt · 64 tokens

agnt-plugin-builder

End-to-end workflow for creating, building, installing, and hot-reloading AGNT plugins entirely from chat. Use this skill whenever the user asks to 'build a plugin', 'create an AGNT plugin', 'add a new tool to AGNT', 'integrate X with AGNT' (where X is an API or service), 'make a plugin for [service]', or wants to…

agnt-gg/agnt · 201 tokens

annie-universal-api-orchestrator

Use AGNT's stored OAuth tokens and API keys to call ANY third-party API directly from the orchestrator, without building a tool or plugin first. Use this skill whenever the user asks you to "do something with my GitHub / Gmail / Drive / Slack / Notion / Stripe / Shopify / Discord / Linear / Jira / Vercel / Netlify /…

agnt-gg/agnt · 208 tokens

frontend-slides

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

agnt-gg/agnt · 63 tokens

image-to-cinematic-video

Turn a prompt or an existing image into a polished multi-scene cinematic short video using Seedance for clip generation, uguu.se for file hosting, and FFmpeg for last-frame extraction and crossfade stitching. Supports two modes — PARALLEL (multiple scenes from the same reference image, concurrent, 3 min total) and…

agnt-gg/agnt · 297 tokens