moflo 4.8.12 → 4.8.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/.claude/settings.json +1 -1
  2. package/.claude/workflow-state.json +3 -3
  3. package/package.json +2 -4
  4. package/src/@claude-flow/cli/dist/src/commands/hooks.js +3 -3
  5. package/src/@claude-flow/cli/dist/src/init/claudemd-generator.js +47 -46
  6. package/src/@claude-flow/cli/dist/src/services/workflow-gate.js +96 -68
  7. package/src/@claude-flow/cli/package.json +1 -1
  8. package/.claude/agents/MIGRATION_SUMMARY.md +0 -222
  9. package/.claude/agents/analysis/code-review/analyze-code-quality.md +0 -179
  10. package/.claude/agents/development/backend/dev-backend-api.md +0 -142
  11. package/.claude/agents/flow-nexus/app-store.md +0 -88
  12. package/.claude/agents/flow-nexus/authentication.md +0 -69
  13. package/.claude/agents/flow-nexus/challenges.md +0 -81
  14. package/.claude/agents/flow-nexus/neural-network.md +0 -88
  15. package/.claude/agents/flow-nexus/payments.md +0 -83
  16. package/.claude/agents/flow-nexus/sandbox.md +0 -76
  17. package/.claude/agents/flow-nexus/swarm.md +0 -76
  18. package/.claude/agents/flow-nexus/user-tools.md +0 -96
  19. package/.claude/agents/flow-nexus/workflow.md +0 -84
  20. package/.claude/agents/payments/agentic-payments.md +0 -126
  21. package/.claude/agents/sona/sona-learning-optimizer.md +0 -74
  22. package/.claude/agents/sublinear/consensus-coordinator.md +0 -338
  23. package/.claude/agents/sublinear/matrix-optimizer.md +0 -185
  24. package/.claude/agents/sublinear/pagerank-analyzer.md +0 -299
  25. package/.claude/agents/sublinear/performance-optimizer.md +0 -368
  26. package/.claude/agents/sublinear/trading-predictor.md +0 -246
  27. package/.claude/agents/testing/unit/tdd-london-swarm.md +0 -244
  28. package/.claude/agents/testing/validation/production-validator.md +0 -395
  29. package/.claude/agents/v3/database-specialist.yaml +0 -21
  30. package/.claude/agents/v3/index.yaml +0 -17
  31. package/.claude/agents/v3/project-coordinator.yaml +0 -15
  32. package/.claude/agents/v3/python-specialist.yaml +0 -21
  33. package/.claude/agents/v3/test-architect.yaml +0 -20
  34. package/.claude/agents/v3/typescript-specialist.yaml +0 -21
  35. package/.claude/agents/v3/v3-integration-architect.md +0 -346
  36. package/.claude/agents/v3/v3-memory-specialist.md +0 -318
  37. package/.claude/agents/v3/v3-performance-engineer.md +0 -397
  38. package/.claude/agents/v3/v3-queen-coordinator.md +0 -98
  39. package/.claude/agents/v3/v3-security-architect.md +0 -174
  40. package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +0 -54
  41. package/.claude/commands/analysis/README.md +0 -9
  42. package/.claude/commands/analysis/bottleneck-detect.md +0 -162
  43. package/.claude/commands/analysis/performance-bottlenecks.md +0 -59
  44. package/.claude/commands/analysis/performance-report.md +0 -25
  45. package/.claude/commands/analysis/token-efficiency.md +0 -45
  46. package/.claude/commands/analysis/token-usage.md +0 -25
  47. package/.claude/commands/automation/README.md +0 -9
  48. package/.claude/commands/automation/auto-agent.md +0 -122
  49. package/.claude/commands/automation/self-healing.md +0 -106
  50. package/.claude/commands/automation/session-memory.md +0 -90
  51. package/.claude/commands/automation/smart-agents.md +0 -73
  52. package/.claude/commands/automation/smart-spawn.md +0 -25
  53. package/.claude/commands/automation/workflow-select.md +0 -25
  54. package/.claude/commands/coordination/README.md +0 -9
  55. package/.claude/commands/coordination/agent-spawn.md +0 -25
  56. package/.claude/commands/coordination/init.md +0 -44
  57. package/.claude/commands/coordination/orchestrate.md +0 -43
  58. package/.claude/commands/coordination/spawn.md +0 -45
  59. package/.claude/commands/coordination/swarm-init.md +0 -85
  60. package/.claude/commands/coordination/task-orchestrate.md +0 -25
  61. package/.claude/commands/flow-nexus/app-store.md +0 -124
  62. package/.claude/commands/flow-nexus/challenges.md +0 -120
  63. package/.claude/commands/flow-nexus/login-registration.md +0 -65
  64. package/.claude/commands/flow-nexus/neural-network.md +0 -134
  65. package/.claude/commands/flow-nexus/payments.md +0 -116
  66. package/.claude/commands/flow-nexus/sandbox.md +0 -83
  67. package/.claude/commands/flow-nexus/swarm.md +0 -87
  68. package/.claude/commands/flow-nexus/user-tools.md +0 -152
  69. package/.claude/commands/flow-nexus/workflow.md +0 -115
  70. package/.claude/commands/monitoring/README.md +0 -9
  71. package/.claude/commands/monitoring/agent-metrics.md +0 -25
  72. package/.claude/commands/monitoring/agents.md +0 -44
  73. package/.claude/commands/monitoring/real-time-view.md +0 -25
  74. package/.claude/commands/monitoring/status.md +0 -46
  75. package/.claude/commands/monitoring/swarm-monitor.md +0 -25
  76. package/.claude/commands/optimization/README.md +0 -9
  77. package/.claude/commands/optimization/auto-topology.md +0 -62
  78. package/.claude/commands/optimization/cache-manage.md +0 -25
  79. package/.claude/commands/optimization/parallel-execute.md +0 -25
  80. package/.claude/commands/optimization/parallel-execution.md +0 -50
  81. package/.claude/commands/optimization/topology-optimize.md +0 -25
  82. package/.claude/commands/pair/README.md +0 -261
  83. package/.claude/commands/pair/commands.md +0 -546
  84. package/.claude/commands/pair/config.md +0 -510
  85. package/.claude/commands/pair/examples.md +0 -512
  86. package/.claude/commands/pair/modes.md +0 -348
  87. package/.claude/commands/pair/session.md +0 -407
  88. package/.claude/commands/pair/start.md +0 -209
  89. package/.claude/commands/stream-chain/pipeline.md +0 -121
  90. package/.claude/commands/stream-chain/run.md +0 -70
  91. package/.claude/commands/training/README.md +0 -9
  92. package/.claude/commands/training/model-update.md +0 -25
  93. package/.claude/commands/training/neural-patterns.md +0 -74
  94. package/.claude/commands/training/neural-train.md +0 -25
  95. package/.claude/commands/training/pattern-learn.md +0 -25
  96. package/.claude/commands/training/specialization.md +0 -63
  97. package/.claude/commands/truth/start.md +0 -143
  98. package/.claude/commands/verify/check.md +0 -50
  99. package/.claude/commands/verify/start.md +0 -128
  100. package/.claude/helpers/gate-hook.mjs +0 -50
  101. package/.claude/helpers/gate.cjs +0 -138
  102. package/.claude/helpers/hook-handler.cjs +0 -83
  103. package/.claude/helpers/prompt-hook.mjs +0 -72
  104. package/.claude/scripts/build-embeddings.mjs +0 -549
  105. package/.claude/scripts/generate-code-map.mjs +0 -697
  106. package/.claude/scripts/hooks.mjs +0 -656
  107. package/.claude/scripts/index-guidance.mjs +0 -893
  108. package/.claude/scripts/index-tests.mjs +0 -710
  109. package/.claude/scripts/semantic-search.mjs +0 -473
  110. package/.claude/scripts/session-start-launcher.mjs +0 -226
  111. package/.claude/skills/agentic-jujutsu/SKILL.md +0 -645
  112. package/.claude/skills/dual-mode/README.md +0 -71
  113. package/.claude/skills/dual-mode/dual-collect.md +0 -103
  114. package/.claude/skills/dual-mode/dual-coordinate.md +0 -85
  115. package/.claude/skills/dual-mode/dual-spawn.md +0 -81
  116. package/.claude/skills/flow-nexus-neural/SKILL.md +0 -738
  117. package/.claude/skills/flow-nexus-platform/SKILL.md +0 -1157
  118. package/.claude/skills/flow-nexus-swarm/SKILL.md +0 -610
  119. package/.claude/skills/pair-programming/SKILL.md +0 -1202
  120. package/.claude/skills/stream-chain/SKILL.md +0 -563
  121. package/.claude/skills/v3-cli-modernization/SKILL.md +0 -872
  122. package/.claude/skills/v3-core-implementation/SKILL.md +0 -797
  123. package/.claude/skills/v3-ddd-architecture/SKILL.md +0 -442
  124. package/.claude/skills/v3-integration-deep/SKILL.md +0 -241
  125. package/.claude/skills/v3-mcp-optimization/SKILL.md +0 -777
  126. package/.claude/skills/v3-memory-unification/SKILL.md +0 -174
  127. package/.claude/skills/v3-performance-optimization/SKILL.md +0 -390
  128. package/.claude/skills/v3-security-overhaul/SKILL.md +0 -82
  129. package/.claude/skills/v3-swarm-coordination/SKILL.md +0 -340
  130. package/.claude-plugin/README.md +0 -720
  131. package/.claude-plugin/docs/INSTALLATION.md +0 -261
  132. package/.claude-plugin/docs/PLUGIN_SUMMARY.md +0 -361
  133. package/.claude-plugin/docs/QUICKSTART.md +0 -361
  134. package/.claude-plugin/docs/STRUCTURE.md +0 -128
  135. package/.claude-plugin/hooks/hooks.json +0 -74
  136. package/.claude-plugin/marketplace.json +0 -96
  137. package/.claude-plugin/plugin.json +0 -71
  138. package/.claude-plugin/scripts/install.sh +0 -234
  139. package/.claude-plugin/scripts/uninstall.sh +0 -36
  140. package/.claude-plugin/scripts/verify.sh +0 -108
@@ -1,70 +0,0 @@
1
- # stream-chain run
2
-
3
- Execute a custom stream chain with your own prompts.
4
-
5
- ## Usage
6
-
7
- ```bash
8
- claude-flow stream-chain run <prompt1> <prompt2> [...] [options]
9
- ```
10
-
11
- Minimum 2 prompts required for chaining.
12
-
13
- ## Options
14
-
15
- - `--verbose` - Show detailed execution information
16
- - `--timeout <seconds>` - Timeout per step (default: 30)
17
- - `--debug` - Enable debug mode
18
-
19
- ## How It Works
20
-
21
- Each prompt in the chain receives the complete output from the previous step as context, enabling complex multi-step workflows.
22
-
23
- ## Examples
24
-
25
- ### Basic Chain
26
- ```bash
27
- claude-flow stream-chain run \
28
- "Write a function" \
29
- "Add tests for it"
30
- ```
31
-
32
- ### Complex Workflow
33
- ```bash
34
- claude-flow stream-chain run \
35
- "Analyze the authentication system" \
36
- "Identify security vulnerabilities" \
37
- "Propose fixes with priority levels" \
38
- "Implement the critical fixes" \
39
- "Generate tests for the fixes"
40
- ```
41
-
42
- ### With Options
43
- ```bash
44
- claude-flow stream-chain run \
45
- "Complex analysis task" \
46
- "Detailed implementation" \
47
- --timeout 60 \
48
- --verbose
49
- ```
50
-
51
- ## Context Preservation
52
-
53
- The output from each step is injected into the next prompt:
54
-
55
- ```
56
- Step 1: "Write a sorting function"
57
- Output: [function code]
58
-
59
- Step 2 receives: "Previous step output:
60
- [function code]
61
-
62
- Next step: Optimize for performance"
63
- ```
64
-
65
- ## Best Practices
66
-
67
- 1. **Clear Instructions**: Make each prompt specific
68
- 2. **Logical Flow**: Order prompts in logical sequence
69
- 3. **Appropriate Timeouts**: Increase for complex tasks
70
- 4. **Verification**: Add verification steps in chain
@@ -1,9 +0,0 @@
1
- # Training Commands
2
-
3
- Commands for training operations in Claude Flow.
4
-
5
- ## Available Commands
6
-
7
- - [neural-train](./neural-train.md)
8
- - [pattern-learn](./pattern-learn.md)
9
- - [model-update](./model-update.md)
@@ -1,25 +0,0 @@
1
- # model-update
2
-
3
- Update neural models with new data.
4
-
5
- ## Usage
6
- ```bash
7
- npx claude-flow training model-update [options]
8
- ```
9
-
10
- ## Options
11
- - `--model <name>` - Model to update
12
- - `--incremental` - Incremental update
13
- - `--validate` - Validate after update
14
-
15
- ## Examples
16
- ```bash
17
- # Update all models
18
- npx claude-flow training model-update
19
-
20
- # Specific model
21
- npx claude-flow training model-update --model agent-selector
22
-
23
- # Incremental with validation
24
- npx claude-flow training model-update --incremental --validate
25
- ```
@@ -1,74 +0,0 @@
1
- # Neural Pattern Training
2
-
3
- ## Purpose
4
- Continuously improve coordination through neural network learning.
5
-
6
- ## How Training Works
7
-
8
- ### 1. Automatic Learning
9
- Every successful operation trains the neural networks:
10
- - Edit patterns for different file types
11
- - Search strategies that find results faster
12
- - Task decomposition approaches
13
- - Agent coordination patterns
14
-
15
- ### 2. Manual Training
16
- ```
17
- Tool: mcp__moflo__neural_train
18
- Parameters: {
19
- "pattern_type": "coordination",
20
- "training_data": "successful task patterns",
21
- "epochs": 50
22
- }
23
- ```
24
-
25
- ### 3. Pattern Types
26
-
27
- **Cognitive Patterns:**
28
- - Convergent: Focused problem-solving
29
- - Divergent: Creative exploration
30
- - Lateral: Alternative approaches
31
- - Systems: Holistic thinking
32
- - Critical: Analytical evaluation
33
- - Abstract: High-level design
34
-
35
- ### 4. Improvement Tracking
36
- ```
37
- Tool: mcp__moflo__neural_status
38
- Result: {
39
- "patterns": {
40
- "convergent": 0.92,
41
- "divergent": 0.87,
42
- "lateral": 0.85
43
- },
44
- "improvement": "5.3% since last session",
45
- "confidence": 0.89
46
- }
47
- ```
48
-
49
- ## Pattern Analysis
50
- ```
51
- Tool: mcp__moflo__neural_patterns
52
- Parameters: {
53
- "action": "analyze",
54
- "operation": "recent_edits"
55
- }
56
- ```
57
-
58
- ## Benefits
59
- - 🧠 Learns your coding style
60
- - 📈 Improves with each use
61
- - 🎯 Better task predictions
62
- - ⚡ Faster coordination
63
-
64
- ## CLI Usage
65
- ```bash
66
- # Train neural patterns via CLI
67
- npx claude-flow neural train --type coordination --epochs 50
68
-
69
- # Check neural status
70
- npx claude-flow neural status
71
-
72
- # Analyze patterns
73
- npx claude-flow neural patterns --analyze
74
- ```
@@ -1,25 +0,0 @@
1
- # neural-train
2
-
3
- Train neural patterns from operations.
4
-
5
- ## Usage
6
- ```bash
7
- npx claude-flow training neural-train [options]
8
- ```
9
-
10
- ## Options
11
- - `--data <source>` - Training data source
12
- - `--model <name>` - Target model
13
- - `--epochs <n>` - Training epochs
14
-
15
- ## Examples
16
- ```bash
17
- # Train from recent ops
18
- npx claude-flow training neural-train --data recent
19
-
20
- # Specific model
21
- npx claude-flow training neural-train --model task-predictor
22
-
23
- # Custom epochs
24
- npx claude-flow training neural-train --epochs 100
25
- ```
@@ -1,25 +0,0 @@
1
- # pattern-learn
2
-
3
- Learn patterns from successful operations.
4
-
5
- ## Usage
6
- ```bash
7
- npx claude-flow training pattern-learn [options]
8
- ```
9
-
10
- ## Options
11
- - `--source <type>` - Pattern source
12
- - `--threshold <score>` - Success threshold
13
- - `--save <name>` - Save pattern set
14
-
15
- ## Examples
16
- ```bash
17
- # Learn from all ops
18
- npx claude-flow training pattern-learn
19
-
20
- # High success only
21
- npx claude-flow training pattern-learn --threshold 0.9
22
-
23
- # Save patterns
24
- npx claude-flow training pattern-learn --save optimal-patterns
25
- ```
@@ -1,63 +0,0 @@
1
- # Agent Specialization Training
2
-
3
- ## Purpose
4
- Train agents to become experts in specific domains for better performance.
5
-
6
- ## Specialization Areas
7
-
8
- ### 1. By File Type
9
- Agents automatically specialize based on file extensions:
10
- - **.js/.ts**: Modern JavaScript patterns
11
- - **.py**: Pythonic idioms
12
- - **.go**: Go best practices
13
- - **.rs**: Rust safety patterns
14
-
15
- ### 2. By Task Type
16
- ```
17
- Tool: mcp__moflo__agent_spawn
18
- Parameters: {
19
- "type": "coder",
20
- "capabilities": ["react", "typescript", "testing"],
21
- "name": "React Specialist"
22
- }
23
- ```
24
-
25
- ### 3. Training Process
26
- The system trains through:
27
- - Successful edit operations
28
- - Code review patterns
29
- - Error fix approaches
30
- - Performance optimizations
31
-
32
- ### 4. Specialization Benefits
33
- ```
34
- # Check agent specializations
35
- Tool: mcp__moflo__agent_list
36
- Parameters: {"swarmId": "current"}
37
-
38
- Result shows expertise levels:
39
- {
40
- "agents": [
41
- {
42
- "id": "coder-123",
43
- "specializations": {
44
- "javascript": 0.95,
45
- "react": 0.88,
46
- "testing": 0.82
47
- }
48
- }
49
- ]
50
- }
51
- ```
52
-
53
- ## Continuous Improvement
54
- Agents share learnings across sessions for cumulative expertise!
55
-
56
- ## CLI Usage
57
- ```bash
58
- # Train agent specialization via CLI
59
- npx claude-flow train agent --type coder --capabilities "react,typescript"
60
-
61
- # Check specializations
62
- npx claude-flow agent list --specializations
63
- ```
@@ -1,143 +0,0 @@
1
- # 📊 Truth Command
2
-
3
- View truth scores and reliability metrics for your codebase and agent tasks.
4
-
5
- ## Overview
6
-
7
- The `truth` command provides comprehensive insights into code quality, agent performance, and verification metrics.
8
-
9
- ## Usage
10
-
11
- ```bash
12
- claude-flow truth [options]
13
- ```
14
-
15
- ## Options
16
-
17
- - `--format <type>` - Output format: table (default), json, csv, html
18
- - `--period <time>` - Time period: 1h, 24h, 7d, 30d
19
- - `--agent <name>` - Filter by specific agent
20
- - `--threshold <0-1>` - Show only scores below threshold
21
- - `--export <file>` - Export metrics to file
22
- - `--watch` - Real-time monitoring mode
23
-
24
- ## Metrics Displayed
25
-
26
- ### Truth Scores
27
- - **Overall Score**: Aggregate truth score (0.0-1.0)
28
- - **File Scores**: Individual file truth ratings
29
- - **Agent Scores**: Per-agent reliability metrics
30
- - **Task Scores**: Task completion quality
31
-
32
- ### Trends
33
- - **Improvement Rate**: Quality trend over time
34
- - **Regression Detection**: Identifies declining scores
35
- - **Agent Learning**: Shows agent improvement curves
36
-
37
- ### Statistics
38
- - **Mean Score**: Average truth score
39
- - **Median Score**: Middle value of scores
40
- - **Standard Deviation**: Score consistency
41
- - **Confidence Interval**: Statistical reliability
42
-
43
- ## Examples
44
-
45
- ### Basic Usage
46
- ```bash
47
- # View current truth scores
48
- claude-flow truth
49
-
50
- # View scores for last 7 days
51
- claude-flow truth --period 7d
52
-
53
- # Export to HTML report
54
- claude-flow truth --export report.html --format html
55
- ```
56
-
57
- ### Advanced Analysis
58
- ```bash
59
- # Monitor real-time scores
60
- claude-flow truth --watch
61
-
62
- # Find problematic files
63
- claude-flow truth --threshold 0.8
64
-
65
- # Agent-specific metrics
66
- claude-flow truth --agent coder --period 24h
67
-
68
- # JSON for processing
69
- claude-flow truth --format json | jq '.overall_score'
70
- ```
71
-
72
- ## Dashboard View
73
-
74
- ```
75
- 📊 Truth Metrics Dashboard
76
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
77
-
78
- Overall Truth Score: 0.947 ✅
79
- Trend: ↗️ +2.3% (7d)
80
-
81
- Top Performers:
82
- verification-agent 0.982 ⭐
83
- code-analyzer 0.971 ⭐
84
- test-generator 0.958 ✅
85
-
86
- Needs Attention:
87
- refactor-agent 0.821 ⚠️
88
- docs-generator 0.794 ⚠️
89
-
90
- Recent Tasks:
91
- task-456 0.991 ✅ "Implement auth"
92
- task-455 0.967 ✅ "Add tests"
93
- task-454 0.743 ❌ "Refactor API"
94
- ```
95
-
96
- ## Integration
97
-
98
- ### With CI/CD
99
- ```yaml
100
- # GitHub Actions example
101
- - name: Check Truth Scores
102
- run: |
103
- claude-flow truth --format json > truth.json
104
- score=$(jq '.overall_score' truth.json)
105
- if (( $(echo "$score < 0.95" | bc -l) )); then
106
- echo "Truth score too low: $score"
107
- exit 1
108
- fi
109
- ```
110
-
111
- ### With Monitoring
112
- ```bash
113
- # Send to monitoring system
114
- claude-flow truth --format json | \
115
- curl -X POST https://metrics.example.com/api/truth \
116
- -H "Content-Type: application/json" \
117
- -d @-
118
- ```
119
-
120
- ## Configuration
121
-
122
- Set truth display preferences in `.claude-flow/config.json`:
123
-
124
- ```json
125
- {
126
- "truth": {
127
- "defaultFormat": "table",
128
- "defaultPeriod": "24h",
129
- "warningThreshold": 0.85,
130
- "criticalThreshold": 0.75,
131
- "autoExport": {
132
- "enabled": true,
133
- "path": ".claude-flow/metrics/truth-daily.json"
134
- }
135
- }
136
- }
137
- ```
138
-
139
- ## Related Commands
140
-
141
- - `verify` - Run verification checks
142
- - `pair` - Collaborative development with truth tracking
143
- - `report` - Generate detailed reports
@@ -1,50 +0,0 @@
1
- # verify check
2
-
3
- Run verification checks on code, tasks, or agent outputs.
4
-
5
- ## Usage
6
-
7
- ```bash
8
- claude-flow verify check [options]
9
- ```
10
-
11
- ## Options
12
-
13
- - `--file <path>` - Verify specific file
14
- - `--task <id>` - Verify task output
15
- - `--directory <path>` - Verify entire directory
16
- - `--threshold <0-1>` - Override default threshold (0.95)
17
- - `--auto-fix` - Attempt automatic fixes
18
- - `--json` - Output results as JSON
19
- - `--verbose` - Show detailed verification steps
20
-
21
- ## Examples
22
-
23
- ```bash
24
- # Basic file verification
25
- claude-flow verify check --file src/app.js
26
-
27
- # Verify with higher threshold
28
- claude-flow verify check --file src/critical.js --threshold 0.99
29
-
30
- # Verify and auto-fix issues
31
- claude-flow verify check --directory src/ --auto-fix
32
-
33
- # Get JSON output for CI/CD
34
- claude-flow verify check --json > verification.json
35
- ```
36
-
37
- ## Truth Scoring
38
-
39
- The check command evaluates:
40
- - Code correctness
41
- - Best practices adherence
42
- - Security vulnerabilities
43
- - Performance implications
44
- - Documentation completeness
45
-
46
- ## Exit Codes
47
-
48
- - `0` - Verification passed
49
- - `1` - Verification failed
50
- - `2` - Error during verification
@@ -1,128 +0,0 @@
1
- # 🔍 Verification Commands
2
-
3
- Truth verification system for ensuring code quality and correctness with a 0.95 accuracy threshold.
4
-
5
- ## Overview
6
-
7
- The verification system provides real-time truth checking and validation for all agent tasks, ensuring high-quality outputs and automatic rollback on failures.
8
-
9
- ## Subcommands
10
-
11
- ### `verify check`
12
- Run verification checks on current code or agent outputs.
13
-
14
- ```bash
15
- claude-flow verify check --file src/app.js
16
- claude-flow verify check --task "task-123"
17
- claude-flow verify check --threshold 0.98
18
- ```
19
-
20
- ### `verify rollback`
21
- Automatically rollback changes that fail verification.
22
-
23
- ```bash
24
- claude-flow verify rollback --to-commit abc123
25
- claude-flow verify rollback --last-good
26
- claude-flow verify rollback --interactive
27
- ```
28
-
29
- ### `verify report`
30
- Generate verification reports and metrics.
31
-
32
- ```bash
33
- claude-flow verify report --format json
34
- claude-flow verify report --export metrics.html
35
- claude-flow verify report --period 7d
36
- ```
37
-
38
- ### `verify dashboard`
39
- Launch interactive verification dashboard.
40
-
41
- ```bash
42
- claude-flow verify dashboard
43
- claude-flow verify dashboard --port 3000
44
- claude-flow verify dashboard --export
45
- ```
46
-
47
- ## Configuration
48
-
49
- Default threshold: **0.95** (95% accuracy required)
50
-
51
- Configure in `.claude-flow/config.json`:
52
- ```json
53
- {
54
- "verification": {
55
- "threshold": 0.95,
56
- "autoRollback": true,
57
- "gitIntegration": true,
58
- "hooks": {
59
- "preCommit": true,
60
- "preTask": true,
61
- "postEdit": true
62
- }
63
- }
64
- }
65
- ```
66
-
67
- ## Integration
68
-
69
- ### With Swarm Commands
70
- ```bash
71
- claude-flow swarm --verify --threshold 0.98
72
- claude-flow hive-mind --verify
73
- ```
74
-
75
- ### With Training Pipeline
76
- ```bash
77
- claude-flow train --verify --rollback-on-fail
78
- ```
79
-
80
- ### With Pair Programming
81
- ```bash
82
- claude-flow pair --verify --real-time
83
- ```
84
-
85
- ## Metrics
86
-
87
- - **Truth Score**: 0.0 to 1.0 (higher is better)
88
- - **Confidence Level**: Statistical confidence in verification
89
- - **Rollback Rate**: Percentage of changes rolled back
90
- - **Quality Improvement**: Trend over time
91
-
92
- ## Examples
93
-
94
- ### Basic Verification
95
- ```bash
96
- # Verify current directory
97
- claude-flow verify check
98
-
99
- # Verify with custom threshold
100
- claude-flow verify check --threshold 0.99
101
-
102
- # Verify and auto-fix
103
- claude-flow verify check --auto-fix
104
- ```
105
-
106
- ### Advanced Workflows
107
- ```bash
108
- # Continuous verification during development
109
- claude-flow verify watch --directory src/
110
-
111
- # Batch verification
112
- claude-flow verify batch --files "*.js" --parallel
113
-
114
- # Integration testing
115
- claude-flow verify integration --test-suite full
116
- ```
117
-
118
- ## Performance
119
-
120
- - Verification latency: <100ms for most checks
121
- - Rollback time: <1s for git-based rollback
122
- - Dashboard refresh: Real-time via WebSocket
123
-
124
- ## Related Commands
125
-
126
- - `truth` - View truth scores and metrics
127
- - `pair` - Collaborative development with verification
128
- - `train` - Training with verification feedback
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env node
2
- import { execSync } from 'child_process';
3
- import { resolve } from 'path';
4
-
5
- var command = process.argv[2];
6
- if (!command) process.exit(0);
7
-
8
- // Read stdin JSON from Claude Code
9
- var stdinData = '';
10
- try {
11
- stdinData = await new Promise(function(res) {
12
- var data = '';
13
- var timeout = setTimeout(function() { res(data); }, 500);
14
- process.stdin.setEncoding('utf-8');
15
- process.stdin.on('data', function(chunk) { data += chunk; });
16
- process.stdin.on('end', function() { clearTimeout(timeout); res(data); });
17
- process.stdin.on('error', function() { clearTimeout(timeout); res(''); });
18
- if (process.stdin.isTTY) { clearTimeout(timeout); res(''); }
19
- });
20
- } catch (e) { /* no stdin */ }
21
-
22
- var hookContext = {};
23
- try { if (stdinData.trim()) hookContext = JSON.parse(stdinData); } catch (e) {}
24
-
25
- // Pass tool info as env vars for gate.cjs
26
- var env = Object.assign({}, process.env);
27
- if (hookContext.tool_name) env.TOOL_NAME = hookContext.tool_name;
28
- if (hookContext.tool_input && typeof hookContext.tool_input === 'object') {
29
- Object.keys(hookContext.tool_input).forEach(function(key) {
30
- if (typeof hookContext.tool_input[key] === 'string') {
31
- env['TOOL_INPUT_' + key] = hookContext.tool_input[key];
32
- }
33
- });
34
- }
35
-
36
- // Run gate.cjs with the enriched environment
37
- var projectDir = (env.CLAUDE_PROJECT_DIR || process.cwd()).replace(/^\/([a-z])\//i, '$1:/');
38
- var gateScript = resolve(projectDir, '.claude/helpers/gate.cjs');
39
- try {
40
- var output = execSync('node "' + gateScript + '" ' + command, {
41
- env: env, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe']
42
- });
43
- if (output.trim()) process.stdout.write(output);
44
- process.exit(0);
45
- } catch (err) {
46
- // gate.cjs exit(2) = block, exit(1) = also block attempt — translate both to exit(2)
47
- if (err.stderr) process.stderr.write(err.stderr);
48
- if (err.stdout) process.stderr.write(err.stdout);
49
- process.exit(err.status === 2 || err.status === 1 ? 2 : 0);
50
- }