# Chain

> Use when the workflow needs multi-step processing with sequential, parallel, or conditional tool compositions and proper data flow.

- **Type:** Skill
- **Install:** `agentstack add skill-sharpdeveye-maestro-chain`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [sharpdeveye](https://agentstack.voostack.com/s/sharpdeveye)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [sharpdeveye](https://github.com/sharpdeveye)
- **Source:** https://github.com/sharpdeveye/maestro/tree/main/source/skills/chain
- **Website:** https://maestroskills.dev

## Install

```sh
agentstack add skill-sharpdeveye-maestro-chain
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

## 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:

```markdown
## 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

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [sharpdeveye](https://github.com/sharpdeveye)
- **Source:** [sharpdeveye/maestro](https://github.com/sharpdeveye/maestro)
- **License:** MIT
- **Homepage:** https://maestroskills.dev

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-sharpdeveye-maestro-chain
- Seller: https://agentstack.voostack.com/s/sharpdeveye
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
