Use when tasks require multiple steps, need human decisions mid-workflow, exceed single context window, or have validation requirements - designs reliable multi-step AI workflows with explicit input/output contracts, context compression, and validation gates. Benefits include reduced context bloat, systematic validation between steps, clear error recovery, and ability to resume interrupted work.
/plugin marketplace add mthalman/superpowers/plugin install superpowers@claude-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Multi-step AI workflows fail without explicit chain design. This skill teaches how to orchestrate complex tasks as chains with clear inputs, outputs, validation gates, and context management.
Core principle: Describing phases ≠ designing chains. Chains have explicit input/output contracts, validation gates, context extraction, and error recovery.
Use when tasks have ANY of these characteristics:
Don't use for:
Not phases. Chain steps with explicit contracts.
Example: Vague phases vs explicit chain contracts
❌ BAD: Vague phases
Phase 1: Analyze codebase
Phase 2: Design solution
Phase 3: Implement
✅ GOOD: Chain with contracts
Step 1: Analyze codebase
Input: User requirements
Output: { current_auth: "none", db: "postgresql", files: [...] }
Step 2: Design solution options
Input: Structured findings from Step 1
Output: { options: [{approach, pros, cons}], recommendation }
Step 3: Get human decision
Input: Options from Step 2
Output: { chosen_approach, constraints }
Step 4: Implement
Input: Decision from Step 3, findings from Step 1
Output: Code changes
Each step must specify:
Problem: Step 1 produces 50KB analysis. Step 2 can't consume all of it.
Solution: Extract structured data.
Example: Context bloat vs structured extraction
❌ BAD: Pass raw output forward
Step 1 output: [Long prose analysis of codebase architecture,
file-by-file review, detailed observations...]
Step 2 input: [All 50KB from Step 1]
✅ GOOD: Extract structured findings
Step 1 output (compressed):
{
"current_state": "no authentication",
"database": "postgresql with sequelize",
"session_mgmt": "express-session already installed",
"relevant_files": ["src/server.js", "src/models/User.js"],
"constraints": ["must work with existing sessions"]
}
Step 2 input: This 200-byte JSON (not 50KB prose)
Context compression strategies:
Validation gates check quality before proceeding.
Example: Validation gate with error recovery
After Step 2 (Design solution):
✓ Check: Does design reference actual files from codebase?
✓ Check: Are security requirements addressed?
✓ Check: Is approach compatible with constraints?
If NO → Retry Step 2 with specific feedback
If YES → Proceed to Step 3
Validation gate checklist for each step:
When to pause for human decision:
Use AskUserQuestion for checkpoints:
Example: Human checkpoint for architectural decision
After Step 2 (Analysis complete):
"I've identified 3 approaches for authentication:
A) JWT with Redis session store
✓ Stateless, scalable
✗ Requires Redis setup
B) OAuth2 with third-party
✓ No credential management
✗ External dependency
C) Session-based with existing express-session
✓ Minimal changes
✗ Less scalable
Which approach fits your needs?"
[PAUSE - Get human decision]
Step 3 continues with chosen approach
Use TodoWrite to track chain progress:
Example: TodoWrite for chain state tracking
TodoWrite todos:
[
{ content: "Analyze existing auth patterns", status: "completed" },
{ content: "Design auth options with tradeoffs", status: "completed" },
{ content: "Get user decision on approach", status: "in_progress" },
{ content: "Implement chosen auth method", status: "pending" },
{ content: "Validate security requirements", status: "pending" }
]
Benefits:
Use when: Requirements clear but approach needs decision
Example: Research → Decide → Execute chain pattern
Step 1: Analyze current state
Output: Structured findings
Step 2: Generate options with tradeoffs
Input: Findings
Output: { options: [...], recommendation }
Step 3: Human decision
Input: Options
Output: { chosen_option, rationale }
Step 4: Execute
Input: Decision + findings
Output: Implementation
Step 5: Validate
Input: Implementation
Output: Verification results
Use when: Debugging, root cause analysis
Example: Investigation chain for debugging
Step 1: Reproduce & gather evidence
Output: { symptoms, logs, patterns }
Step 2: Form hypotheses
Input: Evidence
Output: { hypotheses: [{cause, likelihood, test}] }
Step 3: Test hypotheses
Input: Hypotheses
Output: { confirmed_hypothesis, evidence }
Step 4: Implement fix
Input: Confirmed hypothesis
Output: Code changes
Step 5: Verify fix
Input: Changes
Output: Validation results
Use when: Requirements vague or ambiguous
Example: Clarification chain for vague requirements
Step 1: Ask clarifying questions
Output: { requirements, constraints, priorities }
Step 2: Design approach
Input: Requirements
Output: { plan, steps, validation_criteria }
Step 3: Get approval
Input: Plan
Output: { approved: true/false, modifications }
Step 4: Execute plan
Input: Approved plan
Output: Implementation
Step 5: Validate against criteria
Input: Implementation + validation_criteria
Output: Results
Example: Validation failure recovery
Step 3 validation failed:
→ Check: Is failure recoverable?
YES → Retry Step 3 with specific feedback
NO → Backtrack to Step 2, redesign
Example: Quality recovery pattern
Step 2 output quality too low:
→ Add explicit quality requirements
→ Retry with refined prompt
→ If 2nd attempt fails, reconsider decomposition
Example: Context overflow recovery
Step 1 produced too much context:
→ Apply compression (extract structured data)
→ Split step into sub-steps
→ Use files to store intermediate results
If you catch yourself doing these: Stop. Design the chain explicitly.
| Use Chain When | Use Single-Shot When |
|---|---|
| Multiple perspectives needed | Clear implementation path |
| Human decision required | No ambiguity |
| Context exceeds window | Fits in context |
| Validation critical | Simple verification |
| Investigation required | Known solution |
When unsure: Design the chain. Overhead is small, benefits are large.
When using this skill:
User request: "Add authentication to my app"
Chain Design:
Step 1: Analyze current state
Input: Codebase
Actions: Search for existing auth, db, session handling
Output: {
current_auth: "none",
database: "postgresql",
session_library: "express-session installed",
relevant_files: ["src/server.js"]
}
Validation: Found DB and session library
Step 2: Design options
Input: Structured findings from Step 1
Actions: Generate 3 approaches with tradeoffs
Output: {
options: [
{approach: "JWT + Redis", pros: [...], cons: [...]},
{approach: "OAuth2", pros: [...], cons: [...]},
{approach: "Session-based", pros: [...], cons: [...]}
],
recommendation: "Session-based (builds on existing)"
}
Validation: Each option has concrete pros/cons
Step 3: Human checkpoint
Input: Options from Step 2
Actions: Use AskUserQuestion
Output: { chosen: "Session-based", constraints: ["must support 2FA later"] }
Validation: Got explicit decision
Step 4: Implement
Input: Decision from Step 3 + findings from Step 1
Actions: Write auth middleware, routes, tests
Output: Code changes
Validation: Tests pass, security checks pass
Step 5: Security review
Input: Implementation
Actions: Check for common vulnerabilities
Output: { secure: true, issues: [] }
Validation: No critical issues
TodoWrite tracking:
[
{content: "Analyze current auth setup", status: "completed"},
{content: "Design auth options", status: "completed"},
{content: "Get user decision on approach", status: "completed"},
{content: "Implement session-based auth", status: "completed"},
{content: "Security review implementation", status: "completed"}
]
| Mistake | Fix |
|---|---|
| "Phase 1, Phase 2, Phase 3" without contracts | Define input/output for each |
| Passing 50KB prose between steps | Extract structured data |
| No validation gates | Add explicit quality checks |
| Skipping human checkpoints | Pause for decisions |
| Not tracking with TodoWrite | Create todos for chain steps |
| Vague about what steps consume/produce | Be explicit about data formats |
Chains are a design pattern, not just a sequence of steps.
Good chain design means:
When you design chains this way, complex multi-step tasks become reliable and maintainable.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.