Chain Builder

Chain Builder is a skill for Claude Code, Codex from eddiebelaval/squire. It costs 13 tokens per session (2,942 once invoked), scanned A, original, MIT.

Build and execute multi-step prompt chains for complex tasks.

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/eddiebelaval/squire/chain-builder
Any agent
npx skills add eddiebelaval/squire --skill chain-builder
Clone the repo
git clone --depth 1 https://github.com/eddiebelaval/squire

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Chain Builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/eddiebelaval/squire/chain-builder.svg)](https://agentmods.dev/skills/eddiebelaval/squire/chain-builder)
Your own site
<a href="https://agentmods.dev/skills/eddiebelaval/squire/chain-builder"><img src="https://agentmods.dev/badge/skills/eddiebelaval/squire/chain-builder.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,942 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00013 $0.02942
Opus 5 $0.00006 $0.01471
Sonnet 5 $0.00003 $0.00588
Haiku 4.5 $0.00001 $0.00294

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

Security

Grade A, and why

Chain Builder 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 today.

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.

skills/chain-builder/SKILL.md · 404 lines

How it starts

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

Chain Builder

The Chain Builder skill helps you design and execute multi-step prompt chains where the output of one prompt becomes the input to the next. This enables complex, multi-stage processing that would be difficult to accomplish in a single prompt, while maintaining clarity, modularity, and debuggability.

This skill guides you through chain design, identifying optimal breakpoints, managing data flow between steps, handling errors, and validating outputs at each stage. It's particularly valuable for tasks that involve multiple distinct phases like research → analysis → synthesis → formatting, or ideation → planning → implementation → review.

Use this skill when you have complex tasks that benefit from sequential processing, when you need intermediate validation between steps, or when different parts of a task require different specialized prompts or tools.

Core Workflows

Workflow 1: Design Prompt Chain from Goal

  1. Clarify the end goal:
    • What's the final output?
    • What quality standards apply?
    • What constraints exist?
  2. Decompose into logical stages:
    • Identify distinct phases
    • Determine stage boundaries
    • Order by dependencies
  3. Design individual prompts:
    • Purpose of each stage
    • Input requirements
    • Output specifications
    • Success criteria
  4. Define data flow:
    • What passes between stages?
    • What format for intermediate outputs?
    • What state is maintained?
  5. Add validation:
    • Checkpoints after each stage
    • Quality gates
    • Error handling
  6. Document the chain:
    • Chain purpose
    • Stage descriptions
    • Data flow diagram
    • Usage examples
  7. Test end-to-end

Workflow 2: Execute Existing Chain

  1. Load chain definition:
    • Read chain specification
    • Understand stages
    • Prepare inputs
  2. Initialize chain state:
    • Set initial inputs
    • Prepare storage for outputs
    • Initialize tracking
  3. Execute each stage sequentially:
    • Run stage prompt
    • Validate output
    • If validation fails: Handle error
    • If validation passes: Continue
    • Store intermediate result
    • Pass output to next stage
  4. Monitor progress:
    • Track current stage
    • Log outputs
    • Report status
  5. Validate final output
  6. Report results and any issues

Read the full file on GitHub · 404 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. today First seen · 404 lines · 13 tokens per session scan A 0d1bc0ab83bf

Subscribe to this mod's changes

Chain Builder is a skill published in the GitHub repository eddiebelaval/squire (21 stars, last pushed 19d ago), licensed MIT. It adds 13 tokens to every session and 2,942 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-09-03.