$npx -y skills add spencermarx/open-code-review --skill stream-chainStream-JSON chaining for multi-agent pipelines, data transformation, and sequential workflows
| 1 | # Stream-Chain Skill |
| 2 | |
| 3 | Execute sophisticated multi-step workflows where each agent's output flows into the next, enabling complex data transformations and sequential processing pipelines. |
| 4 | |
| 5 | ## Overview |
| 6 | |
| 7 | Stream-Chain provides two powerful modes for orchestrating multi-agent workflows: |
| 8 | |
| 9 | 1. **Custom Chains** (`run`): Execute custom prompt sequences with full control |
| 10 | 2. **Predefined Pipelines** (`pipeline`): Use battle-tested workflows for common tasks |
| 11 | |
| 12 | Each step in a chain receives the complete output from the previous step, enabling sophisticated multi-agent coordination through streaming data flow. |
| 13 | |
| 14 | --- |
| 15 | |
| 16 | ## Quick Start |
| 17 | |
| 18 | ### Run a Custom Chain |
| 19 | |
| 20 | ```bash |
| 21 | claude-flow stream-chain run \ |
| 22 | "Analyze codebase structure" \ |
| 23 | "Identify improvement areas" \ |
| 24 | "Generate action plan" |
| 25 | ``` |
| 26 | |
| 27 | ### Execute a Pipeline |
| 28 | |
| 29 | ```bash |
| 30 | claude-flow stream-chain pipeline analysis |
| 31 | ``` |
| 32 | |
| 33 | --- |
| 34 | |
| 35 | ## Custom Chains (`run`) |
| 36 | |
| 37 | Execute custom stream chains with your own prompts for maximum flexibility. |
| 38 | |
| 39 | ### Syntax |
| 40 | |
| 41 | ```bash |
| 42 | claude-flow stream-chain run <prompt1> <prompt2> [...] [options] |
| 43 | ``` |
| 44 | |
| 45 | **Requirements:** |
| 46 | - Minimum 2 prompts required |
| 47 | - Each prompt becomes a step in the chain |
| 48 | - Output flows sequentially through all steps |
| 49 | |
| 50 | ### Options |
| 51 | |
| 52 | | Option | Description | Default | |
| 53 | |--------|-------------|---------| |
| 54 | | `--verbose` | Show detailed execution information | `false` | |
| 55 | | `--timeout <seconds>` | Timeout per step | `30` | |
| 56 | | `--debug` | Enable debug mode with full logging | `false` | |
| 57 | |
| 58 | ### How Context Flows |
| 59 | |
| 60 | Each step receives the previous output as context: |
| 61 | |
| 62 | ``` |
| 63 | Step 1: "Write a sorting function" |
| 64 | Output: [function implementation] |
| 65 | |
| 66 | Step 2 receives: |
| 67 | "Previous step output: |
| 68 | [function implementation] |
| 69 | |
| 70 | Next task: Add comprehensive tests" |
| 71 | |
| 72 | Step 3 receives: |
| 73 | "Previous steps output: |
| 74 | [function + tests] |
| 75 | |
| 76 | Next task: Optimize performance" |
| 77 | ``` |
| 78 | |
| 79 | ### Examples |
| 80 | |
| 81 | #### Basic Development Chain |
| 82 | |
| 83 | ```bash |
| 84 | claude-flow stream-chain run \ |
| 85 | "Write a user authentication function" \ |
| 86 | "Add input validation and error handling" \ |
| 87 | "Create unit tests with edge cases" |
| 88 | ``` |
| 89 | |
| 90 | #### Security Audit Workflow |
| 91 | |
| 92 | ```bash |
| 93 | claude-flow stream-chain run \ |
| 94 | "Analyze authentication system for vulnerabilities" \ |
| 95 | "Identify and categorize security issues by severity" \ |
| 96 | "Propose fixes with implementation priority" \ |
| 97 | "Generate security test cases" \ |
| 98 | --timeout 45 \ |
| 99 | --verbose |
| 100 | ``` |
| 101 | |
| 102 | #### Code Refactoring Chain |
| 103 | |
| 104 | ```bash |
| 105 | claude-flow stream-chain run \ |
| 106 | "Identify code smells in src/ directory" \ |
| 107 | "Create refactoring plan with specific changes" \ |
| 108 | "Apply refactoring to top 3 priority items" \ |
| 109 | "Verify refactored code maintains behavior" \ |
| 110 | --debug |
| 111 | ``` |
| 112 | |
| 113 | #### Data Processing Pipeline |
| 114 | |
| 115 | ```bash |
| 116 | claude-flow stream-chain run \ |
| 117 | "Extract data from API responses" \ |
| 118 | "Transform data into normalized format" \ |
| 119 | "Validate data against schema" \ |
| 120 | "Generate data quality report" |
| 121 | ``` |
| 122 | |
| 123 | --- |
| 124 | |
| 125 | ## Predefined Pipelines (`pipeline`) |
| 126 | |
| 127 | Execute battle-tested workflows optimized for common development tasks. |
| 128 | |
| 129 | ### Syntax |
| 130 | |
| 131 | ```bash |
| 132 | claude-flow stream-chain pipeline <type> [options] |
| 133 | ``` |
| 134 | |
| 135 | ### Available Pipelines |
| 136 | |
| 137 | #### 1. Analysis Pipeline |
| 138 | |
| 139 | Comprehensive codebase analysis and improvement identification. |
| 140 | |
| 141 | ```bash |
| 142 | claude-flow stream-chain pipeline analysis |
| 143 | ``` |
| 144 | |
| 145 | **Workflow Steps:** |
| 146 | 1. **Structure Analysis**: Map directory structure and identify components |
| 147 | 2. **Issue Detection**: Find potential improvements and problems |
| 148 | 3. **Recommendations**: Generate actionable improvement report |
| 149 | |
| 150 | **Use Cases:** |
| 151 | - New codebase onboarding |
| 152 | - Technical debt assessment |
| 153 | - Architecture review |
| 154 | - Code quality audits |
| 155 | |
| 156 | #### 2. Refactor Pipeline |
| 157 | |
| 158 | Systematic code refactoring with prioritization. |
| 159 | |
| 160 | ```bash |
| 161 | claude-flow stream-chain pipeline refactor |
| 162 | ``` |
| 163 | |
| 164 | **Workflow Steps:** |
| 165 | 1. **Candidate Identification**: Find code needing refactoring |
| 166 | 2. **Prioritization**: Create ranked refactoring plan |
| 167 | 3. **Implementation**: Provide refactored code for top priorities |
| 168 | |
| 169 | **Use Cases:** |
| 170 | - Technical debt reduction |
| 171 | - Code quality improvement |
| 172 | - Legacy code modernization |
| 173 | - Design pattern implementation |
| 174 | |
| 175 | #### 3. Test Pipeline |
| 176 | |
| 177 | Comprehensive test generation with coverage analysis. |
| 178 | |
| 179 | ```bash |
| 180 | claude-flow stream-chain pipeline test |
| 181 | ``` |
| 182 | |
| 183 | **Workflow Steps:** |
| 184 | 1. **Coverage Analysis**: Identify areas lacking tests |
| 185 | 2. **Test Design**: Create test cases for critical functions |
| 186 | 3. **Implementation**: Generate unit tests with assertions |
| 187 | |
| 188 | **Use Cases:** |
| 189 | - Increasing test coverage |
| 190 | - TDD workflow support |
| 191 | - Regression test creation |
| 192 | - Quality assurance |
| 193 | |
| 194 | #### 4. Optimize Pipeline |
| 195 | |
| 196 | Performance optimization with profiling and implementation. |
| 197 | |
| 198 | ```bash |
| 199 | claude-flow stream-chain pipeline optimize |
| 200 | ``` |
| 201 | |
| 202 | **Workflow Steps:** |
| 203 | 1. **Profiling**: Identify performance bottlenecks |
| 204 | 2. **Strategy**: Analyze and suggest optimization approaches |
| 205 | 3. **Implementation**: Provide optimized cod |