Verification & Quality Assurance Skill

Comprehensive truth scoring, code quality verification, and automatic rollback system with 0.95 accuracy threshold for ensuring high-quality agent outputs and codebase reliability.

by ruvnet·MIT license·★ 94,702 Stars on the repo·GitHub ↗

Use now

Files of Verification & Quality Assurance Skill

ruvnet/main1 file shown
SKILL.md
Show the full text650 lines

Verification & Quality Assurance Skill

What This Skill Does

This skill provides a comprehensive verification and quality assurance system that ensures code quality and correctness through:

  • Truth Scoring: Real-time reliability metrics (0.0-1.0 scale) for code, agents, and tasks
  • Verification Checks: Automated code correctness, security, and best practices validation
  • Automatic Rollback: Instant reversion of changes that fail verification (default threshold: 0.95)
  • Quality Metrics: Statistical analysis with trends, confidence intervals, and improvement tracking
  • CI/CD Integration: Export capabilities for continuous integration pipelines
  • Real-time Monitoring: Live dashboards and watch modes for ongoing verification

Prerequisites

  • Claude Flow installed (npx claude-flow@alpha)
  • Git repository (for rollback features)
  • Node.js 18+ (for dashboard features)

Quick Start

# 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

Complete Guide

Truth Scoring System
View Truth Metrics

Display comprehensive quality and reliability metrics for your codebase and agent tasks.

Basic Usage:

# 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

Output Formats:

# 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

Real-time Monitoring:

# 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 Score Dashboard

Example dashboard output:

📊 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"
Metrics Explained

Truth Scores (0.0-1.0):

  • 1.0-0.95: Excellent ⭐ (production-ready)
  • 0.94-0.85: Good ✅ (acceptable quality)
  • 0.84-0.75: Warning ⚠️ (needs attention)
  • <0.75: Critical ❌ (requires immediate action)

Trend Indicators:

  • ↗️ Improving (positive trend)
  • → Stable (consistent performance)
  • ↘️ Declining (quality regression detected)

Statistics:

  • Mean Score: Average truth score across all measurements
  • Median Score: Middle value (less affected by outliers)
  • Standard Deviation: Consistency of scores (lower = more consistent)
  • Confidence Interval: Statistical reliability of measurements
Verification Checks
Run Verification

Execute comprehensive verification checks on code, tasks, or agent outputs.

File Verification:

# 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

Task Verification:

# 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

Batch Verification:

# 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
Verification Criteria

The verification system evaluates:

  1. Code Correctness

    • Syntax validation
    • Type checking (TypeScript)
    • Logic flow analysis
    • Error handling completeness
  2. Best Practices

    • Code style adherence
    • SOLID principles
    • Design patterns usage
    • Modularity and reusability
  3. Security

    • Vulnerability scanning
    • Secret detection
    • Input validation
    • Authentication/authorization checks
  4. Performance

    • Algorithmic complexity
    • Memory usage patterns
    • Database query optimization
    • Bundle size impact
  5. Documentation

    • JSDoc/TypeDoc completeness
    • README accuracy
    • API documentation
    • Code comments quality
JSON Output for CI/CD
# 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": [...]
    }
  ]
}
Automatic Rollback
Rollback Failed Changes

Automatically revert changes that fail verification checks.

Basic Rollback:

# 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

Smart Rollback:

# 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

Rollback Performance:

  • Git-based rollback: <1 second
  • Selective file rollback: <500ms
  • Backup creation: Automatic before rollback
Verification Reports
Generate Reports

Create detailed verification reports with metrics and visualizations.

Report Formats:

# 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

Time-based Reports:

# 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

Report Content:

  • Overall truth scores
  • Per-agent performance metrics
  • Task completion quality
  • Verification pass/fail rates
  • Rollback frequency
  • Quality improvement trends
  • Statistical confidence intervals
Interactive Dashboard
Launch Dashboard

Run interactive web-based verification dashboard with real-time updates.

# 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

Dashboard Features:

  • Real-time truth score updates (WebSocket)
  • Interactive charts and graphs
  • Agent performance comparison
  • Task history timeline
  • Rollback history viewer
  • Export to PDF/HTML
  • Filter by time period/agent/score
Configuration
Default Configuration

Set verification preferences in .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"
    }
  }
}
Threshold Configuration

Adjust verification strictness:

# 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

Per-environment thresholds:

{
  "verification": {
    "thresholds": {
      "production": 0.99,
      "staging": 0.95,
      "development": 0.90
    }
  }
}
Integration Examples
CI/CD Integration

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 Integration

Run verification automatically during swarm operations:

# 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 Programming Integration

Enable real-time verification during collaborative development:

# 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
Advanced Workflows
Continuous Verification

Monitor codebase continuously during development:

# 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
Monitoring Integration

Send metrics to external monitoring systems:

# 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 @-
Pre-commit Hooks

Automatically verify before commits:

# 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"
Performance Metrics

Verification Speed:

  • Single file check: <100ms
  • Directory scan: <500ms (per 100 files)
  • Full codebase analysis: <5s (typical project)
  • Truth score calculation: <50ms

Rollback Speed:

  • Git-based rollback: <1s
  • Selective file rollback: <500ms
  • Backup creation: <2s

Dashboard Performance:

  • Initial load: <1s
  • Real-time updates: <100ms latency (WebSocket)
  • Chart rendering: 60 FPS
Troubleshooting
Common Issues

Low Truth Scores:

# 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

Rollback Failures:

# Check git status
git status

# View rollback history
npx claude-flow@alpha verify rollback --history

# Manual rollback
git reset --hard HEAD~1

Verification Timeouts:

# Increase timeout
npx claude-flow@alpha verify check --timeout 60s

# Verify in batches
npx claude-flow@alpha verify batch --batch-size 10
Exit Codes

Verification commands return standard exit codes:

  • 0: Verification passed (score ≥ threshold)
  • 1: Verification failed (score < threshold)
  • 2: Error during verification (invalid input, system error)
  • npx claude-flow@alpha pair - Collaborative development with verification
  • npx claude-flow@alpha train - Training with verification feedback
  • npx claude-flow@alpha swarm - Multi-agent coordination with quality checks
  • npx claude-flow@alpha report - Generate comprehensive project reports
Best Practices
  1. Set Appropriate Thresholds: Use 0.99 for critical code, 0.95 for standard, 0.90 for experimental
  2. Enable Auto-rollback: Prevent bad code from persisting
  3. Monitor Trends: Track improvement over time, not just current scores
  4. Integrate with CI/CD: Make verification part of your pipeline
  5. Use Watch Mode: Get immediate feedback during development
  6. Export Metrics: Track quality metrics in your monitoring system
  7. Review Rollbacks: Understand why changes were rejected
  8. Train Agents: Use verification feedback to improve agent performance
Additional Resources
  • Truth Scoring Algorithm: See /docs/truth-scoring.md
  • Verification Criteria: See /docs/verification-criteria.md
  • Integration Examples: See /examples/verification/
  • API Reference: See /docs/api/verification.md
1---
2name: "Verification & Quality Assurance"
3description: "Comprehensive truth scoring, code quality verification, and automatic rollback system with 0.95 accuracy threshold for ensuring high-quality agent outputs and codebase reliability."
4version: "2.0.0"
5category: "quality-assurance"
6tags: ["verification", "truth-scoring", "quality", "rollback", "metrics", "ci-cd"]
7---
8 
9# Verification & Quality Assurance Skill
10 
11## What This Skill Does
12 
13This skill provides a comprehensive verification and quality assurance system that ensures code quality and correctness through:
14 
15- **Truth Scoring**: Real-time reliability metrics (0.0-1.0 scale) for code, agents, and tasks
16- **Verification Checks**: Automated code correctness, security, and best practices validation
17- **Automatic Rollback**: Instant reversion of changes that fail verification (default threshold: 0.95)
18- **Quality Metrics**: Statistical analysis with trends, confidence intervals, and improvement tracking
19- **CI/CD Integration**: Export capabilities for continuous integration pipelines
20- **Real-time Monitoring**: Live dashboards and watch modes for ongoing verification
21 
22## Prerequisites
23 
24- Claude Flow installed (`npx claude-flow@alpha`)
25- Git repository (for rollback features)
26- Node.js 18+ (for dashboard features)
27 
28## Quick Start
29 
30```bash
31# View current truth scores
32npx claude-flow@alpha truth
33 
34# Run verification check
35npx claude-flow@alpha verify check
36 
37# Verify specific file with custom threshold
38npx claude-flow@alpha verify check --file src/app.js --threshold 0.98
39 
40# Rollback last failed verification
41npx claude-flow@alpha verify rollback --last-good
42```
43 
44---
45 
46## Complete Guide
47 
48### Truth Scoring System
49 
50#### View Truth Metrics
51 
52Display comprehensive quality and reliability metrics for your codebase and agent tasks.
53 
54**Basic Usage:**
55```bash
56# View current truth scores (default: table format)
57npx claude-flow@alpha truth
58 
59# View scores for specific time period
60npx claude-flow@alpha truth --period 7d
61 
62# View scores for specific agent
63npx claude-flow@alpha truth --agent coder --period 24h
64 
65# Find files/tasks below threshold
66npx claude-flow@alpha truth --threshold 0.8
67```
68 
69**Output Formats:**
70```bash
71# Table format (default)
72npx claude-flow@alpha truth --format table
73 
74# JSON for programmatic access
75npx claude-flow@alpha truth --format json
76 
77# CSV for spreadsheet analysis
78npx claude-flow@alpha truth --format csv
79 
80# HTML report with visualizations
81npx claude-flow@alpha truth --format html --export report.html
82```
83 
84**Real-time Monitoring:**
85```bash
86# Watch mode with live updates
87npx claude-flow@alpha truth --watch
88 
89# Export metrics automatically
90npx claude-flow@alpha truth --export .claude-flow/metrics/truth-$(date +%Y%m%d).json
91```
92 
93#### Truth Score Dashboard
94 
95Example dashboard output:
96```
97📊 Truth Metrics Dashboard
98━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
99 
100Overall Truth Score: 0.947 ✅
101Trend: ↗️ +2.3% (7d)
102 
103Top Performers:
104 verification-agent 0.982 ⭐
105 code-analyzer 0.971 ⭐
106 test-generator 0.958 ✅
107 
108Needs Attention:
109 refactor-agent 0.821 ⚠️
110 docs-generator 0.794 ⚠️
111 
112Recent Tasks:
113 task-456 0.991 ✅ "Implement auth"
114 task-455 0.967 ✅ "Add tests"
115 task-454 0.743 ❌ "Refactor API"
116```
117 
118#### Metrics Explained
119 
120**Truth Scores (0.0-1.0):**
121- `1.0-0.95`: Excellent ⭐ (production-ready)
122- `0.94-0.85`: Good ✅ (acceptable quality)
123- `0.84-0.75`: Warning ⚠️ (needs attention)
124- `<0.75`: Critical ❌ (requires immediate action)
125 
126**Trend Indicators:**
127- ↗️ Improving (positive trend)
128- → Stable (consistent performance)
129- ↘️ Declining (quality regression detected)
130 
131**Statistics:**
132- **Mean Score**: Average truth score across all measurements
133- **Median Score**: Middle value (less affected by outliers)
134- **Standard Deviation**: Consistency of scores (lower = more consistent)
135- **Confidence Interval**: Statistical reliability of measurements
136 
137### Verification Checks
138 
139#### Run Verification
140 
141Execute comprehensive verification checks on code, tasks, or agent outputs.
142 
143**File Verification:**
144```bash
145# Verify single file
146npx claude-flow@alpha verify check --file src/app.js
147 
148# Verify directory recursively
149npx claude-flow@alpha verify check --directory src/
150 
151# Verify with auto-fix enabled
152npx claude-flow@alpha verify check --file src/utils.js --auto-fix
153 
154# Verify current working directory
155npx claude-flow@alpha verify check
156```
157 
158**Task Verification:**
159```bash
160# Verify specific task output
161npx claude-flow@alpha verify check --task task-123
162 
163# Verify with custom threshold
164npx claude-flow@alpha verify check --task task-456 --threshold 0.99
165 
166# Verbose output for debugging
167npx claude-flow@alpha verify check --task task-789 --verbose
168```
169 
170**Batch Verification:**
171```bash
172# Verify multiple files in parallel
173npx claude-flow@alpha verify batch --files "*.js" --parallel
174 
175# Verify with pattern matching
176npx claude-flow@alpha verify batch --pattern "src/**/*.ts"
177 
178# Integration test suite
179npx claude-flow@alpha verify integration --test-suite full
180```
181 
182#### Verification Criteria
183 
184The verification system evaluates:
185 
1861. **Code Correctness**
187 - Syntax validation
188 - Type checking (TypeScript)
189 - Logic flow analysis
190 - Error handling completeness
191 
1922. **Best Practices**
193 - Code style adherence
194 - SOLID principles
195 - Design patterns usage
196 - Modularity and reusability
197 
1983. **Security**
199 - Vulnerability scanning
200 - Secret detection
201 - Input validation
202 - Authentication/authorization checks
203 
2044. **Performance**
205 - Algorithmic complexity
206 - Memory usage patterns
207 - Database query optimization
208 - Bundle size impact
209 
2105. **Documentation**
211 - JSDoc/TypeDoc completeness
212 - README accuracy
213 - API documentation
214 - Code comments quality
215 
216#### JSON Output for CI/CD
217 
218```bash
219# Get structured JSON output
220npx claude-flow@alpha verify check --json > verification.json
221 
222# Example JSON structure:
223{
224 "overallScore": 0.947,
225 "passed": true,
226 "threshold": 0.95,
227 "checks": [
228 {
229 "name": "code-correctness",
230 "score": 0.98,
231 "passed": true
232 },
233 {
234 "name": "security",
235 "score": 0.91,
236 "passed": false,
237 "issues": [...]
238 }
239 ]
240}
241```
242 
243### Automatic Rollback
244 
245#### Rollback Failed Changes
246 
247Automatically revert changes that fail verification checks.
248 
249**Basic Rollback:**
250```bash
251# Rollback to last known good state
252npx claude-flow@alpha verify rollback --last-good
253 
254# Rollback to specific commit
255npx claude-flow@alpha verify rollback --to-commit abc123
256 
257# Interactive rollback with preview
258npx claude-flow@alpha verify rollback --interactive
259```
260 
261**Smart Rollback:**
262```bash
263# Rollback only failed files (preserve good changes)
264npx claude-flow@alpha verify rollback --selective
265 
266# Rollback with automatic backup
267npx claude-flow@alpha verify rollback --backup-first
268 
269# Dry-run mode (preview without executing)
270npx claude-flow@alpha verify rollback --dry-run
271```
272 
273**Rollback Performance:**
274- Git-based rollback: <1 second
275- Selective file rollback: <500ms
276- Backup creation: Automatic before rollback
277 
278### Verification Reports
279 
280#### Generate Reports
281 
282Create detailed verification reports with metrics and visualizations.
283 
284**Report Formats:**
285```bash
286# JSON report
287npx claude-flow@alpha verify report --format json
288 
289# HTML report with charts
290npx claude-flow@alpha verify report --export metrics.html --format html
291 
292# CSV for data analysis
293npx claude-flow@alpha verify report --format csv --export metrics.csv
294 
295# Markdown summary
296npx claude-flow@alpha verify report --format markdown
297```
298 
299**Time-based Reports:**
300```bash
301# Last 24 hours
302npx claude-flow@alpha verify report --period 24h
303 
304# Last 7 days
305npx claude-flow@alpha verify report --period 7d
306 
307# Last 30 days with trends
308npx claude-flow@alpha verify report --period 30d --include-trends
309 
310# Custom date range
311npx claude-flow@alpha verify report --from 2025-01-01 --to 2025-01-31
312```
313 
314**Report Content:**
315- Overall truth scores
316- Per-agent performance metrics
317- Task completion quality
318- Verification pass/fail rates
319- Rollback frequency
320- Quality improvement trends
321- Statistical confidence intervals
322 
323### Interactive Dashboard
324 
325#### Launch Dashboard
326 
327Run interactive web-based verification dashboard with real-time updates.
328 
329```bash
330# Launch dashboard on default port (3000)
331npx claude-flow@alpha verify dashboard
332 
333# Custom port
334npx claude-flow@alpha verify dashboard --port 8080
335 
336# Export dashboard data
337npx claude-flow@alpha verify dashboard --export
338 
339# Dashboard with auto-refresh
340npx claude-flow@alpha verify dashboard --refresh 5s
341```
342 
343**Dashboard Features:**
344- Real-time truth score updates (WebSocket)
345- Interactive charts and graphs
346- Agent performance comparison
347- Task history timeline
348- Rollback history viewer
349- Export to PDF/HTML
350- Filter by time period/agent/score
351 
352### Configuration
353 
354#### Default Configuration
355 
356Set verification preferences in `.claude-flow/config.json`:
357 
358```json
359{
360 "verification": {
361 "threshold": 0.95,
362 "autoRollback": true,
363 "gitIntegration": true,
364 "hooks": {
365 "preCommit": true,
366 "preTask": true,
367 "postEdit": true
368 },
369 "checks": {
370 "codeCorrectness": true,
371 "security": true,
372 "performance": true,
373 "documentation": true,
374 "bestPractices": true
375 }
376 },
377 "truth": {
378 "defaultFormat": "table",
379 "defaultPeriod": "24h",
380 "warningThreshold": 0.85,
381 "criticalThreshold": 0.75,
382 "autoExport": {
383 "enabled": true,
384 "path": ".claude-flow/metrics/truth-daily.json"
385 }
386 }
387}
388```
389 
390#### Threshold Configuration
391 
392**Adjust verification strictness:**
393```bash
394# Strict mode (99% accuracy required)
395npx claude-flow@alpha verify check --threshold 0.99
396 
397# Lenient mode (90% acceptable)
398npx claude-flow@alpha verify check --threshold 0.90
399 
400# Set default threshold
401npx claude-flow@alpha config set verification.threshold 0.98
402```
403 
404**Per-environment thresholds:**
405```json
406{
407 "verification": {
408 "thresholds": {
409 "production": 0.99,
410 "staging": 0.95,
411 "development": 0.90
412 }
413 }
414}
415```
416 
417### Integration Examples
418 
419#### CI/CD Integration
420 
421**GitHub Actions:**
422```yaml
423name: Quality Verification
424 
425on: [push, pull_request]
426 
427jobs:
428 verify:
429 runs-on: ubuntu-latest
430 steps:
431 - uses: actions/checkout@v3
432 
433 - name: Install Dependencies
434 run: npm install
435 
436 - name: Run Verification
437 run: |
438 npx claude-flow@alpha verify check --json > verification.json
439 
440 - name: Check Truth Score
441 run: |
442 score=$(jq '.overallScore' verification.json)
443 if (( $(echo "$score < 0.95" | bc -l) )); then
444 echo "Truth score too low: $score"
445 exit 1
446 fi
447 
448 - name: Upload Report
449 uses: actions/upload-artifact@v3
450 with:
451 name: verification-report
452 path: verification.json
453```
454 
455**GitLab CI:**
456```yaml
457verify:
458 stage: test
459 script:
460 - npx claude-flow@alpha verify check --threshold 0.95 --json > verification.json
461 - |
462 score=$(jq '.overallScore' verification.json)
463 if [ $(echo "$score < 0.95" | bc) -eq 1 ]; then
464 echo "Verification failed with score: $score"
465 exit 1
466 fi
467 artifacts:
468 paths:
469 - verification.json
470 reports:
471 junit: verification.json
472```
473 
474#### Swarm Integration
475 
476Run verification automatically during swarm operations:
477 
478```bash
479# Swarm with verification enabled
480npx claude-flow@alpha swarm --verify --threshold 0.98
481 
482# Hive Mind with auto-rollback
483npx claude-flow@alpha hive-mind --verify --rollback-on-fail
484 
485# Training pipeline with verification
486npx claude-flow@alpha train --verify --threshold 0.99
487```
488 
489#### Pair Programming Integration
490 
491Enable real-time verification during collaborative development:
492 
493```bash
494# Pair with verification
495npx claude-flow@alpha pair --verify --real-time
496 
497# Pair with custom threshold
498npx claude-flow@alpha pair --verify --threshold 0.97 --auto-fix
499```
500 
501### Advanced Workflows
502 
503#### Continuous Verification
504 
505Monitor codebase continuously during development:
506 
507```bash
508# Watch directory for changes
509npx claude-flow@alpha verify watch --directory src/
510 
511# Watch with auto-fix
512npx claude-flow@alpha verify watch --directory src/ --auto-fix
513 
514# Watch with notifications
515npx claude-flow@alpha verify watch --notify --threshold 0.95
516```
517 
518#### Monitoring Integration
519 
520Send metrics to external monitoring systems:
521 
522```bash
523# Export to Prometheus
524npx claude-flow@alpha truth --format json | \
525 curl -X POST https://pushgateway.example.com/metrics/job/claude-flow \
526 -d @-
527 
528# Send to DataDog
529npx claude-flow@alpha verify report --format json | \
530 curl -X POST "https://api.datadoghq.com/api/v1/series?api_key=${DD_API_KEY}" \
531 -H "Content-Type: application/json" \
532 -d @-
533 
534# Custom webhook
535npx claude-flow@alpha truth --format json | \
536 curl -X POST https://metrics.example.com/api/truth \
537 -H "Content-Type: application/json" \
538 -d @-
539```
540 
541#### Pre-commit Hooks
542 
543Automatically verify before commits:
544 
545```bash
546# Install pre-commit hook
547npx claude-flow@alpha verify install-hook --pre-commit
548 
549# .git/hooks/pre-commit example:
550#!/bin/bash
551npx claude-flow@alpha verify check --threshold 0.95 --json > /tmp/verify.json
552 
553score=$(jq '.overallScore' /tmp/verify.json)
554if (( $(echo "$score < 0.95" | bc -l) )); then
555 echo "❌ Verification failed with score: $score"
556 echo "Run 'npx claude-flow@alpha verify check --verbose' for details"
557 exit 1
558fi
559 
560echo "✅ Verification passed with score: $score"
561```
562 
563### Performance Metrics
564 
565**Verification Speed:**
566- Single file check: <100ms
567- Directory scan: <500ms (per 100 files)
568- Full codebase analysis: <5s (typical project)
569- Truth score calculation: <50ms
570 
571**Rollback Speed:**
572- Git-based rollback: <1s
573- Selective file rollback: <500ms
574- Backup creation: <2s
575 
576**Dashboard Performance:**
577- Initial load: <1s
578- Real-time updates: <100ms latency (WebSocket)
579- Chart rendering: 60 FPS
580 
581### Troubleshooting
582 
583#### Common Issues
584 
585**Low Truth Scores:**
586```bash
587# Get detailed breakdown
588npx claude-flow@alpha truth --verbose --threshold 0.0
589 
590# Check specific criteria
591npx claude-flow@alpha verify check --verbose
592 
593# View agent-specific issues
594npx claude-flow@alpha truth --agent <agent-name> --format json
595```
596 
597**Rollback Failures:**
598```bash
599# Check git status
600git status
601 
602# View rollback history
603npx claude-flow@alpha verify rollback --history
604 
605# Manual rollback
606git reset --hard HEAD~1
607```
608 
609**Verification Timeouts:**
610```bash
611# Increase timeout
612npx claude-flow@alpha verify check --timeout 60s
613 
614# Verify in batches
615npx claude-flow@alpha verify batch --batch-size 10
616```
617 
618### Exit Codes
619 
620Verification commands return standard exit codes:
621 
622- `0`: Verification passed (score ≥ threshold)
623- `1`: Verification failed (score < threshold)
624- `2`: Error during verification (invalid input, system error)
625 
626### Related Commands
627 
628- `npx claude-flow@alpha pair` - Collaborative development with verification
629- `npx claude-flow@alpha train` - Training with verification feedback
630- `npx claude-flow@alpha swarm` - Multi-agent coordination with quality checks
631- `npx claude-flow@alpha report` - Generate comprehensive project reports
632 
633### Best Practices
634 
6351. **Set Appropriate Thresholds**: Use 0.99 for critical code, 0.95 for standard, 0.90 for experimental
6362. **Enable Auto-rollback**: Prevent bad code from persisting
6373. **Monitor Trends**: Track improvement over time, not just current scores
6384. **Integrate with CI/CD**: Make verification part of your pipeline
6395. **Use Watch Mode**: Get immediate feedback during development
6406. **Export Metrics**: Track quality metrics in your monitoring system
6417. **Review Rollbacks**: Understand why changes were rejected
6428. **Train Agents**: Use verification feedback to improve agent performance
643 
644### Additional Resources
645 
646- Truth Scoring Algorithm: See `/docs/truth-scoring.md`
647- Verification Criteria: See `/docs/verification-criteria.md`
648- Integration Examples: See `/examples/verification/`
649- API Reference: See `/docs/api/verification.md`
650 

Discussion