gaia-framework 1.57.0 → 1.57.2
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/README.md +1 -1
- package/bin/gaia-framework.js +27 -19
- package/gaia-install.sh +1 -1
- package/package.json +15 -11
- package/.claude/commands/gaia-a11y-testing.md +0 -17
- package/.claude/commands/gaia-action-items.md +0 -23
- package/.claude/commands/gaia-add-feature.md +0 -17
- package/.claude/commands/gaia-add-stories.md +0 -17
- package/.claude/commands/gaia-advanced-elicitation.md +0 -17
- package/.claude/commands/gaia-adversarial.md +0 -15
- package/.claude/commands/gaia-agent-analyst.md +0 -14
- package/.claude/commands/gaia-agent-architect.md +0 -14
- package/.claude/commands/gaia-agent-brainstorming.md +0 -14
- package/.claude/commands/gaia-agent-data-engineer.md +0 -14
- package/.claude/commands/gaia-agent-design-thinking.md +0 -14
- package/.claude/commands/gaia-agent-dev-angular.md +0 -14
- package/.claude/commands/gaia-agent-dev-flutter.md +0 -14
- package/.claude/commands/gaia-agent-dev-go.md +0 -14
- package/.claude/commands/gaia-agent-dev-java.md +0 -14
- package/.claude/commands/gaia-agent-dev-mobile.md +0 -14
- package/.claude/commands/gaia-agent-dev-python.md +0 -14
- package/.claude/commands/gaia-agent-dev-typescript.md +0 -14
- package/.claude/commands/gaia-agent-devops.md +0 -14
- package/.claude/commands/gaia-agent-innovation.md +0 -14
- package/.claude/commands/gaia-agent-performance.md +0 -14
- package/.claude/commands/gaia-agent-pm.md +0 -14
- package/.claude/commands/gaia-agent-presentation.md +0 -14
- package/.claude/commands/gaia-agent-problem-solver.md +0 -14
- package/.claude/commands/gaia-agent-qa.md +0 -14
- package/.claude/commands/gaia-agent-security.md +0 -14
- package/.claude/commands/gaia-agent-sm.md +0 -14
- package/.claude/commands/gaia-agent-storyteller.md +0 -14
- package/.claude/commands/gaia-agent-tech-writer.md +0 -14
- package/.claude/commands/gaia-agent-test-architect.md +0 -14
- package/.claude/commands/gaia-agent-ux-designer.md +0 -14
- package/.claude/commands/gaia-agent-validator.md +0 -14
- package/.claude/commands/gaia-atdd.md +0 -17
- package/.claude/commands/gaia-brainstorm.md +0 -17
- package/.claude/commands/gaia-brainstorming.md +0 -17
- package/.claude/commands/gaia-brownfield.md +0 -17
- package/.claude/commands/gaia-build-configs.md +0 -22
- package/.claude/commands/gaia-change-request.md +0 -11
- package/.claude/commands/gaia-changelog.md +0 -16
- package/.claude/commands/gaia-check-dod.md +0 -17
- package/.claude/commands/gaia-check-review-gate.md +0 -17
- package/.claude/commands/gaia-ci-setup.md +0 -17
- package/.claude/commands/gaia-code-review.md +0 -17
- package/.claude/commands/gaia-correct-course.md +0 -17
- package/.claude/commands/gaia-create-arch.md +0 -17
- package/.claude/commands/gaia-create-epics.md +0 -17
- package/.claude/commands/gaia-create-prd.md +0 -17
- package/.claude/commands/gaia-create-story.md +0 -23
- package/.claude/commands/gaia-create-ux.md +0 -17
- package/.claude/commands/gaia-creative-sprint.md +0 -17
- package/.claude/commands/gaia-deploy-checklist.md +0 -17
- package/.claude/commands/gaia-design-thinking.md +0 -17
- package/.claude/commands/gaia-dev-story.md +0 -23
- package/.claude/commands/gaia-document-project.md +0 -17
- package/.claude/commands/gaia-domain-research.md +0 -17
- package/.claude/commands/gaia-edge-cases.md +0 -15
- package/.claude/commands/gaia-edit-arch.md +0 -17
- package/.claude/commands/gaia-edit-prd.md +0 -17
- package/.claude/commands/gaia-edit-test-plan.md +0 -17
- package/.claude/commands/gaia-editorial-prose.md +0 -15
- package/.claude/commands/gaia-editorial-structure.md +0 -15
- package/.claude/commands/gaia-epic-status.md +0 -17
- package/.claude/commands/gaia-fix-story.md +0 -17
- package/.claude/commands/gaia-help.md +0 -15
- package/.claude/commands/gaia-index-docs.md +0 -15
- package/.claude/commands/gaia-infra-design.md +0 -17
- package/.claude/commands/gaia-innovation.md +0 -17
- package/.claude/commands/gaia-market-research.md +0 -17
- package/.claude/commands/gaia-memory-hygiene.md +0 -17
- package/.claude/commands/gaia-merge-docs.md +0 -16
- package/.claude/commands/gaia-mobile-testing.md +0 -17
- package/.claude/commands/gaia-nfr.md +0 -17
- package/.claude/commands/gaia-party.md +0 -17
- package/.claude/commands/gaia-perf-testing.md +0 -17
- package/.claude/commands/gaia-performance-review.md +0 -17
- package/.claude/commands/gaia-pitch-deck.md +0 -17
- package/.claude/commands/gaia-post-deploy.md +0 -17
- package/.claude/commands/gaia-problem-solving.md +0 -17
- package/.claude/commands/gaia-product-brief.md +0 -17
- package/.claude/commands/gaia-project-context.md +0 -17
- package/.claude/commands/gaia-qa-tests.md +0 -17
- package/.claude/commands/gaia-quick-dev.md +0 -17
- package/.claude/commands/gaia-quick-spec.md +0 -17
- package/.claude/commands/gaia-readiness-check.md +0 -17
- package/.claude/commands/gaia-refresh-ground-truth.md +0 -17
- package/.claude/commands/gaia-release-plan.md +0 -17
- package/.claude/commands/gaia-resume.md +0 -25
- package/.claude/commands/gaia-retro.md +0 -20
- package/.claude/commands/gaia-review-a11y.md +0 -16
- package/.claude/commands/gaia-review-api.md +0 -16
- package/.claude/commands/gaia-review-deps.md +0 -16
- package/.claude/commands/gaia-review-perf.md +0 -16
- package/.claude/commands/gaia-review-security.md +0 -16
- package/.claude/commands/gaia-rollback-plan.md +0 -17
- package/.claude/commands/gaia-run-all-reviews.md +0 -17
- package/.claude/commands/gaia-security-review.md +0 -17
- package/.claude/commands/gaia-shard-doc.md +0 -15
- package/.claude/commands/gaia-slide-deck.md +0 -17
- package/.claude/commands/gaia-sprint-plan.md +0 -17
- package/.claude/commands/gaia-sprint-status.md +0 -17
- package/.claude/commands/gaia-storytelling.md +0 -17
- package/.claude/commands/gaia-summarize.md +0 -16
- package/.claude/commands/gaia-teach-testing.md +0 -17
- package/.claude/commands/gaia-tech-debt-review.md +0 -20
- package/.claude/commands/gaia-tech-research.md +0 -17
- package/.claude/commands/gaia-test-automate.md +0 -17
- package/.claude/commands/gaia-test-design.md +0 -17
- package/.claude/commands/gaia-test-framework.md +0 -17
- package/.claude/commands/gaia-test-review.md +0 -17
- package/.claude/commands/gaia-threat-model.md +0 -17
- package/.claude/commands/gaia-trace.md +0 -17
- package/.claude/commands/gaia-triage-findings.md +0 -20
- package/.claude/commands/gaia-val-validate-plan.md +0 -17
- package/.claude/commands/gaia-val-validate.md +0 -17
- package/.claude/commands/gaia-validate-framework.md +0 -17
- package/.claude/commands/gaia-validate-prd.md +0 -17
- package/.claude/commands/gaia-validate-story.md +0 -22
- package/.claude/commands/gaia.md +0 -32
- package/CLAUDE.md +0 -165
- package/_gaia/_config/agent-manifest.csv +0 -29
- package/_gaia/_config/agents/CUSTOMIZATION-README.md +0 -117
- package/_gaia/_config/files-manifest.csv +0 -30
- package/_gaia/_config/gaia-help.csv +0 -82
- package/_gaia/_config/global.yaml +0 -45
- package/_gaia/_config/lifecycle-sequence.yaml +0 -593
- package/_gaia/_config/manifest.yaml +0 -24
- package/_gaia/_config/skill-manifest.csv +0 -12
- package/_gaia/_config/task-manifest.csv +0 -17
- package/_gaia/_config/workflow-manifest.csv +0 -73
- package/_gaia/_memory/tier2-results/.gitkeep +0 -0
- package/_gaia/_memory/tier2-results/checkpoint-resume-2026-03-24.yaml +0 -6
- package/_gaia/_memory/tier2-results/engine-scenarios-2026-03-22.yaml +0 -14
- package/_gaia/core/.resolved/.gitkeep +0 -0
- package/_gaia/core/agents/orchestrator.md +0 -303
- package/_gaia/core/config.yaml +0 -8
- package/_gaia/core/engine/error-recovery.xml +0 -28
- package/_gaia/core/engine/protocols/discover-inputs.xml +0 -31
- package/_gaia/core/engine/protocols/handoff.xml +0 -21
- package/_gaia/core/engine/protocols/preflight-check.xml +0 -31
- package/_gaia/core/engine/task-runner.xml +0 -63
- package/_gaia/core/engine/workflow.xml +0 -225
- package/_gaia/core/module-help.csv +0 -21
- package/_gaia/core/protocols/agent-specification-protocol.md +0 -103
- package/_gaia/core/protocols/review-gate-check.xml +0 -29
- package/_gaia/core/protocols/sprint-status-write-safety.xml +0 -35
- package/_gaia/core/protocols/status-sync.xml +0 -49
- package/_gaia/core/tasks/editorial-review-prose.xml +0 -42
- package/_gaia/core/tasks/editorial-review-structure.xml +0 -43
- package/_gaia/core/tasks/generate-changelog.xml +0 -35
- package/_gaia/core/tasks/help.md +0 -45
- package/_gaia/core/tasks/index-docs.xml +0 -46
- package/_gaia/core/tasks/merge-docs.xml +0 -34
- package/_gaia/core/tasks/review-accessibility.xml +0 -47
- package/_gaia/core/tasks/review-adversarial.xml +0 -55
- package/_gaia/core/tasks/review-api-design.xml +0 -38
- package/_gaia/core/tasks/review-dependency-audit.xml +0 -38
- package/_gaia/core/tasks/review-edge-case-hunter.xml +0 -52
- package/_gaia/core/tasks/review-performance.xml +0 -49
- package/_gaia/core/tasks/review-security.xml +0 -37
- package/_gaia/core/tasks/shard-doc.xml +0 -49
- package/_gaia/core/tasks/summarize-doc.xml +0 -33
- package/_gaia/core/tasks/validate-framework.xml +0 -66
- package/_gaia/core/workflows/brainstorming/steps/step-01-session-setup.md +0 -7
- package/_gaia/core/workflows/brainstorming/steps/step-02-technique-selection.md +0 -20
- package/_gaia/core/workflows/brainstorming/steps/step-03-technique-execution.md +0 -11
- package/_gaia/core/workflows/brainstorming/steps/step-04-idea-organization.md +0 -14
- package/_gaia/core/workflows/brainstorming/template.md +0 -38
- package/_gaia/core/workflows/brainstorming/workflow.yaml +0 -26
- package/_gaia/core/workflows/party-mode/steps/step-01-agent-loading.md +0 -11
- package/_gaia/core/workflows/party-mode/steps/step-02-discussion-orchestration.md +0 -16
- package/_gaia/core/workflows/party-mode/steps/step-03-graceful-exit.md +0 -10
- package/_gaia/core/workflows/party-mode/workflow.yaml +0 -23
- package/_gaia/creative/.resolved/.gitkeep +0 -0
- package/_gaia/creative/agents/brainstorming-coach.md +0 -93
- package/_gaia/creative/agents/design-thinking-coach.md +0 -91
- package/_gaia/creative/agents/innovation-strategist.md +0 -89
- package/_gaia/creative/agents/presentation-designer.md +0 -99
- package/_gaia/creative/agents/problem-solver.md +0 -90
- package/_gaia/creative/agents/storyteller.md +0 -90
- package/_gaia/creative/config.yaml +0 -8
- package/_gaia/creative/data/design-methods.csv +0 -28
- package/_gaia/creative/data/innovation-frameworks.csv +0 -15
- package/_gaia/creative/data/solving-methods.csv +0 -14
- package/_gaia/creative/data/story-types.csv +0 -12
- package/_gaia/creative/module-help.csv +0 -8
- package/_gaia/creative/teams/creative-squad.yaml +0 -10
- package/_gaia/creative/workflows/creative-sprint/checklist.md +0 -10
- package/_gaia/creative/workflows/creative-sprint/instructions.xml +0 -40
- package/_gaia/creative/workflows/creative-sprint/workflow.yaml +0 -11
- package/_gaia/creative/workflows/design-thinking/checklist.md +0 -25
- package/_gaia/creative/workflows/design-thinking/instructions.xml +0 -38
- package/_gaia/creative/workflows/design-thinking/workflow.yaml +0 -13
- package/_gaia/creative/workflows/innovation-strategy/checklist.md +0 -26
- package/_gaia/creative/workflows/innovation-strategy/instructions.xml +0 -34
- package/_gaia/creative/workflows/innovation-strategy/workflow.yaml +0 -13
- package/_gaia/creative/workflows/pitch-deck/checklist.md +0 -22
- package/_gaia/creative/workflows/pitch-deck/instructions.xml +0 -49
- package/_gaia/creative/workflows/pitch-deck/workflow.yaml +0 -15
- package/_gaia/creative/workflows/problem-solving/checklist.md +0 -26
- package/_gaia/creative/workflows/problem-solving/instructions.xml +0 -39
- package/_gaia/creative/workflows/problem-solving/workflow.yaml +0 -13
- package/_gaia/creative/workflows/slide-deck/checklist.md +0 -21
- package/_gaia/creative/workflows/slide-deck/instructions.xml +0 -39
- package/_gaia/creative/workflows/slide-deck/workflow.yaml +0 -15
- package/_gaia/creative/workflows/storytelling/checklist.md +0 -26
- package/_gaia/creative/workflows/storytelling/instructions.xml +0 -38
- package/_gaia/creative/workflows/storytelling/workflow.yaml +0 -13
- package/_gaia/dev/agents/_base-dev.md +0 -180
- package/_gaia/dev/agents/angular-dev.md +0 -70
- package/_gaia/dev/agents/flutter-dev.md +0 -70
- package/_gaia/dev/agents/go-dev.md +0 -72
- package/_gaia/dev/agents/java-dev.md +0 -70
- package/_gaia/dev/agents/mobile-dev.md +0 -70
- package/_gaia/dev/agents/python-dev.md +0 -70
- package/_gaia/dev/agents/typescript-dev.md +0 -70
- package/_gaia/dev/config.yaml +0 -11
- package/_gaia/dev/knowledge/_index.csv +0 -25
- package/_gaia/dev/knowledge/angular/angular-conventions.md +0 -119
- package/_gaia/dev/knowledge/angular/angular-patterns.md +0 -126
- package/_gaia/dev/knowledge/angular/ngrx-state.md +0 -124
- package/_gaia/dev/knowledge/angular/rxjs-patterns.md +0 -119
- package/_gaia/dev/knowledge/flutter/dart-conventions.md +0 -143
- package/_gaia/dev/knowledge/flutter/platform-channels.md +0 -144
- package/_gaia/dev/knowledge/flutter/state-management.md +0 -144
- package/_gaia/dev/knowledge/flutter/widget-patterns.md +0 -134
- package/_gaia/dev/knowledge/go/gin-fiber-patterns.md +0 -40
- package/_gaia/dev/knowledge/go/go-conventions.md +0 -54
- package/_gaia/dev/knowledge/go/go-stdlib-patterns.md +0 -39
- package/_gaia/dev/knowledge/go/go-testing-patterns.md +0 -39
- package/_gaia/dev/knowledge/java/jpa-patterns.md +0 -136
- package/_gaia/dev/knowledge/java/maven-gradle.md +0 -189
- package/_gaia/dev/knowledge/java/microservices.md +0 -159
- package/_gaia/dev/knowledge/java/spring-boot-patterns.md +0 -160
- package/_gaia/dev/knowledge/mobile/kotlin-patterns.md +0 -193
- package/_gaia/dev/knowledge/mobile/mobile-testing.md +0 -186
- package/_gaia/dev/knowledge/mobile/react-native-patterns.md +0 -162
- package/_gaia/dev/knowledge/mobile/swift-patterns.md +0 -190
- package/_gaia/dev/knowledge/python/data-pipelines.md +0 -169
- package/_gaia/dev/knowledge/python/django-patterns.md +0 -145
- package/_gaia/dev/knowledge/python/fastapi-patterns.md +0 -164
- package/_gaia/dev/knowledge/python/python-conventions.md +0 -170
- package/_gaia/dev/knowledge/typescript/express-patterns.md +0 -188
- package/_gaia/dev/knowledge/typescript/nextjs-patterns.md +0 -166
- package/_gaia/dev/knowledge/typescript/react-patterns.md +0 -176
- package/_gaia/dev/knowledge/typescript/ts-conventions.md +0 -133
- package/_gaia/dev/module-help.csv +0 -10
- package/_gaia/dev/skills/_skill-index.yaml +0 -55
- package/_gaia/dev/skills/api-design.md +0 -229
- package/_gaia/dev/skills/code-review-standards.md +0 -226
- package/_gaia/dev/skills/database-design.md +0 -172
- package/_gaia/dev/skills/docker-workflow.md +0 -222
- package/_gaia/dev/skills/documentation-standards.md +0 -256
- package/_gaia/dev/skills/git-workflow.md +0 -157
- package/_gaia/dev/skills/security-basics.md +0 -230
- package/_gaia/dev/skills/testing-patterns.md +0 -232
- package/_gaia/lifecycle/.resolved/.gitkeep +0 -0
- package/_gaia/lifecycle/agents/analyst.md +0 -104
- package/_gaia/lifecycle/agents/architect.md +0 -109
- package/_gaia/lifecycle/agents/data-engineer.md +0 -99
- package/_gaia/lifecycle/agents/devops.md +0 -110
- package/_gaia/lifecycle/agents/performance.md +0 -92
- package/_gaia/lifecycle/agents/pm.md +0 -112
- package/_gaia/lifecycle/agents/qa.md +0 -89
- package/_gaia/lifecycle/agents/security.md +0 -108
- package/_gaia/lifecycle/agents/sm.md +0 -119
- package/_gaia/lifecycle/agents/tech-writer.md +0 -94
- package/_gaia/lifecycle/agents/ux-designer.md +0 -94
- package/_gaia/lifecycle/agents/validator.md +0 -189
- package/_gaia/lifecycle/config.yaml +0 -14
- package/_gaia/lifecycle/module-help.csv +0 -39
- package/_gaia/lifecycle/skills/ground-truth-management.md +0 -252
- package/_gaia/lifecycle/skills/memory-management.md +0 -322
- package/_gaia/lifecycle/skills/validation-patterns.md +0 -230
- package/_gaia/lifecycle/teams/team-data-intensive.yaml +0 -12
- package/_gaia/lifecycle/teams/team-enterprise.yaml +0 -16
- package/_gaia/lifecycle/teams/team-full.yaml +0 -13
- package/_gaia/lifecycle/teams/team-implementation.yaml +0 -8
- package/_gaia/lifecycle/teams/team-planning.yaml +0 -9
- package/_gaia/lifecycle/teams/team-quick-ship.yaml +0 -6
- package/_gaia/lifecycle/teams/team-security-focused.yaml +0 -13
- package/_gaia/lifecycle/templates/api-documentation-template.md +0 -112
- package/_gaia/lifecycle/templates/architecture-template.md +0 -65
- package/_gaia/lifecycle/templates/brownfield-architecture-template.md +0 -198
- package/_gaia/lifecycle/templates/brownfield-assessment-template.md +0 -78
- package/_gaia/lifecycle/templates/brownfield-onboarding-template.md +0 -160
- package/_gaia/lifecycle/templates/dependency-map-template.md +0 -73
- package/_gaia/lifecycle/templates/deployment-template.md +0 -52
- package/_gaia/lifecycle/templates/epic-status-template.md +0 -64
- package/_gaia/lifecycle/templates/event-catalog-template.md +0 -78
- package/_gaia/lifecycle/templates/nfr-assessment-template.md +0 -96
- package/_gaia/lifecycle/templates/prd-template.md +0 -83
- package/_gaia/lifecycle/templates/product-brief-template.md +0 -48
- package/_gaia/lifecycle/templates/review-template.md +0 -47
- package/_gaia/lifecycle/templates/sprint-plan-template.md +0 -45
- package/_gaia/lifecycle/templates/story-template.md +0 -118
- package/_gaia/lifecycle/templates/tech-debt-dashboard-template.md +0 -71
- package/_gaia/lifecycle/templates/test-plan-template.md +0 -56
- package/_gaia/lifecycle/templates/ux-design-assessment-template.md +0 -122
- package/_gaia/lifecycle/workflows/1-analysis/advanced-elicitation/instructions.xml +0 -44
- package/_gaia/lifecycle/workflows/1-analysis/advanced-elicitation/methods.csv +0 -9
- package/_gaia/lifecycle/workflows/1-analysis/advanced-elicitation/workflow.yaml +0 -33
- package/_gaia/lifecycle/workflows/1-analysis/brainstorm-project/checklist.md +0 -24
- package/_gaia/lifecycle/workflows/1-analysis/brainstorm-project/instructions.xml +0 -39
- package/_gaia/lifecycle/workflows/1-analysis/brainstorm-project/workflow.yaml +0 -19
- package/_gaia/lifecycle/workflows/1-analysis/create-product-brief/checklist.md +0 -27
- package/_gaia/lifecycle/workflows/1-analysis/create-product-brief/instructions.xml +0 -57
- package/_gaia/lifecycle/workflows/1-analysis/create-product-brief/workflow.yaml +0 -38
- package/_gaia/lifecycle/workflows/1-analysis/domain-research/checklist.md +0 -22
- package/_gaia/lifecycle/workflows/1-analysis/domain-research/instructions.xml +0 -34
- package/_gaia/lifecycle/workflows/1-analysis/domain-research/workflow.yaml +0 -15
- package/_gaia/lifecycle/workflows/1-analysis/market-research/checklist.md +0 -28
- package/_gaia/lifecycle/workflows/1-analysis/market-research/instructions.xml +0 -42
- package/_gaia/lifecycle/workflows/1-analysis/market-research/workflow.yaml +0 -15
- package/_gaia/lifecycle/workflows/1-analysis/technical-research/checklist.md +0 -22
- package/_gaia/lifecycle/workflows/1-analysis/technical-research/instructions.xml +0 -34
- package/_gaia/lifecycle/workflows/1-analysis/technical-research/workflow.yaml +0 -15
- package/_gaia/lifecycle/workflows/2-planning/create-prd/checklist.md +0 -36
- package/_gaia/lifecycle/workflows/2-planning/create-prd/instructions.xml +0 -80
- package/_gaia/lifecycle/workflows/2-planning/create-prd/workflow.yaml +0 -23
- package/_gaia/lifecycle/workflows/2-planning/create-ux-design/checklist.md +0 -26
- package/_gaia/lifecycle/workflows/2-planning/create-ux-design/instructions.xml +0 -49
- package/_gaia/lifecycle/workflows/2-planning/create-ux-design/workflow.yaml +0 -23
- package/_gaia/lifecycle/workflows/2-planning/edit-prd/checklist.md +0 -17
- package/_gaia/lifecycle/workflows/2-planning/edit-prd/instructions.xml +0 -50
- package/_gaia/lifecycle/workflows/2-planning/edit-prd/workflow.yaml +0 -22
- package/_gaia/lifecycle/workflows/2-planning/validate-prd/checklist.md +0 -12
- package/_gaia/lifecycle/workflows/2-planning/validate-prd/instructions.xml +0 -52
- package/_gaia/lifecycle/workflows/2-planning/validate-prd/workflow.yaml +0 -19
- package/_gaia/lifecycle/workflows/3-solutioning/create-architecture/checklist.md +0 -32
- package/_gaia/lifecycle/workflows/3-solutioning/create-architecture/instructions.xml +0 -100
- package/_gaia/lifecycle/workflows/3-solutioning/create-architecture/workflow.yaml +0 -41
- package/_gaia/lifecycle/workflows/3-solutioning/create-epics-stories/checklist.md +0 -30
- package/_gaia/lifecycle/workflows/3-solutioning/create-epics-stories/instructions.xml +0 -86
- package/_gaia/lifecycle/workflows/3-solutioning/create-epics-stories/workflow.yaml +0 -34
- package/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/checklist.md +0 -24
- package/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/instructions.xml +0 -91
- package/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/workflow.yaml +0 -32
- package/_gaia/lifecycle/workflows/3-solutioning/implementation-readiness/checklist.md +0 -66
- package/_gaia/lifecycle/workflows/3-solutioning/implementation-readiness/instructions.xml +0 -160
- package/_gaia/lifecycle/workflows/3-solutioning/implementation-readiness/workflow.yaml +0 -48
- package/_gaia/lifecycle/workflows/3-solutioning/infrastructure-design/checklist.md +0 -24
- package/_gaia/lifecycle/workflows/3-solutioning/infrastructure-design/instructions.xml +0 -44
- package/_gaia/lifecycle/workflows/3-solutioning/infrastructure-design/workflow.yaml +0 -23
- package/_gaia/lifecycle/workflows/3-solutioning/security-threat-model/checklist.md +0 -24
- package/_gaia/lifecycle/workflows/3-solutioning/security-threat-model/instructions.xml +0 -55
- package/_gaia/lifecycle/workflows/3-solutioning/security-threat-model/workflow.yaml +0 -23
- package/_gaia/lifecycle/workflows/4-implementation/action-items/instructions.xml +0 -131
- package/_gaia/lifecycle/workflows/4-implementation/action-items/workflow.yaml +0 -19
- package/_gaia/lifecycle/workflows/4-implementation/add-stories/checklist.md +0 -27
- package/_gaia/lifecycle/workflows/4-implementation/add-stories/instructions.xml +0 -100
- package/_gaia/lifecycle/workflows/4-implementation/add-stories/workflow.yaml +0 -35
- package/_gaia/lifecycle/workflows/4-implementation/change-request/checklist.md +0 -25
- package/_gaia/lifecycle/workflows/4-implementation/change-request/instructions.xml +0 -123
- package/_gaia/lifecycle/workflows/4-implementation/change-request/workflow.yaml +0 -38
- package/_gaia/lifecycle/workflows/4-implementation/check-dod/checklist.md +0 -18
- package/_gaia/lifecycle/workflows/4-implementation/check-dod/instructions.xml +0 -54
- package/_gaia/lifecycle/workflows/4-implementation/check-dod/workflow.yaml +0 -19
- package/_gaia/lifecycle/workflows/4-implementation/check-review-gate/checklist.md +0 -18
- package/_gaia/lifecycle/workflows/4-implementation/check-review-gate/instructions.xml +0 -53
- package/_gaia/lifecycle/workflows/4-implementation/check-review-gate/workflow.yaml +0 -19
- package/_gaia/lifecycle/workflows/4-implementation/code-review/checklist.md +0 -18
- package/_gaia/lifecycle/workflows/4-implementation/code-review/instructions.xml +0 -50
- package/_gaia/lifecycle/workflows/4-implementation/code-review/workflow.yaml +0 -24
- package/_gaia/lifecycle/workflows/4-implementation/correct-course/checklist.md +0 -21
- package/_gaia/lifecycle/workflows/4-implementation/correct-course/instructions.xml +0 -63
- package/_gaia/lifecycle/workflows/4-implementation/correct-course/workflow.yaml +0 -25
- package/_gaia/lifecycle/workflows/4-implementation/create-story/checklist.md +0 -38
- package/_gaia/lifecycle/workflows/4-implementation/create-story/instructions.xml +0 -194
- package/_gaia/lifecycle/workflows/4-implementation/create-story/workflow.yaml +0 -26
- package/_gaia/lifecycle/workflows/4-implementation/dev-story/checklist.md +0 -26
- package/_gaia/lifecycle/workflows/4-implementation/dev-story/instructions.xml +0 -268
- package/_gaia/lifecycle/workflows/4-implementation/dev-story/workflow.yaml +0 -51
- package/_gaia/lifecycle/workflows/4-implementation/epic-status/checklist.md +0 -25
- package/_gaia/lifecycle/workflows/4-implementation/epic-status/instructions.xml +0 -62
- package/_gaia/lifecycle/workflows/4-implementation/epic-status/workflow.yaml +0 -24
- package/_gaia/lifecycle/workflows/4-implementation/fix-story/checklist.md +0 -12
- package/_gaia/lifecycle/workflows/4-implementation/fix-story/instructions.xml +0 -67
- package/_gaia/lifecycle/workflows/4-implementation/fix-story/workflow.yaml +0 -17
- package/_gaia/lifecycle/workflows/4-implementation/qa-generate-tests/checklist.md +0 -19
- package/_gaia/lifecycle/workflows/4-implementation/qa-generate-tests/instructions.xml +0 -52
- package/_gaia/lifecycle/workflows/4-implementation/qa-generate-tests/workflow.yaml +0 -20
- package/_gaia/lifecycle/workflows/4-implementation/retrospective/checklist.md +0 -15
- package/_gaia/lifecycle/workflows/4-implementation/retrospective/instructions.xml +0 -164
- package/_gaia/lifecycle/workflows/4-implementation/retrospective/workflow.yaml +0 -30
- package/_gaia/lifecycle/workflows/4-implementation/run-all-reviews/checklist.md +0 -14
- package/_gaia/lifecycle/workflows/4-implementation/run-all-reviews/instructions.xml +0 -78
- package/_gaia/lifecycle/workflows/4-implementation/run-all-reviews/workflow.yaml +0 -16
- package/_gaia/lifecycle/workflows/4-implementation/security-review/checklist.md +0 -29
- package/_gaia/lifecycle/workflows/4-implementation/security-review/instructions.xml +0 -80
- package/_gaia/lifecycle/workflows/4-implementation/security-review/workflow.yaml +0 -27
- package/_gaia/lifecycle/workflows/4-implementation/sprint-planning/checklist.md +0 -29
- package/_gaia/lifecycle/workflows/4-implementation/sprint-planning/instructions.xml +0 -140
- package/_gaia/lifecycle/workflows/4-implementation/sprint-planning/workflow.yaml +0 -33
- package/_gaia/lifecycle/workflows/4-implementation/sprint-status/checklist.md +0 -18
- package/_gaia/lifecycle/workflows/4-implementation/sprint-status/instructions.xml +0 -36
- package/_gaia/lifecycle/workflows/4-implementation/sprint-status/workflow.yaml +0 -19
- package/_gaia/lifecycle/workflows/4-implementation/tech-debt-review/checklist.md +0 -30
- package/_gaia/lifecycle/workflows/4-implementation/tech-debt-review/instructions.xml +0 -147
- package/_gaia/lifecycle/workflows/4-implementation/tech-debt-review/workflow.yaml +0 -24
- package/_gaia/lifecycle/workflows/4-implementation/triage-findings/checklist.md +0 -17
- package/_gaia/lifecycle/workflows/4-implementation/triage-findings/instructions.xml +0 -124
- package/_gaia/lifecycle/workflows/4-implementation/triage-findings/workflow.yaml +0 -15
- package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/checklist.md +0 -48
- package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/instructions.xml +0 -125
- package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/workflow.yaml +0 -31
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/checklist.md +0 -54
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/instructions.xml +0 -147
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/test-structure.sh +0 -116
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/workflow.yaml +0 -29
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-plan/checklist.md +0 -34
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-plan/instructions.xml +0 -162
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-plan/workflow.yaml +0 -39
- package/_gaia/lifecycle/workflows/4-implementation/validate-story/checklist.md +0 -23
- package/_gaia/lifecycle/workflows/4-implementation/validate-story/instructions.xml +0 -146
- package/_gaia/lifecycle/workflows/4-implementation/validate-story/workflow.yaml +0 -25
- package/_gaia/lifecycle/workflows/5-deployment/deployment-checklist/checklist.md +0 -29
- package/_gaia/lifecycle/workflows/5-deployment/deployment-checklist/instructions.xml +0 -59
- package/_gaia/lifecycle/workflows/5-deployment/deployment-checklist/workflow.yaml +0 -39
- package/_gaia/lifecycle/workflows/5-deployment/post-deploy-verify/checklist.md +0 -19
- package/_gaia/lifecycle/workflows/5-deployment/post-deploy-verify/instructions.xml +0 -33
- package/_gaia/lifecycle/workflows/5-deployment/post-deploy-verify/workflow.yaml +0 -15
- package/_gaia/lifecycle/workflows/5-deployment/release-plan/checklist.md +0 -20
- package/_gaia/lifecycle/workflows/5-deployment/release-plan/instructions.xml +0 -33
- package/_gaia/lifecycle/workflows/5-deployment/release-plan/workflow.yaml +0 -19
- package/_gaia/lifecycle/workflows/5-deployment/rollback-plan/checklist.md +0 -20
- package/_gaia/lifecycle/workflows/5-deployment/rollback-plan/instructions.xml +0 -33
- package/_gaia/lifecycle/workflows/5-deployment/rollback-plan/workflow.yaml +0 -15
- package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/checklist.md +0 -52
- package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/instructions.xml +0 -122
- package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/test-step7.sh +0 -149
- package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/workflow.yaml +0 -33
- package/_gaia/lifecycle/workflows/anytime/document-project/checklist.md +0 -11
- package/_gaia/lifecycle/workflows/anytime/document-project/instructions.xml +0 -26
- package/_gaia/lifecycle/workflows/anytime/document-project/workflow.yaml +0 -15
- package/_gaia/lifecycle/workflows/anytime/generate-project-context/checklist.md +0 -11
- package/_gaia/lifecycle/workflows/anytime/generate-project-context/instructions.xml +0 -22
- package/_gaia/lifecycle/workflows/anytime/generate-project-context/workflow.yaml +0 -15
- package/_gaia/lifecycle/workflows/anytime/memory-hygiene/checklist.md +0 -24
- package/_gaia/lifecycle/workflows/anytime/memory-hygiene/instructions.xml +0 -108
- package/_gaia/lifecycle/workflows/anytime/memory-hygiene/workflow.yaml +0 -15
- package/_gaia/lifecycle/workflows/anytime/performance-review/checklist.md +0 -25
- package/_gaia/lifecycle/workflows/anytime/performance-review/instructions.xml +0 -62
- package/_gaia/lifecycle/workflows/anytime/performance-review/workflow.yaml +0 -15
- package/_gaia/lifecycle/workflows/cross-phase/add-feature/checklist.md +0 -30
- package/_gaia/lifecycle/workflows/cross-phase/add-feature/instructions.xml +0 -85
- package/_gaia/lifecycle/workflows/cross-phase/add-feature/workflow.yaml +0 -37
- package/_gaia/lifecycle/workflows/quick-flow/quick-dev/checklist.md +0 -11
- package/_gaia/lifecycle/workflows/quick-flow/quick-dev/instructions.xml +0 -26
- package/_gaia/lifecycle/workflows/quick-flow/quick-dev/workflow.yaml +0 -19
- package/_gaia/lifecycle/workflows/quick-flow/quick-spec/checklist.md +0 -13
- package/_gaia/lifecycle/workflows/quick-flow/quick-spec/instructions.xml +0 -27
- package/_gaia/lifecycle/workflows/quick-flow/quick-spec/workflow.yaml +0 -15
- package/_gaia/testing/.resolved/.gitkeep +0 -0
- package/_gaia/testing/agents/test-architect.md +0 -131
- package/_gaia/testing/config.yaml +0 -8
- package/_gaia/testing/knowledge/_index.csv +0 -22
- package/_gaia/testing/knowledge/accessibility/axe-core-patterns.md +0 -177
- package/_gaia/testing/knowledge/accessibility/wcag-checks.md +0 -191
- package/_gaia/testing/knowledge/core/deterministic-testing.md +0 -167
- package/_gaia/testing/knowledge/core/fixture-architecture.md +0 -131
- package/_gaia/testing/knowledge/core/test-isolation.md +0 -142
- package/_gaia/testing/knowledge/core/test-pyramid.md +0 -129
- package/_gaia/testing/knowledge/extended/api-testing-patterns.md +0 -196
- package/_gaia/testing/knowledge/extended/data-factories.md +0 -158
- package/_gaia/testing/knowledge/extended/risk-governance.md +0 -119
- package/_gaia/testing/knowledge/extended/selector-resilience.md +0 -109
- package/_gaia/testing/knowledge/mobile-testing/appium-patterns.md +0 -164
- package/_gaia/testing/knowledge/mobile-testing/react-native-testing.md +0 -193
- package/_gaia/testing/knowledge/mobile-testing/responsive-testing.md +0 -177
- package/_gaia/testing/knowledge/performance/k6-patterns.md +0 -200
- package/_gaia/testing/knowledge/performance/lighthouse-ci.md +0 -158
- package/_gaia/testing/knowledge/specialized/contract-testing.md +0 -173
- package/_gaia/testing/knowledge/specialized/test-healing.md +0 -129
- package/_gaia/testing/knowledge/specialized/visual-testing.md +0 -129
- package/_gaia/testing/knowledge/unit-testing/jest-vitest-patterns.md +0 -193
- package/_gaia/testing/knowledge/unit-testing/junit5-patterns.md +0 -200
- package/_gaia/testing/knowledge/unit-testing/pytest-patterns.md +0 -185
- package/_gaia/testing/module-help.csv +0 -13
- package/_gaia/testing/workflows/accessibility-testing/checklist.md +0 -12
- package/_gaia/testing/workflows/accessibility-testing/instructions.xml +0 -41
- package/_gaia/testing/workflows/accessibility-testing/workflow.yaml +0 -13
- package/_gaia/testing/workflows/atdd/checklist.md +0 -6
- package/_gaia/testing/workflows/atdd/instructions.xml +0 -36
- package/_gaia/testing/workflows/atdd/workflow.yaml +0 -22
- package/_gaia/testing/workflows/ci-setup/checklist.md +0 -9
- package/_gaia/testing/workflows/ci-setup/instructions.xml +0 -43
- package/_gaia/testing/workflows/ci-setup/workflow.yaml +0 -11
- package/_gaia/testing/workflows/edit-test-plan/checklist.md +0 -20
- package/_gaia/testing/workflows/edit-test-plan/instructions.xml +0 -65
- package/_gaia/testing/workflows/edit-test-plan/workflow.yaml +0 -35
- package/_gaia/testing/workflows/mobile-testing/checklist.md +0 -13
- package/_gaia/testing/workflows/mobile-testing/instructions.xml +0 -41
- package/_gaia/testing/workflows/mobile-testing/workflow.yaml +0 -11
- package/_gaia/testing/workflows/nfr-assessment/checklist.md +0 -7
- package/_gaia/testing/workflows/nfr-assessment/instructions.xml +0 -26
- package/_gaia/testing/workflows/nfr-assessment/workflow.yaml +0 -11
- package/_gaia/testing/workflows/performance-testing/checklist.md +0 -11
- package/_gaia/testing/workflows/performance-testing/instructions.xml +0 -41
- package/_gaia/testing/workflows/performance-testing/workflow.yaml +0 -11
- package/_gaia/testing/workflows/teach-me-testing/checklist.md +0 -6
- package/_gaia/testing/workflows/teach-me-testing/instructions.xml +0 -28
- package/_gaia/testing/workflows/teach-me-testing/workflow.yaml +0 -12
- package/_gaia/testing/workflows/test-automation/checklist.md +0 -6
- package/_gaia/testing/workflows/test-automation/instructions.xml +0 -49
- package/_gaia/testing/workflows/test-automation/workflow.yaml +0 -11
- package/_gaia/testing/workflows/test-design/checklist.md +0 -9
- package/_gaia/testing/workflows/test-design/instructions.xml +0 -47
- package/_gaia/testing/workflows/test-design/workflow.yaml +0 -11
- package/_gaia/testing/workflows/test-framework/checklist.md +0 -8
- package/_gaia/testing/workflows/test-framework/instructions.xml +0 -25
- package/_gaia/testing/workflows/test-framework/workflow.yaml +0 -11
- package/_gaia/testing/workflows/test-review/checklist.md +0 -9
- package/_gaia/testing/workflows/test-review/instructions.xml +0 -51
- package/_gaia/testing/workflows/test-review/workflow.yaml +0 -11
- package/_gaia/testing/workflows/traceability/checklist.md +0 -6
- package/_gaia/testing/workflows/traceability/instructions.xml +0 -49
- package/_gaia/testing/workflows/traceability/workflow.yaml +0 -21
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: k6-patterns
|
|
3
|
-
tier: performance
|
|
4
|
-
version: '1.0'
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# k6 Patterns
|
|
8
|
-
|
|
9
|
-
## Principle
|
|
10
|
-
|
|
11
|
-
k6 is a developer-centric load testing tool that uses JavaScript for test scripts.
|
|
12
|
-
It runs locally or in CI, produces metrics in real-time, and integrates with monitoring
|
|
13
|
-
systems. Write load tests as code, version them with your application, and run them
|
|
14
|
-
as part of your deployment pipeline.
|
|
15
|
-
|
|
16
|
-
## Rationale
|
|
17
|
-
|
|
18
|
-
Performance problems discovered in production are expensive to fix. k6 enables
|
|
19
|
-
shift-left performance testing — running load tests in CI catches regressions before
|
|
20
|
-
deployment. Its JavaScript API is familiar to developers, reducing the barrier to
|
|
21
|
-
writing and maintaining performance tests.
|
|
22
|
-
|
|
23
|
-
## Pattern Examples
|
|
24
|
-
|
|
25
|
-
### Basic Load Test
|
|
26
|
-
|
|
27
|
-
```javascript
|
|
28
|
-
import http from 'k6/http';
|
|
29
|
-
import { check, sleep } from 'k6';
|
|
30
|
-
|
|
31
|
-
export const options = {
|
|
32
|
-
stages: [
|
|
33
|
-
{ duration: '2m', target: 50 }, // ramp up to 50 users
|
|
34
|
-
{ duration: '5m', target: 50 }, // hold at 50
|
|
35
|
-
{ duration: '2m', target: 0 }, // ramp down
|
|
36
|
-
],
|
|
37
|
-
thresholds: {
|
|
38
|
-
http_req_duration: ['p(95)<500'], // 95% of requests under 500ms
|
|
39
|
-
http_req_failed: ['rate<0.01'], // less than 1% failure rate
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default function () {
|
|
44
|
-
const res = http.get('https://api.example.com/users');
|
|
45
|
-
|
|
46
|
-
check(res, {
|
|
47
|
-
'status is 200': (r) => r.status === 200,
|
|
48
|
-
'response time < 500ms': (r) => r.timings.duration < 500,
|
|
49
|
-
'body has users': (r) => JSON.parse(r.body).length > 0,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
sleep(1); // think time between requests
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Test Scenarios
|
|
57
|
-
|
|
58
|
-
```javascript
|
|
59
|
-
// Spike test — sudden traffic surge
|
|
60
|
-
export const options = {
|
|
61
|
-
stages: [
|
|
62
|
-
{ duration: '30s', target: 10 },
|
|
63
|
-
{ duration: '1m', target: 500 }, // sudden spike
|
|
64
|
-
{ duration: '30s', target: 500 },
|
|
65
|
-
{ duration: '1m', target: 10 }, // recovery
|
|
66
|
-
],
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// Soak test — sustained load over time
|
|
70
|
-
export const options = {
|
|
71
|
-
stages: [
|
|
72
|
-
{ duration: '5m', target: 100 },
|
|
73
|
-
{ duration: '4h', target: 100 }, // long duration
|
|
74
|
-
{ duration: '5m', target: 0 },
|
|
75
|
-
],
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// Stress test — increasing load to find breaking point
|
|
79
|
-
export const options = {
|
|
80
|
-
stages: [
|
|
81
|
-
{ duration: '2m', target: 100 },
|
|
82
|
-
{ duration: '2m', target: 200 },
|
|
83
|
-
{ duration: '2m', target: 300 },
|
|
84
|
-
{ duration: '2m', target: 400 }, // keep increasing
|
|
85
|
-
{ duration: '2m', target: 500 },
|
|
86
|
-
{ duration: '5m', target: 0 },
|
|
87
|
-
],
|
|
88
|
-
};
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Virtual User Profiles
|
|
92
|
-
|
|
93
|
-
```javascript
|
|
94
|
-
import { scenario } from 'k6/execution';
|
|
95
|
-
|
|
96
|
-
export const options = {
|
|
97
|
-
scenarios: {
|
|
98
|
-
browse: {
|
|
99
|
-
executor: 'ramping-vus',
|
|
100
|
-
startVUs: 0,
|
|
101
|
-
stages: [{ duration: '5m', target: 100 }],
|
|
102
|
-
exec: 'browseProducts',
|
|
103
|
-
},
|
|
104
|
-
checkout: {
|
|
105
|
-
executor: 'constant-arrival-rate',
|
|
106
|
-
rate: 10,
|
|
107
|
-
timeUnit: '1s',
|
|
108
|
-
duration: '5m',
|
|
109
|
-
preAllocatedVUs: 50,
|
|
110
|
-
exec: 'completePurchase',
|
|
111
|
-
},
|
|
112
|
-
api: {
|
|
113
|
-
executor: 'constant-vus',
|
|
114
|
-
vus: 20,
|
|
115
|
-
duration: '5m',
|
|
116
|
-
exec: 'apiCalls',
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export function browseProducts() {
|
|
122
|
-
http.get('https://api.example.com/products');
|
|
123
|
-
sleep(Math.random() * 3 + 1);
|
|
124
|
-
}
|
|
125
|
-
export function completePurchase() {
|
|
126
|
-
const cart = http.post('https://api.example.com/cart', JSON.stringify({
|
|
127
|
-
items: [{ id: 1, quantity: 1 }],
|
|
128
|
-
}), { headers: { 'Content-Type': 'application/json' } });
|
|
129
|
-
http.post('https://api.example.com/checkout', JSON.stringify({
|
|
130
|
-
cartId: JSON.parse(cart.body).id,
|
|
131
|
-
}), { headers: { 'Content-Type': 'application/json' } });
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Thresholds and Custom Metrics
|
|
136
|
-
|
|
137
|
-
```javascript
|
|
138
|
-
export const options = {
|
|
139
|
-
thresholds: {
|
|
140
|
-
http_req_duration: ['p(50)<200', 'p(95)<500', 'p(99)<1000'],
|
|
141
|
-
http_req_failed: ['rate<0.01'],
|
|
142
|
-
'http_req_duration{name:login}': ['p(95)<300'],
|
|
143
|
-
checks: ['rate>0.99'],
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Custom Metrics
|
|
149
|
-
|
|
150
|
-
```javascript
|
|
151
|
-
import { Trend, Counter, Rate } from 'k6/metrics';
|
|
152
|
-
|
|
153
|
-
const loginDuration = new Trend('login_duration');
|
|
154
|
-
const errorCount = new Counter('errors');
|
|
155
|
-
const successRate = new Rate('success_rate');
|
|
156
|
-
|
|
157
|
-
export default function () {
|
|
158
|
-
const start = Date.now();
|
|
159
|
-
const res = http.post('https://api.example.com/login', JSON.stringify({
|
|
160
|
-
email: 'test@example.com',
|
|
161
|
-
password: 'password',
|
|
162
|
-
}));
|
|
163
|
-
|
|
164
|
-
loginDuration.add(Date.now() - start);
|
|
165
|
-
errorCount.add(res.status !== 200 ? 1 : 0);
|
|
166
|
-
successRate.add(res.status === 200);
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### CI Integration (GitHub Actions)
|
|
171
|
-
|
|
172
|
-
```yaml
|
|
173
|
-
- name: Run k6 load test
|
|
174
|
-
uses: grafana/k6-action@v0.3.1
|
|
175
|
-
with:
|
|
176
|
-
filename: tests/performance/load-test.js
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
## Anti-Patterns
|
|
180
|
-
|
|
181
|
-
1. **No think time** — Omitting `sleep()` between requests creates unrealistic load
|
|
182
|
-
patterns. Real users pause between actions.
|
|
183
|
-
|
|
184
|
-
2. **Single endpoint testing** — Load testing only one endpoint misses interaction
|
|
185
|
-
effects. Test realistic user journeys across multiple endpoints.
|
|
186
|
-
|
|
187
|
-
3. **Ignoring ramp-up** — Jumping straight to peak load triggers cold-start failures
|
|
188
|
-
that mask real issues. Always ramp up gradually.
|
|
189
|
-
|
|
190
|
-
4. **Testing in development** — Load test results are only meaningful against
|
|
191
|
-
production-like infrastructure. Test against staging with realistic data.
|
|
192
|
-
|
|
193
|
-
5. **No thresholds** — Running load tests without pass/fail criteria makes them
|
|
194
|
-
informational only. Define thresholds and fail CI on violations.
|
|
195
|
-
|
|
196
|
-
## Integration Points
|
|
197
|
-
|
|
198
|
-
- **Tools**: k6, Grafana Cloud, InfluxDB, GitHub Actions
|
|
199
|
-
- **Workflows**: `performance-testing` (test plan), `ci-setup` (pipeline integration)
|
|
200
|
-
- **Related fragments**: `lighthouse-ci` (frontend performance)
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: lighthouse-ci
|
|
3
|
-
tier: performance
|
|
4
|
-
version: '1.0'
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Lighthouse CI
|
|
8
|
-
|
|
9
|
-
## Principle
|
|
10
|
-
|
|
11
|
-
Lighthouse CI integrates Google Lighthouse into your CI/CD pipeline, enforcing
|
|
12
|
-
performance budgets and Core Web Vitals targets on every build. It tracks scores
|
|
13
|
-
over time, preventing gradual performance degradation that manual testing misses.
|
|
14
|
-
|
|
15
|
-
## Rationale
|
|
16
|
-
|
|
17
|
-
Frontend performance regressions are introduced incrementally — a new dependency here,
|
|
18
|
-
an unoptimized image there. By the time the impact is noticed, dozens of changes
|
|
19
|
-
contribute to the problem. Lighthouse CI creates a performance ratchet that catches
|
|
20
|
-
regressions at the PR level, when they are cheapest to fix.
|
|
21
|
-
|
|
22
|
-
## Pattern Examples
|
|
23
|
-
|
|
24
|
-
### Lighthouse CI Configuration
|
|
25
|
-
|
|
26
|
-
```javascript
|
|
27
|
-
// lighthouserc.js
|
|
28
|
-
module.exports = {
|
|
29
|
-
ci: {
|
|
30
|
-
collect: {
|
|
31
|
-
url: [
|
|
32
|
-
'http://localhost:3000/',
|
|
33
|
-
'http://localhost:3000/dashboard',
|
|
34
|
-
'http://localhost:3000/products',
|
|
35
|
-
],
|
|
36
|
-
startServerCommand: 'npm run start',
|
|
37
|
-
numberOfRuns: 3, // median of 3 runs for stability
|
|
38
|
-
},
|
|
39
|
-
assert: {
|
|
40
|
-
assertions: {
|
|
41
|
-
'categories:performance': ['error', { minScore: 0.9 }],
|
|
42
|
-
'categories:accessibility': ['error', { minScore: 0.9 }],
|
|
43
|
-
'categories:best-practices': ['warn', { minScore: 0.85 }],
|
|
44
|
-
'categories:seo': ['warn', { minScore: 0.9 }],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
upload: {
|
|
48
|
-
target: 'temporary-public-storage', // or 'lhci' for self-hosted
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Core Web Vitals Targets
|
|
55
|
-
|
|
56
|
-
```javascript
|
|
57
|
-
// lighthouserc.js — CWV-focused assertions
|
|
58
|
-
module.exports = {
|
|
59
|
-
ci: {
|
|
60
|
-
assert: {
|
|
61
|
-
assertions: {
|
|
62
|
-
// Largest Contentful Paint — under 2.5s
|
|
63
|
-
'largest-contentful-paint': ['error', { maxNumericValue: 2500 }],
|
|
64
|
-
|
|
65
|
-
// Interaction to Next Paint (replaces FID) — under 200ms
|
|
66
|
-
'interactive': ['error', { maxNumericValue: 3800 }],
|
|
67
|
-
|
|
68
|
-
// Cumulative Layout Shift — under 0.1
|
|
69
|
-
'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }],
|
|
70
|
-
|
|
71
|
-
// First Contentful Paint — under 1.8s
|
|
72
|
-
'first-contentful-paint': ['warn', { maxNumericValue: 1800 }],
|
|
73
|
-
|
|
74
|
-
// Total Blocking Time — under 200ms
|
|
75
|
-
'total-blocking-time': ['error', { maxNumericValue: 200 }],
|
|
76
|
-
|
|
77
|
-
// Speed Index — under 3.4s
|
|
78
|
-
'speed-index': ['warn', { maxNumericValue: 3400 }],
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Performance Budgets
|
|
86
|
-
|
|
87
|
-
```javascript
|
|
88
|
-
// lighthouserc.js — resource budgets
|
|
89
|
-
module.exports = {
|
|
90
|
-
ci: {
|
|
91
|
-
assert: {
|
|
92
|
-
assertions: {
|
|
93
|
-
'resource-summary:script:size': ['error', { maxNumericValue: 300000 }], // 300KB JS
|
|
94
|
-
'resource-summary:stylesheet:size': ['warn', { maxNumericValue: 50000 }], // 50KB CSS
|
|
95
|
-
'resource-summary:image:size': ['warn', { maxNumericValue: 500000 }], // 500KB images
|
|
96
|
-
'resource-summary:total:size': ['error', { maxNumericValue: 1000000 }], // 1MB total
|
|
97
|
-
'resource-summary:third-party:size': ['warn', { maxNumericValue: 200000 }],
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### GitHub Actions Integration
|
|
106
|
-
|
|
107
|
-
```yaml
|
|
108
|
-
- name: Run Lighthouse CI
|
|
109
|
-
uses: treosh/lighthouse-ci-action@v11
|
|
110
|
-
with:
|
|
111
|
-
configPath: './lighthouserc.js'
|
|
112
|
-
uploadArtifacts: true
|
|
113
|
-
temporaryPublicStorage: true
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Bundle Analysis Integration
|
|
117
|
-
|
|
118
|
-
```javascript
|
|
119
|
-
// webpack.config.js
|
|
120
|
-
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
121
|
-
module.exports = {
|
|
122
|
-
plugins: [
|
|
123
|
-
new BundleAnalyzerPlugin({
|
|
124
|
-
analyzerMode: process.env.CI ? 'static' : 'server',
|
|
125
|
-
reportFilename: 'bundle-report.html',
|
|
126
|
-
}),
|
|
127
|
-
],
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
// Next.js — next.config.js
|
|
131
|
-
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
|
132
|
-
enabled: process.env.ANALYZE === 'true',
|
|
133
|
-
});
|
|
134
|
-
module.exports = withBundleAnalyzer({ /* next config */ });
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
## Anti-Patterns
|
|
138
|
-
|
|
139
|
-
1. **Warning-only thresholds** — Using `warn` for critical metrics lets regressions
|
|
140
|
-
through. Use `error` for Core Web Vitals and `warn` for secondary metrics.
|
|
141
|
-
|
|
142
|
-
2. **Single-run results** — One Lighthouse run has high variance. Always use
|
|
143
|
-
`numberOfRuns: 3` or more and take the median.
|
|
144
|
-
|
|
145
|
-
3. **Testing development builds** — Development builds include source maps and debug
|
|
146
|
-
code. Always test production builds for accurate results.
|
|
147
|
-
|
|
148
|
-
4. **Ignoring third-party impact** — Third-party scripts (analytics, ads, widgets)
|
|
149
|
-
significantly affect performance. Budget for and track them separately.
|
|
150
|
-
|
|
151
|
-
5. **No historical tracking** — Without a Lighthouse CI server, you lose trending data.
|
|
152
|
-
Set up self-hosted LHCI or use temporary public storage for PR comparisons.
|
|
153
|
-
|
|
154
|
-
## Integration Points
|
|
155
|
-
|
|
156
|
-
- **Tools**: Lighthouse CI, webpack-bundle-analyzer, @next/bundle-analyzer
|
|
157
|
-
- **Workflows**: `performance-testing` (test plan), `ci-setup` (pipeline integration)
|
|
158
|
-
- **Related fragments**: `k6-patterns` (backend performance)
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: contract-testing
|
|
3
|
-
tier: specialized
|
|
4
|
-
version: '1.0'
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Contract Testing
|
|
8
|
-
|
|
9
|
-
## Principle
|
|
10
|
-
|
|
11
|
-
Contract testing validates API contracts between consumer and provider services without
|
|
12
|
-
requiring integrated end-to-end tests. Consumers define expectations as pact files,
|
|
13
|
-
providers verify against them independently. This enables parallel development, catches
|
|
14
|
-
breaking changes before merge, and documents API behavior as executable specifications.
|
|
15
|
-
|
|
16
|
-
## Rationale
|
|
17
|
-
|
|
18
|
-
Traditional integration testing requires running consumer and provider simultaneously,
|
|
19
|
-
creating slow and flaky tests with complex setup. Contract testing decouples services:
|
|
20
|
-
consumers define expectations (pact files), providers verify independently. The Pact
|
|
21
|
-
Broker acts as a central contract registry, enabling `can-i-deploy` safety checks before
|
|
22
|
-
production deployment.
|
|
23
|
-
|
|
24
|
-
## Pattern Examples
|
|
25
|
-
|
|
26
|
-
### Consumer Test (Frontend defines expectations)
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
// tests/contract/user-api.pact.spec.ts
|
|
30
|
-
import { PactV3, MatchersV3 } from '@pact-foundation/pact';
|
|
31
|
-
import { getUserById } from '@/api/user-service';
|
|
32
|
-
|
|
33
|
-
const { like, string, integer } = MatchersV3;
|
|
34
|
-
|
|
35
|
-
const provider = new PactV3({
|
|
36
|
-
consumer: 'user-management-web',
|
|
37
|
-
provider: 'user-api-service',
|
|
38
|
-
dir: './pacts',
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
describe('User API Contract', () => {
|
|
42
|
-
it('returns user when exists', async () => {
|
|
43
|
-
await provider
|
|
44
|
-
.given('user with id 1 exists') // Provider state
|
|
45
|
-
.uponReceiving('a request for user 1')
|
|
46
|
-
.withRequest({
|
|
47
|
-
method: 'GET',
|
|
48
|
-
path: '/users/1',
|
|
49
|
-
headers: { Authorization: like('Bearer token123') },
|
|
50
|
-
})
|
|
51
|
-
.willRespondWith({
|
|
52
|
-
status: 200,
|
|
53
|
-
body: like({
|
|
54
|
-
id: integer(1),
|
|
55
|
-
name: string('John Doe'),
|
|
56
|
-
email: string('john@example.com'),
|
|
57
|
-
}),
|
|
58
|
-
})
|
|
59
|
-
.executeTest(async (mockServer) => {
|
|
60
|
-
const user = await getUserById(1, { baseURL: mockServer.url });
|
|
61
|
-
expect(user.name).toBe('John Doe');
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('handles 404 when user missing', async () => {
|
|
66
|
-
await provider
|
|
67
|
-
.given('user with id 999 does not exist')
|
|
68
|
-
.uponReceiving('a request for non-existent user')
|
|
69
|
-
.withRequest({ method: 'GET', path: '/users/999' })
|
|
70
|
-
.willRespondWith({
|
|
71
|
-
status: 404,
|
|
72
|
-
body: { error: 'User not found', code: 'USER_NOT_FOUND' },
|
|
73
|
-
})
|
|
74
|
-
.executeTest(async (mockServer) => {
|
|
75
|
-
await expect(getUserById(999, { baseURL: mockServer.url }))
|
|
76
|
-
.rejects.toThrow('User not found');
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Provider Verification
|
|
83
|
-
|
|
84
|
-
```typescript
|
|
85
|
-
// tests/contract/user-api.provider.spec.ts
|
|
86
|
-
import { Verifier } from '@pact-foundation/pact';
|
|
87
|
-
import { seedDatabase, resetDatabase } from '../support/db-helpers';
|
|
88
|
-
|
|
89
|
-
describe('Provider Verification', () => {
|
|
90
|
-
it('verifies pacts from all consumers', async () => {
|
|
91
|
-
await new Verifier({
|
|
92
|
-
provider: 'user-api-service',
|
|
93
|
-
providerBaseUrl: `http://localhost:${PORT}`,
|
|
94
|
-
pactBrokerUrl: process.env.PACT_BROKER_URL,
|
|
95
|
-
pactBrokerToken: process.env.PACT_BROKER_TOKEN,
|
|
96
|
-
publishVerificationResult: process.env.CI === 'true',
|
|
97
|
-
providerVersion: process.env.GIT_SHA,
|
|
98
|
-
|
|
99
|
-
stateHandlers: {
|
|
100
|
-
'user with id 1 exists': async () => {
|
|
101
|
-
await seedDatabase({ users: [{ id: 1, name: 'John Doe' }] });
|
|
102
|
-
},
|
|
103
|
-
'user with id 999 does not exist': async () => {
|
|
104
|
-
await resetDatabase();
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
requestFilter: (req, res, next) => {
|
|
109
|
-
req.headers['authorization'] = 'Bearer valid-test-token';
|
|
110
|
-
next();
|
|
111
|
-
},
|
|
112
|
-
}).verifyProvider();
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### CI Integration
|
|
118
|
-
|
|
119
|
-
```yaml
|
|
120
|
-
# Consumer: publish pacts on merge
|
|
121
|
-
- name: Run consumer contract tests
|
|
122
|
-
run: npm run test:contract
|
|
123
|
-
- name: Publish pacts
|
|
124
|
-
run: |
|
|
125
|
-
npx pact-broker publish ./pacts \
|
|
126
|
-
--consumer-app-version ${{ github.sha }} \
|
|
127
|
-
--branch ${{ github.head_ref || github.ref_name }}
|
|
128
|
-
|
|
129
|
-
# Provider: verify on PR + webhook trigger
|
|
130
|
-
- name: Verify pacts
|
|
131
|
-
run: npm run test:contract:provider
|
|
132
|
-
- name: Can I Deploy?
|
|
133
|
-
run: |
|
|
134
|
-
npx pact-broker can-i-deploy \
|
|
135
|
-
--pacticipant user-api-service \
|
|
136
|
-
--version ${{ github.sha }} \
|
|
137
|
-
--to-environment production
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### When Contract vs Integration
|
|
141
|
-
|
|
142
|
-
| Scenario | Contract | Integration |
|
|
143
|
-
|-------------------------------|-------------|-------------|
|
|
144
|
-
| API shape validation | Primary | Supplement |
|
|
145
|
-
| Cross-team service boundaries | Primary | Overkill |
|
|
146
|
-
| Same-team microservices | Supplement | Primary |
|
|
147
|
-
| Database interactions | Cannot test | Primary |
|
|
148
|
-
| Breaking change detection | Primary | Cannot test |
|
|
149
|
-
|
|
150
|
-
## Anti-Patterns
|
|
151
|
-
|
|
152
|
-
1. **Skipping provider states** -- Consumer tests that do not define `given()` states
|
|
153
|
-
leave the provider guessing about what data to set up. Always define states explicitly.
|
|
154
|
-
|
|
155
|
-
2. **Testing implementation details** -- Contracts should define the API shape, not
|
|
156
|
-
internal behavior. Avoid asserting on exact header values or response timing.
|
|
157
|
-
|
|
158
|
-
3. **No can-i-deploy check** -- Publishing pacts without checking compatibility before
|
|
159
|
-
deploy defeats the purpose. Always gate deployments on `can-i-deploy`.
|
|
160
|
-
|
|
161
|
-
4. **Contract sprawl** -- Old pacts from deleted branches clutter the broker. Set up
|
|
162
|
-
weekly cleanup with retention policies (keep 30 days, production tags, branch latest).
|
|
163
|
-
|
|
164
|
-
5. **Replacing all integration tests** -- Contract tests verify shape, not behavior.
|
|
165
|
-
Keep integration tests for data integrity, transactions, and business logic that
|
|
166
|
-
crosses service boundaries.
|
|
167
|
-
|
|
168
|
-
## Integration Points
|
|
169
|
-
|
|
170
|
-
- **Workflows**: `test-design` (deciding when to use contracts), `ci-setup` (Pact broker
|
|
171
|
-
integration)
|
|
172
|
-
- **Related fragments**: `api-testing-patterns` (API test structure),
|
|
173
|
-
`test-pyramid` (where contracts fit), `risk-governance` (contracts as quality gates)
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: test-healing
|
|
3
|
-
tier: specialized
|
|
4
|
-
version: '1.0'
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Test Healing
|
|
8
|
-
|
|
9
|
-
## Principle
|
|
10
|
-
|
|
11
|
-
Common test failures follow predictable patterns: stale selectors, race conditions,
|
|
12
|
-
dynamic data assertions, network errors, and hard waits. Catalog these failure signatures
|
|
13
|
-
and apply pattern-based fixes. Automated healing identifies the failure type and suggests
|
|
14
|
-
or applies the corresponding fix. Retries mask bugs -- fix the root cause instead.
|
|
15
|
-
|
|
16
|
-
## Rationale
|
|
17
|
-
|
|
18
|
-
Test failures waste developer time on repetitive debugging. Teams manually fix the same
|
|
19
|
-
selector issues, timing bugs, and data mismatches across test suites. By cataloging
|
|
20
|
-
common failure patterns with diagnostic signatures and fixes, maintenance shifts from
|
|
21
|
-
reactive debugging to proactive pattern application, reducing repair time by 60-80%.
|
|
22
|
-
|
|
23
|
-
## Pattern Examples
|
|
24
|
-
|
|
25
|
-
### Failure Pattern Catalog
|
|
26
|
-
|
|
27
|
-
| Failure Type | Diagnostic Signature | Fix Strategy |
|
|
28
|
-
|----------------|---------------------------------------------|---------------------------------------|
|
|
29
|
-
| Stale selector | "locator resolved to 0 elements" | Replace with data-testid or ARIA role |
|
|
30
|
-
| Race condition | "timeout waiting for element" | Add network-first interception |
|
|
31
|
-
| Dynamic data | "Expected 'User 123' got 'User 456'" | Use regex or capture dynamic values |
|
|
32
|
-
| Network error | "API call failed", "500 error" | Add route mocking |
|
|
33
|
-
| Hard wait | Code contains `waitForTimeout()` / `wait(n)`| Replace with event-based waits |
|
|
34
|
-
|
|
35
|
-
### Selector Fallback Strategy
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
// Detect stale selector failure
|
|
39
|
-
function isSelectorFailure(error: Error): boolean {
|
|
40
|
-
return /locator.*resolved to 0 elements|element not found/i.test(error.message);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Suggest better selector based on what failed
|
|
44
|
-
function suggestFix(badSelector: string): string {
|
|
45
|
-
if (badSelector.startsWith('.') || badSelector.includes('class=')) {
|
|
46
|
-
return `page.getByTestId('...') // Replace CSS class with data-testid`;
|
|
47
|
-
}
|
|
48
|
-
if (badSelector.includes('.nth(')) {
|
|
49
|
-
return `page.locator('...').filter({ hasText: '...' }) // Replace nth with filter`;
|
|
50
|
-
}
|
|
51
|
-
if (badSelector.includes('>') || badSelector.includes('+')) {
|
|
52
|
-
return `page.getByRole('button', { name: '...' }) // Replace complex CSS with ARIA`;
|
|
53
|
-
}
|
|
54
|
-
return `page.getByTestId('...') // Add data-testid attribute to element`;
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Auto-Wait Pattern (Replacing Hard Waits)
|
|
59
|
-
|
|
60
|
-
```typescript
|
|
61
|
-
// BEFORE: Flaky hard wait
|
|
62
|
-
// await page.waitForTimeout(3000);
|
|
63
|
-
|
|
64
|
-
// AFTER: Deterministic event-based wait
|
|
65
|
-
// Option A: Wait for network response
|
|
66
|
-
await page.waitForResponse(resp =>
|
|
67
|
-
resp.url().includes('/api/dashboard') && resp.ok()
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
// Option B: Wait for element state change
|
|
71
|
-
await page.getByTestId('loading-spinner').waitFor({ state: 'detached' });
|
|
72
|
-
|
|
73
|
-
// Option C: Network-first pattern (intercept before navigate)
|
|
74
|
-
const dataPromise = page.waitForResponse('**/api/data');
|
|
75
|
-
await page.goto('/page');
|
|
76
|
-
await dataPromise;
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### When Healing Hides Real Issues
|
|
80
|
-
|
|
81
|
-
```typescript
|
|
82
|
-
// DANGEROUS: Auto-retry on any failure
|
|
83
|
-
test('dashboard loads', async ({ page }) => {
|
|
84
|
-
// retries: 3 in config -- masks the actual race condition
|
|
85
|
-
await page.goto('/dashboard');
|
|
86
|
-
await expect(page.getByText('Welcome')).toBeVisible();
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
// CORRECT: Fix the root cause
|
|
90
|
-
test('dashboard loads', async ({ page }) => {
|
|
91
|
-
const dataPromise = page.waitForResponse('**/api/dashboard');
|
|
92
|
-
await page.goto('/dashboard');
|
|
93
|
-
await dataPromise; // Wait for actual data, not a timer
|
|
94
|
-
await expect(page.getByText('Welcome')).toBeVisible();
|
|
95
|
-
});
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Healing Workflow
|
|
99
|
-
|
|
100
|
-
1. **Run test** -- capture failure message and stack trace
|
|
101
|
-
2. **Identify pattern** -- match error against diagnostic signatures
|
|
102
|
-
3. **Apply fix** -- use pattern-based healing strategy
|
|
103
|
-
4. **Re-run test** -- validate fix works (max 3 iterations)
|
|
104
|
-
5. **Mark unfixable** -- use `test.fixme()` if healing fails after 3 attempts
|
|
105
|
-
|
|
106
|
-
## Anti-Patterns
|
|
107
|
-
|
|
108
|
-
1. **Retry as healing** -- Adding `retries: 3` to flaky tests hides bugs. Retries are
|
|
109
|
-
for CI infrastructure glitches, not test design problems.
|
|
110
|
-
|
|
111
|
-
2. **Silent selector fallback** -- Auto-switching selectors without logging makes
|
|
112
|
-
debugging harder. Always log what was healed and why.
|
|
113
|
-
|
|
114
|
-
3. **Healing without root cause analysis** -- Applying a fix without understanding why
|
|
115
|
-
the test broke means it will break again. Document the root cause.
|
|
116
|
-
|
|
117
|
-
4. **Over-healing** -- Some test failures indicate real bugs. If a test fails because the
|
|
118
|
-
feature is broken, do not heal the test -- fix the feature.
|
|
119
|
-
|
|
120
|
-
5. **No iteration limit** -- Healing loops without a max attempt count can run forever.
|
|
121
|
-
Cap at 3 attempts, then mark as `test.fixme()` for human review.
|
|
122
|
-
|
|
123
|
-
## Integration Points
|
|
124
|
-
|
|
125
|
-
- **Workflows**: `test-review` (healing recommendations), `test-automation` (auto-healing
|
|
126
|
-
after generation)
|
|
127
|
-
- **Related fragments**: `selector-resilience` (resilient selector patterns),
|
|
128
|
-
`deterministic-testing` (preventing failures that need healing),
|
|
129
|
-
`fixture-architecture` (clean fixtures prevent state-related failures)
|