claude-flow-novice 2.14.13 → 2.14.15

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 (74) hide show
  1. package/.claude/commands/CFN_LOOP_TASK_MODE.md +7 -51
  2. package/.claude/commands/cfn-loop-cli.md +50 -125
  3. package/.claude/skills/cfn-agent-selector/SKILL.md +2 -2
  4. package/.claude/skills/cfn-agent-selector/select-agents.sh +0 -45
  5. package/.claude/skills/cfn-loop-orchestration/helpers/context-injection.sh +6 -69
  6. package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +0 -17
  7. package/README.md +2 -2
  8. package/claude-assets/agents/cfn-dev-team/CLAUDE.md +3 -3
  9. package/claude-assets/agents/cfn-dev-team/README.md +1 -1
  10. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +2 -2
  11. package/claude-assets/agents/cfn-dev-team/developers/README.md +3 -3
  12. package/claude-assets/agents/cfn-dev-team/documentation/agent-type-guidelines.md +1 -1
  13. package/claude-assets/agents/cfn-dev-team/test-agent.md +2 -2
  14. package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +7 -51
  15. package/claude-assets/commands/cfn-loop-cli.md +50 -125
  16. package/claude-assets/skills/cfn-agent-selector/SKILL.md +2 -2
  17. package/claude-assets/skills/cfn-agent-selector/select-agents.sh +0 -45
  18. package/claude-assets/skills/cfn-loop-orchestration/helpers/context-injection.sh +6 -69
  19. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +0 -17
  20. package/claude-assets/skills/cfn-multi-coordinator-planning/README.md +256 -0
  21. package/claude-assets/skills/cfn-multi-coordinator-planning/SKILL.md +62 -0
  22. package/claude-assets/skills/cfn-multi-coordinator-planning/map-dependencies-conflicts.sh +376 -0
  23. package/claude-assets/skills/cfn-multi-coordinator-planning/plan-coordinator-resources.sh +258 -0
  24. package/claude-assets/skills/cfn-multi-coordinator-planning/plan-multi-coordinator-work.sh +267 -0
  25. package/claude-assets/skills/cfn-multi-coordinator-planning/plan-risk-rollout.sh +350 -0
  26. package/claude-assets/skills/cfn-multi-coordinator-planning/test-multi-coordinator-planning.sh +338 -0
  27. package/claude-assets/skills/cfn-multi-coordinator-planning/validate-task-planning.sh +189 -0
  28. package/dist/agents/agent-loader.js +165 -146
  29. package/dist/agents/agent-loader.js.map +1 -1
  30. package/package.json +1 -1
  31. package/.claude/skills/cfn-agent-selector/SKILL.md.backup_before_replace +0 -91
  32. package/.claude/skills/cfn-loop-orchestration/helpers/validate-task-context.sh +0 -241
  33. package/.claude/skills/pre-edit-backup/backup.sh +0 -130
  34. package/.claude/skills/pre-edit-backup/cleanup.sh +0 -155
  35. package/.claude/skills/pre-edit-backup/restore.sh +0 -128
  36. package/.claude/skills/pre-edit-backup/revert-file.sh +0 -168
  37. package/claude-assets/agents/cfn-dev-team/CLAUDE.md.backup_before_replace +0 -1086
  38. package/claude-assets/agents/cfn-dev-team/README.md.backup_before_replace +0 -116
  39. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md.backup_before_replace +0 -451
  40. package/claude-assets/agents/cfn-dev-team/developers/README.md.backup_before_replace +0 -69
  41. package/claude-assets/agents/cfn-dev-team/documentation/agent-type-guidelines.md.backup_before_replace +0 -465
  42. package/claude-assets/agents/cfn-dev-team/test-agent.md.backup_before_replace +0 -141
  43. package/claude-assets/skills/CFN-LOOP-VALIDATION.md +0 -202
  44. package/claude-assets/skills/REDIS-COORDINATION.md +0 -187
  45. package/claude-assets/skills/SKILL.md +0 -229
  46. package/claude-assets/skills/agent-discovery/agents-registry.json +0 -484
  47. package/claude-assets/skills/agent-name-validation/README.md +0 -28
  48. package/claude-assets/skills/agent-name-validation/SKILL.md +0 -168
  49. package/claude-assets/skills/agent-name-validation/validate-agent-names.sh +0 -47
  50. package/claude-assets/skills/cfn-agent-selector/SKILL.md.backup_before_replace +0 -91
  51. package/claude-assets/skills/cfn-loop-orchestration/helpers/validate-task-context.sh +0 -241
  52. package/claude-assets/skills/consensus-calculator.js +0 -45
  53. package/claude-assets/skills/evidence-chain.sql +0 -66
  54. package/claude-assets/skills/hook-pipeline/bash-dependency-checker.sh +0 -89
  55. package/claude-assets/skills/hook-pipeline/bash-pipe-safety.sh +0 -69
  56. package/claude-assets/skills/hook-pipeline/enforce-lf.sh +0 -36
  57. package/claude-assets/skills/hook-pipeline/js-promise-safety.sh +0 -110
  58. package/claude-assets/skills/hook-pipeline/python-async-safety.py +0 -124
  59. package/claude-assets/skills/hook-pipeline/python-import-checker.py +0 -114
  60. package/claude-assets/skills/hook-pipeline/python-subprocess-safety.py +0 -77
  61. package/claude-assets/skills/hook-pipeline/rust-command-safety.sh +0 -38
  62. package/claude-assets/skills/hook-pipeline/rust-dependency-checker.sh +0 -50
  63. package/claude-assets/skills/hook-pipeline/rust-future-safety.sh +0 -50
  64. package/claude-assets/skills/pre-edit-backup/backup.sh +0 -130
  65. package/claude-assets/skills/pre-edit-backup/cleanup.sh +0 -155
  66. package/claude-assets/skills/pre-edit-backup/restore.sh +0 -128
  67. package/claude-assets/skills/pre-edit-backup/revert-file.sh +0 -168
  68. package/claude-assets/skills/run-all-skill-tests.sh +0 -124
  69. package/claude-assets/skills/seo-orchestration/SKILL.md +0 -292
  70. package/claude-assets/skills/seo-orchestration/orchestrate-seo.sh +0 -566
  71. package/claude-assets/skills/seo-orchestration/orchestrate-seo.sh.backup +0 -755
  72. package/claude-assets/skills/seo-orchestration/validate-consensus.sh +0 -270
  73. package/claude-assets/skills/team-provider-routing/execute-agent.sh +0 -76
  74. package/claude-assets/skills/test-execution-coordinator-pattern.md +0 -228
@@ -1,202 +0,0 @@
1
- ---
2
- name: cfn-loop-validation
3
- description: Automated validation skill for Claude Flow Novice CFN Loop with intelligent auto-retry mechanisms
4
- version: 1.0.0
5
- allowed-tools:
6
- - Bash
7
- - Task
8
- - TodoWrite
9
- - SQLite
10
- - Redis
11
- - Grep
12
-
13
- # Skill Taxonomy
14
- skill-type: validation
15
- complexity: advanced
16
- domain: ai-agent-orchestration
17
-
18
- # Validation Modes
19
- modes:
20
- - name: MVP
21
- gate-threshold: 0.65
22
- consensus-threshold: 0.85
23
- max-iterations: 5
24
- validators: 2
25
-
26
- - name: Standard
27
- gate-threshold: 0.75
28
- consensus-threshold: 0.90
29
- max-iterations: 10
30
- validators: 4
31
-
32
- - name: Enterprise
33
- gate-threshold: 0.85
34
- consensus-threshold: 0.95
35
- max-iterations: 15
36
- validators: 5
37
-
38
- ---
39
-
40
- # CFN Loop Validation Skill
41
-
42
- ## 1. Mode Selection & Thresholds
43
-
44
- ### Threshold Evaluation Matrix
45
-
46
- | Mode | Gate Threshold | Consensus | Max Iterations | Validators | Escalation |
47
- |------------|----------------|-----------|---------------|------------|------------|
48
- | MVP | ≥0.65 | ≥0.85 | 5 | 2 | Low |
49
- | Standard | ≥0.75 | ≥0.90 | 10 | 4 | Medium |
50
- | Enterprise | ≥0.85 | ≥0.95 | 15 | 5 | High |
51
-
52
- ## 2. Execution Pattern: Auto-Retry Bash Script
53
-
54
- ### Validation Script Template (`cfn-loop-validation.sh`)
55
-
56
- ```bash
57
- #!/usr/bin/env bash
58
-
59
- # CFN Loop Validation Script
60
- # Handles intelligent auto-retry with progressive complexity
61
-
62
- CFN_VALIDATION_MODE="${1:-standard}"
63
- MAX_ITERATIONS=10
64
- CURRENT_ITERATION=0
65
- CONSENSUS_THRESHOLD=0.90
66
- GATE_THRESHOLD=0.75
67
-
68
- # Validation Function
69
- validate_loop() {
70
- local task_id="$1"
71
- local mode="$2"
72
-
73
- # Invoke consensus calculator
74
- local validation_result=$(node consensus-calculator.js \
75
- --task-id "$task_id" \
76
- --mode "$mode")
77
-
78
- # Parse validation metrics
79
- local confidence=$(echo "$validation_result" | jq '.confidence')
80
- local consensus=$(echo "$validation_result" | jq '.consensus')
81
- local gate_score=$(echo "$validation_result" | jq '.gate_score')
82
-
83
- # Validation decision tree
84
- if (( $(echo "$confidence >= $CONSENSUS_THRESHOLD" | bc -l) )) &&
85
- (( $(echo "$gate_score >= $GATE_THRESHOLD" | bc -l) )); then
86
- return 0 # Success
87
- else
88
- return 1 # Retry needed
89
- }
90
- }
91
-
92
- # Main Validation Loop
93
- while [[ $CURRENT_ITERATION -lt $MAX_ITERATIONS ]]; do
94
- if validate_loop "$TASK_ID" "$CFN_VALIDATION_MODE"; then
95
- # Successful validation
96
- redis-cli lpush "swarm:validation:complete" \
97
- "$(jq -n \
98
- --arg task "$TASK_ID" \
99
- --arg mode "$CFN_VALIDATION_MODE" \
100
- '{task: $task, mode: $mode, status: "success"}')"
101
- exit 0
102
- else
103
- # Increment iteration, potential escalation
104
- CURRENT_ITERATION=$((CURRENT_ITERATION + 1))
105
-
106
- # Optional: Escalation strategy
107
- if [[ $CURRENT_ITERATION -ge $((MAX_ITERATIONS * 0.8)) ]]; then
108
- redis-cli lpush "swarm:validation:escalation" \
109
- "$(jq -n \
110
- --arg task "$TASK_ID" \
111
- --arg mode "$CFN_VALIDATION_MODE" \
112
- '{task: $task, mode: $mode, status: "escalate"}')"
113
- fi
114
-
115
- # Exponential backoff
116
- sleep $((2 ** CURRENT_ITERATION))
117
- fi
118
- done
119
-
120
- # Final failure state
121
- redis-cli lpush "swarm:validation:failure" \
122
- "$(jq -n \
123
- --arg task "$TASK_ID" \
124
- --arg mode "$CFN_VALIDATION_MODE" \
125
- '{task: $task, mode: $mode, status: "failure"}')"
126
- exit 1
127
- ```
128
-
129
- ## 3. Memory Integration: Evidence Chain
130
-
131
- ### SQLite Schema (`evidence-chain.sql`)
132
-
133
- ```sql
134
- -- Evidence Chain Schema for CFN Loop Validation
135
- CREATE TABLE validation_evidence (
136
- id INTEGER PRIMARY KEY AUTOINCREMENT,
137
- task_id TEXT NOT NULL,
138
- validation_mode TEXT NOT NULL,
139
- confidence REAL,
140
- consensus_score REAL,
141
- gate_score REAL,
142
- iteration INTEGER,
143
- timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
144
- status TEXT CHECK(status IN ('pending', 'success', 'retry', 'escalate', 'failure'))
145
- );
146
-
147
- CREATE INDEX idx_task_validation ON validation_evidence(task_id, validation_mode);
148
- ```
149
-
150
- ## 4. Consensus Calculator Interface
151
-
152
- ### `consensus-calculator.js`
153
-
154
- ```javascript
155
- const calculateConsensus = (taskMetrics) => {
156
- const {
157
- validatorScores,
158
- confidenceScores,
159
- gateways
160
- } = taskMetrics;
161
-
162
- const consensusScore = calculateWeightedConsensus(validatorScores);
163
- const confidenceScore = calculateConfidenceMetric(confidenceScores);
164
- const gateScore = calculateGatewayScore(gateways);
165
-
166
- return {
167
- consensus: consensusScore,
168
- confidence: confidenceScore,
169
- gate_score: gateScore,
170
- recommendation: decideNextAction(consensusScore, confidenceScore, gateScore)
171
- };
172
- };
173
-
174
- module.exports = { calculateConsensus };
175
- ```
176
-
177
- ## 5. Automatic Relaunch Logic
178
-
179
- ### Decision Matrix
180
-
181
- | Scenario | Condition | Action | Escalation Level |
182
- |----------|-----------|--------|-----------------|
183
- | Low Confidence | consensus < 0.75 | Retry | Low |
184
- | Medium Confidence | 0.75 ≤ consensus < 0.90 | Retry with Specialized Agents | Medium |
185
- | High Confidence Failure | consensus ≥ 0.90 but gate fails | Manual Review | High |
186
- | Persistent Failure | Max iterations reached | Escalate to Human | Critical |
187
-
188
- ## 6. Usage Example
189
-
190
- ```bash
191
- # Invoke validation for a task
192
- ./cfn-loop-validation.sh "task-auth-system" standard
193
- ```
194
-
195
- ## Performance & Telemetry
196
-
197
- - Average Execution Time: <500ms
198
- - Memory Footprint: <50MB
199
- - Redis Pub/Sub Latency: <100ms
200
- - SQLite Write Latency: <20ms
201
-
202
- ---
@@ -1,187 +0,0 @@
1
- # Redis Coordination Skill
2
-
3
- ## Metadata
4
- ```yaml
5
- name: redis-coordination
6
- description: Advanced Redis-based agent coordination and communication
7
- version: 1.1
8
- complexity: advanced
9
- allowed-tools:
10
- - Redis
11
- - SQLite
12
- - Bash
13
- - TypeScript
14
- constraints:
15
- - Low-latency communication
16
- - Persistent state management
17
- - Distributed consensus
18
- ```
19
-
20
- ## Overview
21
- Redis Coordination is a sophisticated communication and state management skill for multi-agent systems, enabling real-time, fault-tolerant interactions across distributed environments.
22
-
23
- ## 1. When to Use
24
-
25
- ### Topology Selection
26
- - **Mesh Network (2-7 agents)**:
27
- - Peer-to-peer communication
28
- - Low-complexity tasks
29
- - Direct channel subscriptions
30
-
31
- - **Hierarchical Network (8+ agents)**:
32
- - Centralized coordination
33
- - Complex, multi-stage workflows
34
- - Coordinator-mediated communication
35
-
36
- ### Decision Criteria
37
- ✅ Use Redis Coordination when:
38
- - Task requires real-time agent interactions
39
- - Agents need persistent state tracking
40
- - Work involves multiple independent/dependent steps
41
- - Fault tolerance is critical
42
- - Low-latency communication is required
43
-
44
- ❌ Avoid when:
45
- - Single-agent, linear tasks
46
- - Extremely low-compute environments
47
- - No persistent storage needed
48
-
49
- ## 2. Channel Naming Convention
50
-
51
- ### Fundamental Patterns
52
- ```bash
53
- # Swarm-level coordination
54
- swarm:{swarm_id}:coordination
55
-
56
- # Agent-specific channels
57
- agent:{agent_id}:feedback
58
- agent:{agent_id}:status
59
-
60
- # Task-specific channels
61
- task:{task_id}:progress
62
- task:{task_id}:results
63
- ```
64
-
65
- ### Advanced Namespacing
66
- ```bash
67
- # Complex task routing
68
- swarm:{project}:{phase}:{task_type}:coordination
69
- ```
70
-
71
- ## 3. Timeout & Resilience Handling
72
-
73
- ### Timeout Template
74
- ```bash
75
- # Basic timeout pattern
76
- timeout 300 redis-cli --csv blpop "channel:name" 0
77
-
78
- # Advanced timeout with fallback
79
- function redis_robust_pop() {
80
- local channel="$1"
81
- local timeout="${2:-300}"
82
- local fallback_action="${3:-continue}"
83
-
84
- result=$(timeout "$timeout" redis-cli --csv blpop "$channel" 0)
85
-
86
- if [ $? -ne 0 ]; then
87
- echo "TIMEOUT: Channel $channel unresponsive"
88
- case "$fallback_action" in
89
- "continue") return 0 ;;
90
- "retry") redis_robust_pop "$channel" "$timeout" ;;
91
- "abort") exit 1 ;;
92
- esac
93
- fi
94
- }
95
- ```
96
-
97
- ## 4. Consensus & Validation
98
-
99
- ### Confidence Thresholds
100
- - MVP Mode: Gate ≥0.65, Consensus ≥0.85
101
- - Standard Mode: Gate ≥0.75, Consensus ≥0.90
102
- - Enterprise Mode: Gate ≥0.85, Consensus ≥0.95
103
-
104
- ### Validation Workflow
105
- 1. Publish coordination message
106
- 2. Collect agent responses
107
- 3. Calculate consensus
108
- 4. Decide: Continue/Retry/Abort
109
-
110
- ## 5. Best Practices
111
-
112
- ### Performance Optimization
113
- - Use `LPUSH`/`RPOP` for queues
114
- - Implement short TTLs
115
- - Minimize payload size
116
- - Use pipeline for batch operations
117
-
118
- ### Security Considerations
119
- - Use Redis ACLs
120
- - Encrypt sensitive payloads
121
- - Validate all incoming messages
122
- - Implement rate limiting
123
-
124
- ## 6. Error Handling
125
-
126
- ### Common Failure Modes
127
- - Network interruption
128
- - Redis connection loss
129
- - Timeout scenarios
130
- - Partial task completion
131
-
132
- ### Recommended Mitigation
133
- ```bash
134
- # Resilient Redis interaction
135
- function safe_redis_publish() {
136
- local channel="$1"
137
- local message="$2"
138
-
139
- max_retries=3
140
- retry_delay=1
141
-
142
- for ((i=1; i<=max_retries; i++)); do
143
- redis-cli PUBLISH "$channel" "$message"
144
- if [ $? -eq 0 ]; then
145
- return 0
146
- fi
147
-
148
- echo "Publish attempt $i failed. Retrying in $retry_delay seconds..."
149
- sleep "$retry_delay"
150
- retry_delay=$((retry_delay * 2))
151
- done
152
-
153
- echo "Fatal: Unable to publish message after $max_retries attempts"
154
- return 1
155
- }
156
- ```
157
-
158
- ## 7. Monitoring & Metrics
159
-
160
- ### Key Performance Indicators
161
- - Message latency
162
- - Successful publish rate
163
- - Consensus achievement time
164
- - Error rate
165
-
166
- ### Recommended Logging
167
- ```json
168
- {
169
- "timestamp": "2025-10-18T12:34:56Z",
170
- "swarm_id": "skills-sprint-1.1",
171
- "event_type": "coordination",
172
- "status": "success",
173
- "latency_ms": 42,
174
- "consensus_score": 0.92
175
- }
176
- ```
177
-
178
- ## Resources
179
- - Redis Documentation
180
- - Distributed Systems Design Patterns
181
- - High Performance Redis Techniques
182
-
183
- ---
184
-
185
- ✅ Skill Status: Active
186
- 📅 Last Updated: 2025-10-18
187
- 🔬 Complexity Level: Advanced
@@ -1,229 +0,0 @@
1
- # Hook Pipeline Auto-Resolution Skill
2
-
3
- ## DEPRECATED - CONSOLIDATED INTO HOOK PIPELINE SKILL
4
-
5
- **Status:** This skill has been consolidated into the main Hook Pipeline skill.
6
-
7
- **Reason:** Auto-resolution is an integral part of the post-edit validation workflow, not a separate skill. The feedback-resolver.sh implementation already exists in the Hook Pipeline directory and works in concert with post-edit-handler.sh.
8
-
9
- **Migration Path:**
10
- - All auto-resolution functionality is now documented in: `.claude/skills/hook-pipeline/SKILL.md`
11
- - Use the convenience wrapper: `.claude/skills/hook-pipeline/auto-resolve.sh`
12
- - Original implementation: `.claude/skills/hook-pipeline/feedback-resolver.sh`
13
-
14
- ## Quick Reference
15
-
16
- ### Old Usage (DEPRECATED)
17
- ```bash
18
- # This documentation is outdated
19
- ```
20
-
21
- ### New Usage (CURRENT)
22
- ```bash
23
- # Resolve most recent feedback
24
- ./.claude/skills/hook-pipeline/auto-resolve.sh
25
-
26
- # Resolve with auto-fix enabled
27
- ./.claude/skills/hook-pipeline/auto-resolve.sh --auto-fix
28
-
29
- # Resolve specific feedback type
30
- ./.claude/skills/hook-pipeline/auto-resolve.sh --type ROOT_WARNING --auto-fix
31
- ```
32
-
33
- ## Complete Documentation
34
-
35
- See: `.claude/skills/hook-pipeline/SKILL.md` - Section "Automatic Feedback Resolution"
36
-
37
- ## Components Now Located In Hook Pipeline
38
-
39
- | Component | Location |
40
- |-----------|----------|
41
- | Auto-resolver | `.claude/skills/hook-pipeline/feedback-resolver.sh` |
42
- | Convenience wrapper | `.claude/skills/hook-pipeline/auto-resolve.sh` |
43
- | Post-edit handler | `.claude/skills/hook-pipeline/post-edit-handler.sh` |
44
- | Documentation | `.claude/skills/hook-pipeline/SKILL.md` |
45
-
46
- ---
47
-
48
- ## Legacy Documentation (For Historical Reference Only)
49
-
50
- The content below is preserved for historical reference but should NOT be used. Refer to Hook Pipeline SKILL.md instead.
51
-
52
- <details>
53
- <summary>Click to view legacy documentation</summary>
54
-
55
- ## Metadata (OUTDATED)
56
- ```yaml
57
- name: hook-pipeline-auto-resolver
58
- version: 1.0.0
59
- description: Automatic resolution for post-edit hook feedback
60
- type: system-skill
61
- allowed-tools:
62
- - Bash
63
- - Read
64
- - Edit
65
- - Grep
66
- configuration:
67
- max-retry-attempts: 3
68
- default-timeout: 300ms
69
- ```
70
-
71
- ## 1. Architectural Decision Record (OUTDATED)
72
-
73
- ### Context
74
- - Complex multi-agent workflows require intelligent, automatic feedback resolution
75
- - Minimize manual intervention in common error scenarios
76
- - Provide clear, actionable feedback for agents
77
-
78
- ### Decision
79
- Implement a hierarchical, type-based auto-resolution skill with progressive complexity and Redis-backed communication.
80
-
81
- ### Consequences
82
- - Reduced manual oversight
83
- - Standardized error handling
84
- - Enhanced system resilience
85
- - Minimal performance overhead
86
-
87
- ## 2. Automatic Execution Workflow
88
-
89
- ### 2.1 Hook Trigger Sequence
90
- ```bash
91
- #!/bin/bash
92
- # post-edit-handler.sh
93
- set -euo pipefail
94
-
95
- FILE_PATH="${1:-}"
96
- MEMORY_KEY="${2:-swarm/default}"
97
-
98
- # Validate input
99
- [[ -z "$FILE_PATH" ]] && {
100
- echo "Error: No file path provided" >&2
101
- exit 1
102
- }
103
-
104
- # Run feedback resolver
105
- /bin/bash /config/hooks/feedback-resolver.sh "$FILE_PATH" "$MEMORY_KEY"
106
- ```
107
-
108
- ### 2.2 Execution Phases
109
- 1. File modification detected
110
- 2. Post-edit hook triggered
111
- 3. Feedback resolver analyzes file
112
- 4. Auto-resolution attempted
113
- 5. Optional human intervention
114
-
115
- ## 3. Feedback Types Priority Matrix
116
-
117
- | Type | Severity | Auto-Resolution | Human Intervention |
118
- |------|----------|-----------------|-------------------|
119
- | ROOT_WARNING | High | Auto-move | Optional review |
120
- | TDD_VIOLATION | High | Generate test scaffolding | Code review required |
121
- | LOW_COVERAGE | Medium | Generate additional tests | Optional optimization |
122
- | RUST_QUALITY | Medium | Apply auto-linting | Style guide alignment |
123
- | LINT_ISSUES | Low | Auto-fix via ESLint | Optional refinement |
124
-
125
- ## 4. ROOT_WARNING Handling
126
-
127
- ### 4.1 Auto-Move Script
128
- ```bash
129
- #!/bin/bash
130
- # auto-move-handler.sh
131
- handle_root_warning() {
132
- local file_path="$1"
133
- local filename=$(basename "$file_path")
134
-
135
- # Predefined move destinations
136
- declare -A destinations=(
137
- ["*.js"]="src/"
138
- ["*.ts"]="src/"
139
- ["*.md"]="docs/"
140
- ["*.test.js"]="tests/"
141
- ["*.config.js"]="config/"
142
- )
143
-
144
- for pattern in "${!destinations[@]}"; do
145
- if [[ "$filename" == $pattern ]]; then
146
- destination="${destinations[$pattern]}"
147
- mv "$file_path" "$destination$filename"
148
- echo "Moved $filename to $destination"
149
- return 0
150
- fi
151
- done
152
-
153
- # Fallback: generate warning
154
- redis-cli publish "agent:feedback" "{
155
- \"type\": \"ROOT_WARNING\",
156
- \"file\": \"$file_path\",
157
- \"message\": \"Unable to auto-resolve file location\"
158
- }"
159
- }
160
- ```
161
-
162
- ## 5. TDD_VIOLATION Handling
163
-
164
- ### 5.1 Test Generation Strategy
165
- ```bash
166
- #!/bin/bash
167
- # tdd-violation-handler.sh
168
- generate_test_scaffold() {
169
- local source_file="$1"
170
- local test_file="${source_file/.js/.test.js}"
171
-
172
- # Basic test scaffold generation
173
- cat > "$test_file" <<EOF
174
- import { describe, it, expect } from 'vitest'
175
- import { $(basename "${source_file%.*}") } from '$source_file'
176
-
177
- describe('${source_file}', () => {
178
- it('should have basic test coverage', () => {
179
- // TODO: Implement specific tests
180
- expect(true).toBe(true)
181
- })
182
- })
183
- EOF
184
- }
185
- ```
186
-
187
- ## 6. Redis Feedback Integration
188
-
189
- ### 6.1 CLI Subscription Pattern
190
- ```bash
191
- #!/bin/bash
192
- # redis-feedback-subscriber.sh
193
- redis-cli subscribe "agent:feedback" | while read -r event; do
194
- case "$event" in
195
- *ROOT_WARNING*)
196
- handle_root_warning "$event"
197
- ;;
198
- *TDD_VIOLATION*)
199
- generate_test_scaffold "$event"
200
- ;;
201
- # Additional handlers
202
- esac
203
- done
204
- ```
205
-
206
- ## 7. Confidence and Performance Metrics
207
-
208
- ```json
209
- {
210
- "skill_confidence": 0.87,
211
- "resolution_success_rate": 0.92,
212
- "avg_resolution_time_ms": 42,
213
- "total_auto_resolutions": 1247
214
- }
215
- ```
216
-
217
- ## 8. Deployment and Configuration
218
-
219
- ### Installation
220
- ```bash
221
- npm install @claude-flow/hook-resolver
222
- claude-flow hooks install post-edit-resolver
223
- ```
224
-
225
- ## 9. Future Improvements
226
- - Machine learning-based resolution recommendations
227
- - Expanded pattern matching
228
- - More granular feedback types
229
- - Enhanced test generation