qe-verification-quality について
qe-verification-qualityは、コードやエージェントの出力を検証するスキルです。自動チェック、信頼性の追跡、失敗時のロールバックを必要とする開発チーム向けで、Truth Score、統計レポート、リアルタイム監視、CI/CD出力を備えます。
主な機能
- 01コード・エージェント・タスクのTruth Score算出
- 02正確性・セキュリティ・ベストプラクティスの検査
- 03失敗した変更の自動ロールバック
- 04傾向と信頼区間の追跡
- 05JSON・CSV・HTMLレポートの出力
- 06ライブダッシュボードによる監視
活用シーン
- 01コミット前のコード品質チェック
- 02CI/CDでの検証と結果出力
- 03コード変更の監視と自動修正
- 04品質検査に失敗した変更の取り消し
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ proffesor-for-testing/ agentic-qe --skill qe-verification-qualityインストール後、Claude Code で/qe-verification-qualityを入力して読み込まれたか確認します。
詳細
検証と品質保証スキル
このスキルでできること
このスキルは、以下の機能を通じてコードの品質と正確性を確保する、包括的な検証・品質保証システムを提供します。
- 信頼性スコア:コード、エージェント、タスクのリアルタイム信頼性指標(0.0~1.0 のスケール)
- 検証チェック:コードの正確性、セキュリティ、ベストプラクティスを自動検証
- 自動ロールバック:検証に失敗した変更を即座に元に戻します(デフォルトのしきい値:0.95)
- 品質指標:傾向、信頼区間、改善状況を含む統計分析
- CI/CD 統合:継続的インテグレーションパイプラインへのエクスポート機能
- リアルタイム監視:継続的な検証のためのライブダッシュボードと監視モード
前提条件
- Claude Flow がインストールされていること(
npx claude-flow@alpha) - Git リポジトリ(ロールバック機能用)
- Node.js 18+(ダッシュボード機能用)
クイックスタート
# View current truth scores
npx claude-flow@alpha truth
# Run verification check
npx claude-flow@alpha verify check
# Verify specific file with custom threshold
npx claude-flow@alpha verify check --file src/app.js --threshold 0.98
# Rollback last failed verification
npx claude-flow@alpha verify rollback --last-good
完全ガイド
信頼性スコアシステム
信頼性指標を表示する
コードベースとエージェントのタスクについて、品質と信頼性に関する包括的な指標を表示します。
基本的な使い方:
# View current truth scores (default: table format)
npx claude-flow@alpha truth
# View scores for specific time period
npx claude-flow@alpha truth --period 7d
# View scores for specific agent
npx claude-flow@alpha truth --agent coder --period 24h
# Find files/tasks below threshold
npx claude-flow@alpha truth --threshold 0.8
出力形式:
# Table format (default)
npx claude-flow@alpha truth --format table
# JSON for programmatic access
npx claude-flow@alpha truth --format json
# CSV for spreadsheet analysis
npx claude-flow@alpha truth --format csv
# HTML report with visualizations
npx claude-flow@alpha truth --format html --export report.html
リアルタイム監視:
# Watch mode with live updates
npx claude-flow@alpha truth --watch
# Export metrics automatically
npx claude-flow@alpha truth --export .claude-flow/metrics/truth-$(date +%Y%m%d).json
信頼性スコアダッシュボード
ダッシュボードの出力例:
📊 Truth Metrics Dashboard
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Overall Truth Score: 0.947 ✅
Trend: ↗️ +2.3% (7d)
Top Performers:
verification-agent 0.982 ⭐
code-analyzer 0.971 ⭐
test-generator 0.958 ✅
Needs Attention:
refactor-agent 0.821 ⚠️
docs-generator 0.794 ⚠️
Recent Tasks:
task-456 0.991 ✅ "Implement auth"
task-455 0.967 ✅ "Add tests"
task-454 0.743 ❌ "Refactor API"
指標の説明
信頼性スコア(0.0~1.0):
1.0-0.95:優秀 ⭐(本番環境で使用可能)0.94-0.85:良好 ✅(許容できる品質)0.84-0.75:警告 ⚠️(要対応)<0.75:重大 ❌(直ちに対応が必要)
傾向の指標:
- ↗️ 改善中(上昇傾向)
- → 安定(パフォーマンスが一貫)
- ↘️ 低下中(品質の低下を検出)
統計情報:
- 平均スコア:すべての測定値における信頼性スコアの平均
- 中央値スコア:中央の値(外れ値の影響を受けにくい)
- 標準偏差:スコアの一貫性(値が小さいほど一貫性が高い)
- 信頼区間:測定値の統計的な信頼性
検証チェック
検証を実行する
コード、タスク、またはエージェントの出力に対して、包括的な検証チェックを実行します。
ファイルの検証:
# Verify single file
npx claude-flow@alpha verify check --file src/app.js
# Verify directory recursively
npx claude-flow@alpha verify check --directory src/
# Verify with auto-fix enabled
npx claude-flow@alpha verify check --file src/utils.js --auto-fix
# Verify current working directory
npx claude-flow@alpha verify check
タスクの検証:
# Verify specific task output
npx claude-flow@alpha verify check --task task-123
# Verify with custom threshold
npx claude-flow@alpha verify check --task task-456 --threshold 0.99
# Verbose output for debugging
npx claude-flow@alpha verify check --task task-789 --verbose
一括検証:
# Verify multiple files in parallel
npx claude-flow@alpha verify batch --files "*.js" --parallel
# Verify with pattern matching
npx claude-flow@alpha verify batch --pattern "src/**/*.ts"
# Integration test suite
npx claude-flow@alpha verify integration --test-suite full
検証基準
検証システムでは、以下を評価します。
-
コードの正確性
- 構文検証
- 型チェック(TypeScript)
- ロジックフロー分析
- エラー処理の完全性
-
ベストプラクティス
- コードスタイルへの準拠
- SOLID 原則
- デザインパターンの使用
- モジュール性と再利用性
-
セキュリティ
- 脆弱性スキャン
- シークレットの検出
- 入力検証
- 認証/認可チェック
-
パフォーマンス
- アルゴリズムの計算量
- メモリ使用パターン
- データベースクエリの最適化
- バンドルサイズへの影響
-
ドキュメント
- JSDoc/TypeDoc の完全性
- README の正確性
- API ドキュメント
- コードコメントの品質
CI/CD 用の JSON 出力
# Get structured JSON output
npx claude-flow@alpha verify check --json > verification.json
# Example JSON structure:
{
"overallScore": 0.947,
"passed": true,
"threshold": 0.95,
"checks": [
{
"name": "code-correctness",
"score": 0.98,
"passed": true
},
{
"name": "security",
"score": 0.91,
"passed": false,
"issues": [...]
}
]
}
自動ロールバック
失敗した変更をロールバックする
検証チェックに失敗した変更を自動的に元に戻します。
基本的なロールバック:
# Rollback to last known good state
npx claude-flow@alpha verify rollback --last-good
# Rollback to specific commit
npx claude-flow@alpha verify rollback --to-commit abc123
# Interactive rollback with preview
npx claude-flow@alpha verify rollback --interactive
スマートロールバック:
# Rollback only failed files (preserve good changes)
npx claude-flow@alpha verify rollback --selective
# Rollback with automatic backup
npx claude-flow@alpha verify rollback --backup-first
# Dry-run mode (preview without executing)
npx claude-flow@alpha verify rollback --dry-run
ロールバックのパフォーマンス:
- Git ベースのロールバック:<1 秒
- ファイルを選択してロールバック:<500ms
- バックアップの作成:ロールバック前に自動実行
検証レポート
レポートを生成する
指標と視覚化を含む詳細な検証レポートを作成します。
レポート形式:
# JSON report
npx claude-flow@alpha verify report --format json
# HTML report with charts
npx claude-flow@alpha verify report --export metrics.html --format html
# CSV for data analysis
npx claude-flow@alpha verify report --format csv --export metrics.csv
# Markdown summary
npx claude-flow@alpha verify report --format markdown
期間別レポート:
# Last 24 hours
npx claude-flow@alpha verify report --period 24h
# Last 7 days
npx claude-flow@alpha verify report --period 7d
# Last 30 days with trends
npx claude-flow@alpha verify report --period 30d --include-trends
# Custom date range
npx claude-flow@alpha verify report --from 2025-01-01 --to 2025-01-31
レポートの内容:
- 全体の信頼性スコア
- エージェントごとのパフォーマンス指標
- タスク完了時の品質
- 検証の合格率/失敗率
- ロールバックの頻度
- 品質改善の傾向
- 統計的信頼区間
インタラクティブダッシュボード
ダッシュボードを起動する
リアルタイム更新に対応した、インタラクティブなウェブベースの検証ダッシュボードを実行します。
# Launch dashboard on default port (3000)
npx claude-flow@alpha verify dashboard
# Custom port
npx claude-flow@alpha verify dashboard --port 8080
# Export dashboard data
npx claude-flow@alpha verify dashboard --export
# Dashboard with auto-refresh
npx claude-flow@alpha verify dashboard --refresh 5s
ダッシュボードの機能:
- 信頼性スコアをリアルタイムで更新(WebSocket)
- インタラクティブなチャートとグラフ
- エージェントのパフォーマンス比較
- タスク履歴のタイムライン
- ロールバック履歴の表示
- PDF/HTML へのエクスポート
- 期間/エージェント/スコアによるフィルタリング
設定
デフォルト設定
.claude-flow/config.json で検証の設定を行います。
{
"verification": {
"threshold": 0.95,
"autoRollback": true,
"gitIntegration": true,
"hooks": {
"preCommit": true,
"preTask": true,
"postEdit": true
},
"checks": {
"codeCorrectness": true,
"security": true,
"performance": true,
"documentation": true,
"bestPractices": true
}
},
"truth": {
"defaultFormat": "table",
"defaultPeriod": "24h",
"warningThreshold": 0.85,
"criticalThreshold": 0.75,
"autoExport": {
"enabled": true,
"path": ".claude-flow/metrics/truth-daily.json"
}
}
}
しきい値の設定
検証の厳密さを調整します。
# Strict mode (99% accuracy required)
npx claude-flow@alpha verify check --threshold 0.99
# Lenient mode (90% acceptable)
npx claude-flow@alpha verify check --threshold 0.90
# Set default threshold
npx claude-flow@alpha config set verification.threshold 0.98
環境ごとのしきい値:
{
"verification": {
"thresholds": {
"production": 0.99,
"staging": 0.95,
"development": 0.90
}
}
}
統合例
CI/CD との統合
GitHub Actions:
name: Quality Verification
on: [push, pull_request]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: npm install
- name: Run Verification
run: |
npx claude-flow@alpha verify check --json > verification.json
- name: Check Truth Score
run: |
score=$(jq '.overallScore' verification.json)
if (( $(echo "$score < 0.95" | bc -l) )); then
echo "Truth score too low: $score"
exit 1
fi
- name: Upload Report
uses: actions/upload-artifact@v3
with:
name: verification-report
path: verification.json
GitLab CI:
verify:
stage: test
script:
- npx claude-flow@alpha verify check --threshold 0.95 --json > verification.json
- |
score=$(jq '.overallScore' verification.json)
if [ $(echo "$score < 0.95" | bc) -eq 1 ]; then
echo "Verification failed with score: $score"
exit 1
fi
artifacts:
paths:
- verification.json
reports:
junit: verification.json
Swarm との統合
Swarm の操作中に検証を自動実行します。
# Swarm with verification enabled
npx claude-flow@alpha swarm --verify --threshold 0.98
# Hive Mind with auto-rollback
npx claude-flow@alpha hive-mind --verify --rollback-on-fail
# Training pipeline with verification
npx claude-flow@alpha train --verify --threshold 0.99
ペアプログラミングとの統合
共同開発中のリアルタイム検証を有効にします。
# Pair with verification
npx claude-flow@alpha pair --verify --real-time
# Pair with custom threshold
npx claude-flow@alpha pair --verify --threshold 0.97 --auto-fix
高度なワークフロー
継続的な検証
開発中にコードベースを継続的に監視します。
# Watch directory for changes
npx claude-flow@alpha verify watch --directory src/
# Watch with auto-fix
npx claude-flow@alpha verify watch --directory src/ --auto-fix
# Watch with notifications
npx claude-flow@alpha verify watch --notify --threshold 0.95
監視との統合
メトリクスを外部の監視システムに送信します。
# Export to Prometheus
npx claude-flow@alpha truth --format json | \
curl -X POST https://pushgateway.example.com/metrics/job/claude-flow \
-d @-
# Send to DataDog
npx claude-flow@alpha verify report --format json | \
curl -X POST "https://api.datadoghq.com/api/v1/series?api_key=${DD_API_KEY}" \
-H "Content-Type: application/json" \
-d @-
# Custom webhook
npx claude-flow@alpha truth --format json | \
curl -X POST https://metrics.example.com/api/truth \
-H "Content-Type: application/json" \
-d @-
コミット前フック
コミット前に自動で検証します。
# Install pre-commit hook
npx claude-flow@alpha verify install-hook --pre-commit
# .git/hooks/pre-commit example:
#!/bin/bash
npx claude-flow@alpha verify check --threshold 0.95 --json > /tmp/verify.json
score=$(jq '.overallScore' /tmp/verify.json)
if (( $(echo "$score < 0.95" | bc -l) )); then
echo "❌ Verification failed with score: $score"
echo "Run 'npx claude-flow@alpha verify check --verbose' for details"
exit 1
fi
echo "✅ Verification passed with score: $score"
パフォーマンス指標
検証速度:
- 単一ファイルのチェック:<100ms
- ディレクトリのスキャン:<500ms(100 ファイルあたり)
- コードベース全体の分析:<5s(一般的なプロジェクト)
- 真実性スコアの計算:<50ms
ロールバック速度:
- Git ベースのロールバック:<1s
- ファイルを選択したロールバック:<500ms
- バックアップの作成:<2s
ダッシュボードのパフォーマンス:
- 初回読み込み:<1s
- リアルタイム更新:レイテンシ <100ms(WebSocket)
- グラフの描画:60 FPS
トラブルシューティング
よくある問題
真実性スコアが低い場合:
# Get detailed breakdown
npx claude-flow@alpha truth --verbose --threshold 0.0
# Check specific criteria
npx claude-flow@alpha verify check --verbose
# View agent-specific issues
npx claude-flow@alpha truth --agent <agent-name> --format json
ロールバックに失敗する場合:
# Check git status
git status
# View rollback history
npx claude-flow@alpha verify rollback --history
# Manual rollback
git reset --hard HEAD~1
検証がタイムアウトする場合:
# Increase timeout
npx claude-flow@alpha verify check --timeout 60s
# Verify in batches
npx claude-flow@alpha verify batch --batch-size 10
終了コード
検証コマンドは標準の終了コードを返します。
0:検証に合格(スコア ≥ しきい値)1:検証に失敗(スコア < しきい値)2:検証中にエラーが発生(無効な入力、システムエラー)
関連コマンド
npx claude-flow@alpha pair- 検証を伴う共同開発npx claude-flow@alpha train- 検証フィードバックを活用したトレーニングnpx claude-flow@alpha swarm- 品質チェックを伴う複数エージェントの連携npx claude-flow@alpha report- プロジェクトの包括的なレポートを生成
ベストプラクティス
- 適切なしきい値を設定する: 重要なコードには 0.99、標準的なコードには 0.95、実験的なコードには 0.90 を使用します
- 自動ロールバックを有効にする: 問題のあるコードが残らないようにします
- 傾向を監視する: 現在のスコアだけでなく、時間の経過に伴う改善を追跡します
- CI/CD と統合する: 検証をパイプラインの一部にします
- ウォッチモードを使用する: 開発中にすぐフィードバックを得ます
- メトリクスをエクスポートする: 監視システムで品質指標を追跡します
- ロールバックを確認する: 変更が却下された理由を把握します
- エージェントをトレーニングする: 検証フィードバックを活用してエージェントのパフォーマンスを向上させます
追加リソース
- 真実性スコアリングアルゴリズム:
/docs/truth-scoring.mdを参照してください - 検証基準:
/docs/verification-criteria.mdを参照してください - 統合例:
/examples/verification/を参照してください - API リファレンス:
/docs/api/verification.mdを参照してください