stream-chain
Stream-JSON chaining for multi-agent pipelines, data transformation, and sequential workflows
By ruvnet · 1,154 installs
npx skills add ruvnet/ruflo --skill stream-chain
Source repository · Upstream listing
Stream Chain Skill
Execute sophisticated multi step workflows where each agent's output flows into the next, enabling complex data transformations and sequential processing pipelines.
Overview
Stream Chain provides two powerful modes for orchestrating multi agent workflows:
1. Custom Chains ( run ): Execute custom prompt sequences with full control
2. Predefined Pipelines ( pipeline ): Use battle tested workflows for common tasks
Each step in a chain receives the complete output from the previous step, enabling sophisticated multi agent coordination through streaming data flow.
Quick Start
Run a Custom Chain
Execute a Pipeline
Custom Chains ( run )
Execute custom stream chains with your own prompts for maximum flexibility.
Syntax
Requirements:
Minimum 2 prompts required
Each prompt becomes a step in the chain
Output flows sequentially through all steps
Options
Option Description Default
verbose Show detailed execution information false
timeout <seconds Timeout per step 30
debug Enable debug mode with full logging false
How Context Flows
Each step receives the previous output as context:
Examples
Basic Development Chain
Security Audit Workflow
Code Refactoring Chain
Data Processing Pipeline
Predefined Pipelines ( pipeline )
Execute battle tested workflows optimized for common development tasks.
Syntax
Available Pipelines
1. Analysis Pipeline
Comprehensive codebase analysis and improvement identification.
Workflow Steps:
1. Structure Analysis : Map directory structure and identify components
2. Issue Detection : Find potential improvements and problems
3. Recommendations : Generate actionable improvement report
Use Cases:
New codebase onboarding
Technical debt assessment
Architecture review
Code quality audits
2. Refactor Pipeline
Systematic code refactoring with prioritization.
Workflow Steps:
1. Candidate Identification : Find code needing refactoring
2. Prioritization : Create ranked refactoring plan
3. Implementation : Provide refactored code for top priorities
Use Cases:
Technical debt reduction
Code quality improvement
Legacy code modernization
Design pattern implementation
3. Test Pipeline
Comprehensive test generation with coverage analysis.
Workflow Steps:
1. Coverage Analysis : Identify areas lacking tests
2. Test Design : Create test cases for critical functions
3. Implementation : Generate unit tests with assertions
Use Cases:
Increasing test coverage
TDD workflow support
Regression test creation
Quality assurance
4. Optimize Pipeline
Performance optimization with profiling and implementation.
Workflow Steps:
1. Profiling : Identify performance bottlenecks
2. Strategy : Analyze and suggest optimization approaches
3. Implementation : Provide optimized code
Use Cases:
Performance improvement
Resource optimization
Scalability enhancement
Latency reduction
Pipeline Options
Option Description Default
verbose Show detailed execution false
timeout <seconds Timeout per step 30
debug Enable debug mode false
Pipeline Examples
Quick Analysis
Extended Refactoring
Debug Test Generation
Comprehensive Optimization
Pipeline Output
Each pipeline execution provides:
Progress : Step by step execution status
Results : Success/failure per step
Timing : Total and per step execution time
Summary : Consolidated results and recommendations
Custom Pipeline Definitions
Define reusable pipelines in .claude flow/config.json :
Configuration Format
Execute Custom Pipeline
Advanced Use Cases
Multi Agent Coordination
Chain different agent types for complex workflows:
Data Transformation Pipeline
Process and transform data through multiple stages:
Code Migration Workflow
Systematic code migration with validation:
Quality Assurance Chain
Comprehensive code quality workflow:
Best Practices
1. Clear and Specific Prompts
Good:
Avoid:
2. Logical Progression
Order prompts to build on previous outputs:
3. Appropriate Timeouts
Simple tasks: 30 seconds (default)
Analysis tasks: 45 60 seconds
Implementation tasks: 60 90 seconds
Complex workflows: 90 120 seconds
4. Verification Steps
Include validation in your chains:
5. Iterative Refinement
Use chains for iterative improvement:
Integration with Claude Flow
Combine with Swarm Coordination
Memory Integration
Stream chains automatically store context in memory for cross session persistence:
Neural Pattern Training
Successful chains train neural patterns for improved performance:
Troubleshooting
Chain Timeout
If steps timeout, increase timeout value:
Context Loss
If context not flowing properly, use debug :
Pipeline Not Found
Verify pipeline name and custom definitions:
Performance Characteristics
Throughput : 2 5 steps per minute (varies by complexity)
Context Size : Up to 100K tokens per step
Memory Usage : ~50MB per active chain
Concurrency : Supports parallel chain execution
Related Skills
SPARC Methodology : Systematic development workflow
Swarm Coordination : Multi agent orchestration
Memory Management : Persistent context storage
Neural Patterns : Adaptive learning
Examples Repository
Complete Development Workflow
Code Review Pipeline
Migration Assistant
Conclusion
Stream Chain enables sophisticated multi step workflows by:
Sequential Processing : Each step builds on previous results
Context Preservation : Full output history flows through chain
Flexible Orchestration : Custom chains or predefined pipelines
Agent Coordination : Natural multi agent collaboration pattern
Data Transformation : Complex processing through simple steps
Use run for custom workflows and pipeline for battle tested solutions.