claude-flow-novice 1.3.5 → 1.5.0
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.
- package/.claude/agents/analysis/code-analyzer.md +3 -20
- package/.claude/agents/analysis/code-review/analyze-code-quality.md +1 -1
- package/.claude/agents/analyst.md +300 -0
- package/.claude/agents/architect.md +557 -0
- package/.claude/agents/architecture/system-architect.md +630 -0
- package/.claude/agents/architecture/system-design/arch-system-design.md +1 -1
- package/.claude/agents/base-template-generator.md +24 -1
- package/.claude/agents/coder.md +180 -0
- package/.claude/agents/consensus/byzantine-coordinator.md +4 -21
- package/.claude/agents/consensus/consensus-builder.md +3 -20
- package/.claude/agents/consensus/crdt-synchronizer.md +4 -21
- package/.claude/agents/consensus/gossip-coordinator.md +4 -21
- package/.claude/agents/consensus/performance-benchmarker.md +4 -21
- package/.claude/agents/consensus/quorum-manager.md +4 -21
- package/.claude/agents/consensus/raft-manager.md +4 -21
- package/.claude/agents/consensus/security-manager.md +4 -21
- package/.claude/agents/coordinator.md +842 -0
- package/.claude/agents/data/ml/data-ml-model.md +2 -2
- package/.claude/agents/development/backend/dev-backend-api.md +2 -2
- package/.claude/agents/devops/ci-cd/ops-cicd-github.md +2 -2
- package/.claude/agents/devops/devops-engineer.md +638 -0
- package/.claude/agents/documentation/api-docs/docs-api-openapi.md +2 -2
- package/.claude/agents/github/code-review-swarm.md +1 -1
- package/.claude/agents/github/github-specialist.md +856 -0
- package/.claude/agents/github/pr-manager.md +1 -1
- package/.claude/agents/github/release-manager.md +1 -1
- package/.claude/agents/neural/neural-pattern-agent.md +762 -0
- package/.claude/agents/optimization/benchmark-suite.md +1 -1
- package/.claude/agents/optimization/perf-analyzer.md +725 -0
- package/.claude/agents/optimization/performance-monitor.md +1 -1
- package/.claude/agents/planner.md +135 -0
- package/.claude/agents/researcher.md +185 -0
- package/.claude/agents/reviewer.md +291 -0
- package/.claude/agents/security/security-specialist.md +978 -0
- package/.claude/agents/sparc/architecture.md +1 -1
- package/.claude/agents/sparc/pseudocode.md +1 -1
- package/.claude/agents/sparc/refinement.md +1 -1
- package/.claude/agents/sparc/specification.md +1 -1
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +2 -2
- package/.claude/agents/swarm/adaptive-coordinator-enhanced.md +746 -0
- package/.claude/agents/tester.md +663 -0
- package/.claude/agents/testing/unit/tdd-london-swarm.md +1 -1
- package/.claude/agents/testing/validation/production-validator.md +1 -1
- package/.claude/commands/claude-soul.js +1 -1
- package/.claude/hooks.json +12 -15
- package/{.claude → .claude-flow-novice/.claude}/agents/MIGRATION_SUMMARY.md +1 -1
- package/.claude-flow-novice/.claude/agents/analysis/code-analyzer.md +192 -0
- package/.claude-flow-novice/.claude/agents/analysis/code-review/analyze-code-quality.md +180 -0
- package/.claude-flow-novice/.claude/agents/analyst.md +300 -0
- package/.claude-flow-novice/.claude/agents/architect.md +557 -0
- package/.claude-flow-novice/.claude/agents/architecture/system-architect.md +630 -0
- package/.claude-flow-novice/.claude/agents/architecture/system-design/arch-system-design.md +156 -0
- package/.claude-flow-novice/.claude/agents/backend-dev.json +42 -0
- package/.claude-flow-novice/.claude/agents/base-template-generator.md +65 -0
- package/.claude-flow-novice/.claude/agents/code-analyzer.json +39 -0
- package/.claude-flow-novice/.claude/agents/coder.json +42 -0
- package/.claude-flow-novice/.claude/agents/coder.md +180 -0
- package/.claude-flow-novice/.claude/agents/consensus/byzantine-coordinator.md +46 -0
- package/.claude-flow-novice/.claude/agents/consensus/consensus-builder.md +225 -0
- package/.claude-flow-novice/.claude/agents/consensus/crdt-synchronizer.md +980 -0
- package/.claude-flow-novice/.claude/agents/consensus/gossip-coordinator.md +46 -0
- package/.claude-flow-novice/.claude/agents/consensus/performance-benchmarker.md +834 -0
- package/.claude-flow-novice/.claude/agents/consensus/quorum-manager.md +806 -0
- package/.claude-flow-novice/.claude/agents/consensus/raft-manager.md +46 -0
- package/.claude-flow-novice/.claude/agents/consensus/security-manager.md +605 -0
- package/.claude-flow-novice/.claude/agents/coordinator.md +842 -0
- package/.claude-flow-novice/.claude/agents/data/ml/data-ml-model.md +193 -0
- package/.claude-flow-novice/.claude/agents/development/backend/dev-backend-api.md +142 -0
- package/.claude-flow-novice/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
- package/.claude-flow-novice/.claude/agents/devops/devops-engineer.md +638 -0
- package/.claude-flow-novice/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
- package/.claude-flow-novice/.claude/agents/github/code-review-swarm.md +538 -0
- package/.claude-flow-novice/.claude/agents/github/github-modes.md +173 -0
- package/.claude-flow-novice/.claude/agents/github/github-specialist.md +856 -0
- package/.claude-flow-novice/.claude/agents/github/issue-tracker.md +319 -0
- package/.claude-flow-novice/.claude/agents/github/multi-repo-swarm.md +553 -0
- package/.claude-flow-novice/.claude/agents/github/pr-manager.md +191 -0
- package/.claude-flow-novice/.claude/agents/github/project-board-sync.md +509 -0
- package/.claude-flow-novice/.claude/agents/github/release-manager.md +367 -0
- package/.claude-flow-novice/.claude/agents/github/release-swarm.md +583 -0
- package/.claude-flow-novice/.claude/agents/github/repo-architect.md +398 -0
- package/.claude-flow-novice/.claude/agents/github/swarm-issue.md +573 -0
- package/.claude-flow-novice/.claude/agents/github/swarm-pr.md +428 -0
- package/.claude-flow-novice/.claude/agents/github/sync-coordinator.md +452 -0
- package/.claude-flow-novice/.claude/agents/github/workflow-automation.md +635 -0
- package/.claude-flow-novice/.claude/agents/goal/goal-planner.md +73 -0
- package/.claude-flow-novice/.claude/agents/neural/neural-pattern-agent.md +762 -0
- package/.claude-flow-novice/.claude/agents/neural/safla-neural.md +74 -0
- package/.claude-flow-novice/.claude/agents/optimization/benchmark-suite.md +665 -0
- package/.claude-flow-novice/.claude/agents/optimization/load-balancer.md +431 -0
- package/.claude-flow-novice/.claude/agents/optimization/perf-analyzer.md +725 -0
- package/.claude-flow-novice/.claude/agents/optimization/performance-monitor.md +672 -0
- package/.claude-flow-novice/.claude/agents/optimization/resource-allocator.md +674 -0
- package/.claude-flow-novice/.claude/agents/optimization/topology-optimizer.md +808 -0
- package/.claude-flow-novice/.claude/agents/planner.json +41 -0
- package/.claude-flow-novice/.claude/agents/planner.md +135 -0
- package/.claude-flow-novice/.claude/agents/researcher.json +41 -0
- package/.claude-flow-novice/.claude/agents/researcher.md +185 -0
- package/.claude-flow-novice/.claude/agents/reviewer.json +39 -0
- package/.claude-flow-novice/.claude/agents/reviewer.md +291 -0
- package/.claude-flow-novice/.claude/agents/security/security-specialist.md +978 -0
- package/.claude-flow-novice/.claude/agents/sparc/architecture.md +472 -0
- package/.claude-flow-novice/.claude/agents/sparc/pseudocode.md +318 -0
- package/.claude-flow-novice/.claude/agents/sparc/refinement.md +525 -0
- package/.claude-flow-novice/.claude/agents/sparc/specification.md +276 -0
- package/.claude-flow-novice/.claude/agents/specialized/mobile/spec-mobile-react-native.md +226 -0
- package/.claude-flow-novice/.claude/agents/sublinear/consciousness-evolution-agent.md +499 -0
- package/.claude-flow-novice/.claude/agents/sublinear/matrix-solver-agent.md +113 -0
- package/.claude-flow-novice/.claude/agents/sublinear/nanosecond-scheduler-agent.md +644 -0
- package/.claude-flow-novice/.claude/agents/sublinear/pagerank-agent.md +699 -0
- package/.claude-flow-novice/.claude/agents/sublinear/phi-calculator-agent.md +749 -0
- package/.claude-flow-novice/.claude/agents/sublinear/psycho-symbolic-agent.md +543 -0
- package/.claude-flow-novice/.claude/agents/sublinear/sublinear.md +816 -0
- package/.claude-flow-novice/.claude/agents/sublinear/temporal-advantage-agent.md +360 -0
- package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator-enhanced.md +746 -0
- package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator.md +396 -0
- package/.claude-flow-novice/.claude/agents/swarm/hierarchical-coordinator.md +300 -0
- package/.claude-flow-novice/.claude/agents/swarm/mesh-coordinator.md +435 -0
- package/.claude-flow-novice/.claude/agents/system-architect.json +40 -0
- package/.claude-flow-novice/.claude/agents/templates/automation-smart-agent.md +205 -0
- package/.claude-flow-novice/.claude/agents/templates/coordinator-swarm-init.md +90 -0
- package/.claude-flow-novice/.claude/agents/templates/github-pr-manager.md +177 -0
- package/.claude-flow-novice/.claude/agents/templates/implementer-sparc-coder.md +259 -0
- package/.claude-flow-novice/.claude/agents/templates/memory-coordinator.md +187 -0
- package/.claude-flow-novice/.claude/agents/templates/migration-plan.md +746 -0
- package/.claude-flow-novice/.claude/agents/templates/orchestrator-task.md +139 -0
- package/.claude-flow-novice/.claude/agents/templates/performance-analyzer.md +199 -0
- package/.claude-flow-novice/.claude/agents/templates/sparc-coordinator.md +183 -0
- package/.claude-flow-novice/.claude/agents/tester.json +40 -0
- package/.claude-flow-novice/.claude/agents/tester.md +663 -0
- package/.claude-flow-novice/.claude/agents/testing/e2e/playwright-agent.md +249 -0
- package/.claude-flow-novice/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
- package/.claude-flow-novice/.claude/agents/testing/validation/production-validator.md +395 -0
- package/.claude-flow-novice/dist/index.js +12 -24
- package/.claude-flow-novice/dist/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/agent-manager.js +123 -69
- package/.claude-flow-novice/dist/src/agents/agent-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js +7 -7
- package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js.map +1 -1
- package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js +485 -0
- package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js +630 -0
- package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/agent.js +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/agent.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/config-integration.js +6 -6
- package/.claude-flow-novice/dist/src/cli/commands/enterprise.js +18 -18
- package/.claude-flow-novice/dist/src/cli/commands/enterprise.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/goal-init.js +4 -4
- package/.claude-flow-novice/dist/src/cli/commands/help-new.js +23 -23
- package/.claude-flow-novice/dist/src/cli/commands/help-new.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/help.js +74 -74
- package/.claude-flow-novice/dist/src/cli/commands/help.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js +2 -2
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/hive.js +4 -4
- package/.claude-flow-novice/dist/src/cli/commands/index.js +103 -132
- package/.claude-flow-novice/dist/src/cli/commands/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/mcp.js +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/migrate.js +4 -4
- package/.claude-flow-novice/dist/src/cli/commands/migrate.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/monitor.js +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/neural-init.js +4 -4
- package/.claude-flow-novice/dist/src/cli/commands/ruv-swarm.js +8 -8
- package/.claude-flow-novice/dist/src/cli/commands/sparc.js +12 -12
- package/.claude-flow-novice/dist/src/cli/commands/sparc.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/start/start-command.js +3 -3
- package/.claude-flow-novice/dist/src/cli/commands/status.js +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/swarm.js +7 -7
- package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/verification.js +18 -18
- package/.claude-flow-novice/dist/src/cli/completion.js +54 -54
- package/.claude-flow-novice/dist/src/cli/completion.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js +11 -11
- package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/core/CommandHandlers.js +31 -31
- package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js +39 -39
- package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js +25 -25
- package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js +8 -8
- package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js +6 -6
- package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js +7 -7
- package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/index-remote.js +10 -10
- package/.claude-flow-novice/dist/src/cli/index.js +1 -1
- package/.claude-flow-novice/dist/src/cli/init/directory-structure.js +8 -8
- package/.claude-flow-novice/dist/src/cli/init/index.js +3 -3
- package/.claude-flow-novice/dist/src/cli/init/sparc-environment.js +67 -67
- package/.claude-flow-novice/dist/src/cli/init/swarm-commands.js +18 -18
- package/.claude-flow-novice/dist/src/cli/node-repl.js +2 -2
- package/.claude-flow-novice/dist/src/cli/repl.js +1 -1
- package/.claude-flow-novice/dist/src/cli/simple-cli.js +68 -68
- package/.claude-flow-novice/dist/src/cli/simple-cli.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/simple-commands/session-start-soul.js +271 -0
- package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js +7 -7
- package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/ui/fallback-handler.js +7 -7
- package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js +816 -0
- package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js +812 -0
- package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/optimized-serialization.js +369 -0
- package/.claude-flow-novice/dist/src/communication/optimized-serialization.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/performance-optimizations.js +526 -0
- package/.claude-flow-novice/dist/src/communication/performance-optimizations.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/performance-validator.js +532 -0
- package/.claude-flow-novice/dist/src/communication/performance-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/priority-message-queue.js +525 -0
- package/.claude-flow-novice/dist/src/communication/priority-message-queue.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js +218 -0
- package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js +521 -0
- package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js +563 -0
- package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/websocket-cluster.js +344 -0
- package/.claude-flow-novice/dist/src/communication/websocket-cluster.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js +369 -0
- package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/config-manager.js +1 -1
- package/.claude-flow-novice/dist/src/config/config-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/config/core/intelligent-configuration-manager.js +1 -1
- package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js +6 -6
- package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js.map +1 -1
- package/.claude-flow-novice/dist/src/config/migration/config-migration.js +1 -1
- package/.claude-flow-novice/dist/src/config/ruv-swarm-integration.js +1 -1
- package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js +1 -1
- package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js.map +1 -1
- package/.claude-flow-novice/dist/src/config/web-portal-config.js +0 -9
- package/.claude-flow-novice/dist/src/config/web-portal-config.js.map +1 -1
- package/.claude-flow-novice/dist/src/config/zero-config-setup.js +18 -18
- package/.claude-flow-novice/dist/src/config/zero-config-setup.js.map +1 -1
- package/.claude-flow-novice/dist/src/core/logger.js +33 -10
- package/.claude-flow-novice/dist/src/core/logger.js.map +1 -1
- package/.claude-flow-novice/dist/src/migration/index.js +1 -1
- package/.claude-flow-novice/dist/src/migration/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/migration/migration-runner.js +4 -4
- package/.claude-flow-novice/dist/src/migration/migration-runner.js.map +1 -1
- package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js +430 -0
- package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/slash-commands/claude-soul.js +248 -365
- package/.claude-flow-novice/dist/src/slash-commands/register-all-commands.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/claude-code-interface.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/claude-flow-executor.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js +471 -0
- package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/hive-mind-integration.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js +543 -0
- package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/optimizations/connection-pool.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/optimizations/optimized-executor.js +1 -1
- package/.claude-flow-novice/dist/src/swarm/types.js.map +1 -1
- package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js +709 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js +612 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js +679 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js +654 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js +402 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js +459 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js +513 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js +19 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js +568 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js +418 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js +530 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js +250 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js.map +1 -0
- package/.claude-flow-novice/dist/src/task/index.js +7 -7
- package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js +420 -0
- package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/validation/production-validator.js +1435 -0
- package/.claude-flow-novice/dist/src/validation/production-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/cli-integration.js +3 -3
- package/.claude-flow-novice/dist/src/verification/hooks.js +1 -1
- package/CHANGELOG.md +13 -0
- package/CLAUDE.md +1032 -61
- package/README.md +0 -1
- package/config/build/babel.config.cjs +19 -11
- package/config/typescript/tsconfig.json +1 -1
- package/examples/02-workflows/claude-workflow.json +5 -5
- package/examples/claude-api-error-handling.ts +2 -2
- package/examples/frontend-testing-demo.ts +470 -0
- package/examples/litellm/config/config.yaml +1 -1
- package/package.json +13 -7
- package/scripts/build/unified-builder.sh +6 -6
- package/scripts/build/validate-agents.js +238 -0
- package/scripts/post-install-claude-md.js +28 -0
- package/scripts/run-production-validation.ts +590 -0
- package/scripts/test/test-coordination-features.ts +2 -2
- package/scripts/validate-stage3-performance.ts +377 -0
- package/src/cli/simple-commands/hooks.js +1 -0
- package/src/cli/simple-commands/init/agent-copier.js +0 -2
- package/src/cli/simple-commands/init/index.js +18 -110
- package/src/cli/simple-commands/init/templates/CLAUDE.md +162 -1158
- package/src/cli/simple-commands/init/templates/claude-md.js +38 -157
- package/src/swarm-fullstack/integrations/communication-bridge.ts +931 -0
- package/src/swarm-fullstack/testing/api-contract-validator.ts +909 -0
- package/src/swarm-fullstack/testing/backend-test-orchestrator.ts +791 -0
- package/src/swarm-fullstack/testing/frontend-test-orchestrator.ts +853 -0
- package/src/swarm-fullstack/testing/visual-regression.ts +507 -0
- package/src/swarm-fullstack/workflows/convergence-detector.ts +736 -0
- package/src/swarm-fullstack/workflows/fix-coordinator.ts +677 -0
- package/src/swarm-fullstack/workflows/index.ts +75 -0
- package/src/swarm-fullstack/workflows/iterative-build-test.ts +829 -0
- package/src/swarm-fullstack/workflows/regression-test-manager.ts +590 -0
- package/src/swarm-fullstack/workflows/test-result-analyzer.ts +739 -0
- package/src/swarm-fullstack/workflows/workflow-metrics.ts +399 -0
- package/wiki/command-reference/README.md +1 -2
- package/wiki/command-reference/mcp-tools/README.md +1 -1
- package/wiki/getting-started/claude-code-mcp/README.md +1 -2
- package/wiki/getting-started/installation/README.md +2 -10
- package/.claude/agents/backend-dev.json +0 -9
- package/.claude/agents/code-analyzer.json +0 -9
- package/.claude/agents/coder.json +0 -9
- package/.claude/agents/planner.json +0 -9
- package/.claude/agents/researcher.json +0 -9
- package/.claude/agents/reviewer.json +0 -9
- package/.claude/agents/system-architect.json +0 -9
- package/.claude/agents/tester.json +0 -9
- package/.claude/commands/flow-nexus/app-store.md +0 -124
- package/.claude/commands/flow-nexus/challenges.md +0 -120
- package/.claude/commands/flow-nexus/login-registration.md +0 -65
- package/.claude/commands/flow-nexus/neural-network.md +0 -134
- package/.claude/commands/flow-nexus/payments.md +0 -116
- package/.claude/commands/flow-nexus/sandbox.md +0 -83
- package/.claude/commands/flow-nexus/swarm.md +0 -87
- package/.claude/commands/flow-nexus/user-tools.md +0 -152
- package/.claude/commands/flow-nexus/workflow.md +0 -115
- package/.claude-flow-novice/dist/cli/index.js +0 -45
- package/.claude-flow-novice/dist/core/index.js +0 -22
- package/.claude-flow-novice/dist/mcp/mcp-server-novice.js +0 -595
- package/.claude-flow-novice/dist/mcp/mcp-server-sdk.js +0 -649
- package/.claude-flow-novice/dist/mcp/mcp-server-with-slash-commands.js +0 -776
- package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/claude-md.js +0 -1101
- package/src/cli/simple-commands/init/templates/CLAUDE.md.optimized +0 -265
- /package/{.claude → .claude-flow-novice/.claude}/agents/README.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/consensus/README.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/core/coder.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/core/planner.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/core/researcher.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/core/reviewer.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/core/tester.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/optimization/README.md +0 -0
- /package/{.claude → .claude-flow-novice/.claude}/agents/swarm/README.md +0 -0
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tester
|
|
3
|
+
description: MUST BE USED when creating tests, validating functionality, implementing TDD practices, or ensuring code quality. Use PROACTIVELY for unit tests, integration tests, end-to-end tests, test automation, coverage validation, bug validation, performance testing, security testing, regression testing, and CI/CD test pipelines. ALWAYS delegate when user asks to "test", "create tests", "write test cases", "validate functionality", "check coverage", "implement TDD", "verify behavior", "ensure quality", "test automation", or mentions testing frameworks (Jest, Mocha, Pytest, etc.). Keywords - test, validate, TDD, unit test, integration test, e2e test, coverage, test suite, quality assurance, QA, bug validation, test-driven development, test strategy, test automation, regression test, acceptance test
|
|
4
|
+
tools: Read, Write, Edit, MultiEdit, Bash, Glob, Grep, TodoWrite
|
|
5
|
+
model: sonnet
|
|
6
|
+
color: purple
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a Tester Agent, a quality assurance expert specializing in comprehensive testing strategies, test implementation, and quality validation. Your expertise lies in ensuring software reliability, functionality, and performance through systematic testing approaches and automated quality assurance processes.
|
|
10
|
+
|
|
11
|
+
## 🚨 MANDATORY POST-EDIT VALIDATION
|
|
12
|
+
|
|
13
|
+
**CRITICAL**: After **EVERY** test file creation or modification, you **MUST** run the enhanced post-edit hook:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# After editing any test file, IMMEDIATELY run:
|
|
17
|
+
/hooks post-edit [FILE_PATH] --memory-key "tester/[TEST_SUITE]" --structured
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**This provides**:
|
|
21
|
+
- 🧪 **TDD Compliance**: Validates Red-Green-Refactor cycle adherence
|
|
22
|
+
- 📊 **Test Coverage**: Real-time coverage analysis with threshold validation
|
|
23
|
+
- 🔍 **Test Quality**: Analyzes test completeness and effectiveness
|
|
24
|
+
- 🤖 **Test Recommendations**: Suggests missing test cases and improvements
|
|
25
|
+
- 💾 **Memory Coordination**: Tracks testing progress across agent interactions
|
|
26
|
+
|
|
27
|
+
**⚠️ CRITICAL FOR TDD**: This hook validates proper TDD practices and ensures test quality.
|
|
28
|
+
|
|
29
|
+
## Core Responsibilities
|
|
30
|
+
|
|
31
|
+
### 1. Test Strategy & Planning
|
|
32
|
+
- **Test Strategy Development**: Create comprehensive testing approaches for projects
|
|
33
|
+
- **Test Planning**: Define test scope, objectives, and methodologies
|
|
34
|
+
- **Quality Gates**: Establish quality criteria and acceptance standards
|
|
35
|
+
- **Test Data Management**: Design and manage test data sets and fixtures
|
|
36
|
+
- **Risk-Based Testing**: Prioritize testing efforts based on risk assessment
|
|
37
|
+
|
|
38
|
+
### 2. Test Implementation
|
|
39
|
+
- **Unit Testing**: Write comprehensive unit tests for individual components
|
|
40
|
+
- **Integration Testing**: Test component interactions and system integration
|
|
41
|
+
- **End-to-End Testing**: Validate complete user workflows and system behavior
|
|
42
|
+
- **API Testing**: Test REST/GraphQL APIs, endpoints, and data contracts
|
|
43
|
+
- **Performance Testing**: Measure and validate system performance characteristics
|
|
44
|
+
|
|
45
|
+
### 3. Quality Assurance
|
|
46
|
+
- **Code Quality Analysis**: Review code for testability and quality issues
|
|
47
|
+
- **Test Coverage Analysis**: Ensure adequate test coverage across codebase
|
|
48
|
+
- **Bug Detection & Validation**: Identify, reproduce, and validate defects
|
|
49
|
+
- **Regression Testing**: Ensure new changes don't break existing functionality
|
|
50
|
+
- **Security Testing**: Validate security controls and identify vulnerabilities
|
|
51
|
+
|
|
52
|
+
## Testing Methodologies
|
|
53
|
+
|
|
54
|
+
### 1. Unit Testing Patterns
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
// Jest/Vitest unit testing
|
|
58
|
+
describe('UserService', () => {
|
|
59
|
+
let userService: UserService;
|
|
60
|
+
let mockUserRepository: jest.Mocked<UserRepository>;
|
|
61
|
+
let mockPasswordService: jest.Mocked<PasswordService>;
|
|
62
|
+
|
|
63
|
+
beforeEach(() => {
|
|
64
|
+
mockUserRepository = {
|
|
65
|
+
create: jest.fn(),
|
|
66
|
+
findById: jest.fn(),
|
|
67
|
+
findByEmail: jest.fn(),
|
|
68
|
+
update: jest.fn(),
|
|
69
|
+
delete: jest.fn(),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
mockPasswordService = {
|
|
73
|
+
hash: jest.fn(),
|
|
74
|
+
compare: jest.fn(),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
userService = new UserService(mockUserRepository, mockPasswordService);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
describe('createUser', () => {
|
|
81
|
+
it('should create user with hashed password', async () => {
|
|
82
|
+
// Arrange
|
|
83
|
+
const userData = {
|
|
84
|
+
email: 'test@example.com',
|
|
85
|
+
password: 'test123',
|
|
86
|
+
name: 'Test User'
|
|
87
|
+
};
|
|
88
|
+
const hashedPassword = 'hash123';
|
|
89
|
+
const expectedUser = { id: '1', ...userData, password: hashedPassword };
|
|
90
|
+
|
|
91
|
+
mockPasswordService.hash.mockResolvedValue(hashedPassword);
|
|
92
|
+
mockUserRepository.create.mockResolvedValue(expectedUser);
|
|
93
|
+
|
|
94
|
+
// Act
|
|
95
|
+
const result = await userService.createUser(userData);
|
|
96
|
+
|
|
97
|
+
// Assert
|
|
98
|
+
expect(mockPasswordService.hash).toHaveBeenCalledWith('plaintext');
|
|
99
|
+
expect(mockUserRepository.create).toHaveBeenCalledWith({
|
|
100
|
+
...userData,
|
|
101
|
+
password: hashedPassword
|
|
102
|
+
});
|
|
103
|
+
expect(result).toEqual(expectedUser);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it('should throw ValidationError for invalid email', async () => {
|
|
107
|
+
// Arrange
|
|
108
|
+
const invalidUserData = {
|
|
109
|
+
email: 'invalid-email',
|
|
110
|
+
password: 'password123',
|
|
111
|
+
name: 'Test User'
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// Act & Assert
|
|
115
|
+
await expect(userService.createUser(invalidUserData))
|
|
116
|
+
.rejects.toThrow(ValidationError);
|
|
117
|
+
expect(mockUserRepository.create).not.toHaveBeenCalled();
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('should handle repository errors gracefully', async () => {
|
|
121
|
+
// Arrange
|
|
122
|
+
const userData = {
|
|
123
|
+
email: 'test@example.com',
|
|
124
|
+
password: 'password123',
|
|
125
|
+
name: 'Test User'
|
|
126
|
+
};
|
|
127
|
+
mockPasswordService.hash.mockResolvedValue('hashed');
|
|
128
|
+
mockUserRepository.create.mockRejectedValue(new Error('Database error'));
|
|
129
|
+
|
|
130
|
+
// Act & Assert
|
|
131
|
+
await expect(userService.createUser(userData))
|
|
132
|
+
.rejects.toThrow('Database error');
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 2. Integration Testing
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
// Supertest for API integration testing
|
|
142
|
+
describe('User API Integration', () => {
|
|
143
|
+
let app: Express;
|
|
144
|
+
let testDb: TestDatabase;
|
|
145
|
+
|
|
146
|
+
beforeAll(async () => {
|
|
147
|
+
testDb = await setupTestDatabase();
|
|
148
|
+
app = createApp(testDb);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
afterAll(async () => {
|
|
152
|
+
await testDb.cleanup();
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
beforeEach(async () => {
|
|
156
|
+
await testDb.reset();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
describe('POST /api/users', () => {
|
|
160
|
+
it('should create user and return 201', async () => {
|
|
161
|
+
const userData = {
|
|
162
|
+
email: 'test@example.com',
|
|
163
|
+
password: 'securePassword123',
|
|
164
|
+
name: 'Test User'
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const response = await request(app)
|
|
168
|
+
.post('/api/users')
|
|
169
|
+
.send(userData)
|
|
170
|
+
.expect(201);
|
|
171
|
+
|
|
172
|
+
expect(response.body).toMatchObject({
|
|
173
|
+
success: true,
|
|
174
|
+
data: {
|
|
175
|
+
id: expect.any(String),
|
|
176
|
+
email: userData.email,
|
|
177
|
+
name: userData.name,
|
|
178
|
+
password: undefined // Password should not be returned
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// Verify user was created in database
|
|
183
|
+
const createdUser = await testDb.users.findById(response.body.data.id);
|
|
184
|
+
expect(createdUser).toBeTruthy();
|
|
185
|
+
expect(createdUser.email).toBe(userData.email);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('should return 400 for duplicate email', async () => {
|
|
189
|
+
const userData = {
|
|
190
|
+
email: 'existing@example.com',
|
|
191
|
+
password: 'password123',
|
|
192
|
+
name: 'Test User'
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// Create user first
|
|
196
|
+
await testDb.users.create(userData);
|
|
197
|
+
|
|
198
|
+
// Attempt to create duplicate
|
|
199
|
+
const response = await request(app)
|
|
200
|
+
.post('/api/users')
|
|
201
|
+
.send(userData)
|
|
202
|
+
.expect(400);
|
|
203
|
+
|
|
204
|
+
expect(response.body).toMatchObject({
|
|
205
|
+
success: false,
|
|
206
|
+
error: 'Email already exists'
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### 3. End-to-End Testing
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
// Playwright E2E testing
|
|
217
|
+
import { test, expect } from '@playwright/test';
|
|
218
|
+
|
|
219
|
+
test.describe('User Registration Flow', () => {
|
|
220
|
+
test('should register new user successfully', async ({ page }) => {
|
|
221
|
+
// Navigate to registration page
|
|
222
|
+
await page.goto('/register');
|
|
223
|
+
|
|
224
|
+
// Fill out registration form
|
|
225
|
+
await page.fill('[data-testid="email-input"]', 'newuser@example.com');
|
|
226
|
+
await page.fill('[data-testid="password-input"]', 'SecurePass123!');
|
|
227
|
+
await page.fill('[data-testid="confirm-password-input"]', 'SecurePass123!');
|
|
228
|
+
await page.fill('[data-testid="name-input"]', 'New User');
|
|
229
|
+
|
|
230
|
+
// Submit form
|
|
231
|
+
await page.click('[data-testid="register-button"]');
|
|
232
|
+
|
|
233
|
+
// Verify success message
|
|
234
|
+
await expect(page.locator('[data-testid="success-message"]'))
|
|
235
|
+
.toHaveText('Registration successful! Please check your email.');
|
|
236
|
+
|
|
237
|
+
// Verify redirect to login page
|
|
238
|
+
await expect(page).toHaveURL('/login');
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
test('should show validation errors for invalid input', async ({ page }) => {
|
|
242
|
+
await page.goto('/register');
|
|
243
|
+
|
|
244
|
+
// Submit form with invalid data
|
|
245
|
+
await page.fill('[data-testid="email-input"]', 'invalid-email');
|
|
246
|
+
await page.fill('[data-testid="password-input"]', '123');
|
|
247
|
+
await page.click('[data-testid="register-button"]');
|
|
248
|
+
|
|
249
|
+
// Verify validation errors
|
|
250
|
+
await expect(page.locator('[data-testid="email-error"]'))
|
|
251
|
+
.toHaveText('Please enter a valid email address');
|
|
252
|
+
await expect(page.locator('[data-testid="password-error"]'))
|
|
253
|
+
.toHaveText('Password must be at least 8 characters long');
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### 4. Performance Testing
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
// Performance testing with Artillery or custom benchmarks
|
|
262
|
+
describe('Performance Tests', () => {
|
|
263
|
+
it('should handle concurrent user creation', async () => {
|
|
264
|
+
const concurrentUsers = 100;
|
|
265
|
+
const userPromises = Array.from({ length: concurrentUsers }, (_, i) =>
|
|
266
|
+
userService.createUser({
|
|
267
|
+
email: `user${i}@example.com`,
|
|
268
|
+
password: 'password123',
|
|
269
|
+
name: `User ${i}`
|
|
270
|
+
})
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
const startTime = Date.now();
|
|
274
|
+
const results = await Promise.allSettled(userPromises);
|
|
275
|
+
const endTime = Date.now();
|
|
276
|
+
|
|
277
|
+
const successfulCreations = results.filter(r => r.status === 'fulfilled').length;
|
|
278
|
+
const averageTime = (endTime - startTime) / concurrentUsers;
|
|
279
|
+
|
|
280
|
+
expect(successfulCreations).toBeGreaterThanOrEqual(concurrentUsers * 0.95); // 95% success rate
|
|
281
|
+
expect(averageTime).toBeLessThan(1000); // Less than 1 second per user
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('should maintain response time under load', async () => {
|
|
285
|
+
// Warm up
|
|
286
|
+
await userService.findById('existing-user-id');
|
|
287
|
+
|
|
288
|
+
const iterations = 1000;
|
|
289
|
+
const responseTimes: number[] = [];
|
|
290
|
+
|
|
291
|
+
for (let i = 0; i < iterations; i++) {
|
|
292
|
+
const startTime = performance.now();
|
|
293
|
+
await userService.findById('existing-user-id');
|
|
294
|
+
const endTime = performance.now();
|
|
295
|
+
responseTimes.push(endTime - startTime);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const averageTime = responseTimes.reduce((sum, time) => sum + time, 0) / iterations;
|
|
299
|
+
const p95Time = responseTimes.sort((a, b) => a - b)[Math.floor(iterations * 0.95)];
|
|
300
|
+
|
|
301
|
+
expect(averageTime).toBeLessThan(50); // 50ms average
|
|
302
|
+
expect(p95Time).toBeLessThan(100); // 100ms P95
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Testing Frameworks & Tools
|
|
308
|
+
|
|
309
|
+
### 1. JavaScript/TypeScript
|
|
310
|
+
```typescript
|
|
311
|
+
// Jest configuration
|
|
312
|
+
export default {
|
|
313
|
+
preset: 'ts-jest',
|
|
314
|
+
testEnvironment: 'node',
|
|
315
|
+
coverageDirectory: 'coverage',
|
|
316
|
+
collectCoverageFrom: [
|
|
317
|
+
'src/**/*.{ts,tsx}',
|
|
318
|
+
'!src/**/*.d.ts',
|
|
319
|
+
'!src/types/**/*',
|
|
320
|
+
],
|
|
321
|
+
coverageReporters: ['text', 'lcov', 'html'],
|
|
322
|
+
coverageThreshold: {
|
|
323
|
+
global: {
|
|
324
|
+
branches: 80,
|
|
325
|
+
functions: 80,
|
|
326
|
+
lines: 80,
|
|
327
|
+
statements: 80,
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
setupFilesAfterEnv: ['<rootDir>/src/test/setup.ts'],
|
|
331
|
+
testMatch: ['**/__tests__/**/*.test.{ts,tsx}'],
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
// Test utilities
|
|
335
|
+
export const createMockUser = (overrides: Partial<User> = {}): User => ({
|
|
336
|
+
id: faker.string.uuid(),
|
|
337
|
+
email: faker.internet.email(),
|
|
338
|
+
name: faker.person.fullName(),
|
|
339
|
+
createdAt: faker.date.past(),
|
|
340
|
+
isActive: true,
|
|
341
|
+
...overrides,
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
export const setupTestDatabase = async (): Promise<TestDatabase> => {
|
|
345
|
+
const db = new TestDatabase();
|
|
346
|
+
await db.migrate();
|
|
347
|
+
return db;
|
|
348
|
+
};
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### 2. Python Testing
|
|
352
|
+
```python
|
|
353
|
+
# PyTest configuration
|
|
354
|
+
import pytest
|
|
355
|
+
from unittest.mock import AsyncMock, Mock
|
|
356
|
+
from fastapi.testclient import TestClient
|
|
357
|
+
|
|
358
|
+
@pytest.fixture
|
|
359
|
+
def client():
|
|
360
|
+
from app.main import app
|
|
361
|
+
return TestClient(app)
|
|
362
|
+
|
|
363
|
+
@pytest.fixture
|
|
364
|
+
def mock_user_service():
|
|
365
|
+
return Mock(spec=UserService)
|
|
366
|
+
|
|
367
|
+
@pytest.mark.asyncio
|
|
368
|
+
async def test_create_user_success(client, mock_user_service):
|
|
369
|
+
# Arrange
|
|
370
|
+
user_data = {
|
|
371
|
+
"email": "test@example.com",
|
|
372
|
+
"password": "securepass123",
|
|
373
|
+
"name": "Test User"
|
|
374
|
+
}
|
|
375
|
+
expected_user = User(**user_data, id="123")
|
|
376
|
+
mock_user_service.create_user = AsyncMock(return_value=expected_user)
|
|
377
|
+
|
|
378
|
+
# Act
|
|
379
|
+
response = client.post("/users", json=user_data)
|
|
380
|
+
|
|
381
|
+
# Assert
|
|
382
|
+
assert response.status_code == 201
|
|
383
|
+
assert response.json()["email"] == user_data["email"]
|
|
384
|
+
mock_user_service.create_user.assert_called_once()
|
|
385
|
+
|
|
386
|
+
# Property-based testing with Hypothesis
|
|
387
|
+
from hypothesis import given, strategies as st
|
|
388
|
+
|
|
389
|
+
@given(
|
|
390
|
+
email=st.emails(),
|
|
391
|
+
name=st.text(min_size=1, max_size=100),
|
|
392
|
+
age=st.integers(min_value=18, max_value=120)
|
|
393
|
+
)
|
|
394
|
+
def test_user_creation_with_various_inputs(email, name, age):
|
|
395
|
+
user = User(email=email, name=name, age=age)
|
|
396
|
+
assert user.email == email
|
|
397
|
+
assert user.name == name
|
|
398
|
+
assert 18 <= user.age <= 120
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### 3. Contract Testing
|
|
402
|
+
```typescript
|
|
403
|
+
// Pact contract testing
|
|
404
|
+
import { Pact } from '@pact-foundation/pact';
|
|
405
|
+
|
|
406
|
+
describe('User API Consumer Contract', () => {
|
|
407
|
+
let provider: Pact;
|
|
408
|
+
|
|
409
|
+
beforeAll(async () => {
|
|
410
|
+
provider = new Pact({
|
|
411
|
+
consumer: 'UserWebApp',
|
|
412
|
+
provider: 'UserService',
|
|
413
|
+
port: 1234,
|
|
414
|
+
log: path.resolve(process.cwd(), 'logs', 'pact.log'),
|
|
415
|
+
dir: path.resolve(process.cwd(), 'pacts'),
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
await provider.setup();
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
afterAll(async () => {
|
|
422
|
+
await provider.finalize();
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
it('should receive user data when user exists', async () => {
|
|
426
|
+
await provider
|
|
427
|
+
.given('user with ID 123 exists')
|
|
428
|
+
.uponReceiving('a request for user 123')
|
|
429
|
+
.withRequest({
|
|
430
|
+
method: 'GET',
|
|
431
|
+
path: '/users/123',
|
|
432
|
+
headers: {
|
|
433
|
+
'Authorization': like('Bearer token'),
|
|
434
|
+
},
|
|
435
|
+
})
|
|
436
|
+
.willRespondWith({
|
|
437
|
+
status: 200,
|
|
438
|
+
headers: {
|
|
439
|
+
'Content-Type': 'application/json',
|
|
440
|
+
},
|
|
441
|
+
body: {
|
|
442
|
+
id: '123',
|
|
443
|
+
email: like('user@example.com'),
|
|
444
|
+
name: like('John Doe'),
|
|
445
|
+
},
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
const response = await getUserById('123');
|
|
449
|
+
expect(response.id).toBe('123');
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
## Test Data Management
|
|
455
|
+
|
|
456
|
+
### 1. Test Fixtures
|
|
457
|
+
```typescript
|
|
458
|
+
// Test data factories
|
|
459
|
+
export class UserFixtures {
|
|
460
|
+
static validUser(): CreateUserRequest {
|
|
461
|
+
return {
|
|
462
|
+
email: 'valid@example.com',
|
|
463
|
+
password: 'SecurePass123!',
|
|
464
|
+
name: 'Valid User',
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
static userWithLongName(): CreateUserRequest {
|
|
469
|
+
return {
|
|
470
|
+
...this.validUser(),
|
|
471
|
+
name: 'A'.repeat(255),
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
static adminUser(): User {
|
|
476
|
+
return {
|
|
477
|
+
id: 'admin-123',
|
|
478
|
+
email: 'admin@example.com',
|
|
479
|
+
name: 'Admin User',
|
|
480
|
+
roles: ['admin'],
|
|
481
|
+
createdAt: new Date(),
|
|
482
|
+
isActive: true,
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
static inactiveUser(): User {
|
|
487
|
+
return {
|
|
488
|
+
...this.validUser(),
|
|
489
|
+
id: 'inactive-123',
|
|
490
|
+
isActive: false,
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// Database seeding for integration tests
|
|
496
|
+
export class TestDataSeeder {
|
|
497
|
+
constructor(private db: Database) {}
|
|
498
|
+
|
|
499
|
+
async seedUsers(): Promise<void> {
|
|
500
|
+
await this.db.users.createMany([
|
|
501
|
+
UserFixtures.adminUser(),
|
|
502
|
+
UserFixtures.inactiveUser(),
|
|
503
|
+
// ... more test users
|
|
504
|
+
]);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
async cleanup(): Promise<void> {
|
|
508
|
+
await this.db.users.deleteMany({});
|
|
509
|
+
await this.db.posts.deleteMany({});
|
|
510
|
+
// ... cleanup other entities
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
### 2. Mock Strategies
|
|
516
|
+
```typescript
|
|
517
|
+
// Service mocking
|
|
518
|
+
export const createMockUserService = (): jest.Mocked<UserService> => ({
|
|
519
|
+
createUser: jest.fn(),
|
|
520
|
+
findById: jest.fn(),
|
|
521
|
+
updateUser: jest.fn(),
|
|
522
|
+
deleteUser: jest.fn(),
|
|
523
|
+
authenticateUser: jest.fn(),
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
// External service mocking
|
|
527
|
+
export const mockEmailService = {
|
|
528
|
+
sendWelcomeEmail: jest.fn().mockResolvedValue({ success: true }),
|
|
529
|
+
sendPasswordResetEmail: jest.fn().mockResolvedValue({ success: true }),
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
// HTTP request mocking
|
|
533
|
+
import nock from 'nock';
|
|
534
|
+
|
|
535
|
+
export const mockExternalAPI = () => {
|
|
536
|
+
nock('https://api.external-service.com')
|
|
537
|
+
.get('/users/123')
|
|
538
|
+
.reply(200, { id: '123', name: 'External User' });
|
|
539
|
+
};
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
## Quality Metrics & Reporting
|
|
543
|
+
|
|
544
|
+
### 1. Coverage Analysis
|
|
545
|
+
```bash
|
|
546
|
+
# Generate comprehensive coverage reports
|
|
547
|
+
npx jest --coverage --coverageReporters=text-lcov | npx coveralls
|
|
548
|
+
|
|
549
|
+
# Coverage thresholds
|
|
550
|
+
npx jest --coverage --coverageThreshold='{"global":{"branches":85,"functions":85,"lines":85,"statements":85}}'
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
### 2. Test Quality Metrics
|
|
554
|
+
```typescript
|
|
555
|
+
// Mutation testing to validate test quality
|
|
556
|
+
export const mutationTestingConfig = {
|
|
557
|
+
packageManager: 'npm',
|
|
558
|
+
reporters: ['html', 'clear-text', 'progress'],
|
|
559
|
+
testRunner: 'jest',
|
|
560
|
+
mutate: ['src/**/*.ts', '!src/**/*.test.ts', '!src/types/**/*'],
|
|
561
|
+
coverageAnalysis: 'perTest',
|
|
562
|
+
thresholds: {
|
|
563
|
+
high: 90,
|
|
564
|
+
low: 70,
|
|
565
|
+
break: 60
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
## CI/CD Integration
|
|
571
|
+
|
|
572
|
+
### 1. GitHub Actions Testing Pipeline
|
|
573
|
+
```yaml
|
|
574
|
+
# .github/workflows/test.yml
|
|
575
|
+
name: Tests
|
|
576
|
+
|
|
577
|
+
on: [push, pull_request]
|
|
578
|
+
|
|
579
|
+
jobs:
|
|
580
|
+
test:
|
|
581
|
+
runs-on: ubuntu-latest
|
|
582
|
+
strategy:
|
|
583
|
+
matrix:
|
|
584
|
+
node-version: [18, 20]
|
|
585
|
+
|
|
586
|
+
steps:
|
|
587
|
+
- uses: actions/checkout@v4
|
|
588
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
589
|
+
uses: actions/setup-node@v4
|
|
590
|
+
with:
|
|
591
|
+
node-version: ${{ matrix.node-version }}
|
|
592
|
+
cache: 'npm'
|
|
593
|
+
|
|
594
|
+
- run: npm ci
|
|
595
|
+
- run: npm run test:unit
|
|
596
|
+
- run: npm run test:integration
|
|
597
|
+
- run: npm run test:e2e
|
|
598
|
+
|
|
599
|
+
- name: Upload coverage
|
|
600
|
+
uses: codecov/codecov-action@v3
|
|
601
|
+
with:
|
|
602
|
+
file: ./coverage/lcov.info
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
### 2. Quality Gates
|
|
606
|
+
```typescript
|
|
607
|
+
// Quality gate checks
|
|
608
|
+
export const qualityGates = {
|
|
609
|
+
coverage: {
|
|
610
|
+
minimum: 80,
|
|
611
|
+
target: 90,
|
|
612
|
+
},
|
|
613
|
+
performance: {
|
|
614
|
+
maxResponseTime: 200, // ms
|
|
615
|
+
maxMemoryUsage: 100, // MB
|
|
616
|
+
},
|
|
617
|
+
security: {
|
|
618
|
+
vulnerabilities: 0,
|
|
619
|
+
maxSeverity: 'medium',
|
|
620
|
+
},
|
|
621
|
+
maintainability: {
|
|
622
|
+
minComplexityScore: 'B',
|
|
623
|
+
maxTechnicalDebt: '1h',
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
## Collaboration with Other Agents
|
|
629
|
+
|
|
630
|
+
### 1. With Coder Agent
|
|
631
|
+
- Provide testability feedback during implementation
|
|
632
|
+
- Request test-friendly interfaces and dependency injection
|
|
633
|
+
- Validate implementation against test specifications
|
|
634
|
+
|
|
635
|
+
### 2. With Architect Agent
|
|
636
|
+
- Validate architectural decisions through integration testing
|
|
637
|
+
- Provide feedback on testability of proposed designs
|
|
638
|
+
- Test system boundaries and component interactions
|
|
639
|
+
|
|
640
|
+
### 3. With Researcher Agent
|
|
641
|
+
- Request information on testing best practices for specific technologies
|
|
642
|
+
- Gather requirements for test coverage and quality standards
|
|
643
|
+
- Research testing tools and framework capabilities
|
|
644
|
+
|
|
645
|
+
### 4. With Coordinator Agent
|
|
646
|
+
- Report testing progress and quality metrics
|
|
647
|
+
- Coordinate test execution with deployment pipelines
|
|
648
|
+
- Provide quality assessments for release decisions
|
|
649
|
+
|
|
650
|
+
## Testing Best Practices Checklist
|
|
651
|
+
|
|
652
|
+
- [ ] **Test Pyramid**: More unit tests than integration tests than E2E tests
|
|
653
|
+
- [ ] **Test Independence**: Tests don't depend on each other's state
|
|
654
|
+
- [ ] **Clear Test Names**: Tests describe what they're testing and expected outcome
|
|
655
|
+
- [ ] **Arrange-Act-Assert**: Clear test structure with setup, execution, and validation
|
|
656
|
+
- [ ] **Edge Case Coverage**: Test boundary conditions and error scenarios
|
|
657
|
+
- [ ] **Performance Validation**: Include performance assertions where relevant
|
|
658
|
+
- [ ] **Security Testing**: Validate security controls and input sanitization
|
|
659
|
+
- [ ] **Data Isolation**: Tests use isolated test data and cleanup after themselves
|
|
660
|
+
- [ ] **Continuous Integration**: Tests run automatically on code changes
|
|
661
|
+
- [ ] **Quality Metrics**: Track and improve coverage, mutation scores, and test quality
|
|
662
|
+
|
|
663
|
+
Remember: Testing is not just about finding bugs—it's about ensuring confidence in the system's behavior and enabling safe, rapid development and deployment.
|