claude-flow-novice 2.15.9 → 2.15.11

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/skills/cfn-loop-orchestration/IMPLEMENTATION_SUMMARY.md +519 -0
  2. package/.claude/skills/cfn-loop-orchestration/ORCHESTRATOR_IMPLEMENTATION.md +493 -0
  3. package/.claude/skills/cfn-loop-orchestration/ORCHESTRATOR_QUICK_START.md +499 -0
  4. package/.claude/skills/cfn-loop-orchestration/helpers/orchestrate-ts.sh +104 -0
  5. package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +2 -2
  6. package/.claude/skills/cfn-loop-orchestration/src/orchestrate.ts +648 -0
  7. package/.claude/skills/cfn-loop-orchestration/tests/orchestrate.test.ts +836 -0
  8. package/README.md +205 -10
  9. package/claude-assets/agents/cfn-dev-team/CLAUDE.md +9 -81
  10. package/claude-assets/agents/cfn-dev-team/architecture/base-template-generator.md +4 -4
  11. package/claude-assets/agents/cfn-dev-team/architecture/planner.md +4 -4
  12. package/claude-assets/agents/cfn-dev-team/architecture/system-architect.md +5 -5
  13. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +184 -229
  14. package/claude-assets/agents/cfn-dev-team/dev-ops/devops-engineer.md +4 -4
  15. package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +9 -37
  16. package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +9 -37
  17. package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +4 -4
  18. package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +10 -40
  19. package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +3 -0
  20. package/claude-assets/agents/cfn-dev-team/developers/frontend/mobile-dev.md +4 -1
  21. package/claude-assets/agents/cfn-dev-team/developers/frontend/react-frontend-engineer.md +4 -1
  22. package/claude-assets/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +4 -1
  23. package/claude-assets/agents/cfn-dev-team/developers/frontend/ui-designer.md +5 -0
  24. package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +2 -1
  25. package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +2 -1
  26. package/claude-assets/agents/cfn-dev-team/documentation/pseudocode.md +2 -7
  27. package/claude-assets/agents/cfn-dev-team/product-owners/accessibility-advocate-persona.md +4 -4
  28. package/claude-assets/agents/cfn-dev-team/product-owners/cto-agent.md +4 -4
  29. package/claude-assets/agents/cfn-dev-team/product-owners/power-user-persona.md +4 -4
  30. package/claude-assets/agents/cfn-dev-team/product-owners/product-owner.md +18 -22
  31. package/claude-assets/agents/cfn-dev-team/reviewers/code-reviewer.md +1 -1
  32. package/claude-assets/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +1 -1
  33. package/claude-assets/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +1 -1
  34. package/claude-assets/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +1 -1
  35. package/claude-assets/agents/cfn-dev-team/reviewers/quality/security-specialist.md +1 -1
  36. package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +7 -35
  37. package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +17 -36
  38. package/claude-assets/agents/cfn-dev-team/testers/contract-tester.md +10 -11
  39. package/claude-assets/agents/cfn-dev-team/testers/e2e/playwright-tester.md +5 -5
  40. package/claude-assets/agents/cfn-dev-team/testers/integration-tester.md +10 -12
  41. package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +7 -36
  42. package/claude-assets/agents/cfn-dev-team/testers/load-testing-specialist.md +10 -12
  43. package/claude-assets/agents/cfn-dev-team/testers/mutation-testing-specialist.md +10 -12
  44. package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +7 -37
  45. package/claude-assets/agents/cfn-dev-team/testers/tester.md +7 -33
  46. package/claude-assets/agents/cfn-dev-team/testers/unit/tdd-london-unit-swarm.md +5 -5
  47. package/claude-assets/agents/cfn-dev-team/testers/validation/validation-production-validator.md +4 -4
  48. package/claude-assets/agents/cfn-dev-team/testing/test-validation-agent.md +4 -4
  49. package/claude-assets/agents/cfn-dev-team/utility/agent-builder.md +16 -16
  50. package/claude-assets/agents/cfn-dev-team/utility/analyst.md +4 -4
  51. package/claude-assets/agents/cfn-dev-team/utility/code-booster.md +4 -4
  52. package/claude-assets/agents/cfn-dev-team/utility/context-curator.md +4 -4
  53. package/claude-assets/agents/cfn-dev-team/utility/epic-creator.md +7 -85
  54. package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +7 -93
  55. package/claude-assets/agents/cfn-dev-team/utility/researcher.md +4 -4
  56. package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +7 -84
  57. package/claude-assets/skills/cfn-loop-orchestration/IMPLEMENTATION_SUMMARY.md +519 -0
  58. package/claude-assets/skills/cfn-loop-orchestration/ORCHESTRATOR_IMPLEMENTATION.md +493 -0
  59. package/claude-assets/skills/cfn-loop-orchestration/ORCHESTRATOR_QUICK_START.md +499 -0
  60. package/claude-assets/skills/cfn-loop-orchestration/helpers/orchestrate-ts.sh +104 -0
  61. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +2 -2
  62. package/claude-assets/skills/cfn-loop-orchestration/src/orchestrate.ts +648 -0
  63. package/claude-assets/skills/cfn-loop-orchestration/tests/orchestrate.test.ts +836 -0
  64. package/dist/cli/agent-definition-parser.js +37 -4
  65. package/dist/cli/agent-definition-parser.js.map +1 -1
  66. package/dist/cli/agent-executor.js +32 -2
  67. package/dist/cli/agent-executor.js.map +1 -1
  68. package/dist/coordination/coordinate.js +369 -0
  69. package/dist/coordination/coordinate.js.map +1 -0
  70. package/dist/coordination/spawn-agent.js +364 -0
  71. package/dist/coordination/spawn-agent.js.map +1 -0
  72. package/dist/coordination/types-export.js +38 -0
  73. package/dist/coordination/types-export.js.map +1 -0
  74. package/package.json +1 -1
@@ -319,6 +319,188 @@ All generated criteria MUST conform to:
319
319
 
320
320
  Orchestrate CFN Loop v3 execution using Redis coordination for CLI agent spawning, context management, and consensus collection.
321
321
 
322
+ ## COORDINATOR EXECUTION (START HERE - MANDATORY)
323
+
324
+ **Execute ALL 5 actions in THIS bash script below. DO NOT execute actions separately.**
325
+
326
+ **CRITICAL:** This is THE execution path. Execute the complete bash script in ONE call.
327
+
328
+ ### Unified Execution Script (Actions 1-5)
329
+
330
+ ```bash
331
+ #!/bin/bash
332
+ set -euo pipefail
333
+
334
+ # ITERATION GUARD: Prevent infinite loops
335
+ if [[ ${BASH_EXECUTION_COUNT:-0} -gt 1 ]]; then
336
+ echo "❌ FATAL: Multiple executions detected - orchestrator should have been invoked" >&2
337
+ exit 1
338
+ fi
339
+ export BASH_EXECUTION_COUNT=$((${BASH_EXECUTION_COUNT:-0} + 1))
340
+
341
+ # ==============================================================================
342
+ # ACTION 1: Initialize Task Context
343
+ # ==============================================================================
344
+ TASK_ID="${TASK_ID:-$(date +%s)}"
345
+ TASK_DESCRIPTION="${TASK_DESCRIPTION:-Generic CFN Loop task}"
346
+ MODE="${MODE:-standard}"
347
+ MAX_ITERATIONS="${MAX_ITERATIONS:-10}" # Default to 10, can be overridden via context
348
+ PROJECT_ROOT="${PROJECT_ROOT:-.}"
349
+
350
+ echo "📋 COORDINATOR INITIALIZATION (CLI Mode v3.0)"
351
+ echo " TASK_ID: $TASK_ID"
352
+ echo " MODE: $MODE"
353
+ echo " TASK: $TASK_DESCRIPTION"
354
+
355
+ # ==============================================================================
356
+ # ACTION 2: Perform Task Classification
357
+ # ==============================================================================
358
+ TASK_TYPE="software-development" # Default fallback
359
+
360
+ if [[ -f "$PROJECT_ROOT/.claude/skills/task-classifier/classify-task.sh" ]]; then
361
+ CLASSIFIED=$(bash "$PROJECT_ROOT/.claude/skills/task-classifier/classify-task.sh" "$TASK_DESCRIPTION" 2>/dev/null || echo "")
362
+ [[ -n "$CLASSIFIED" ]] && TASK_TYPE="$CLASSIFIED"
363
+ fi
364
+
365
+ # Store in Redis for persistence across Bash tool calls
366
+ redis-cli -h "${REDIS_HOST:-localhost}" -p "${REDIS_PORT:-6379}" \
367
+ HSET "swarm:${TASK_ID}:config" "task_type" "$TASK_TYPE" 2>/dev/null || true
368
+
369
+ echo "✅ ACTION 2 Complete: Task classified as '$TASK_TYPE'"
370
+
371
+ # ==============================================================================
372
+ # ACTION 3: Select Agents Based on Task Type
373
+ # ==============================================================================
374
+ case "$TASK_TYPE" in
375
+ "infrastructure")
376
+ LOOP3_AGENTS="terraform-engineer,devops-engineer,cloud-architect"
377
+ LOOP2_AGENTS="security-auditor,compliance-checker,cost-optimizer"
378
+ PRODUCT_OWNER="infrastructure-product-owner"
379
+ ;;
380
+ "software-development"|*)
381
+ LOOP3_AGENTS="backend-developer,frontend-developer,database-engineer"
382
+ LOOP2_AGENTS="code-reviewer,security-specialist,performance-tester"
383
+ PRODUCT_OWNER="technical-product-owner"
384
+ ;;
385
+ esac
386
+
387
+ # Store in Redis
388
+ redis-cli -h "${REDIS_HOST:-localhost}" -p "${REDIS_PORT:-6379}" \
389
+ HSET "swarm:${TASK_ID}:config" "loop3_agents" "$LOOP3_AGENTS" 2>/dev/null || true
390
+ redis-cli -h "${REDIS_HOST:-localhost}" -p "${REDIS_PORT:-6379}" \
391
+ HSET "swarm:${TASK_ID}:config" "loop2_agents" "$LOOP2_AGENTS" 2>/dev/null || true
392
+
393
+ echo "✅ ACTION 3 Complete: Agents selected"
394
+ echo " Loop 3: $LOOP3_AGENTS"
395
+ echo " Loop 2: $LOOP2_AGENTS"
396
+ echo " Product Owner: $PRODUCT_OWNER"
397
+
398
+ # ==============================================================================
399
+ # ACTION 4: Validate Parameters
400
+ # ==============================================================================
401
+ if [[ -z "$TASK_ID" ]]; then
402
+ echo "❌ FATAL: TASK_ID is required" >&2
403
+ exit 1
404
+ fi
405
+
406
+ if [[ -z "$LOOP3_AGENTS" ]]; then
407
+ echo "❌ FATAL: No Loop 3 agents selected" >&2
408
+ exit 1
409
+ fi
410
+
411
+ if [[ -z "$LOOP2_AGENTS" ]]; then
412
+ echo "❌ FATAL: No Loop 2 agents selected" >&2
413
+ exit 1
414
+ fi
415
+
416
+ echo "✅ ACTION 4 Complete: Parameters validated"
417
+
418
+ # ==============================================================================
419
+ # ACTION 5: INVOKE ORCHESTRATOR - MANDATORY (This is your PRIMARY job)
420
+ # ==============================================================================
421
+ echo ""
422
+ echo "🚀 ACTION 5: INVOKING ORCHESTRATOR (MANDATORY)"
423
+ echo " This is the ONLY action that truly matters for coordinator"
424
+ echo " The orchestrator handles ALL remaining CFN Loop work"
425
+
426
+ ORCHESTRATOR_PATH="$PROJECT_ROOT/.claude/skills/cfn-loop-orchestration/orchestrate-wrapper.sh"
427
+
428
+ if [[ ! -f "$ORCHESTRATOR_PATH" ]]; then
429
+ echo "❌ FATAL: Orchestrator not found at $ORCHESTRATOR_PATH" >&2
430
+ echo " Expected path: $ORCHESTRATOR_PATH"
431
+ exit 1
432
+ fi
433
+
434
+ # Store success criteria in Redis BEFORE invoking orchestrator
435
+ # The orchestrator requires this when --success-criteria flag is set
436
+ CRITERIA_JSON='{
437
+ "test_suites": [
438
+ {
439
+ "name": "Unit Tests",
440
+ "command": "echo \"Simulated test execution\"",
441
+ "required": true,
442
+ "pass_threshold": 0.70
443
+ }
444
+ ],
445
+ "gate_mode": "test-driven",
446
+ "metadata": {
447
+ "created_by": "cfn-v3-coordinator",
448
+ "task_type": "general",
449
+ "mode": "'$MODE'"
450
+ }
451
+ }'
452
+
453
+ # Store in Redis
454
+ echo "$CRITERIA_JSON" | redis-cli -h "${REDIS_HOST:-localhost}" -p "${REDIS_PORT:-6379}" \
455
+ -x HSET "cfn_loop:task:${TASK_ID}:context" "success-criteria" >/dev/null 2>&1 || true
456
+
457
+ # Store task description in Redis for agent context injection
458
+ redis-cli -h "${REDIS_HOST:-localhost}" -p "${REDIS_PORT:-6379}" \
459
+ HSET "cfn_loop:task:${TASK_ID}:context" "task_description" "$TASK_DESCRIPTION" >/dev/null 2>&1 || true
460
+
461
+ echo " ✅ Success criteria and task description stored in Redis"
462
+
463
+ # Invoke orchestrator with validated parameters
464
+ # The orchestrator handles ALL remaining work:
465
+ # - Loop 3 agent spawning and execution
466
+ # - Test execution and gate validation
467
+ # - Loop 2 validator spawning and consensus
468
+ # - Product Owner decision (PROCEED/ITERATE/ABORT)
469
+ # - Git commits and result reporting
470
+ echo " Executing: $ORCHESTRATOR_PATH"
471
+ bash "$ORCHESTRATOR_PATH" \
472
+ --task-id "$TASK_ID" \
473
+ --mode "$MODE" \
474
+ --loop3-agents "$LOOP3_AGENTS" \
475
+ --loop2-agents "$LOOP2_AGENTS" \
476
+ --product-owner "$PRODUCT_OWNER" \
477
+ --max-iterations "$MAX_ITERATIONS" \
478
+ --success-criteria "enabled" 2>&1
479
+
480
+ ORCHESTRATOR_EXIT_CODE=$?
481
+
482
+ if [[ $ORCHESTRATOR_EXIT_CODE -eq 0 ]]; then
483
+ echo "✅ ORCHESTRATOR COMPLETED SUCCESSFULLY"
484
+ else
485
+ echo "❌ ORCHESTRATOR FAILED (exit code: $ORCHESTRATOR_EXIT_CODE)"
486
+ exit $ORCHESTRATOR_EXIT_CODE
487
+ fi
488
+ ```
489
+
490
+ **What happens next:**
491
+ 1. Orchestrator spawns Loop 3 agents (implementers)
492
+ 2. Loop 3 agents complete work and execute tests
493
+ 3. Orchestrator validates test pass rates against gate threshold
494
+ 4. If gate passes, orchestrator spawns Loop 2 agents (validators)
495
+ 5. Loop 2 validators review work and report consensus
496
+ 6. Orchestrator spawns Product Owner for final decision
497
+ 7. Product Owner decides: PROCEED / ITERATE / ABORT
498
+ 8. Orchestrator creates git commit (if PROCEED) or starts next iteration (if ITERATE)
499
+
500
+ **Coordinator's job is now DONE.** The orchestrator handles everything else.
501
+
502
+
503
+
322
504
  ## CLI Mode Execution (Coordinator is ALWAYS CLI Mode)
323
505
 
324
506
  **IMPORTANT:** This coordinator agent is **ALWAYS CLI mode**. Task mode coordination happens directly in Main Chat, not via coordinator agents.
@@ -748,234 +930,6 @@ Extract deliverables from task description:
748
930
  - Estimate iteration count
749
931
  - Provide reasoning for choices
750
932
 
751
- ## Execution Steps (CLI Mode Only)
752
-
753
- **CRITICAL:** This coordinator is ALWAYS CLI mode. There is no Task Mode execution path.
754
-
755
- ### Step 1: Task Classification (REQUIRED)
756
- ```bash
757
- # BUG #23 FIX: Store task classification in Redis to persist across Bash tool calls
758
- # Each Bash tool call creates a new shell, so environment variables don't persist
759
- # Redis provides persistence across iterations
760
-
761
- # Classify task type (use hardcoded defaults if script fails)
762
- TASK_TYPE="infrastructure" # Default fallback
763
- if [[ -f ".claude/skills/task-classifier/classify-task.sh" ]]; then
764
- CLASSIFIED_TYPE=$(bash .claude/skills/task-classifier/classify-task.sh "$TASK_DESCRIPTION" 2>/dev/null || echo "")
765
- [[ -n "$CLASSIFIED_TYPE" ]] && TASK_TYPE="$CLASSIFIED_TYPE"
766
- fi
767
-
768
- # Store task type in Redis for persistence across Bash tool calls
769
- echo "✅ Task type '$TASK_TYPE' stored in Redis: swarm:${TASK_ID}:config"
770
- ```
771
-
772
- ### Step 2: Agent Selection with Fallback (REQUIRED)
773
- ```bash
774
- # BUG #23 FIX: Store agent selections in Redis to persist across Bash tool calls
775
- # Environment variables are lost between Bash tool executions
776
- # Redis ensures parameters persist through validation and orchestrator invocation
777
-
778
- # Select agents with hardcoded fallbacks (never fail)
779
- LOOP3_AGENTS="terraform-engineer,devops-engineer" # Infrastructure default
780
- LOOP2_AGENTS="security-auditor,compliance-checker,cost-optimizer" # Validation default
781
- PRODUCT_OWNER="product-owner"
782
-
783
- # Try dynamic selection but fall back to defaults
784
- if [[ -f ".claude/skills/cfn-agent-selector/select-agents.sh" ]]; then
785
- SELECTED_AGENTS=$(bash .claude/skills/cfn-agent-selector/select-agents.sh --task-type "$TASK_TYPE" --description "$TASK_DESCRIPTION" 2>/dev/null || echo "")
786
- if [[ -n "$SELECTED_AGENTS" ]]; then
787
- PARSED_AGENTS=$(echo "$SELECTED_AGENTS" | jq -r '.loop3 // empty | join(",")')
788
- [[ -n "$PARSED_AGENTS" ]] && LOOP3_AGENTS="$PARSED_AGENTS"
789
-
790
- PARSED_AGENTS=$(echo "$SELECTED_AGENTS" | jq -r '.loop2 // empty | join(",")')
791
- [[ -n "$PARSED_AGENTS" ]] && LOOP2_AGENTS="$PARSED_AGENTS"
792
- fi
793
- fi
794
-
795
- # Store agent selections in Redis for persistence
796
-
797
- echo "✅ Agent selections stored in Redis:"
798
- echo " loop3_agents: $LOOP3_AGENTS"
799
- echo " loop2_agents: $LOOP2_AGENTS"
800
- echo " product_owner: $PRODUCT_OWNER"
801
- ```
802
-
803
- ### Step 2.5: MANDATORY Parameter Initialization (BUG #22 & BUG #23 FIX)
804
-
805
- **CRITICAL: Execute this BEFORE orchestrator invocation to prevent empty parameter errors.**
806
-
807
- This step implements defense-in-depth fixes for both BUG #22 and BUG #23:
808
- - BUG #22: Empty parameter validation with hardcoded fallbacks
809
- - BUG #23: Redis-first parameter retrieval to handle Bash tool session loss
810
-
811
- ```bash
812
- # BUG #23 FIX: Read parameters from Redis with fallbacks
813
- # Bash tool creates new shell each call, so variables set in Step 2 may be lost
814
- # Redis provides persistent storage across all Bash tool executions
815
- LOOP3_AGENTS=$(redis-cli HGET "swarm:${TASK_ID}:config" "loop3_agents" 2>/dev/null || echo "")
816
- LOOP2_AGENTS=$(redis-cli HGET "swarm:${TASK_ID}:config" "loop2_agents" 2>/dev/null || echo "")
817
- PRODUCT_OWNER=$(redis-cli HGET "swarm:${TASK_ID}:config" "product_owner" 2>/dev/null || echo "")
818
-
819
- echo "🔄 Parameters retrieved from Redis (BUG #23 fix)"
820
- echo " LOOP3_AGENTS='$LOOP3_AGENTS'"
821
- echo " LOOP2_AGENTS='$LOOP2_AGENTS'"
822
- echo " PRODUCT_OWNER='$PRODUCT_OWNER'"
823
-
824
- # BUG #22 FIX: Apply fallbacks if Redis returns empty (defense-in-depth)
825
- # Even if Redis succeeded, re-validate and apply defaults if empty
826
- LOOP3_AGENTS="${LOOP3_AGENTS:-backend-developer,frontend-developer}"
827
- LOOP2_AGENTS="${LOOP2_AGENTS:-code-reviewer,tester,security-specialist}"
828
- PRODUCT_OWNER="${PRODUCT_OWNER:-product-owner}"
829
-
830
- echo "🔒 Fallback parameters initialized (BUG #22 prevention)"
831
- echo " LOOP3_AGENTS='$LOOP3_AGENTS'"
832
- echo " LOOP2_AGENTS='$LOOP2_AGENTS'"
833
- echo " PRODUCT_OWNER='$PRODUCT_OWNER'"
834
-
835
- # MANDATORY: Validate before orchestrator invocation
836
- if [[ -z "$LOOP3_AGENTS" ]] || [[ -z "$LOOP2_AGENTS" ]] || [[ -z "$PRODUCT_OWNER" ]]; then
837
- echo "❌ FATAL: Agent parameters cannot be empty after Redis retrieval + fallback initialization" >&2
838
- echo " This indicates a critical logic error in parameter handling (BUG #22 & #23)" >&2
839
- echo " LOOP3_AGENTS='$LOOP3_AGENTS'" >&2
840
- echo " LOOP2_AGENTS='$LOOP2_AGENTS'" >&2
841
- echo " PRODUCT_OWNER='$PRODUCT_OWNER'" >&2
842
- exit 1
843
- fi
844
-
845
- echo "✅ All parameters validated non-empty before orchestrator invocation (BUG #22 & #23 fixes applied)"
846
- ```
847
-
848
- **Why This Matters:**
849
-
850
- 1. **BUG #23 Fix - Redis Persistence**: Each Bash tool call creates a new shell
851
- - Environment variables set in iteration N are lost in iteration N+1
852
- - Redis provides persistent storage across all Bash tool executions
853
- - Parameters stored in Step 2 are reliably retrieved in Step 2.5
854
- - Prevents coordinator from being stuck in validation loop
855
-
856
- 2. **BUG #22 Fix - Defense-in-Depth**: Multiple layers of protection against empty parameters
857
- - Step 2 provides hardcoded defaults AND stores in Redis
858
- - Step 2.5 reads from Redis then applies fallbacks if Redis fails
859
- - Explicit validation catches any logic errors before orchestrator call
860
-
861
- 3. **Clear Error Messages**: If validation fails, provides:
862
- - Exact parameter values (shows what went wrong)
863
- - Context about where failure occurred (BUG #22 or BUG #23)
864
- - Actionable error message (indicates critical logic error)
865
-
866
- 4. **Fail-Fast Principle**: Better to exit early with clear error than pass empty strings to orchestrator
867
- - Orchestrator would fail with confusing error messages
868
- - Empty parameters cause cascade failures in agent spawning
869
- - Early validation prevents wasted iteration time
870
-
871
- **Testing BUG #22 & BUG #23 Fixes:**
872
-
873
- ```bash
874
- # Test BUG #23 fix (Redis persistence across Bash tool calls)
875
- # Simulate multiple Bash tool executions (coordinator iterations)
876
- npx claude-flow-novice agent-spawn cfn-v3-coordinator \
877
- --task-id test-bug23 \
878
- --env TASK_DESCRIPTION="Test Redis parameter persistence"
879
-
880
- # Expected output in Step 2:
881
- # ✅ Agent selections stored in Redis:
882
- # loop3_agents: backend-developer,frontend-developer
883
- # loop2_agents: code-reviewer,tester,security-specialist
884
- # product_owner: product-owner
885
-
886
- # Expected output in Step 2.5 (even in NEW Bash shell):
887
- # 🔄 Parameters retrieved from Redis (BUG #23 fix)
888
- # LOOP3_AGENTS='backend-developer,frontend-developer'
889
- # LOOP2_AGENTS='code-reviewer,tester,security-specialist'
890
- # PRODUCT_OWNER='product-owner'
891
- # ✅ All parameters validated non-empty before orchestrator invocation (BUG #22 & #23 fixes applied)
892
-
893
- # Test BUG #22 fix (fallbacks when Redis fails)
894
- # Simulate Redis failure
895
- redis-cli SHUTDOWN NOSAVE
896
-
897
- # Run coordinator - should fall back to defaults
898
- npx claude-flow-novice agent-spawn cfn-v3-coordinator \
899
- --task-id test-bug22 \
900
- --env TASK_DESCRIPTION="Test fallback parameters"
901
-
902
- # Expected output:
903
- # 🔄 Parameters retrieved from Redis (BUG #23 fix)
904
- # LOOP3_AGENTS='' (Redis down)
905
- # 🔒 Fallback parameters initialized (BUG #22 prevention)
906
- # LOOP3_AGENTS='backend-developer,frontend-developer'
907
- # ✅ All parameters validated non-empty before orchestrator invocation (BUG #22 & #23 fixes applied)
908
- ```
909
-
910
- ### Step 3: INVOKE ORCHESTRATOR (MANDATORY - NOT OPTIONAL)
911
-
912
- **CRITICAL:** You MUST invoke orchestrator by iteration 3. DO NOT complete tasks directly.
913
-
914
- ```bash
915
- # BUG #23 FIX: Read parameters from Redis before invoking orchestrator
916
- # This ensures we use the SAME parameters that were validated in Step 2.5
917
- # Even if this is executed in a NEW Bash shell (which it likely is)
918
- LOOP3_AGENTS=$(redis-cli HGET "swarm:${TASK_ID}:config" "loop3_agents" 2>/dev/null || echo "backend-developer,frontend-developer")
919
- LOOP2_AGENTS=$(redis-cli HGET "swarm:${TASK_ID}:config" "loop2_agents" 2>/dev/null || echo "code-reviewer,tester,security-specialist")
920
- PRODUCT_OWNER=$(redis-cli HGET "swarm:${TASK_ID}:config" "product_owner" 2>/dev/null || echo "product-owner")
921
-
922
- # Apply final fallbacks if Redis returns empty (defense-in-depth)
923
- LOOP3_AGENTS="${LOOP3_AGENTS:-backend-developer,frontend-developer}"
924
- LOOP2_AGENTS="${LOOP2_AGENTS:-code-reviewer,tester,security-specialist}"
925
- PRODUCT_OWNER="${PRODUCT_OWNER:-product-owner}"
926
-
927
- echo "🔄 Orchestrator parameters loaded from Redis (BUG #23 fix):"
928
- echo " LOOP3_AGENTS='$LOOP3_AGENTS'"
929
- echo " LOOP2_AGENTS='$LOOP2_AGENTS'"
930
- echo " PRODUCT_OWNER='$PRODUCT_OWNER'"
931
-
932
- # ALWAYS invoke orchestrator - this is your ONLY responsibility
933
-
934
- # Store success criteria in Redis BEFORE spawning orchestrator
935
- REDIS_KEY="swarm:${TASK_ID}:context"
936
- cat <<'CRITERIA_EOF' | redis-cli -h "${REDIS_HOST:-localhost}" -p "${REDIS_PORT:-6379}" -x HSET "$REDIS_KEY" "success-criteria"
937
- {
938
- "deliverables": [],
939
- "acceptanceCriteria": ["Implementation complete"],
940
- "test_suites": []
941
- }
942
- CRITERIA_EOF
943
-
944
- # Set TTL on context hash (24 hours)
945
- redis-cli -h "${REDIS_HOST:-localhost}" -p "${REDIS_PORT:-6379}" EXPIRE "$REDIS_KEY" 86400
946
-
947
- echo "✅ Success criteria stored in Redis: $REDIS_KEY"
948
-
949
- # BUG #22 & BUG #23 FIX: Use orchestrate-wrapper.sh with Redis-backed parameters
950
- # BUG #22: Wrapper provides additional validation and error handling
951
- # BUG #23: Parameters are read from Redis to survive Bash tool session boundaries
952
- ./.claude/skills/cfn-loop-orchestration/orchestrate-wrapper.sh \
953
- --task-id "$TASK_ID" \
954
- --mode "standard" \
955
- --loop3-agents "$LOOP3_AGENTS" \
956
- --loop2-agents "$LOOP2_AGENTS" \
957
- --product-owner "$PRODUCT_OWNER" \
958
- --max-iterations 10 \
959
- --success-criteria "enabled"
960
-
961
- # The orchestrator handles ALL CFN Loop execution including:
962
- # - Loop 3 agent spawning and iteration
963
- # - Loop 2 validator spawning and consensus
964
- # - Product Owner decision (PROCEED/ITERATE/ABORT)
965
- # - Git commit and push (on PROCEED)
966
- # - Sprint summary generation
967
-
968
- # Your job is complete after invoking this command - DO NOT wait for results
969
- ```
970
-
971
- **EXECUTION GUARANTEE:**
972
- - If steps 1-2 fail, use hardcoded defaults and proceed to step 3
973
- - **Step 2 stores parameters in Redis** (BUG #23 fix - persistence)
974
- - **Step 2.5 validates parameters from Redis** (BUG #22 + BUG #23 fix - retrieval + fallbacks)
975
- - **Step 3 reads parameters from Redis** (BUG #23 fix - fresh shell reads from persistent storage)
976
- - **Never exit without invoking orchestrator**
977
- - **Orchestrator invocation MUST happen by iteration 3**
978
- - This coordinator's ONLY job is to configure and invoke the orchestrator
979
933
 
980
934
 
981
935
  ## Multi-Worktree Coordination
@@ -1022,4 +976,5 @@ npx claude-flow-novice agent-spawn backend-developer \
1022
976
  - Validation criteria cover all critical requirements
1023
977
  - Deliverable list is comprehensive
1024
978
  - Confidence score ≥ 0.85 in analysis quality
1025
- - **CRITICAL: Orchestrator invoked successfully**
979
+ - **CRITICAL: Orchestrator invoked successfully**
980
+
@@ -132,8 +132,8 @@ Remember: The best infrastructure is invisible—seamless, scalable, and empower
132
132
 
133
133
  Complete your work and provide a structured response with:
134
134
  - Confidence score (0.0-1.0) based on work quality
135
- - Summary of analysis/review completed
136
- - List of findings or deliverables
137
- - Any recommendations made
135
+ - Summary of work completed
136
+ - List of deliverables created
137
+ - Any recommendations or findings
138
138
 
139
- **Note:** Coordination instructions are provided when spawned via CLI.
139
+ **Note:** Coordination handled automatically by the system.
@@ -58,6 +58,8 @@ fi
58
58
 
59
59
  **Old (Deprecated):**
60
60
  ```bash
61
+ # Not shown - deprecated pattern
62
+ ```
61
63
 
62
64
  **New (Required):**
63
65
  ```bash
@@ -619,45 +621,15 @@ networks:
619
621
 
620
622
  ---
621
623
 
622
- ## Completion Protocol (Test-Driven)
623
-
624
- Complete your work and provide test-based validation:
625
-
626
- 1. **Execute Tests**: Run all test suites from success criteria
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
624
+ ## Completion Protocol
639
625
 
640
- 3. **Coverage Check**: Ensure coverage meets minimum thresholds
641
- - Build tests: ≥95%
642
- - Security tests: ≥90%
643
- - Coverage: ≥80%
644
-
645
- 4. **Store in Redis**: Use test-results key (not confidence key)
646
-
647
- 5. **Signal Completion**: Push to completion queue
648
-
649
- **Example Report:**
650
- ```
651
- Test Execution Summary:
652
- - Build Tests: 45/47 passed (95.7%)
653
- - Security Scan Tests: 12/12 passed (100%)
654
- - Performance Tests: 8/10 passed (80%)
655
- - Overall: 65/69 passed (94.2%)
656
- - Coverage: 84.3%
657
- - Gate Status: PASS (≥95% in 2/3 suites, ≥80% overall)
658
- ```
626
+ Complete your work and provide a structured response with:
627
+ - Confidence score (0.0-1.0) based on work quality
628
+ - Summary of work completed
629
+ - List of deliverables created
630
+ - Any recommendations or findings
659
631
 
660
- **Note:** Coordination instructions and success criteria provided when spawned via CLI.
632
+ **Note:** Coordination handled automatically by the system.
661
633
 
662
634
  ## Success Metrics
663
635
  - Images build successfully
@@ -59,6 +59,8 @@ fi
59
59
 
60
60
  **Old (Deprecated):**
61
61
  ```bash
62
+ # Not shown - deprecated pattern
63
+ ```
62
64
 
63
65
  **New (Required):**
64
66
  ```bash
@@ -593,42 +595,12 @@ Before reporting high confidence:
593
595
  4. **Monitoring Setup**: Prometheus metrics, Grafana dashboards
594
596
  5. **CI/CD Integration**: GitOps workflows, ArgoCD applications
595
597
 
596
- ## Completion Protocol (Test-Driven)
597
-
598
- Complete your work and provide test-based validation:
599
-
600
- 1. **Execute Tests**: Run all test suites from success criteria
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
598
+ ## Completion Protocol
613
599
 
614
- 3. **Coverage Check**: Ensure coverage meets minimum thresholds
615
- - Manifest tests: ≥95%
616
- - Deployment tests: ≥90%
617
- - Coverage: ≥80%
618
-
619
- 4. **Store in Redis**: Use test-results key (not confidence key)
620
-
621
- 5. **Signal Completion**: Push to completion queue
622
-
623
- **Example Report:**
624
- ```
625
- Test Execution Summary:
626
- - Manifest Tests: 45/47 passed (95.7%)
627
- - Helm Chart Tests: 12/12 passed (100%)
628
- - Deployment Tests: 8/10 passed (80%)
629
- - Overall: 65/69 passed (94.2%)
630
- - Coverage: 84.3%
631
- - Gate Status: PASS (≥95% in 2/3 suites, ≥80% overall)
632
- ```
600
+ Complete your work and provide a structured response with:
601
+ - Confidence score (0.0-1.0) based on work quality
602
+ - Summary of work completed
603
+ - List of deliverables created
604
+ - Any recommendations or findings
633
605
 
634
- **Note:** Coordination instructions and success criteria provided when spawned via CLI.
606
+ **Note:** Coordination handled automatically by the system.
@@ -746,11 +746,11 @@ Before reporting high confidence:
746
746
 
747
747
  Complete your work and provide a structured response with:
748
748
  - Confidence score (0.0-1.0) based on work quality
749
- - Summary of analysis/review completed
750
- - List of findings or deliverables
751
- - Any recommendations made
749
+ - Summary of work completed
750
+ - List of deliverables created
751
+ - Any recommendations or findings
752
752
 
753
- **Note:** Coordination instructions are provided when spawned via CLI.
753
+ **Note:** Coordination handled automatically by the system.
754
754
 
755
755
  ## Skill References
756
756
  → **Prometheus Setup**: `.claude/skills/prometheus-monitoring/SKILL.md`
@@ -67,10 +67,8 @@ fi
67
67
 
68
68
  ### 3. Report Test Results (NOT Confidence)
69
69
 
70
- **Old (Deprecated):**
71
- ```bash
70
+ Execute tests and report objective pass/fail metrics:
72
71
 
73
- **New (Required):**
74
72
  ```bash
75
73
  # Execute tests and capture output
76
74
  TEST_OUTPUT=$(npm test 2>&1)
@@ -81,6 +79,8 @@ FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
81
79
  TOTAL=$((PASS + FAIL))
82
80
  RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
83
81
 
82
+ # Return results (Main Chat receives automatically in Task Mode)
83
+ echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
84
84
  ```
85
85
 
86
86
  # API Gateway Specialist Agent
@@ -958,42 +958,12 @@ Before reporting high confidence:
958
958
  → **OAuth2/JWT**: `.claude/skills/oauth2-jwt-auth/SKILL.md`
959
959
  → **Nginx Reverse Proxy**: `.claude/skills/nginx-reverse-proxy/SKILL.md`
960
960
 
961
- ## Completion Protocol (Test-Driven)
962
-
963
- Complete your work and provide test-based validation:
964
-
965
- 1. **Execute Tests**: Run all test suites from success criteria
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
961
+ ## Completion Protocol
978
962
 
979
- 3. **Coverage Check**: Ensure coverage meets minimum thresholds
980
- - Core tests: ≥95%
981
- - Configuration tests: ≥90%
982
- - Coverage: ≥80%
983
-
984
- 4. **Store in Redis**: Use test-results key (not confidence key)
985
-
986
- 5. **Signal Completion**: Push to completion queue
987
-
988
- **Example Report:**
989
- ```
990
- Test Execution Summary:
991
- - Configuration Tests: 45/47 passed (95.7%)
992
- - Security Tests: 12/12 passed (100%)
993
- - Performance Tests: 8/10 passed (80%)
994
- - Overall: 65/69 passed (94.2%)
995
- - Coverage: 84.3%
996
- - Gate Status: PASS (≥95% in 2/3 suites, ≥80% overall)
997
- ```
963
+ Complete your work and provide a structured response with:
964
+ - Confidence score (0.0-1.0) based on work quality
965
+ - Summary of work completed
966
+ - List of deliverables created
967
+ - Any recommendations or findings
998
968
 
999
- **Note:** Coordination instructions and success criteria provided when spawned via CLI.
969
+ **Note:** Coordination handled automatically by the system.
@@ -352,6 +352,9 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
352
352
 
353
353
  # Return results (Main Chat receives automatically in Task Mode)
354
354
  echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
355
+ ```
356
+
357
+ 2. **Report Pass Rate**: Return test results in JSON format
355
358
  - Coverage: ≥80%
356
359
  4. **Store in Redis**: Use test-results key (not confidence key)
357
360
  5. **Signal Completion**: Push to completion queue