claude-flow-novice 2.15.7 → 2.15.9

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 (52) hide show
  1. package/.claude/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +1 -1
  2. package/.claude/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +13 -11
  3. package/.claude/skills/cfn-loop-orchestration/helpers/consensus-ts.sh +104 -0
  4. package/.claude/skills/cfn-loop-orchestration/helpers/deliverable-verifier-ts.sh +123 -0
  5. package/.claude/skills/cfn-loop-orchestration/helpers/iteration-manager-ts.sh +89 -0
  6. package/.claude/skills/cfn-loop-orchestration/helpers/timeout-calculator-ts.sh +47 -0
  7. package/.claude/skills/cfn-loop-orchestration/src/helpers/deliverable-verifier.ts +103 -0
  8. package/.claude/skills/cfn-loop-orchestration/src/helpers/iteration-manager.ts +45 -0
  9. package/.claude/skills/cfn-loop-orchestration/src/helpers/timeout-calculator.ts +41 -0
  10. package/.claude/skills/cfn-loop-orchestration/tests/consensus.test.ts +1 -1
  11. package/.claude/skills/cfn-loop-orchestration/tests/deliverable-verifier.test.ts +1 -3
  12. package/.claude/skills/cfn-loop-orchestration/tests/iteration-manager.test.ts +1 -1
  13. package/.claude/skills/cfn-redis-coordination/report-completion.sh +55 -10
  14. package/.claude/skills/cfn-redis-coordination/store-context.sh +31 -1
  15. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +6 -1
  16. package/claude-assets/agents/cfn-dev-team/coordinators/consensus-builder.md +6 -1
  17. package/claude-assets/agents/cfn-dev-team/coordinators/handoff-coordinator.md +6 -1
  18. package/claude-assets/agents/cfn-dev-team/coordinators/multi-sprint-coordinator.md +6 -1
  19. package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +18 -8
  20. package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +18 -8
  21. package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +18 -8
  22. package/claude-assets/agents/cfn-dev-team/developers/backend-developer.md +17 -7
  23. package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +17 -8
  24. package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +18 -8
  25. package/claude-assets/agents/cfn-dev-team/reviewers/code-reviewer.md +9 -5
  26. package/claude-assets/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +13 -6
  27. package/claude-assets/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +13 -6
  28. package/claude-assets/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +13 -6
  29. package/claude-assets/agents/cfn-dev-team/reviewers/quality/security-specialist.md +15 -5
  30. package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +9 -5
  31. package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +8 -4
  32. package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +16 -13
  33. package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +9 -5
  34. package/claude-assets/agents/cfn-dev-team/testers/tester.md +9 -5
  35. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +1 -1
  36. package/claude-assets/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +13 -11
  37. package/claude-assets/skills/cfn-loop-orchestration/helpers/consensus-ts.sh +104 -0
  38. package/claude-assets/skills/cfn-loop-orchestration/helpers/deliverable-verifier-ts.sh +123 -0
  39. package/claude-assets/skills/cfn-loop-orchestration/helpers/iteration-manager-ts.sh +89 -0
  40. package/claude-assets/skills/cfn-loop-orchestration/helpers/timeout-calculator-ts.sh +47 -0
  41. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/consensus.ts +87 -0
  42. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/deliverable-verifier.ts +103 -0
  43. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/iteration-manager.ts +45 -0
  44. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/timeout-calculator.ts +41 -0
  45. package/claude-assets/skills/cfn-loop-orchestration/tests/consensus.test.ts +1 -1
  46. package/claude-assets/skills/cfn-loop-orchestration/tests/deliverable-verifier.test.ts +1 -3
  47. package/claude-assets/skills/cfn-loop-orchestration/tests/iteration-manager.test.ts +1 -1
  48. package/claude-assets/skills/cfn-redis-coordination/report-completion.sh +55 -10
  49. package/claude-assets/skills/cfn-redis-coordination/store-context.sh +31 -1
  50. package/dist/cli/config-manager.js +109 -91
  51. package/dist/cli/config-manager.js.map +1 -1
  52. package/package.json +1 -1
@@ -2,7 +2,10 @@
2
2
  # Report agent completion and confidence to Redis
3
3
  # Replaces deprecated invoke-waiting-mode.sh for CFN Loop coordination
4
4
  #
5
- # Usage: report-completion.sh --task-id <id> --agent-id <id> --confidence <0.0-1.0> [--result <json>]
5
+ # Usage:
6
+ # report-completion.sh --task-id <id> --agent-id <id> --confidence <0.0-1.0>
7
+ # [--iteration <n>] [--namespace <ns>] [--result <json>]
8
+ # [--test-pass-rate <pct>] [--tests-run <n>] [--tests-passed <n>]
6
9
 
7
10
  set -euo pipefail
8
11
 
@@ -16,6 +19,10 @@ AGENT_ID=""
16
19
  CONFIDENCE=""
17
20
  RESULT=""
18
21
  ITERATION="1"
22
+ NAMESPACE="swarm"
23
+ TEST_PASS_RATE=""
24
+ TESTS_RUN=""
25
+ TESTS_PASSED=""
19
26
 
20
27
  while [[ $# -gt 0 ]]; do
21
28
  case $1 in
@@ -39,6 +46,22 @@ while [[ $# -gt 0 ]]; do
39
46
  ITERATION="$2"
40
47
  shift 2
41
48
  ;;
49
+ --namespace)
50
+ NAMESPACE="$2"
51
+ shift 2
52
+ ;;
53
+ --test-pass-rate)
54
+ TEST_PASS_RATE="$2"
55
+ shift 2
56
+ ;;
57
+ --tests-run)
58
+ TESTS_RUN="$2"
59
+ shift 2
60
+ ;;
61
+ --tests-passed)
62
+ TESTS_PASSED="$2"
63
+ shift 2
64
+ ;;
42
65
  *)
43
66
  echo "Unknown option: $1" >&2
44
67
  exit 1
@@ -51,7 +74,9 @@ done
51
74
  # Wrapper provides graceful Task mode fallback when Redis unavailable
52
75
  if [ -z "$TASK_ID" ] || [ -z "$AGENT_ID" ] || [ -z "$CONFIDENCE" ]; then
53
76
  echo "Error: Missing required parameters" >&2
54
- echo "Usage: $0 --task-id <id> --agent-id <id> --confidence <0.0-1.0> [--result <json>] [--iteration <n>]" >&2
77
+ echo "Usage: $0 --task-id <id> --agent-id <id> --confidence <0.0-1.0>" >&2
78
+ echo " [--iteration <n>] [--namespace <ns>] [--result <json>]" >&2
79
+ echo " [--test-pass-rate <pct>] [--tests-run <n>] [--tests-passed <n>]" >&2
55
80
  exit 1
56
81
  fi
57
82
 
@@ -66,24 +91,44 @@ fi
66
91
  # Measured improvement: ~62% coordination overhead reduction in standard mode
67
92
  {
68
93
  echo "MULTI"
69
- echo "LPUSH swarm:${TASK_ID}:${AGENT_ID}:done complete"
70
- echo "SET swarm:${TASK_ID}:${AGENT_ID}:confidence $CONFIDENCE EX 3600"
94
+ echo "LPUSH ${NAMESPACE}:${TASK_ID}:${AGENT_ID}:done complete"
95
+ echo "SET ${NAMESPACE}:${TASK_ID}:${AGENT_ID}:confidence $CONFIDENCE EX 3600"
96
+
97
+ # Build result hash with test metrics if provided
98
+ RESULT_HASH_ARGS="confidence $CONFIDENCE iteration $ITERATION"
71
99
 
72
100
  if [ -n "$RESULT" ]; then
73
- echo "HSET swarm:${TASK_ID}:${AGENT_ID}:result confidence $CONFIDENCE iteration $ITERATION result $RESULT timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)"
74
- else
75
- echo "HSET swarm:${TASK_ID}:${AGENT_ID}:result confidence $CONFIDENCE iteration $ITERATION timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)"
101
+ RESULT_HASH_ARGS="$RESULT_HASH_ARGS result $RESULT"
76
102
  fi
77
103
 
104
+ if [ -n "$TEST_PASS_RATE" ]; then
105
+ RESULT_HASH_ARGS="$RESULT_HASH_ARGS test_pass_rate $TEST_PASS_RATE"
106
+ fi
107
+
108
+ if [ -n "$TESTS_RUN" ]; then
109
+ RESULT_HASH_ARGS="$RESULT_HASH_ARGS tests_run $TESTS_RUN"
110
+ fi
111
+
112
+ if [ -n "$TESTS_PASSED" ]; then
113
+ RESULT_HASH_ARGS="$RESULT_HASH_ARGS tests_passed $TESTS_PASSED"
114
+ fi
115
+
116
+ RESULT_HASH_ARGS="$RESULT_HASH_ARGS timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)"
117
+
118
+ echo "HSET ${NAMESPACE}:${TASK_ID}:${AGENT_ID}:result $RESULT_HASH_ARGS"
119
+
78
120
  echo "EXEC"
79
121
  } | redis-cli > /dev/null
80
122
 
81
123
  # Step 4: Add to agent completion list (for orchestrator tracking)
82
- redis-cli LPUSH "swarm:${TASK_ID}:completed_agents" "$AGENT_ID" > /dev/null
124
+ redis-cli LPUSH "${NAMESPACE}:${TASK_ID}:completed_agents" "$AGENT_ID" > /dev/null
83
125
 
84
126
  # Step 5: Set TTL on keys (auto-cleanup)
85
- redis-cli EXPIRE "swarm:${TASK_ID}:${AGENT_ID}:result" 3600 > /dev/null
86
- redis-cli EXPIRE "swarm:${TASK_ID}:${AGENT_ID}:done" 3600 > /dev/null
127
+ redis-cli EXPIRE "${NAMESPACE}:${TASK_ID}:${AGENT_ID}:result" 3600 > /dev/null
128
+ redis-cli EXPIRE "${NAMESPACE}:${TASK_ID}:${AGENT_ID}:done" 3600 > /dev/null
87
129
 
88
130
  echo "✅ Reported completion for agent: $AGENT_ID (confidence: $CONFIDENCE)"
131
+ if [ -n "$TEST_PASS_RATE" ]; then
132
+ echo " Test pass rate: $TEST_PASS_RATE%"
133
+ fi
89
134
  exit 0
@@ -4,6 +4,7 @@
4
4
  #
5
5
  # Usage:
6
6
  # store-context.sh --task-id <id> --key <key> --value <value> [--namespace <ns>]
7
+ # store-context.sh --task-id <id> --epic <epic> --mode <mode> [--namespace <ns>]
7
8
  # store-context.sh <task_id> <context_json> (legacy mode)
8
9
 
9
10
  set -euo pipefail
@@ -18,6 +19,8 @@ KEY=""
18
19
  VALUE=""
19
20
  NAMESPACE="swarm"
20
21
  CONTEXT=""
22
+ EPIC=""
23
+ MODE=""
21
24
 
22
25
  # Parse arguments
23
26
  while [[ $# -gt 0 ]]; do
@@ -38,6 +41,14 @@ while [[ $# -gt 0 ]]; do
38
41
  NAMESPACE="$2"
39
42
  shift 2
40
43
  ;;
44
+ --epic)
45
+ EPIC="$2"
46
+ shift 2
47
+ ;;
48
+ --mode)
49
+ MODE="$2"
50
+ shift 2
51
+ ;;
41
52
  *)
42
53
  # Legacy mode: positional arguments
43
54
  if [ -z "$TASK_ID" ]; then
@@ -54,10 +65,29 @@ done
54
65
  if [ -z "$TASK_ID" ]; then
55
66
  echo "Error: --task-id or TASK_ID required" >&2
56
67
  echo "Usage: $0 --task-id <id> --key <key> --value <value> [--namespace <ns>]" >&2
68
+ echo " or: $0 --task-id <id> --epic <epic> --mode <mode> [--namespace <ns>]" >&2
57
69
  echo " or: $0 <task_id> <context_json> (legacy)" >&2
58
70
  exit 1
59
71
  fi
60
72
 
73
+ # Handle epic+mode mode (new)
74
+ if [ -n "$EPIC" ] && [ -n "$MODE" ]; then
75
+ # Store epic and mode with task context
76
+ REDIS_KEY="${NAMESPACE}:${TASK_ID}:context"
77
+
78
+ redis-cli HSET "$REDIS_KEY" \
79
+ "epic" "$EPIC" \
80
+ "mode" "$MODE" \
81
+ "updated_at" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
82
+ > /dev/null
83
+
84
+ # Set TTL (24 hours)
85
+ redis-cli EXPIRE "$REDIS_KEY" 86400 > /dev/null
86
+
87
+ echo "✅ Context stored: epic=$EPIC, mode=$MODE for task: $TASK_ID"
88
+ exit 0
89
+ fi
90
+
61
91
  # Handle structured mode (new)
62
92
  if [ -n "$KEY" ] && [ -n "$VALUE" ]; then
63
93
  # Store structured context with specific key
@@ -89,5 +119,5 @@ if [ -n "$CONTEXT" ]; then
89
119
  exit 0
90
120
  fi
91
121
 
92
- echo "Error: Either --key/--value or <context_json> required" >&2
122
+ echo "Error: Either --epic/--mode, --key/--value, or <context_json> required" >&2
93
123
  exit 1
@@ -845,6 +845,8 @@ fi
845
845
  Complete your frontend coordination work and provide test-based validation:
846
846
 
847
847
  1. **Execute Tests**: Run all test suites from success criteria
848
+
849
+ ```bash
848
850
  # Parse natively (no external dependencies)
849
851
  PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
850
852
  FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
@@ -853,7 +855,10 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
853
855
 
854
856
  # Return results (Main Chat receives automatically in Task Mode)
855
857
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
856
- - Coverage: ≥80%
858
+ ```
859
+
860
+ 2. **Review Metrics**: Verify test pass rate ≥95%
861
+ 3. **Coverage Check**: Ensure test coverage ≥80%
857
862
  4. **Store in Redis**: Use test-results key (not confidence key)
858
863
  5. **Signal Completion**: Push to completion queue
859
864
 
@@ -440,6 +440,8 @@ When spawned via Task() tool in Main Chat:
440
440
  Complete your consensus-building work and provide test-based validation:
441
441
 
442
442
  1. **Execute Tests**: Run all test suites from success criteria
443
+
444
+ ```bash
443
445
  # Parse natively (no external dependencies)
444
446
  PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
445
447
  FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
@@ -448,7 +450,10 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
448
450
 
449
451
  # Return results (Main Chat receives automatically in Task Mode)
450
452
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
451
- - Coverage: ≥80%
453
+ ```
454
+
455
+ 2. **Review Metrics**: Verify test pass rate ≥95%
456
+ 3. **Coverage Check**: Ensure test coverage ≥80%
452
457
  4. **Store in Redis**: Use test-results key (not confidence key)
453
458
  5. **Signal Completion**: Push to completion queue
454
459
 
@@ -529,6 +529,8 @@ echo "CONFIDENCE: [0.0-1.0]"
529
529
  Complete your handoff coordination work and provide test-based validation:
530
530
 
531
531
  1. **Execute Tests**: Run all test suites from success criteria
532
+
533
+ ```bash
532
534
  # Parse natively (no external dependencies)
533
535
  PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
534
536
  FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
@@ -537,7 +539,10 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
537
539
 
538
540
  # Return results (Main Chat receives automatically in Task Mode)
539
541
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
540
- - Coverage: ≥80%
542
+ ```
543
+
544
+ 2. **Review Metrics**: Verify test pass rate ≥95%
545
+ 3. **Coverage Check**: Ensure test coverage ≥80%
541
546
  4. **Store in Redis**: Use test-results key (not confidence key)
542
547
  5. **Signal Completion**: Push to completion queue
543
548
 
@@ -470,6 +470,8 @@ When spawned via Task() tool in Main Chat:
470
470
  Complete your multi-sprint coordination work and provide test-based validation:
471
471
 
472
472
  1. **Execute Tests**: Run all test suites from success criteria
473
+
474
+ ```bash
473
475
  # Parse natively (no external dependencies)
474
476
  PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
475
477
  FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
@@ -478,7 +480,10 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
478
480
 
479
481
  # Return results (Main Chat receives automatically in Task Mode)
480
482
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
481
- - Coverage: ≥80%
483
+ ```
484
+
485
+ 2. **Review Metrics**: Verify test pass rate ≥95%
486
+ 3. **Coverage Check**: Ensure test coverage ≥80%
482
487
  4. **Store in Redis**: Use test-results key (not confidence key)
483
488
  5. **Signal Completion**: Push to completion queue
484
489
 
@@ -624,16 +624,26 @@ networks:
624
624
  Complete your work and provide test-based validation:
625
625
 
626
626
  1. **Execute Tests**: Run all test suites from success criteria
627
- # Parse natively (no external dependencies)
628
- PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
629
- FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
630
- TOTAL=$((PASS + FAIL))
631
- RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
632
-
633
- # Return results (Main Chat receives automatically in Task Mode)
634
- echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
627
+ ```bash
628
+ # Parse natively (no external dependencies)
629
+ PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
630
+ FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
631
+ TOTAL=$((PASS + FAIL))
632
+ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
633
+
634
+ # Return results (Main Chat receives automatically in Task Mode)
635
+ echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
636
+ ```
637
+
638
+ 2. **Parse Results**: Extract test counts and calculate pass rate
639
+
640
+ 3. **Coverage Check**: Ensure coverage meets minimum thresholds
641
+ - Build tests: ≥95%
642
+ - Security tests: ≥90%
635
643
  - Coverage: ≥80%
644
+
636
645
  4. **Store in Redis**: Use test-results key (not confidence key)
646
+
637
647
  5. **Signal Completion**: Push to completion queue
638
648
 
639
649
  **Example Report:**
@@ -598,16 +598,26 @@ Before reporting high confidence:
598
598
  Complete your work and provide test-based validation:
599
599
 
600
600
  1. **Execute Tests**: Run all test suites from success criteria
601
- # Parse natively (no external dependencies)
602
- PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
603
- FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
604
- TOTAL=$((PASS + FAIL))
605
- RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
606
-
607
- # Return results (Main Chat receives automatically in Task Mode)
608
- echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
601
+ ```bash
602
+ # Parse natively (no external dependencies)
603
+ PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
604
+ FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
605
+ TOTAL=$((PASS + FAIL))
606
+ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
607
+
608
+ # Return results (Main Chat receives automatically in Task Mode)
609
+ echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
610
+ ```
611
+
612
+ 2. **Parse Results**: Extract test counts and calculate pass rate
613
+
614
+ 3. **Coverage Check**: Ensure coverage meets minimum thresholds
615
+ - Manifest tests: ≥95%
616
+ - Deployment tests: ≥90%
609
617
  - Coverage: ≥80%
618
+
610
619
  4. **Store in Redis**: Use test-results key (not confidence key)
620
+
611
621
  5. **Signal Completion**: Push to completion queue
612
622
 
613
623
  **Example Report:**
@@ -963,16 +963,26 @@ Before reporting high confidence:
963
963
  Complete your work and provide test-based validation:
964
964
 
965
965
  1. **Execute Tests**: Run all test suites from success criteria
966
- # Parse natively (no external dependencies)
967
- PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
968
- FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
969
- TOTAL=$((PASS + FAIL))
970
- RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
971
-
972
- # Return results (Main Chat receives automatically in Task Mode)
973
- echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
966
+ ```bash
967
+ # Parse natively (no external dependencies)
968
+ PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
969
+ FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
970
+ TOTAL=$((PASS + FAIL))
971
+ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
972
+
973
+ # Return results (Main Chat receives automatically in Task Mode)
974
+ echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
975
+ ```
976
+
977
+ 2. **Parse Results**: Extract test counts and calculate pass rate
978
+
979
+ 3. **Coverage Check**: Ensure coverage meets minimum thresholds
980
+ - Core tests: ≥95%
981
+ - Configuration tests: ≥90%
974
982
  - Coverage: ≥80%
983
+
975
984
  4. **Store in Redis**: Use test-results key (not confidence key)
985
+
976
986
  5. **Signal Completion**: Push to completion queue
977
987
 
978
988
  **Example Report:**
@@ -164,16 +164,26 @@ DO NOT report subjective confidence scores. Instead:
164
164
  Complete your work and provide test-based validation:
165
165
 
166
166
  1. **Execute Tests**: Run all test suites from success criteria
167
- # Parse natively (no external dependencies)
168
- PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
169
- FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
170
- TOTAL=$((PASS + FAIL))
171
- RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
167
+ ```bash
168
+ # Parse natively (no external dependencies)
169
+ PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
170
+ FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
171
+ TOTAL=$((PASS + FAIL))
172
+ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
173
+
174
+ # Return results (Main Chat receives automatically in Task Mode)
175
+ echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
176
+ ```
177
+
178
+ 2. **Parse Results**: Extract test counts and calculate pass rate
172
179
 
173
- # Return results (Main Chat receives automatically in Task Mode)
174
- echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
180
+ 3. **Coverage Check**: Ensure coverage meets minimum thresholds
181
+ - Unit tests: ≥95%
182
+ - Integration tests: ≥90%
175
183
  - Coverage: ≥80%
184
+
176
185
  4. **Store in Redis**: Use test-results key (not confidence key)
186
+
177
187
  5. **Signal Completion**: Push to completion queue
178
188
 
179
189
  **Example Report:**
@@ -663,16 +663,25 @@ Validate work with tests instead of confidence scores:
663
663
  - Query complexity tests
664
664
  - Authentication/authorization tests
665
665
 
666
- # Parse natively (no external dependencies)
667
- PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
668
- FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
669
- TOTAL=$((PASS + FAIL))
670
- RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
671
-
672
- # Return results (Main Chat receives automatically in Task Mode)
673
- echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
666
+ 2. **Parse Test Results**: Extract test counts and calculate pass rate
667
+ ```bash
668
+ # Parse natively (no external dependencies)
669
+ PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
670
+ FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
671
+ TOTAL=$((PASS + FAIL))
672
+ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
673
+
674
+ # Return results (Main Chat receives automatically in Task Mode)
675
+ echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
676
+ ```
677
+
678
+ 3. **Coverage Check**: Ensure coverage meets minimum thresholds
679
+ - Schema tests: ≥95%
680
+ - Resolver tests: ≥90%
674
681
  - Coverage: ≥80%
682
+
675
683
  4. **Store in Redis**: Use test-results key (not confidence key)
684
+
676
685
  5. **Signal Completion**: Push to completion queue
677
686
 
678
687
  ## Completion Protocol (Test-Driven)
@@ -187,16 +187,26 @@ Remember: Prioritize safety, performance, and clear, concise implementation.
187
187
  Complete your work and provide test-based validation:
188
188
 
189
189
  1. **Execute Tests**: Run all test suites from success criteria
190
- # Parse natively (no external dependencies)
191
- PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
192
- FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
193
- TOTAL=$((PASS + FAIL))
194
- RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
195
-
196
- # Return results (Main Chat receives automatically in Task Mode)
197
- echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
190
+ ```bash
191
+ # Parse natively (no external dependencies)
192
+ PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
193
+ FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
194
+ TOTAL=$((PASS + FAIL))
195
+ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
196
+
197
+ # Return results (Main Chat receives automatically in Task Mode)
198
+ echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
199
+ ```
200
+
201
+ 2. **Parse Results**: Extract test counts and calculate pass rate
202
+
203
+ 3. **Coverage Check**: Ensure coverage meets minimum thresholds
204
+ - Unit tests: ≥95%
205
+ - Integration tests: ≥90%
198
206
  - Coverage: ≥80%
207
+
199
208
  4. **Store in Redis**: Use test-results key (not confidence key)
209
+
200
210
  5. **Signal Completion**: Push to completion queue
201
211
 
202
212
  **Example Report:**
@@ -52,8 +52,7 @@ fi
52
52
 
53
53
  ### 3. Report Test Results (NOT Confidence)
54
54
 
55
- **Old (Deprecated):**
56
- ```bash
55
+ **Old (Deprecated):** Not used
57
56
 
58
57
  **New (Required):**
59
58
  ```bash
@@ -65,7 +64,6 @@ PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
65
64
  FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
66
65
  TOTAL=$((PASS + FAIL))
67
66
  RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
68
-
69
67
  ```
70
68
 
71
69
  ## MCP Tool Access (Task Mode)
@@ -287,6 +285,8 @@ DO NOT report subjective confidence scores. Instead:
287
285
  Complete your work and provide test-based validation:
288
286
 
289
287
  1. **Execute Tests**: Run all test suites from success criteria
288
+
289
+ ```bash
290
290
  # Parse natively (no external dependencies)
291
291
  PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
292
292
  FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
@@ -295,9 +295,13 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
295
295
 
296
296
  # Return results (Main Chat receives automatically in Task Mode)
297
297
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
298
+ ```
299
+
300
+ 2. **Validate Results**:
298
301
  - Coverage: ≥80%
299
- 4. **Store in Redis**: Use test-results key (not confidence key)
300
- 5. **Signal Completion**: Push to completion queue
302
+
303
+ 3. **Store Results**: Use test-results key (not confidence key)
304
+ 4. **Signal Completion**: Push to completion queue
301
305
 
302
306
  **Example Report:**
303
307
  ```
@@ -64,8 +64,7 @@ fi
64
64
 
65
65
  ### 3. Report Test Results (NOT Confidence)
66
66
 
67
- **Old (Deprecated):**
68
- ```bash
67
+ **Old (Deprecated):** Not used
69
68
 
70
69
  **New (Required):**
71
70
  ```bash
@@ -80,7 +79,6 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
80
79
 
81
80
  # Return results (Main Chat receives automatically in Task Mode)
82
81
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
83
-
84
82
  ```
85
83
 
86
84
  ## Post-Edit Validation
@@ -206,6 +204,8 @@ Remember: Code analysis reveals improvement opportunities. Focus on actionable,
206
204
  DO NOT report subjective confidence scores. Instead:
207
205
 
208
206
  1. **Execute Tests**: Run test suite defined in success criteria
207
+
208
+ ```bash
209
209
  # Parse natively (no external dependencies)
210
210
  PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
211
211
  FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
@@ -214,8 +214,9 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
214
214
 
215
215
  # Return results (Main Chat receives automatically in Task Mode)
216
216
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
217
+ ```
217
218
 
218
- **Validation:**
219
+ **Validation Examples:**
219
220
  - ❌ OLD: "Confidence: 0.83 - quality metrics look solid"
220
221
  - ✅ NEW: "Quality Tests: 38/40 passed (95% pass rate) - 2 refactoring validation scenarios need review"
221
222
 
@@ -224,6 +225,8 @@ echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
224
225
  Complete your work and provide test-based validation:
225
226
 
226
227
  1. **Execute Tests**: Run all code quality test suites from success criteria
228
+
229
+ ```bash
227
230
  # Parse natively (no external dependencies)
228
231
  PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
229
232
  FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
@@ -232,11 +235,15 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
232
235
 
233
236
  # Return results (Main Chat receives automatically in Task Mode)
234
237
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
238
+ ```
239
+
240
+ 2. **Validate Results**:
235
241
  - Coverage: ≥80%
236
242
  - Code smells detected: N
237
243
  - Technical debt score: X/10
238
- 4. **Store in Redis**: Use test-results key (not confidence key)
239
- 5. **Signal Completion**: Push to completion queue
244
+
245
+ 3. **Store Results**: Use test-results key (not confidence key)
246
+ 4. **Signal Completion**: Push to completion queue
240
247
 
241
248
  **Example Report:**
242
249
  ```
@@ -54,8 +54,7 @@ fi
54
54
 
55
55
  ### 3. Report Test Results (NOT Confidence)
56
56
 
57
- **Old (Deprecated):**
58
- ```bash
57
+ **Old (Deprecated):** Not used
59
58
 
60
59
  **New (Required):**
61
60
  ```bash
@@ -70,7 +69,6 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
70
69
 
71
70
  # Return results (Main Chat receives automatically in Task Mode)
72
71
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
73
-
74
72
  ```
75
73
 
76
74
  ## Mandatory Post-Edit Validation
@@ -237,6 +235,8 @@ Remember: Optimize for highest impact with reasonable effort. Focus on critical
237
235
  DO NOT report subjective confidence scores. Instead:
238
236
 
239
237
  1. **Execute Tests**: Run test suite defined in success criteria
238
+
239
+ ```bash
240
240
  # Parse natively (no external dependencies)
241
241
  PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
242
242
  FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
@@ -245,8 +245,9 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
245
245
 
246
246
  # Return results (Main Chat receives automatically in Task Mode)
247
247
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
248
+ ```
248
249
 
249
- **Validation:**
250
+ **Validation Examples:**
250
251
  - ❌ OLD: "Confidence: 0.86 - analysis is thorough"
251
252
  - ✅ NEW: "Analysis Tests: 42/45 passed (93.3% pass rate) - 3 optimization scenarios need validation"
252
253
 
@@ -255,6 +256,8 @@ echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
255
256
  Complete your work and provide test-based validation:
256
257
 
257
258
  1. **Execute Tests**: Run all performance analysis test suites from success criteria
259
+
260
+ ```bash
258
261
  # Parse natively (no external dependencies)
259
262
  PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
260
263
  FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
@@ -263,11 +266,15 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
263
266
 
264
267
  # Return results (Main Chat receives automatically in Task Mode)
265
268
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
269
+ ```
270
+
271
+ 2. **Validate Results**:
266
272
  - Coverage: ≥80%
267
273
  - Bottlenecks identified: N
268
274
  - Expected improvement: X%
269
- 4. **Store in Redis**: Use test-results key (not confidence key)
270
- 5. **Signal Completion**: Push to completion queue
275
+
276
+ 3. **Store Results**: Use test-results key (not confidence key)
277
+ 4. **Signal Completion**: Push to completion queue
271
278
 
272
279
  **Example Report:**
273
280
  ```