qe-stream-chain について
qe-stream-chainは、開発やデータ処理向けのClaude Flowスキルです。各ステップの出力を次へ渡すカスタムプロンプトチェーンと、定義済みのパイプラインを実行できます。
主な機能
- 01プロンプトチェーンの順次実行
- 02分析・リファクタリング用パイプライン
- 03カスタムパイプライン定義
- 04ステップごとのタイムアウトとデバッグ
- 05進捗・時間・結果の表示
活用シーン
- 01コードベースを分析して改善点を報告
- 02カバレッジ分析後にテストを生成
- 03計画に沿って段階的にコードを改修
- 04段階的なデータ変換と検証
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ proffesor-for-testing/ agentic-qe --skill qe-stream-chainインストール後、Claude Code で/qe-stream-chainを入力して読み込まれたか確認します。
詳細
Stream-Chain スキル
各エージェントの出力を次のエージェントに渡しながら高度な複数ステップのワークフローを実行し、複雑なデータ変換と順次処理パイプラインを実現します。
概要
Stream-Chain では、複数エージェントのワークフローをオーケストレーションするための強力なモードを 2 つ利用できます。
- カスタムチェーン(
run):完全に制御しながらカスタムのプロンプトシーケンスを実行します - 定義済みパイプライン(
pipeline):一般的なタスク向けに実証済みのワークフローを使用します
チェーン内の各ステップは、前のステップの出力全体を受け取ります。これにより、データのストリーミングフローを通じた高度な複数エージェント連携が可能になります。
クイックスタート
カスタムチェーンを実行する
claude-flow stream-chain run \
"Analyze codebase structure" \
"Identify improvement areas" \
"Generate action plan"
パイプラインを実行する
claude-flow stream-chain pipeline analysis
カスタムチェーン(run)
柔軟性を最大限に高めるため、独自のプロンプトを使ってカスタムストリームチェーンを実行します。
構文
claude-flow stream-chain run <prompt1> <prompt2> [...] [options]
要件:
- プロンプトは 2 つ以上必要です
- 各プロンプトがチェーン内の 1 つのステップになります
- 出力はすべてのステップを順次流れます
オプション
| オプション | 説明 | デフォルト |
|---|---|---|
--verbose | 実行の詳細情報を表示します | false |
--timeout <seconds> | ステップごとのタイムアウト | 30 |
--debug | すべてのログを有効にしてデバッグモードにします | false |
コンテキストの受け渡し方法
各ステップは、前の出力をコンテキストとして受け取ります。
Step 1: "Write a sorting function"
Output: [function implementation]
Step 2 receives:
"Previous step output:
[function implementation]
Next task: Add comprehensive tests"
Step 3 receives:
"Previous steps output:
[function + tests]
Next task: Optimize performance"
例
基本的な開発チェーン
claude-flow stream-chain run \
"Write a user authentication function" \
"Add input validation and error handling" \
"Create unit tests with edge cases"
セキュリティ監査ワークフロー
claude-flow stream-chain run \
"Analyze authentication system for vulnerabilities" \
"Identify and categorize security issues by severity" \
"Propose fixes with implementation priority" \
"Generate security test cases" \
--timeout 45 \
--verbose
コードリファクタリングチェーン
claude-flow stream-chain run \
"Identify code smells in src/ directory" \
"Create refactoring plan with specific changes" \
"Apply refactoring to top 3 priority items" \
"Verify refactored code maintains behavior" \
--debug
データ処理パイプライン
claude-flow stream-chain run \
"Extract data from API responses" \
"Transform data into normalized format" \
"Validate data against schema" \
"Generate data quality report"
定義済みパイプライン(pipeline)
一般的な開発タスクに合わせて最適化された、実証済みのワークフローを実行します。
構文
claude-flow stream-chain pipeline <type> [options]
利用可能なパイプライン
1. 分析パイプライン
コードベースを包括的に分析し、改善点を特定します。
claude-flow stream-chain pipeline analysis
ワークフローのステップ:
- 構造分析:ディレクトリ構造をマッピングし、コンポーネントを特定します
- 問題の検出:潜在的な改善点や問題を見つけます
- 推奨事項:実行可能な改善レポートを作成します
使用例:
- 新しいコードベースの把握
- 技術的負債の評価
- アーキテクチャのレビュー
- コード品質の監査
2. リファクタリングパイプライン
優先順位を付けて、体系的にコードをリファクタリングします。
claude-flow stream-chain pipeline refactor
ワークフローのステップ:
- 候補の特定:リファクタリングが必要なコードを見つけます
- 優先順位付け:優先順位付きのリファクタリング計画を作成します
- 実装:優先度の高い項目について、リファクタリング後のコードを提示します
使用例:
- 技術的負債の削減
- コード品質の向上
- レガシーコードのモダナイゼーション
- デザインパターンの実装
3. テストパイプライン
カバレッジを分析し、包括的なテストを生成します。
claude-flow stream-chain pipeline test
ワークフローのステップ:
- カバレッジ分析:テストが不足している領域を特定します
- テスト設計:重要な関数のテストケースを作成します
- 実装:アサーションを含む単体テストを生成します
使用例:
- テストカバレッジの向上
- TDD ワークフローのサポート
- 回帰テストの作成
- 品質保証
4. 最適化パイプライン
プロファイリングと実装を通じてパフォーマンスを最適化します。
claude-flow stream-chain pipeline optimize
ワークフローのステップ:
- プロファイリング:パフォーマンスのボトルネックを特定します
- 戦略:最適化のアプローチを分析し、提案します
- 実装:最適化したコードを提示します
使用例:
- パフォーマンスの向上
- リソースの最適化
- スケーラビリティの向上
- レイテンシの削減
パイプラインのオプション
| オプション | 説明 | デフォルト |
|---|---|---|
--verbose | 実行の詳細を表示します | false |
--timeout <seconds> | ステップごとのタイムアウト | 30 |
--debug | デバッグモードを有効にします | false |
パイプラインの例
クイック分析
claude-flow stream-chain pipeline analysis
拡張リファクタリング
claude-flow stream-chain pipeline refactor --timeout 60 --verbose
デバッグ付きテスト生成
claude-flow stream-chain pipeline test --debug
包括的な最適化
claude-flow stream-chain pipeline optimize --timeout 90 --verbose
パイプラインの出力
各パイプラインの実行では、次の情報が得られます。
- 進捗:ステップごとの実行状況
- 結果:各ステップの成功/失敗
- 所要時間:合計およびステップごとの実行時間
- 概要:結果と推奨事項のまとめ
カスタムパイプライン定義
.claude-flow/config.json で再利用可能なパイプラインを定義します。
設定形式
{
"streamChain": {
"pipelines": {
"security": {
"name": "Security Audit Pipeline",
"description": "Comprehensive security analysis",
"prompts": [
"Scan codebase for security vulnerabilities",
"Categorize issues by severity (critical/high/medium/low)",
"Generate fixes with priority and implementation steps",
"Create security test suite"
],
"timeout": 45
},
"documentation": {
"name": "Documentation Generation Pipeline",
"prompts": [
"Analyze code structure and identify undocumented areas",
"Generate API documentation with examples",
"Create usage guides and tutorials",
"Build architecture diagrams and flow charts"
]
}
}
}
}
カスタムパイプラインの実行
claude-flow stream-chain pipeline security
claude-flow stream-chain pipeline documentation
高度なユースケース
マルチエージェントの連携
複雑なワークフローでは、異なる種類のエージェントを連鎖させます。
claude-flow stream-chain run \
"Research best practices for API design" \
"Design REST API with discovered patterns" \
"Implement API endpoints with validation" \
"Generate OpenAPI specification" \
"Create integration tests" \
"Write deployment documentation"
データ変換パイプライン
複数のステージを通じてデータを処理、変換します。
claude-flow stream-chain run \
"Extract user data from CSV files" \
"Normalize and validate data format" \
"Enrich data with external API calls" \
"Generate analytics report" \
"Create visualization code"
コード移行ワークフロー
検証を含む体系的なコード移行です。
claude-flow stream-chain run \
"Analyze legacy codebase dependencies" \
"Create migration plan with risk assessment" \
"Generate modernized code for high-priority modules" \
"Create migration tests" \
"Document migration steps and rollback procedures"
品質保証チェーン
包括的なコード品質ワークフローです。
claude-flow stream-chain pipeline analysis
claude-flow stream-chain pipeline refactor
claude-flow stream-chain pipeline test
claude-flow stream-chain pipeline optimize
ベストプラクティス
1. 明確で具体的なプロンプト
推奨例:
"Analyze authentication.js for SQL injection vulnerabilities"
避ける例:
"Check security"
2. 論理的な順序
前の出力をもとに構築できるよう、プロンプトを順序立てます。
1. "Identify the problem"
2. "Analyze root causes"
3. "Design solution"
4. "Implement solution"
5. "Verify implementation"
3. 適切なタイムアウト
- シンプルなタスク:30 秒(デフォルト)
- 分析タスク:45~60 秒
- 実装タスク:60~90 秒
- 複雑なワークフロー:90~120 秒
4. 検証ステップ
チェーンに検証を含めます。
claude-flow stream-chain run \
"Implement feature X" \
"Write tests for feature X" \
"Verify tests pass and cover edge cases"
5. 反復的な改善
反復的な改善にはチェーンを使用します。
claude-flow stream-chain run \
"Generate initial implementation" \
"Review and identify issues" \
"Refine based on issues found" \
"Final quality check"
Claude Flow との統合
Swarm Coordination との組み合わせ
# Initialize swarm for coordination
claude-flow swarm init --topology mesh
# Execute stream chain with swarm agents
claude-flow stream-chain run \
"Agent 1: Research task" \
"Agent 2: Implement solution" \
"Agent 3: Test implementation" \
"Agent 4: Review and refine"
メモリの統合
Stream-Chain はコンテキストを自動的にメモリに保存し、セッションをまたいで保持します。
# Execute chain with memory
claude-flow stream-chain run \
"Analyze requirements" \
"Design architecture" \
--verbose
# Results stored in .claude-flow/memory/stream-chain/
ニューラルパターンのトレーニング
成功したチェーンはニューラルパターンをトレーニングし、パフォーマンスを向上させます。
# Enable neural training
claude-flow stream-chain pipeline optimize --debug
# Patterns learned and stored for future optimizations
トラブルシューティング
チェーンのタイムアウト
ステップがタイムアウトする場合は、タイムアウト値を増やします。
claude-flow stream-chain run "complex task" --timeout 120
コンテキストの損失
コンテキストが適切に引き継がれない場合は、--debug を使用します。
claude-flow stream-chain run "step 1" "step 2" --debug
パイプラインが見つからない
パイプライン名とカスタム定義を確認します。
# Check available pipelines
cat .claude-flow/config.json | grep -A 10 "streamChain"
パフォーマンス特性
- スループット:毎分 2~5 ステップ(複雑さによって異なります)
- コンテキストサイズ:1 ステップあたり最大 100K トークン
- メモリ使用量:アクティブなチェーンあたり約 50MB
- 並行処理:チェーンの並列実行に対応
関連スキル
- SPARC Methodology:体系的な開発ワークフロー
- Swarm Coordination:マルチエージェントのオーケストレーション
- Memory Management:永続的なコンテキストの保存
- Neural Patterns:適応型学習
サンプルリポジトリ
開発ワークフローの全体例
# Full feature development chain
claude-flow stream-chain run \
"Analyze requirements for user profile feature" \
"Design database schema and API endpoints" \
"Implement backend with validation" \
"Create frontend components" \
"Write comprehensive tests" \
"Generate API documentation" \
--timeout 60 \
--verbose
コードレビューパイプライン
# Automated code review workflow
claude-flow stream-chain run \
"Analyze recent git changes" \
"Identify code quality issues" \
"Check for security vulnerabilities" \
"Verify test coverage" \
"Generate code review report with recommendations"
移行アシスタント
# Framework migration helper
claude-flow stream-chain run \
"Analyze current Vue 2 codebase" \
"Identify Vue 3 breaking changes" \
"Create migration checklist" \
"Generate migration scripts" \
"Provide updated code examples"
まとめ
Stream-Chain を使用すると、次の機能によって高度な複数ステップのワークフローを実現できます。
- 順次処理:各ステップが前の結果をもとに構築されます
- コンテキストの保持:出力の履歴全体がチェーンを通じて引き継がれます
- 柔軟なオーケストレーション:カスタムチェーンまたは事前定義済みのパイプラインを利用できます
- エージェントの連携:自然なマルチエージェント連携パターンを実現します
- データ変換:シンプルなステップを通じて複雑な処理を行います
カスタムワークフローには run を、実績のあるソリューションには pipeline を使用してください。