Home
cd ../playbooks
Developer ToolsAdvanced

Multi-Stage Prompt Pipeline

A methodology for building Claude-to-Claude prompt pipelines where one stage's output feeds the next — a four-purpose taxonomy (Research/Plan/Do/Refine), per-prompt provenance folders, XML-structured outputs with required metadata tags, a fixed human-scannable SUMMARY.md, dependency-aware layered execution, and per-stage validation before anything chains forward.

10 minutes
By glittercowboy (taches-cc-resources)Source
#prompt-engineering#ai-workflows#multi-agent#pipelines#developer-tools#meta-prompting

A single mega-prompt that researches, plans, and implements all at once produces a muddle you can't iterate on — splitting the work into staged prompts, each with one job and a durable output the next stage can parse, is what makes a multi-step AI workflow reviewable and re-runnable instead of a black box.

Who it's for: developers and prompt engineers building multi-step AI workflows, anyone chaining research → plan → implement across separate Claude runs, teams who want provenance and re-runnability in their agent pipelines instead of one unauditable mega-prompt, people designing prompts whose outputs other prompts (or agents) consume programmatically

Example

"Set up a research-then-plan-then-build pipeline for our auth feature" → A Research prompt generated first (no dependencies, parallelizable), then a Plan prompt that references the research output via an @.prompts path, then a Do prompt depending on the plan — each saved to its own .prompts/ provenance folder, each emitting an XML-structured artifact for the next stage plus a four-section SUMMARY.md for humans, with each stage validated before the next one runs

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

Or install from your terminal:
npx ccplaybooks add multi-stage-prompt-pipeline
# Multi-Stage Prompt Pipeline (Meta-Prompts)

Create prompts optimized for Claude-to-Claude pipelines — where one prompt's output is another prompt's input — across research, planning, and execution stages. Each prompt's output is structured for efficient machine parsing by the next stage, and every run also produces a short human-readable `SUMMARY.md` so a person can scan progress without reading full artifacts.

## The Core Idea

A single prompt that tries to research, plan, and implement all at once produces a muddled result and is impossible to iterate on. Splitting the work into staged prompts — each with one job, a durable output artifact, and clear provenance — makes each stage reviewable, re-runnable, and composable. The convention: each prompt gets its own folder under `.prompts/{number}-{topic}-{purpose}/` containing its output artifact (structured for the next Claude to consume) and a `SUMMARY.md` (for a human to scan).

## The Four Purposes

Every prompt has exactly one purpose. Infer it from the request's keywords, or ask if unclear:

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

A methodology for designing prompts that feed other prompts — the Claude-to-Claude pipeline pattern where research hands off to planning, planning hands off to implementation, and each stage's output is structured for the next stage to parse rather than re-interpret. The organizing insight is that one prompt should do one job: a mega-prompt attempting research, planning, and execution at once produces a muddled result that's impossible to iterate on, whereas staged prompts — each with a single purpose, a durable output artifact, and its own provenance folder under .prompts/ — are individually reviewable, re-runnable, and composable. Every prompt is classified by one of four purposes (Research, Plan, Do, Refine), inferred from the request's keywords or asked outright, which also determines its default dependencies.

The pipeline mechanics are what make it robust: outputs that later stages consume carry XML metadata (confidence, dependencies, open questions, assumptions) so the next Claude parses facts rather than prose; every run also emits a four-section SUMMARY.md (Key Findings, Decisions Needed, Blockers, Next Step) with a substantive one-line headline so a human can scan progress in seconds; prompts reference each other by @.prompts/ paths, which build a dependency graph that runs independent stages in parallel and dependent ones in layers; and each stage is validated (artifact exists, non-empty, required metadata present, summary complete) before its output is allowed to chain forward — a hard failure stops the chain rather than feeding a broken artifact downstream. Refine prompts version the prior output into an archive rather than overwriting it, keeping the reasoning chain intact.


Quick Start

Step 1: Create a Project Folder

mkdir prompt-pipeline && cd prompt-pipeline

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ./

Step 3: Build a Pipeline

claude

Describe a multi-step task (e.g. "research, plan, then implement authentication"). Claude will classify each stage by purpose, generate the staged prompts into their own provenance folders with XML-structured outputs and human summaries, wire up dependencies, and validate each stage before chaining to the next.


Tips & Best Practices

  • Let the purpose taxonomy drive the split — if you can't say whether a prompt is Research, Plan, Do, or Refine, it's probably trying to do more than one of them and should be split further.
  • Insist on a substantive one-line headline in every SUMMARY.md — a generic "research completed" defeats the entire point of the summary, which is letting a human (or the next prompt) grasp the outcome without opening the full artifact.
  • Validate each stage before chaining, especially the metadata tags on research/plan outputs — a missing <open_questions> or <assumptions> block is exactly the kind of silent gap that makes the downstream plan or implementation quietly wrong.

Limitations

  • The methodology assumes a filesystem convention (.prompts/ folders, @-path references) for provenance and dependency tracking — adapting it to an environment without persistent local files means re-implementing that bookkeeping some other way.
  • It's built for genuinely multi-stage work; a single well-scoped task doesn't need the pipeline overhead and is better served by one direct prompt.
  • The source's full purpose-specific prompt patterns live in separate reference files not reproduced here — this playbook captures the portable pipeline architecture (taxonomy, provenance, output structure, dependency execution, validation), and the exact wording of each purpose's prompt template is left to your own templates.

$Related Playbooks

Developer Tools

Minimalist UI Design Skill: Editorial, Monochrome Interfaces

A frontend design system that enforces warm monochrome, bento grids, and editorial typography — the Notion/Linear look, banned from gradients, heavy shadows, and Inter

5 minutes
Beginner
Developer Tools

Mermaid Tools

Extract Mermaid diagrams from markdown files and render them to high-quality PNG images using bundled scripts — turning text diagrams into shareable visuals.

5 minutes
Beginner
Developer Tools

Minimalist MVP Scoping

Scope a weekend-shippable MVP using the manual → processized → productized progression. Build as little as possible; charge from day one.

5 minutes
Beginner
Developer Tools

MCP Server Hub Manager

Access 1200+ AI Agent tools via Model Context Protocol (MCP)

10 minutes
Advanced
Developer Tools

n8n Workflow Builder

Automate document workflows with n8n - 7800+ workflow templates

10 minutes
Advanced
Developer Tools

MCP Server Builder

Guide for creating high-quality Model Context Protocol (MCP) servers that enable LLMs to interact with external services and APIs.

30 minutes
Advanced
Developer Tools

Nuxt UI Component Guidance

Build interfaces correctly with @nuxt/ui v4 — five core rules (UApp wrapper, semantic colors, reading generated theme files for real slot names, override priority, icon naming), a task-to-focus-area routing table, the Nuxt UI MCP server for live component API lookups, and full installation for both Nuxt and standalone Vue.

5 minutes
Beginner
Developer Tools

Saga Orchestration for Distributed Transactions

Implement the saga pattern for multi-step workflows that span services and can't use a single ACID transaction — choreography vs. orchestration, a step/compensation model with explicit saga states, reverse-order compensation on failure, persisted saga state that survives an orchestrator restart, timeouts, and the idempotency and compensation-testing discipline that makes rollback actually work.

15 minutes
Advanced
Developer Tools

Simplicity First Code Gate

A hard correctness gate against over-complex or oversized code — one ordering principle (human readability first, agent traceability second), five enforceable rules, and a pre-finish checklist that treats unnecessary complexity as a bug, not a style opinion.

2 minutes
Beginner
Developer Tools

Slidev Presentation Builder

Build developer-focused presentations with Slidev — Markdown-driven slides with live code, syntax highlighting, Monaco editor embeds, Mermaid/PlantUML diagrams, LaTeX math, click-based animations, and presenter notes, plus a quick-reference table for the exact syntax each feature needs.

5 minutes
Beginner
Developer Tools

Technical Writing Style Guide

Write docstrings, READMEs, commit messages, and PR descriptions that read like human technical documentation instead of LLM output — six concrete 'tells' with before/after rewrites, a smoothness diagnostic for prose that sounds authoritative while stating one fact three times, and industry-metaphor substitution tables ('surfaces' to 'raises/returns/logs', 'wired through' to 'passed as a parameter').

5 minutes
Intermediate
Developer Tools

Three.js Scroll World Builder

Build a scroll-controlled real-time Three.js experience as one persistent 3D world instead of stacked sections — a scene-ledger data model for authoring chapters, native-scroll-to-deterministic-state mapping with separate exact and smoothed progress, cinematic camera composition, a measurable per-device performance budget, and mandatory reduced-motion and WebGL-failure fallbacks.

20 minutes
Advanced

Browse all Developer Tools playbooks →