qe-pair-programming について
qe-pair-programmingは、Claude Flow CLIでAIとのペアプログラミングを行うスキルです。共同で開発、テスト、レビューを進める開発者向けに、複数の役割・モードと品質検証、セッション保存を提供します。
主な機能
- 01Driver、Navigator、TDDなどのモード
- 02人間とAIの役割切り替え
- 03テスト生成とカバレッジ追跡
- 04コード、セキュリティ、性能のレビュー
- 05品質スコア、失敗時のロールバック、復元
活用シーン
- 01TDDで機能を開発
- 02共同でコードの問題を調査
- 03継続的なレビューとリファクタリング
- 04長時間のセッションを保存・再開
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ proffesor-for-testing/ agentic-qe --skill qe-pair-programmingインストール後、Claude Code で/qe-pair-programmingを入力して読み込まれたか確認します。
詳細
ペアプログラミング
インテリジェントな役割管理、リアルタイムの品質モニタリング、包括的な開発ワークフローを備えた、AI による共同ペアプログラミングです。
このスキルでできること
このスキルでは、複数のコラボレーションモード、継続的な検証、統合テストに対応した、プロフェッショナルなペアプログラミング機能を AI の支援とともに利用できます。ドライバー/ナビゲーターの役割を管理し、リアルタイムでコードレビューを実施して、品質指標を追跡します。また、トゥルーススコアによる検証を通じて高い水準を維持します。
主な機能:
- 複数のモード:ドライバー、ナビゲーター、切り替え、TDD、レビュー、メンター、デバッグ
- リアルタイム検証:品質を自動採点し、失敗時にはロールバック
- 役割管理:ドライバー/ナビゲーターの役割をシームレスに切り替え
- テスト統合:テストの自動生成、カバレッジの追跡、継続的なテスト
- コードレビュー:セキュリティスキャン、パフォーマンス分析、ベストプラクティスの適用
- セッションの永続化:自動保存、復元、エクスポート、共有
前提条件
必須:
- Claude Flow CLI がインストールされていること(
npm install -g claude-flow@alpha) - Git リポジトリ(任意ですが、推奨)
推奨:
- テストフレームワーク(Jest、pytest など)
- リンターの設定(ESLint、pylint など)
- コードフォーマッター(Prettier、Black など)
クイックスタート
基本セッション
# Start simple pair programming
claude-flow pair --start
TDD セッション
# Test-driven development
claude-flow pair --start \
--mode tdd \
--test-first \
--coverage 90
完全ガイド
セッション制御コマンド
セッションの開始
# Basic start
claude-flow pair --start
# Expert refactoring session
claude-flow pair --start \
--agent senior-dev \
--focus refactor \
--verify \
--threshold 0.98
# Debugging session
claude-flow pair --start \
--agent debugger-expert \
--focus debug \
--review
# Learning session
claude-flow pair --start \
--mode mentor \
--pace slow \
--examples
セッションの管理
# Check status
claude-flow pair --status
# View history
claude-flow pair --history
# Pause session
/pause [--reason <reason>]
# Resume session
/resume
# End session
claude-flow pair --end [--save] [--report]
使用可能なモード
ドライバーモード
AI のガイダンスを受けながら、自分でコードを記述します。
claude-flow pair --start --mode driver
担当する作業:
- 実際のコードを記述する
- ソリューションを実装する
- その場で判断を下す
- 構文と構造に対応する
AI ナビゲーター:
- 戦略的なガイダンス
- 問題になりそうな点の指摘
- 改善案の提案
- リアルタイムレビュー
- 全体的な方向性の追跡
おすすめの用途:
- 新しいパターンを学ぶ
- 慣れ親しんだ機能を実装する
- 素早く反復する
- 実践的にデバッグする
コマンド:
/suggest - Get implementation suggestions
/review - Request code review
/explain - Ask for explanations
/optimize - Request optimization ideas
/patterns - Get pattern recommendations
ナビゲーターモード
自分で方向性を示しながら、AI がコードを記述します。
claude-flow pair --start --mode navigator
担当する作業:
- 大まかな方向性を示す
- 生成されたコードをレビューする
- アーキテクチャ上の決定を下す
- ビジネス要件を満たしていることを確認する
AI ドライバー:
- 実装コードを記述する
- 構文の詳細に対応する
- 指示された内容を実装する
- 定型コードを管理する
- リファクタリングを実行する
おすすめの用途:
- ラピッドプロトタイピング
- 定型コードの生成
- AI のパターンから学ぶ
- ソリューションを探る
コマンド:
/implement - Direct implementation
/refactor - Request refactoring
/test - Generate tests
/document - Add documentation
/alternate - See alternative approaches
切り替えモード
一定の間隔で役割を自動的に交代します。
# Default 10-minute intervals
claude-flow pair --start --mode switch
# 5-minute intervals (rapid)
claude-flow pair --start --mode switch --interval 5m
# 15-minute intervals (deep focus)
claude-flow pair --start --mode switch --interval 15m
引き継ぎの手順:
- 切り替えの30秒前に警告
- 現在のドライバーが作業中の考えをまとめる
- コンテキストの要約を生成
- 役割をスムーズに交代
- 新しいドライバーが続行
おすすめの用途:
- バランスの取れたコラボレーション
- 知識の共有
- 複雑な機能
- 長時間のセッション
特化モード
TDD モード - テスト駆動開発:
claude-flow pair --start \
--mode tdd \
--test-first \
--coverage 100
ワークフロー:失敗するテストを作成 → 実装 → リファクタリング → 繰り返し
レビューモード - 継続的なコードレビュー:
claude-flow pair --start \
--mode review \
--strict \
--security
機能:リアルタイムのフィードバック、セキュリティスキャン、パフォーマンス分析
メンターモード - 学習に重点を置いたモード:
claude-flow pair --start \
--mode mentor \
--explain-all \
--pace slow
機能:詳しい解説、段階的なガイダンス、パターンの指導
デバッグモード - 問題解決:
claude-flow pair --start \
--mode debug \
--verbose \
--trace
機能:問題の特定、根本原因の分析、修正案の提案
セッション中のコマンド
コードコマンド
/explain [--level basic|detailed|expert]
Explain the current code or selection
/suggest [--type refactor|optimize|security|style]
Get improvement suggestions
/implement <description>
Request implementation (navigator mode)
/refactor [--pattern <pattern>] [--scope function|file|module]
Refactor selected code
/optimize [--target speed|memory|both]
Optimize code for performance
/document [--format jsdoc|markdown|inline]
Add documentation to code
/comment [--verbose]
Add inline comments
/pattern <pattern-name> [--example]
Apply a design pattern
テストコマンド
/test [--watch] [--coverage] [--only <pattern>]
Run test suite
/test-gen [--type unit|integration|e2e]
Generate tests for current code
/coverage [--report html|json|terminal]
Check test coverage
/mock <target> [--realistic]
Generate mock data or functions
/test-watch [--on-save]
Enable test watching
/snapshot [--update]
Create test snapshots
レビューコマンド
/review [--scope current|file|changes] [--strict]
Perform code review
/security [--deep] [--fix]
Security analysis
/perf [--profile] [--suggestions]
Performance analysis
/quality [--detailed]
Check code quality metrics
/lint [--fix] [--config <config>]
Run linters
/complexity [--threshold <value>]
Analyze code complexity
ナビゲーションコマンド
/goto <file>[:line[:column]]
Navigate to file or location
/find <pattern> [--regex] [--case-sensitive]
Search in project
/recent [--limit <n>]
Show recent files
/bookmark [add|list|goto|remove] [<name>]
Manage bookmarks
/history [--limit <n>] [--filter <pattern>]
Show command history
/tree [--depth <n>] [--filter <pattern>]
Show project structure
Git コマンド
/diff [--staged] [--file <file>]
Show git diff
/commit [--message <msg>] [--amend]
Commit with verification
/branch [create|switch|delete|list] [<name>]
Branch operations
/stash [save|pop|list|apply] [<message>]
Stash operations
/log [--oneline] [--limit <n>]
View git log
/blame [<file>]
Show git blame
AI パートナーコマンド
/agent [switch|info|config] [<agent-name>]
Manage AI agent
/teach <preference>
Teach the AI your preferences
/feedback [positive|negative] <message>
Provide feedback to AI
/personality [professional|friendly|concise|verbose]
Adjust AI personality
/expertise [add|remove|list] [<domain>]
Set AI expertise focus
指標コマンド
/metrics [--period today|session|week|all]
Show session metrics
/score [--breakdown]
Show quality scores
/productivity [--chart]
Show productivity metrics
/leaderboard [--personal|team]
Show improvement leaderboard
役割とモードのコマンド
/switch [--immediate]
Switch driver/navigator roles
/mode <type>
Change mode (driver|navigator|switch|tdd|review|mentor|debug)
/role
Show current role
/handoff
Prepare role handoff
コマンドのショートカット
| エイリアス | 完全なコマンド |
|---|---|
/s | /suggest |
/e | /explain |
/t | /test |
/r | /review |
/c | /commit |
/g | /goto |
/f | /find |
/h | /help |
/sw | /switch |
/st | /status |
設定
基本設定
.claude-flow/pair-config.json を作成します:
{
"pair": {
"enabled": true,
"defaultMode": "switch",
"defaultAgent": "auto",
"autoStart": false,
"theme": "professional"
}
}
完全設定
{
"pair": {
"general": {
"enabled": true,
"defaultMode": "switch",
"defaultAgent": "senior-dev",
"language": "javascript",
"timezone": "UTC"
},
"modes": {
"driver": {
"enabled": true,
"suggestions": true,
"realTimeReview": true,
"autoComplete": false
},
"navigator": {
"enabled": true,
"codeGeneration": true,
"explanations": true,
"alternatives": true
},
"switch": {
"enabled": true,
"interval": "10m",
"warning": "30s",
"autoSwitch": true,
"pauseOnIdle": true
}
},
"verification": {
"enabled": true,
"threshold": 0.95,
"autoRollback": true,
"preCommitCheck": true,
"continuousMonitoring": true,
"blockOnFailure": true
},
"testing": {
"enabled": true,
"autoRun": true,
"framework": "jest",
"onSave": true,
"coverage": {
"enabled": true,
"minimum": 80,
"enforce": true,
"reportFormat": "html"
}
},
"review": {
"enabled": true,
"continuous": true,
"preCommit": true,
"security": true,
"performance": true,
"style": true,
"complexity": {
"maxComplexity": 10,
"maxDepth": 4,
"maxLines": 100
}
},
"git": {
"enabled": true,
"autoCommit": false,
"commitTemplate": "feat: {message}",
"signCommits": false,
"pushOnEnd": false,
"branchProtection": true
},
"session": {
"autoSave": true,
"saveInterval": "5m",
"maxDuration": "4h",
"idleTimeout": "15m",
"breakReminder": "45m",
"metricsInterval": "1m"
},
"ai": {
"model": "advanced",
"temperature": 0.7,
"maxTokens": 4000,
"personality": "professional",
"expertise": ["backend", "testing", "security"],
"learningEnabled": true
}
}
}
組み込みエージェント
{
"agents": {
"senior-dev": {
"expertise": ["architecture", "patterns", "optimization"],
"style": "thorough",
"reviewLevel": "strict"
},
"tdd-specialist": {
"expertise": ["testing", "mocks", "coverage"],
"style": "test-first",
"reviewLevel": "comprehensive"
},
"debugger-expert": {
"expertise": ["debugging", "profiling", "tracing"],
"style": "analytical",
"reviewLevel": "focused"
},
"junior-dev": {
"expertise": ["learning", "basics", "documentation"],
"style": "questioning",
"reviewLevel": "educational"
}
}
}
CLI 設定
# Set configuration
claude-flow pair config set defaultMode switch
claude-flow pair config set verification.threshold 0.98
# Get configuration
claude-flow pair config get
claude-flow pair config get defaultMode
# Export/Import
claude-flow pair config export > config.json
claude-flow pair config import config.json
# Reset
claude-flow pair config reset
プロファイル管理
再利用可能なプロファイルを作成します:
# Create profile
claude-flow pair profile create refactoring \
--mode driver \
--verify true \
--threshold 0.98 \
--focus refactor
# Use profile
claude-flow pair --start --profile refactoring
# List profiles
claude-flow pair profile list
プロファイル設定:
{
"profiles": {
"refactoring": {
"mode": "driver",
"verification": {
"enabled": true,
"threshold": 0.98
},
"focus": "refactor"
},
"debugging": {
"mode": "navigator",
"agent": "debugger-expert",
"trace": true,
"verbose": true
},
"learning": {
"mode": "mentor",
"pace": "slow",
"explanations": "detailed",
"examples": true
}
}
}
実践的な例
例 1: 機能の実装
JWT トークンを使用したユーザー認証の実装:
# Session setup
claude-flow pair --start \
--mode switch \
--agent senior-dev \
--focus implement \
--verify \
--test
セッションの流れ:
👥 Starting pair programming for authentication feature...
[DRIVER: You - 10 minutes]
/explain JWT authentication flow
> AI explains JWT concepts and best practices
/suggest implementation approach
> AI suggests using middleware pattern with refresh tokens
# You write the basic auth middleware structure
[SWITCH TO NAVIGATOR]
[NAVIGATOR: AI - 10 minutes]
/implement JWT token generation with refresh tokens
> AI generates secure token implementation
/test-gen
> AI creates comprehensive test suite
[SWITCH TO DRIVER]
[DRIVER: You - 10 minutes]
# You refine the implementation
/review --security
> AI performs security review, suggests improvements
/commit --message "feat: JWT authentication with refresh tokens"
✅ Truth Score: 0.98 - Committed successfully
例 2: バグ修正
Node.js におけるメモリリークのデバッグ:
# Session setup
claude-flow pair --start \
--mode navigator \
--agent debugger-expert \
--focus debug \
--trace
セッションの流れ:
👥 Starting debugging session...
/status
> Analyzing application for memory issues...
/perf --profile
> Memory usage growing: 150MB → 450MB over 10 minutes
/find "new EventEmitter" --regex
> Found 3 instances of EventEmitter creation
/inspect eventEmitters --deep
> Discovering listeners not being removed
/suggest fix for memory leak
> AI suggests: "Add removeListener in cleanup functions"
/implement cleanup functions for all event emitters
> AI generates proper cleanup code
/test
> Memory stable at 150MB ✅
/commit --message "fix: memory leak in event emitters"
例 3: TDD セッション
テスト駆動開発によるショッピングカートの構築:
# Session setup
claude-flow pair --start \
--mode tdd \
--agent tdd-specialist \
--test-first
セッションの流れ:
👥 TDD Session: Shopping Cart Feature
[RED PHASE]
/test-gen "add item to cart"
> AI writes failing test:
✗ should add item to cart
✗ should update quantity for existing item
✗ should calculate total price
[GREEN PHASE]
/implement minimal cart functionality
> You write just enough code to pass tests
/test
> Tests passing: 3/3 ✅
[REFACTOR PHASE]
/refactor --pattern repository
> AI refactors to repository pattern
/test
> Tests still passing: 3/3 ✅
[NEXT CYCLE]
/test-gen "remove item from cart"
> AI writes new failing tests...
例 4: コードのリファクタリング
レガシーコードのモダナイズ:
# Session setup
claude-flow pair --start \
--mode driver \
--focus refactor \
--verify \
--threshold 0.98
セッションの流れ:
👥 Refactoring Session: Modernizing UserService
/analyze UserService.js
> AI identifies:
- Callback hell (5 levels deep)
- No error handling
- Tight coupling
- No tests
/suggest refactoring plan
> AI suggests:
1. Convert callbacks to async/await
2. Add error boundaries
3. Extract dependencies
4. Add unit tests
/test-gen --before-refactor
> AI generates tests for current behavior
/refactor callbacks to async/await
# You refactor with AI guidance
/test
> All tests passing ✅
/review --compare
> AI shows before/after comparison
> Code complexity: 35 → 12
> Truth score: 0.99 ✅
/commit --message "refactor: modernize UserService with async/await"
例 5: パフォーマンス最適化
低速な React アプリケーションの最適化:
# Session setup
claude-flow pair --start \
--mode switch \
--agent performance-expert \
--focus optimize \
--profile
セッションの流れ:
👥 Performance Optimization Session
/perf --profile
> React DevTools Profiler Results:
- ProductList: 450ms render
- CartSummary: 200ms render
- Unnecessary re-renders: 15
/suggest optimizations for ProductList
> AI suggests:
1. Add React.memo
2. Use useMemo for expensive calculations
3. Implement virtualization for long lists
/implement React.memo and useMemo
# You implement with AI guidance
/perf --profile
> ProductList: 45ms render (90% improvement!) ✅
/implement virtualization with react-window
> AI implements virtual scrolling
/perf --profile
> ProductList: 12ms render (97% improvement!) ✅
> FPS: 60 stable ✅
/commit --message "perf: optimize ProductList with memoization and virtualization"
例 6: API 開発
Express による RESTful API の構築:
# Session setup
claude-flow pair --start \
--mode navigator \
--agent backend-expert \
--focus implement \
--test
セッションの流れ:
👥 API Development Session
/design REST API for blog platform
> AI designs endpoints:
POST /api/posts
GET /api/posts
GET /api/posts/:id
PUT /api/posts/:id
DELETE /api/posts/:id
/implement CRUD endpoints with validation
> AI implements with Express + Joi validation
/test-gen --integration
> AI generates integration tests
/security --api
> AI adds:
- Rate limiting
- Input sanitization
- JWT authentication
- CORS configuration
/document --openapi
> AI generates OpenAPI documentation
/test --integration
> All endpoints tested: 15/15 ✅
セッションテンプレート
クイックスタートテンプレート
# Refactoring template
claude-flow pair --template refactor
# Focus: Code improvement
# Verification: High (0.98)
# Testing: After each change
# Review: Continuous
# Feature template
claude-flow pair --template feature
# Focus: Implementation
# Verification: Standard (0.95)
# Testing: On completion
# Review: Pre-commit
# Debug template
claude-flow pair --template debug
# Focus: Problem solving
# Verification: Moderate (0.90)
# Testing: Regression tests
# Review: Root cause
# Learning template
claude-flow pair --template learn
# Mode: Mentor
# Pace: Slow
# Explanations: Detailed
# Examples: Many
セッション管理
セッションのステータス
claude-flow pair --status
出力:
👥 Pair Programming Session
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Session ID: pair_1755021234567
Duration: 45 minutes
Status: Active
Partner: senior-dev
Current Role: DRIVER (you)
Mode: Switch (10m intervals)
Next Switch: in 3 minutes
📊 Metrics:
├── Truth Score: 0.982 ✅
├── Lines Changed: 234
├── Files Modified: 5
├── Tests Added: 12
├── Coverage: 87% ↑3%
└── Commits: 3
🎯 Focus: Implementation
📝 Current File: src/auth/login.js
セッション履歴
claude-flow pair --history
出力:
📚 Session History
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. 2024-01-15 14:30 - 16:45 (2h 15m)
Partner: expert-coder
Focus: Refactoring
Truth Score: 0.975
Changes: +340 -125 lines
2. 2024-01-14 10:00 - 11:30 (1h 30m)
Partner: tdd-specialist
Focus: Testing
Truth Score: 0.991
Tests Added: 24
3. 2024-01-13 15:00 - 17:00 (2h)
Partner: debugger-expert
Focus: Bug Fixing
Truth Score: 0.968
Issues Fixed: 5
セッションの永続化
# Save session
claude-flow pair --save [--name <name>]
# Load session
claude-flow pair --load <session-id>
# Export session
claude-flow pair --export <session-id> [--format json|md]
# Generate report
claude-flow pair --report <session-id>
バックグラウンドセッション
# Start in background
claude-flow pair --start --background
# Monitor background session
claude-flow pair --monitor
# Attach to background session
claude-flow pair --attach <session-id>
# End background session
claude-flow pair --end <session-id>
高度な機能
カスタムコマンド
設定で定義します:
{
"customCommands": {
"tdd": "/test-gen && /test --watch",
"full-review": "/lint --fix && /test && /review --strict",
"quick-fix": "/suggest --type fix && /implement && /test"
}
}
カスタムコマンドを使用します:
/custom tdd
/custom full-review
コマンドのチェーン
/test && /commit && /push
/lint --fix && /test && /review --strict
セッションの記録
# Start with recording
claude-flow pair --start --record
# Replay session
claude-flow pair --replay <session-id>
# Session analytics
claude-flow pair --analytics <session-id>
連携オプション
Git との連携:
claude-flow pair --start --git --auto-commit
CI/CD との連携:
claude-flow pair --start --ci --non-interactive
IDE との連携:
claude-flow pair --start --ide vscode
ベストプラクティス
セッションの実践
- 明確な目標 - セッションの目的を事前に定義します
- 適切なモード - タスクの種類に基づいて選択します
- 検証の有効化 - 重要なコードパスに対して行います
- 定期的なテスト - 品質を継続的に維持します
- セッションメモ - 重要な決定事項を記録します
- 定期的な休憩 - 45〜60 分ごとに休憩を取ります
コードの実践
- 早期のテスト - 各変更後にテストを実行します
- コミット前の検証 - 真実スコアを確認します
- セキュリティのレビュー - 機密性の高いコードでは必ず行います
- パフォーマンスのプロファイリング - 最適化には
/perfを使用します - セッションの保存 - 複雑な作業に対して行います
- AI から学ぶ - 頻繁に質問します
モードの選択
- ドライバーモード: 学習しながら実装を制御する場合
- ナビゲーターモード: 迅速なプロトタイピングや生成を行う場合
- スイッチモード: 長時間のセッションやバランスの取れた協業を行う場合
- TDD モード: テストと共に構築する場合
- レビューモード: 品質を重視する場合
- メンターモード: 学習を優先する場合
- デバッグモード: 問題を修正する場合
トラブルシューティング
セッションが開始しない
- エージェントの可用性を確認します
- 設定ファイルの構文を検証します
- ワークスペースがクリーンであることを確認します
- ログファイルを確認します
セッションが切断された
--recoverを使用して復元します- ネットワーク接続を確認します
- バックグラウンドプロセスを確認します
- 自動保存ファイルを確認します
パフォーマンスが低い
- 検証のしきい値を下げます
- 継続的テストを無効化します
- システムリソースを確認します
- より軽量な AI モデルを使用します
設定の問題
- JSON 構文を検証します
- ファイルの権限を確認します
- 優先順位を確認します (CLI > env > project > user > global)
claude-flow pair config validateを実行します
品質メトリクス
真実スコアのしきい値
Error: < 0.90 ❌
Warning: 0.90 - 0.95 ⚠️
Good: 0.95 - 0.98 ✅
Excellent: > 0.98 🌟
カバレッジのしきい値
Error: < 70% ❌
Warning: 70% - 80% ⚠️
Good: 80% - 90% ✅
Excellent: > 90% 🌟
複雑度のしきい値
Error: > 15 ❌
Warning: 10 - 15 ⚠️
Good: 5 - 10 ✅
Excellent: < 5 🌟
環境変数
環境変数で設定を上書きします:
export CLAUDE_PAIR_MODE=driver
export CLAUDE_PAIR_VERIFY=true
export CLAUDE_PAIR_THRESHOLD=0.98
export CLAUDE_PAIR_AGENT=senior-dev
export CLAUDE_PAIR_AUTO_TEST=true
コマンド履歴
履歴を操作します:
↑/↓- コマンド履歴を移動しますCtrl+R- コマンド履歴を検索します!!- 最後のコマンドを繰り返します!<n>- 履歴から n 番目のコマンドを実行します
キーボードショートカット (設定可能)
デフォルトのショートカット:
{
"shortcuts": {
"switch": "ctrl+shift+s",
"suggest": "ctrl+space",
"review": "ctrl+r",
"test": "ctrl+t"
}
}
関連コマンド
claude-flow pair --help- ヘルプを表示しますclaude-flow pair config- 設定を管理しますclaude-flow pair profile- プロファイルを管理しますclaude-flow pair templates- テンプレートを一覧表示しますclaude-flow pair agents- 利用可能なエージェントを一覧表示します