gaia-framework 1.58.0 → 1.58.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/.claude/commands/gaia-a11y-testing.md +17 -0
- package/.claude/commands/gaia-action-items.md +23 -0
- package/.claude/commands/gaia-add-feature.md +17 -0
- package/.claude/commands/gaia-add-stories.md +17 -0
- package/.claude/commands/gaia-advanced-elicitation.md +17 -0
- package/.claude/commands/gaia-adversarial.md +15 -0
- package/.claude/commands/gaia-agent-analyst.md +14 -0
- package/.claude/commands/gaia-agent-architect.md +14 -0
- package/.claude/commands/gaia-agent-brainstorming.md +14 -0
- package/.claude/commands/gaia-agent-data-engineer.md +14 -0
- package/.claude/commands/gaia-agent-design-thinking.md +14 -0
- package/.claude/commands/gaia-agent-dev-angular.md +14 -0
- package/.claude/commands/gaia-agent-dev-flutter.md +14 -0
- package/.claude/commands/gaia-agent-dev-go.md +14 -0
- package/.claude/commands/gaia-agent-dev-java.md +14 -0
- package/.claude/commands/gaia-agent-dev-mobile.md +14 -0
- package/.claude/commands/gaia-agent-dev-python.md +14 -0
- package/.claude/commands/gaia-agent-dev-typescript.md +14 -0
- package/.claude/commands/gaia-agent-devops.md +14 -0
- package/.claude/commands/gaia-agent-innovation.md +14 -0
- package/.claude/commands/gaia-agent-performance.md +14 -0
- package/.claude/commands/gaia-agent-pm.md +14 -0
- package/.claude/commands/gaia-agent-presentation.md +14 -0
- package/.claude/commands/gaia-agent-problem-solver.md +14 -0
- package/.claude/commands/gaia-agent-qa.md +14 -0
- package/.claude/commands/gaia-agent-security.md +14 -0
- package/.claude/commands/gaia-agent-sm.md +14 -0
- package/.claude/commands/gaia-agent-storyteller.md +14 -0
- package/.claude/commands/gaia-agent-tech-writer.md +14 -0
- package/.claude/commands/gaia-agent-test-architect.md +14 -0
- package/.claude/commands/gaia-agent-ux-designer.md +14 -0
- package/.claude/commands/gaia-agent-validator.md +14 -0
- package/.claude/commands/gaia-atdd.md +17 -0
- package/.claude/commands/gaia-brainstorm.md +17 -0
- package/.claude/commands/gaia-brainstorming.md +17 -0
- package/.claude/commands/gaia-brownfield.md +17 -0
- package/.claude/commands/gaia-build-configs.md +22 -0
- package/.claude/commands/gaia-change-request.md +11 -0
- package/.claude/commands/gaia-changelog.md +16 -0
- package/.claude/commands/gaia-check-dod.md +17 -0
- package/.claude/commands/gaia-check-review-gate.md +17 -0
- package/.claude/commands/gaia-ci-setup.md +17 -0
- package/.claude/commands/gaia-code-review.md +17 -0
- package/.claude/commands/gaia-correct-course.md +17 -0
- package/.claude/commands/gaia-create-arch.md +17 -0
- package/.claude/commands/gaia-create-epics.md +17 -0
- package/.claude/commands/gaia-create-prd.md +17 -0
- package/.claude/commands/gaia-create-story.md +23 -0
- package/.claude/commands/gaia-create-ux.md +17 -0
- package/.claude/commands/gaia-creative-sprint.md +17 -0
- package/.claude/commands/gaia-deploy-checklist.md +17 -0
- package/.claude/commands/gaia-design-thinking.md +17 -0
- package/.claude/commands/gaia-dev-story.md +23 -0
- package/.claude/commands/gaia-document-project.md +17 -0
- package/.claude/commands/gaia-domain-research.md +17 -0
- package/.claude/commands/gaia-edge-cases.md +15 -0
- package/.claude/commands/gaia-edit-arch.md +17 -0
- package/.claude/commands/gaia-edit-prd.md +17 -0
- package/.claude/commands/gaia-edit-test-plan.md +17 -0
- package/.claude/commands/gaia-editorial-prose.md +15 -0
- package/.claude/commands/gaia-editorial-structure.md +15 -0
- package/.claude/commands/gaia-epic-status.md +17 -0
- package/.claude/commands/gaia-fix-story.md +17 -0
- package/.claude/commands/gaia-help.md +15 -0
- package/.claude/commands/gaia-index-docs.md +15 -0
- package/.claude/commands/gaia-infra-design.md +17 -0
- package/.claude/commands/gaia-innovation.md +17 -0
- package/.claude/commands/gaia-market-research.md +17 -0
- package/.claude/commands/gaia-memory-hygiene.md +17 -0
- package/.claude/commands/gaia-merge-docs.md +16 -0
- package/.claude/commands/gaia-mobile-testing.md +17 -0
- package/.claude/commands/gaia-nfr.md +17 -0
- package/.claude/commands/gaia-party.md +17 -0
- package/.claude/commands/gaia-perf-testing.md +17 -0
- package/.claude/commands/gaia-performance-review.md +17 -0
- package/.claude/commands/gaia-pitch-deck.md +17 -0
- package/.claude/commands/gaia-post-deploy.md +17 -0
- package/.claude/commands/gaia-problem-solving.md +17 -0
- package/.claude/commands/gaia-product-brief.md +17 -0
- package/.claude/commands/gaia-project-context.md +17 -0
- package/.claude/commands/gaia-qa-tests.md +17 -0
- package/.claude/commands/gaia-quick-dev.md +17 -0
- package/.claude/commands/gaia-quick-spec.md +17 -0
- package/.claude/commands/gaia-readiness-check.md +17 -0
- package/.claude/commands/gaia-refresh-ground-truth.md +17 -0
- package/.claude/commands/gaia-release-plan.md +17 -0
- package/.claude/commands/gaia-resume.md +25 -0
- package/.claude/commands/gaia-retro.md +20 -0
- package/.claude/commands/gaia-review-a11y.md +16 -0
- package/.claude/commands/gaia-review-api.md +16 -0
- package/.claude/commands/gaia-review-deps.md +16 -0
- package/.claude/commands/gaia-review-perf.md +16 -0
- package/.claude/commands/gaia-review-security.md +16 -0
- package/.claude/commands/gaia-rollback-plan.md +17 -0
- package/.claude/commands/gaia-run-all-reviews.md +17 -0
- package/.claude/commands/gaia-security-review.md +17 -0
- package/.claude/commands/gaia-shard-doc.md +15 -0
- package/.claude/commands/gaia-slide-deck.md +17 -0
- package/.claude/commands/gaia-sprint-plan.md +17 -0
- package/.claude/commands/gaia-sprint-status.md +17 -0
- package/.claude/commands/gaia-storytelling.md +17 -0
- package/.claude/commands/gaia-summarize.md +16 -0
- package/.claude/commands/gaia-teach-testing.md +17 -0
- package/.claude/commands/gaia-tech-debt-review.md +20 -0
- package/.claude/commands/gaia-tech-research.md +17 -0
- package/.claude/commands/gaia-test-automate.md +17 -0
- package/.claude/commands/gaia-test-design.md +17 -0
- package/.claude/commands/gaia-test-framework.md +17 -0
- package/.claude/commands/gaia-test-review.md +17 -0
- package/.claude/commands/gaia-threat-model.md +17 -0
- package/.claude/commands/gaia-trace.md +17 -0
- package/.claude/commands/gaia-triage-findings.md +20 -0
- package/.claude/commands/gaia-val-validate-plan.md +17 -0
- package/.claude/commands/gaia-val-validate.md +17 -0
- package/.claude/commands/gaia-validate-framework.md +17 -0
- package/.claude/commands/gaia-validate-prd.md +17 -0
- package/.claude/commands/gaia-validate-story.md +22 -0
- package/.claude/commands/gaia.md +32 -0
- package/CLAUDE.md +165 -0
- package/README.md +3 -3
- package/_gaia/_config/agent-manifest.csv +29 -0
- package/_gaia/_config/agents/CUSTOMIZATION-README.md +117 -0
- package/_gaia/_config/files-manifest.csv +30 -0
- package/_gaia/_config/gaia-help.csv +82 -0
- package/_gaia/_config/global.yaml +45 -0
- package/_gaia/_config/lifecycle-sequence.yaml +623 -0
- package/_gaia/_config/manifest.yaml +24 -0
- package/_gaia/_config/skill-manifest.csv +12 -0
- package/_gaia/_config/task-manifest.csv +17 -0
- package/_gaia/_config/workflow-manifest.csv +73 -0
- package/_gaia/_memory/tier2-results/.gitkeep +0 -0
- package/_gaia/_memory/tier2-results/checkpoint-resume-2026-03-24.yaml +6 -0
- package/_gaia/_memory/tier2-results/engine-scenarios-2026-03-22.yaml +14 -0
- package/_gaia/core/.resolved/.gitkeep +0 -0
- package/_gaia/core/agents/orchestrator.md +303 -0
- package/_gaia/core/config.yaml +8 -0
- package/_gaia/core/engine/error-recovery.xml +28 -0
- package/_gaia/core/engine/protocols/discover-inputs.xml +31 -0
- package/_gaia/core/engine/protocols/handoff.xml +21 -0
- package/_gaia/core/engine/protocols/preflight-check.xml +31 -0
- package/_gaia/core/engine/task-runner.xml +63 -0
- package/_gaia/core/engine/workflow.xml +225 -0
- package/_gaia/core/module-help.csv +21 -0
- package/_gaia/core/protocols/agent-specification-protocol.md +103 -0
- package/_gaia/core/protocols/review-gate-check.xml +29 -0
- package/_gaia/core/protocols/sprint-status-write-safety.xml +35 -0
- package/_gaia/core/protocols/status-sync.xml +49 -0
- package/_gaia/core/tasks/editorial-review-prose.xml +42 -0
- package/_gaia/core/tasks/editorial-review-structure.xml +43 -0
- package/_gaia/core/tasks/generate-changelog.xml +35 -0
- package/_gaia/core/tasks/help.md +45 -0
- package/_gaia/core/tasks/index-docs.xml +46 -0
- package/_gaia/core/tasks/merge-docs.xml +34 -0
- package/_gaia/core/tasks/review-accessibility.xml +47 -0
- package/_gaia/core/tasks/review-adversarial.xml +55 -0
- package/_gaia/core/tasks/review-api-design.xml +38 -0
- package/_gaia/core/tasks/review-dependency-audit.xml +38 -0
- package/_gaia/core/tasks/review-edge-case-hunter.xml +52 -0
- package/_gaia/core/tasks/review-performance.xml +49 -0
- package/_gaia/core/tasks/review-security.xml +37 -0
- package/_gaia/core/tasks/shard-doc.xml +49 -0
- package/_gaia/core/tasks/summarize-doc.xml +33 -0
- package/_gaia/core/tasks/validate-framework.xml +66 -0
- package/_gaia/core/workflows/brainstorming/steps/step-01-session-setup.md +7 -0
- package/_gaia/core/workflows/brainstorming/steps/step-02-technique-selection.md +20 -0
- package/_gaia/core/workflows/brainstorming/steps/step-03-technique-execution.md +11 -0
- package/_gaia/core/workflows/brainstorming/steps/step-04-idea-organization.md +14 -0
- package/_gaia/core/workflows/brainstorming/template.md +38 -0
- package/_gaia/core/workflows/brainstorming/workflow.yaml +26 -0
- package/_gaia/core/workflows/party-mode/steps/step-01-agent-loading.md +11 -0
- package/_gaia/core/workflows/party-mode/steps/step-02-discussion-orchestration.md +16 -0
- package/_gaia/core/workflows/party-mode/steps/step-03-graceful-exit.md +10 -0
- package/_gaia/core/workflows/party-mode/workflow.yaml +23 -0
- package/_gaia/creative/.resolved/.gitkeep +0 -0
- package/_gaia/creative/agents/brainstorming-coach.md +93 -0
- package/_gaia/creative/agents/design-thinking-coach.md +91 -0
- package/_gaia/creative/agents/innovation-strategist.md +89 -0
- package/_gaia/creative/agents/presentation-designer.md +99 -0
- package/_gaia/creative/agents/problem-solver.md +90 -0
- package/_gaia/creative/agents/storyteller.md +90 -0
- package/_gaia/creative/config.yaml +8 -0
- package/_gaia/creative/data/design-methods.csv +28 -0
- package/_gaia/creative/data/innovation-frameworks.csv +15 -0
- package/_gaia/creative/data/solving-methods.csv +14 -0
- package/_gaia/creative/data/story-types.csv +12 -0
- package/_gaia/creative/module-help.csv +8 -0
- package/_gaia/creative/teams/creative-squad.yaml +10 -0
- package/_gaia/creative/workflows/creative-sprint/checklist.md +10 -0
- package/_gaia/creative/workflows/creative-sprint/instructions.xml +40 -0
- package/_gaia/creative/workflows/creative-sprint/workflow.yaml +11 -0
- package/_gaia/creative/workflows/design-thinking/checklist.md +25 -0
- package/_gaia/creative/workflows/design-thinking/instructions.xml +38 -0
- package/_gaia/creative/workflows/design-thinking/workflow.yaml +13 -0
- package/_gaia/creative/workflows/innovation-strategy/checklist.md +26 -0
- package/_gaia/creative/workflows/innovation-strategy/instructions.xml +34 -0
- package/_gaia/creative/workflows/innovation-strategy/workflow.yaml +13 -0
- package/_gaia/creative/workflows/pitch-deck/checklist.md +22 -0
- package/_gaia/creative/workflows/pitch-deck/instructions.xml +49 -0
- package/_gaia/creative/workflows/pitch-deck/workflow.yaml +15 -0
- package/_gaia/creative/workflows/problem-solving/checklist.md +26 -0
- package/_gaia/creative/workflows/problem-solving/instructions.xml +39 -0
- package/_gaia/creative/workflows/problem-solving/workflow.yaml +13 -0
- package/_gaia/creative/workflows/slide-deck/checklist.md +21 -0
- package/_gaia/creative/workflows/slide-deck/instructions.xml +39 -0
- package/_gaia/creative/workflows/slide-deck/workflow.yaml +15 -0
- package/_gaia/creative/workflows/storytelling/checklist.md +26 -0
- package/_gaia/creative/workflows/storytelling/instructions.xml +38 -0
- package/_gaia/creative/workflows/storytelling/workflow.yaml +13 -0
- package/_gaia/dev/agents/_base-dev.md +180 -0
- package/_gaia/dev/agents/angular-dev.md +70 -0
- package/_gaia/dev/agents/flutter-dev.md +70 -0
- package/_gaia/dev/agents/go-dev.md +72 -0
- package/_gaia/dev/agents/java-dev.md +70 -0
- package/_gaia/dev/agents/mobile-dev.md +70 -0
- package/_gaia/dev/agents/python-dev.md +70 -0
- package/_gaia/dev/agents/typescript-dev.md +70 -0
- package/_gaia/dev/config.yaml +11 -0
- package/_gaia/dev/knowledge/_index.csv +25 -0
- package/_gaia/dev/knowledge/angular/angular-conventions.md +119 -0
- package/_gaia/dev/knowledge/angular/angular-patterns.md +126 -0
- package/_gaia/dev/knowledge/angular/ngrx-state.md +124 -0
- package/_gaia/dev/knowledge/angular/rxjs-patterns.md +119 -0
- package/_gaia/dev/knowledge/flutter/dart-conventions.md +143 -0
- package/_gaia/dev/knowledge/flutter/platform-channels.md +144 -0
- package/_gaia/dev/knowledge/flutter/state-management.md +144 -0
- package/_gaia/dev/knowledge/flutter/widget-patterns.md +134 -0
- package/_gaia/dev/knowledge/go/gin-fiber-patterns.md +40 -0
- package/_gaia/dev/knowledge/go/go-conventions.md +54 -0
- package/_gaia/dev/knowledge/go/go-stdlib-patterns.md +39 -0
- package/_gaia/dev/knowledge/go/go-testing-patterns.md +39 -0
- package/_gaia/dev/knowledge/java/jpa-patterns.md +136 -0
- package/_gaia/dev/knowledge/java/maven-gradle.md +189 -0
- package/_gaia/dev/knowledge/java/microservices.md +159 -0
- package/_gaia/dev/knowledge/java/spring-boot-patterns.md +160 -0
- package/_gaia/dev/knowledge/mobile/kotlin-patterns.md +193 -0
- package/_gaia/dev/knowledge/mobile/mobile-testing.md +186 -0
- package/_gaia/dev/knowledge/mobile/react-native-patterns.md +162 -0
- package/_gaia/dev/knowledge/mobile/swift-patterns.md +190 -0
- package/_gaia/dev/knowledge/python/data-pipelines.md +169 -0
- package/_gaia/dev/knowledge/python/django-patterns.md +145 -0
- package/_gaia/dev/knowledge/python/fastapi-patterns.md +164 -0
- package/_gaia/dev/knowledge/python/python-conventions.md +170 -0
- package/_gaia/dev/knowledge/typescript/express-patterns.md +188 -0
- package/_gaia/dev/knowledge/typescript/nextjs-patterns.md +166 -0
- package/_gaia/dev/knowledge/typescript/react-patterns.md +176 -0
- package/_gaia/dev/knowledge/typescript/ts-conventions.md +133 -0
- package/_gaia/dev/module-help.csv +10 -0
- package/_gaia/dev/skills/_skill-index.yaml +55 -0
- package/_gaia/dev/skills/api-design.md +229 -0
- package/_gaia/dev/skills/code-review-standards.md +226 -0
- package/_gaia/dev/skills/database-design.md +172 -0
- package/_gaia/dev/skills/docker-workflow.md +222 -0
- package/_gaia/dev/skills/documentation-standards.md +256 -0
- package/_gaia/dev/skills/git-workflow.md +157 -0
- package/_gaia/dev/skills/security-basics.md +230 -0
- package/_gaia/dev/skills/testing-patterns.md +232 -0
- package/_gaia/lifecycle/.resolved/.gitkeep +0 -0
- package/_gaia/lifecycle/agents/analyst.md +104 -0
- package/_gaia/lifecycle/agents/architect.md +109 -0
- package/_gaia/lifecycle/agents/data-engineer.md +99 -0
- package/_gaia/lifecycle/agents/devops.md +110 -0
- package/_gaia/lifecycle/agents/performance.md +92 -0
- package/_gaia/lifecycle/agents/pm.md +112 -0
- package/_gaia/lifecycle/agents/qa.md +89 -0
- package/_gaia/lifecycle/agents/security.md +108 -0
- package/_gaia/lifecycle/agents/sm.md +119 -0
- package/_gaia/lifecycle/agents/tech-writer.md +94 -0
- package/_gaia/lifecycle/agents/ux-designer.md +94 -0
- package/_gaia/lifecycle/agents/validator.md +189 -0
- package/_gaia/lifecycle/config.yaml +14 -0
- package/_gaia/lifecycle/module-help.csv +39 -0
- package/_gaia/lifecycle/skills/ground-truth-management.md +252 -0
- package/_gaia/lifecycle/skills/memory-management.md +322 -0
- package/_gaia/lifecycle/skills/validation-patterns.md +230 -0
- package/_gaia/lifecycle/teams/team-data-intensive.yaml +12 -0
- package/_gaia/lifecycle/teams/team-enterprise.yaml +16 -0
- package/_gaia/lifecycle/teams/team-full.yaml +13 -0
- package/_gaia/lifecycle/teams/team-implementation.yaml +8 -0
- package/_gaia/lifecycle/teams/team-planning.yaml +9 -0
- package/_gaia/lifecycle/teams/team-quick-ship.yaml +6 -0
- package/_gaia/lifecycle/teams/team-security-focused.yaml +13 -0
- package/_gaia/lifecycle/templates/api-documentation-template.md +112 -0
- package/_gaia/lifecycle/templates/architecture-template.md +65 -0
- package/_gaia/lifecycle/templates/brownfield-architecture-template.md +198 -0
- package/_gaia/lifecycle/templates/brownfield-assessment-template.md +78 -0
- package/_gaia/lifecycle/templates/brownfield-onboarding-template.md +160 -0
- package/_gaia/lifecycle/templates/dependency-map-template.md +73 -0
- package/_gaia/lifecycle/templates/deployment-template.md +52 -0
- package/_gaia/lifecycle/templates/epic-status-template.md +64 -0
- package/_gaia/lifecycle/templates/event-catalog-template.md +78 -0
- package/_gaia/lifecycle/templates/nfr-assessment-template.md +96 -0
- package/_gaia/lifecycle/templates/prd-template.md +83 -0
- package/_gaia/lifecycle/templates/product-brief-template.md +48 -0
- package/_gaia/lifecycle/templates/review-template.md +47 -0
- package/_gaia/lifecycle/templates/sprint-plan-template.md +45 -0
- package/_gaia/lifecycle/templates/story-template.md +118 -0
- package/_gaia/lifecycle/templates/tech-debt-dashboard-template.md +71 -0
- package/_gaia/lifecycle/templates/test-plan-template.md +56 -0
- package/_gaia/lifecycle/templates/ux-design-assessment-template.md +122 -0
- package/_gaia/lifecycle/workflows/1-analysis/advanced-elicitation/instructions.xml +44 -0
- package/_gaia/lifecycle/workflows/1-analysis/advanced-elicitation/methods.csv +9 -0
- package/_gaia/lifecycle/workflows/1-analysis/advanced-elicitation/workflow.yaml +33 -0
- package/_gaia/lifecycle/workflows/1-analysis/brainstorm-project/checklist.md +24 -0
- package/_gaia/lifecycle/workflows/1-analysis/brainstorm-project/instructions.xml +39 -0
- package/_gaia/lifecycle/workflows/1-analysis/brainstorm-project/workflow.yaml +19 -0
- package/_gaia/lifecycle/workflows/1-analysis/create-product-brief/checklist.md +27 -0
- package/_gaia/lifecycle/workflows/1-analysis/create-product-brief/instructions.xml +57 -0
- package/_gaia/lifecycle/workflows/1-analysis/create-product-brief/workflow.yaml +38 -0
- package/_gaia/lifecycle/workflows/1-analysis/domain-research/checklist.md +22 -0
- package/_gaia/lifecycle/workflows/1-analysis/domain-research/instructions.xml +34 -0
- package/_gaia/lifecycle/workflows/1-analysis/domain-research/workflow.yaml +15 -0
- package/_gaia/lifecycle/workflows/1-analysis/market-research/checklist.md +28 -0
- package/_gaia/lifecycle/workflows/1-analysis/market-research/instructions.xml +42 -0
- package/_gaia/lifecycle/workflows/1-analysis/market-research/workflow.yaml +15 -0
- package/_gaia/lifecycle/workflows/1-analysis/technical-research/checklist.md +22 -0
- package/_gaia/lifecycle/workflows/1-analysis/technical-research/instructions.xml +34 -0
- package/_gaia/lifecycle/workflows/1-analysis/technical-research/workflow.yaml +15 -0
- package/_gaia/lifecycle/workflows/2-planning/create-prd/checklist.md +36 -0
- package/_gaia/lifecycle/workflows/2-planning/create-prd/instructions.xml +80 -0
- package/_gaia/lifecycle/workflows/2-planning/create-prd/workflow.yaml +23 -0
- package/_gaia/lifecycle/workflows/2-planning/create-ux-design/checklist.md +26 -0
- package/_gaia/lifecycle/workflows/2-planning/create-ux-design/instructions.xml +49 -0
- package/_gaia/lifecycle/workflows/2-planning/create-ux-design/workflow.yaml +23 -0
- package/_gaia/lifecycle/workflows/2-planning/edit-prd/checklist.md +17 -0
- package/_gaia/lifecycle/workflows/2-planning/edit-prd/instructions.xml +50 -0
- package/_gaia/lifecycle/workflows/2-planning/edit-prd/workflow.yaml +22 -0
- package/_gaia/lifecycle/workflows/2-planning/validate-prd/checklist.md +12 -0
- package/_gaia/lifecycle/workflows/2-planning/validate-prd/instructions.xml +52 -0
- package/_gaia/lifecycle/workflows/2-planning/validate-prd/workflow.yaml +19 -0
- package/_gaia/lifecycle/workflows/3-solutioning/create-architecture/checklist.md +32 -0
- package/_gaia/lifecycle/workflows/3-solutioning/create-architecture/instructions.xml +100 -0
- package/_gaia/lifecycle/workflows/3-solutioning/create-architecture/workflow.yaml +41 -0
- package/_gaia/lifecycle/workflows/3-solutioning/create-epics-stories/checklist.md +30 -0
- package/_gaia/lifecycle/workflows/3-solutioning/create-epics-stories/instructions.xml +86 -0
- package/_gaia/lifecycle/workflows/3-solutioning/create-epics-stories/workflow.yaml +34 -0
- package/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/checklist.md +24 -0
- package/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/instructions.xml +91 -0
- package/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/workflow.yaml +32 -0
- package/_gaia/lifecycle/workflows/3-solutioning/implementation-readiness/checklist.md +66 -0
- package/_gaia/lifecycle/workflows/3-solutioning/implementation-readiness/instructions.xml +160 -0
- package/_gaia/lifecycle/workflows/3-solutioning/implementation-readiness/workflow.yaml +48 -0
- package/_gaia/lifecycle/workflows/3-solutioning/infrastructure-design/checklist.md +24 -0
- package/_gaia/lifecycle/workflows/3-solutioning/infrastructure-design/instructions.xml +44 -0
- package/_gaia/lifecycle/workflows/3-solutioning/infrastructure-design/workflow.yaml +23 -0
- package/_gaia/lifecycle/workflows/3-solutioning/security-threat-model/checklist.md +24 -0
- package/_gaia/lifecycle/workflows/3-solutioning/security-threat-model/instructions.xml +55 -0
- package/_gaia/lifecycle/workflows/3-solutioning/security-threat-model/workflow.yaml +23 -0
- package/_gaia/lifecycle/workflows/4-implementation/action-items/instructions.xml +131 -0
- package/_gaia/lifecycle/workflows/4-implementation/action-items/workflow.yaml +19 -0
- package/_gaia/lifecycle/workflows/4-implementation/add-stories/checklist.md +27 -0
- package/_gaia/lifecycle/workflows/4-implementation/add-stories/instructions.xml +100 -0
- package/_gaia/lifecycle/workflows/4-implementation/add-stories/workflow.yaml +35 -0
- package/_gaia/lifecycle/workflows/4-implementation/change-request/checklist.md +25 -0
- package/_gaia/lifecycle/workflows/4-implementation/change-request/instructions.xml +123 -0
- package/_gaia/lifecycle/workflows/4-implementation/change-request/workflow.yaml +38 -0
- package/_gaia/lifecycle/workflows/4-implementation/check-dod/checklist.md +18 -0
- package/_gaia/lifecycle/workflows/4-implementation/check-dod/instructions.xml +54 -0
- package/_gaia/lifecycle/workflows/4-implementation/check-dod/workflow.yaml +19 -0
- package/_gaia/lifecycle/workflows/4-implementation/check-review-gate/checklist.md +18 -0
- package/_gaia/lifecycle/workflows/4-implementation/check-review-gate/instructions.xml +53 -0
- package/_gaia/lifecycle/workflows/4-implementation/check-review-gate/workflow.yaml +19 -0
- package/_gaia/lifecycle/workflows/4-implementation/code-review/checklist.md +18 -0
- package/_gaia/lifecycle/workflows/4-implementation/code-review/instructions.xml +50 -0
- package/_gaia/lifecycle/workflows/4-implementation/code-review/workflow.yaml +24 -0
- package/_gaia/lifecycle/workflows/4-implementation/correct-course/checklist.md +21 -0
- package/_gaia/lifecycle/workflows/4-implementation/correct-course/instructions.xml +63 -0
- package/_gaia/lifecycle/workflows/4-implementation/correct-course/workflow.yaml +25 -0
- package/_gaia/lifecycle/workflows/4-implementation/create-story/checklist.md +38 -0
- package/_gaia/lifecycle/workflows/4-implementation/create-story/instructions.xml +194 -0
- package/_gaia/lifecycle/workflows/4-implementation/create-story/workflow.yaml +26 -0
- package/_gaia/lifecycle/workflows/4-implementation/dev-story/checklist.md +26 -0
- package/_gaia/lifecycle/workflows/4-implementation/dev-story/instructions.xml +268 -0
- package/_gaia/lifecycle/workflows/4-implementation/dev-story/workflow.yaml +51 -0
- package/_gaia/lifecycle/workflows/4-implementation/epic-status/checklist.md +25 -0
- package/_gaia/lifecycle/workflows/4-implementation/epic-status/instructions.xml +62 -0
- package/_gaia/lifecycle/workflows/4-implementation/epic-status/workflow.yaml +24 -0
- package/_gaia/lifecycle/workflows/4-implementation/fix-story/checklist.md +12 -0
- package/_gaia/lifecycle/workflows/4-implementation/fix-story/instructions.xml +67 -0
- package/_gaia/lifecycle/workflows/4-implementation/fix-story/workflow.yaml +17 -0
- package/_gaia/lifecycle/workflows/4-implementation/qa-generate-tests/checklist.md +19 -0
- package/_gaia/lifecycle/workflows/4-implementation/qa-generate-tests/instructions.xml +52 -0
- package/_gaia/lifecycle/workflows/4-implementation/qa-generate-tests/workflow.yaml +20 -0
- package/_gaia/lifecycle/workflows/4-implementation/retrospective/checklist.md +15 -0
- package/_gaia/lifecycle/workflows/4-implementation/retrospective/instructions.xml +164 -0
- package/_gaia/lifecycle/workflows/4-implementation/retrospective/workflow.yaml +30 -0
- package/_gaia/lifecycle/workflows/4-implementation/run-all-reviews/checklist.md +14 -0
- package/_gaia/lifecycle/workflows/4-implementation/run-all-reviews/instructions.xml +78 -0
- package/_gaia/lifecycle/workflows/4-implementation/run-all-reviews/workflow.yaml +16 -0
- package/_gaia/lifecycle/workflows/4-implementation/security-review/checklist.md +29 -0
- package/_gaia/lifecycle/workflows/4-implementation/security-review/instructions.xml +80 -0
- package/_gaia/lifecycle/workflows/4-implementation/security-review/workflow.yaml +27 -0
- package/_gaia/lifecycle/workflows/4-implementation/sprint-planning/checklist.md +29 -0
- package/_gaia/lifecycle/workflows/4-implementation/sprint-planning/instructions.xml +140 -0
- package/_gaia/lifecycle/workflows/4-implementation/sprint-planning/workflow.yaml +33 -0
- package/_gaia/lifecycle/workflows/4-implementation/sprint-status/checklist.md +18 -0
- package/_gaia/lifecycle/workflows/4-implementation/sprint-status/instructions.xml +36 -0
- package/_gaia/lifecycle/workflows/4-implementation/sprint-status/workflow.yaml +19 -0
- package/_gaia/lifecycle/workflows/4-implementation/tech-debt-review/checklist.md +30 -0
- package/_gaia/lifecycle/workflows/4-implementation/tech-debt-review/instructions.xml +147 -0
- package/_gaia/lifecycle/workflows/4-implementation/tech-debt-review/workflow.yaml +24 -0
- package/_gaia/lifecycle/workflows/4-implementation/triage-findings/checklist.md +17 -0
- package/_gaia/lifecycle/workflows/4-implementation/triage-findings/instructions.xml +124 -0
- package/_gaia/lifecycle/workflows/4-implementation/triage-findings/workflow.yaml +15 -0
- package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/checklist.md +48 -0
- package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/instructions.xml +125 -0
- package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/workflow.yaml +31 -0
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/checklist.md +54 -0
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/instructions.xml +147 -0
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/test-structure.sh +116 -0
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/workflow.yaml +29 -0
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-plan/checklist.md +34 -0
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-plan/instructions.xml +162 -0
- package/_gaia/lifecycle/workflows/4-implementation/val-validate-plan/workflow.yaml +39 -0
- package/_gaia/lifecycle/workflows/4-implementation/validate-story/checklist.md +23 -0
- package/_gaia/lifecycle/workflows/4-implementation/validate-story/instructions.xml +146 -0
- package/_gaia/lifecycle/workflows/4-implementation/validate-story/workflow.yaml +25 -0
- package/_gaia/lifecycle/workflows/5-deployment/deployment-checklist/checklist.md +29 -0
- package/_gaia/lifecycle/workflows/5-deployment/deployment-checklist/instructions.xml +59 -0
- package/_gaia/lifecycle/workflows/5-deployment/deployment-checklist/workflow.yaml +39 -0
- package/_gaia/lifecycle/workflows/5-deployment/post-deploy-verify/checklist.md +19 -0
- package/_gaia/lifecycle/workflows/5-deployment/post-deploy-verify/instructions.xml +33 -0
- package/_gaia/lifecycle/workflows/5-deployment/post-deploy-verify/workflow.yaml +15 -0
- package/_gaia/lifecycle/workflows/5-deployment/release-plan/checklist.md +20 -0
- package/_gaia/lifecycle/workflows/5-deployment/release-plan/instructions.xml +33 -0
- package/_gaia/lifecycle/workflows/5-deployment/release-plan/workflow.yaml +19 -0
- package/_gaia/lifecycle/workflows/5-deployment/rollback-plan/checklist.md +20 -0
- package/_gaia/lifecycle/workflows/5-deployment/rollback-plan/instructions.xml +33 -0
- package/_gaia/lifecycle/workflows/5-deployment/rollback-plan/workflow.yaml +15 -0
- package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/checklist.md +52 -0
- package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/instructions.xml +122 -0
- package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/test-step7.sh +149 -0
- package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/workflow.yaml +33 -0
- package/_gaia/lifecycle/workflows/anytime/document-project/checklist.md +11 -0
- package/_gaia/lifecycle/workflows/anytime/document-project/instructions.xml +26 -0
- package/_gaia/lifecycle/workflows/anytime/document-project/workflow.yaml +15 -0
- package/_gaia/lifecycle/workflows/anytime/generate-project-context/checklist.md +11 -0
- package/_gaia/lifecycle/workflows/anytime/generate-project-context/instructions.xml +22 -0
- package/_gaia/lifecycle/workflows/anytime/generate-project-context/workflow.yaml +15 -0
- package/_gaia/lifecycle/workflows/anytime/memory-hygiene/checklist.md +66 -0
- package/_gaia/lifecycle/workflows/anytime/memory-hygiene/instructions.xml +206 -0
- package/_gaia/lifecycle/workflows/anytime/memory-hygiene/workflow.yaml +15 -0
- package/_gaia/lifecycle/workflows/anytime/performance-review/checklist.md +25 -0
- package/_gaia/lifecycle/workflows/anytime/performance-review/instructions.xml +62 -0
- package/_gaia/lifecycle/workflows/anytime/performance-review/workflow.yaml +15 -0
- package/_gaia/lifecycle/workflows/cross-phase/add-feature/checklist.md +30 -0
- package/_gaia/lifecycle/workflows/cross-phase/add-feature/instructions.xml +85 -0
- package/_gaia/lifecycle/workflows/cross-phase/add-feature/workflow.yaml +37 -0
- package/_gaia/lifecycle/workflows/quick-flow/quick-dev/checklist.md +11 -0
- package/_gaia/lifecycle/workflows/quick-flow/quick-dev/instructions.xml +26 -0
- package/_gaia/lifecycle/workflows/quick-flow/quick-dev/workflow.yaml +19 -0
- package/_gaia/lifecycle/workflows/quick-flow/quick-spec/checklist.md +13 -0
- package/_gaia/lifecycle/workflows/quick-flow/quick-spec/instructions.xml +27 -0
- package/_gaia/lifecycle/workflows/quick-flow/quick-spec/workflow.yaml +15 -0
- package/_gaia/testing/.resolved/.gitkeep +0 -0
- package/_gaia/testing/agents/test-architect.md +131 -0
- package/_gaia/testing/config.yaml +8 -0
- package/_gaia/testing/knowledge/_index.csv +22 -0
- package/_gaia/testing/knowledge/accessibility/axe-core-patterns.md +177 -0
- package/_gaia/testing/knowledge/accessibility/wcag-checks.md +191 -0
- package/_gaia/testing/knowledge/core/deterministic-testing.md +167 -0
- package/_gaia/testing/knowledge/core/fixture-architecture.md +131 -0
- package/_gaia/testing/knowledge/core/test-isolation.md +142 -0
- package/_gaia/testing/knowledge/core/test-pyramid.md +129 -0
- package/_gaia/testing/knowledge/extended/api-testing-patterns.md +196 -0
- package/_gaia/testing/knowledge/extended/data-factories.md +158 -0
- package/_gaia/testing/knowledge/extended/risk-governance.md +119 -0
- package/_gaia/testing/knowledge/extended/selector-resilience.md +109 -0
- package/_gaia/testing/knowledge/mobile-testing/appium-patterns.md +164 -0
- package/_gaia/testing/knowledge/mobile-testing/react-native-testing.md +193 -0
- package/_gaia/testing/knowledge/mobile-testing/responsive-testing.md +177 -0
- package/_gaia/testing/knowledge/performance/k6-patterns.md +200 -0
- package/_gaia/testing/knowledge/performance/lighthouse-ci.md +158 -0
- package/_gaia/testing/knowledge/specialized/contract-testing.md +173 -0
- package/_gaia/testing/knowledge/specialized/test-healing.md +129 -0
- package/_gaia/testing/knowledge/specialized/visual-testing.md +129 -0
- package/_gaia/testing/knowledge/unit-testing/jest-vitest-patterns.md +193 -0
- package/_gaia/testing/knowledge/unit-testing/junit5-patterns.md +200 -0
- package/_gaia/testing/knowledge/unit-testing/pytest-patterns.md +185 -0
- package/_gaia/testing/module-help.csv +13 -0
- package/_gaia/testing/workflows/accessibility-testing/checklist.md +12 -0
- package/_gaia/testing/workflows/accessibility-testing/instructions.xml +41 -0
- package/_gaia/testing/workflows/accessibility-testing/workflow.yaml +13 -0
- package/_gaia/testing/workflows/atdd/checklist.md +6 -0
- package/_gaia/testing/workflows/atdd/instructions.xml +36 -0
- package/_gaia/testing/workflows/atdd/workflow.yaml +22 -0
- package/_gaia/testing/workflows/ci-setup/checklist.md +9 -0
- package/_gaia/testing/workflows/ci-setup/instructions.xml +43 -0
- package/_gaia/testing/workflows/ci-setup/workflow.yaml +11 -0
- package/_gaia/testing/workflows/edit-test-plan/checklist.md +20 -0
- package/_gaia/testing/workflows/edit-test-plan/instructions.xml +65 -0
- package/_gaia/testing/workflows/edit-test-plan/workflow.yaml +35 -0
- package/_gaia/testing/workflows/mobile-testing/checklist.md +13 -0
- package/_gaia/testing/workflows/mobile-testing/instructions.xml +41 -0
- package/_gaia/testing/workflows/mobile-testing/workflow.yaml +11 -0
- package/_gaia/testing/workflows/nfr-assessment/checklist.md +7 -0
- package/_gaia/testing/workflows/nfr-assessment/instructions.xml +26 -0
- package/_gaia/testing/workflows/nfr-assessment/workflow.yaml +11 -0
- package/_gaia/testing/workflows/performance-testing/checklist.md +11 -0
- package/_gaia/testing/workflows/performance-testing/instructions.xml +41 -0
- package/_gaia/testing/workflows/performance-testing/workflow.yaml +11 -0
- package/_gaia/testing/workflows/teach-me-testing/checklist.md +6 -0
- package/_gaia/testing/workflows/teach-me-testing/instructions.xml +28 -0
- package/_gaia/testing/workflows/teach-me-testing/workflow.yaml +12 -0
- package/_gaia/testing/workflows/test-automation/checklist.md +6 -0
- package/_gaia/testing/workflows/test-automation/instructions.xml +49 -0
- package/_gaia/testing/workflows/test-automation/workflow.yaml +11 -0
- package/_gaia/testing/workflows/test-design/checklist.md +9 -0
- package/_gaia/testing/workflows/test-design/instructions.xml +47 -0
- package/_gaia/testing/workflows/test-design/workflow.yaml +11 -0
- package/_gaia/testing/workflows/test-framework/checklist.md +8 -0
- package/_gaia/testing/workflows/test-framework/instructions.xml +25 -0
- package/_gaia/testing/workflows/test-framework/workflow.yaml +11 -0
- package/_gaia/testing/workflows/test-review/checklist.md +9 -0
- package/_gaia/testing/workflows/test-review/instructions.xml +51 -0
- package/_gaia/testing/workflows/test-review/workflow.yaml +11 -0
- package/_gaia/testing/workflows/traceability/checklist.md +6 -0
- package/_gaia/testing/workflows/traceability/instructions.xml +49 -0
- package/_gaia/testing/workflows/traceability/workflow.yaml +21 -0
- package/bin/gaia-framework.js +58 -20
- package/gaia-install.sh +1 -1
- package/package.json +21 -7
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deterministic-testing
|
|
3
|
+
tier: core
|
|
4
|
+
version: '1.0'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Deterministic Testing
|
|
8
|
+
|
|
9
|
+
## Principle
|
|
10
|
+
|
|
11
|
+
A flaky test is worse than no test -- it erodes trust in the entire suite. Every test
|
|
12
|
+
must produce the same result regardless of time, environment, execution order, or
|
|
13
|
+
network state. Control time, intercept networks, disable animations, seed randomness,
|
|
14
|
+
and fix root causes instead of adding retries.
|
|
15
|
+
|
|
16
|
+
## Rationale
|
|
17
|
+
|
|
18
|
+
Flaky tests train developers to ignore failures. Once the team starts dismissing red
|
|
19
|
+
builds as "probably just flaky," real bugs slip through. Deterministic tests require
|
|
20
|
+
more upfront effort but pay for themselves by maintaining trust in the CI pipeline --
|
|
21
|
+
the single most important quality signal a team has.
|
|
22
|
+
|
|
23
|
+
## Pattern Examples
|
|
24
|
+
|
|
25
|
+
### Time Control
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
// BAD: Test depends on system clock
|
|
29
|
+
test('shows expiry warning', () => {
|
|
30
|
+
const token = createToken({ expiresAt: new Date('2025-12-31') });
|
|
31
|
+
expect(isExpiringSoon(token)).toBe(true); // Fails after 2025-12-31
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// GOOD: Mock the clock
|
|
35
|
+
test('shows expiry warning', () => {
|
|
36
|
+
vi.useFakeTimers();
|
|
37
|
+
vi.setSystemTime(new Date('2025-12-25'));
|
|
38
|
+
|
|
39
|
+
const token = createToken({ expiresAt: new Date('2025-12-31') });
|
|
40
|
+
expect(isExpiringSoon(token)).toBe(true); // Always passes
|
|
41
|
+
|
|
42
|
+
vi.useRealTimers();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Playwright: control browser time
|
|
46
|
+
test('countdown displays correctly', async ({ page }) => {
|
|
47
|
+
await page.clock.install({ time: new Date('2025-06-01T12:00:00') });
|
|
48
|
+
await page.goto('/countdown');
|
|
49
|
+
await expect(page.getByTestId('timer')).toHaveText('30 days remaining');
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Network Determinism
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
// BAD: Navigate then hope the API responds in time
|
|
57
|
+
await page.goto('/dashboard');
|
|
58
|
+
await expect(page.getByText('Welcome')).toBeVisible(); // Race condition
|
|
59
|
+
|
|
60
|
+
// GOOD: Intercept BEFORE navigate, wait for response
|
|
61
|
+
const responsePromise = page.waitForResponse('**/api/dashboard');
|
|
62
|
+
await page.goto('/dashboard');
|
|
63
|
+
await responsePromise; // Deterministic -- waits for actual response
|
|
64
|
+
await expect(page.getByText('Welcome')).toBeVisible();
|
|
65
|
+
|
|
66
|
+
// BETTER: Mock for full control
|
|
67
|
+
await page.route('**/api/dashboard', (route) => {
|
|
68
|
+
route.fulfill({
|
|
69
|
+
status: 200,
|
|
70
|
+
body: JSON.stringify({ user: { name: 'Alice' }, notifications: 3 }),
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
await page.goto('/dashboard');
|
|
74
|
+
await expect(page.getByText('Welcome, Alice')).toBeVisible();
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Animation and Transition Handling
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
// Disable animations globally in Playwright config
|
|
81
|
+
// playwright.config.ts
|
|
82
|
+
export default defineConfig({
|
|
83
|
+
use: {
|
|
84
|
+
// Disable CSS animations and transitions
|
|
85
|
+
contextOptions: {
|
|
86
|
+
reducedMotion: 'reduce',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// Or wait for animations to complete
|
|
92
|
+
await page.getByTestId('modal').waitFor({ state: 'visible' });
|
|
93
|
+
await page.waitForFunction(() => {
|
|
94
|
+
const el = document.querySelector('[data-testid="modal"]');
|
|
95
|
+
return getComputedStyle(el!).opacity === '1';
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Seeded Random Data
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// BAD: Random data changes every run
|
|
103
|
+
test('processes order', () => {
|
|
104
|
+
const order = { id: Math.random().toString(), total: Math.random() * 100 };
|
|
105
|
+
// Fails intermittently when random values hit edge cases
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// GOOD: Seeded faker for reproducible randomness
|
|
109
|
+
import { faker } from '@faker-js/faker';
|
|
110
|
+
|
|
111
|
+
beforeEach(() => {
|
|
112
|
+
faker.seed(12345); // Same "random" data every run
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('processes order', () => {
|
|
116
|
+
const order = {
|
|
117
|
+
id: faker.string.uuid(), // Always the same UUID
|
|
118
|
+
total: faker.number.float({ min: 1, max: 100, fractionDigits: 2 }),
|
|
119
|
+
};
|
|
120
|
+
expect(processOrder(order)).toEqual(expect.objectContaining({ status: 'pending' }));
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Retry vs Fix
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
// BAD: Retries mask the root cause
|
|
128
|
+
test('load dashboard', async ({ page }) => {
|
|
129
|
+
// Setting retries: 3 in config because this test is "flaky"
|
|
130
|
+
await page.goto('/dashboard');
|
|
131
|
+
await expect(page.getByText('Welcome')).toBeVisible();
|
|
132
|
+
// Root cause: race condition with API call. Fix the race, not the retry.
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// GOOD: Fix the root cause
|
|
136
|
+
test('load dashboard', async ({ page }) => {
|
|
137
|
+
const dataPromise = page.waitForResponse('**/api/dashboard');
|
|
138
|
+
await page.goto('/dashboard');
|
|
139
|
+
await dataPromise; // Wait for data, not a timeout
|
|
140
|
+
await expect(page.getByText('Welcome')).toBeVisible();
|
|
141
|
+
});
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Anti-Patterns
|
|
145
|
+
|
|
146
|
+
1. **Hard waits** -- `page.waitForTimeout(3000)` or `cy.wait(3000)` are never
|
|
147
|
+
deterministic. Use network waits, element state waits, or response promises.
|
|
148
|
+
|
|
149
|
+
2. **Retries as a fix** -- Adding `retries: 3` to a flaky test hides the bug. Retries
|
|
150
|
+
are for CI resilience on infrastructure glitches, not for masking test design problems.
|
|
151
|
+
|
|
152
|
+
3. **Uncontrolled randomness** -- `Math.random()` or unseeded faker produces different
|
|
153
|
+
data every run. Seed generators or use fixed values for determinism.
|
|
154
|
+
|
|
155
|
+
4. **System clock dependency** -- Tests that use `new Date()` or `Date.now()` without
|
|
156
|
+
mocking will behave differently tomorrow. Always mock time.
|
|
157
|
+
|
|
158
|
+
5. **Ignoring animation timing** -- Clicking elements mid-animation causes intermittent
|
|
159
|
+
failures. Disable animations in test config or wait for animation completion.
|
|
160
|
+
|
|
161
|
+
## Integration Points
|
|
162
|
+
|
|
163
|
+
- **Workflows**: `test-review` (flakiness audit), `test-automation` (deterministic
|
|
164
|
+
patterns in generated tests)
|
|
165
|
+
- **Related fragments**: `test-isolation` (preventing state leaks),
|
|
166
|
+
`fixture-architecture` (cleanup patterns), `selector-resilience` (stable selectors
|
|
167
|
+
prevent false failures)
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fixture-architecture
|
|
3
|
+
tier: core
|
|
4
|
+
version: '1.0'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fixture Architecture
|
|
8
|
+
|
|
9
|
+
## Principle
|
|
10
|
+
|
|
11
|
+
Build test helpers as pure functions first, then wrap in framework-specific fixtures.
|
|
12
|
+
Compose capabilities via `mergeTests` (Playwright) or layered commands (Cypress), not
|
|
13
|
+
inheritance. Each fixture solves one isolated concern (auth, API, logs, network).
|
|
14
|
+
|
|
15
|
+
## Rationale
|
|
16
|
+
|
|
17
|
+
Traditional Page Object Models create tight coupling through inheritance chains
|
|
18
|
+
(`BasePage -> LoginPage -> AdminPage`). When base classes change, all descendants break.
|
|
19
|
+
Pure functions with fixture wrappers provide testability (unit-testable without the
|
|
20
|
+
framework), composability (mix capabilities freely), reusability (export via package
|
|
21
|
+
subpaths), and maintainability (one concern per fixture).
|
|
22
|
+
|
|
23
|
+
## Pattern Examples
|
|
24
|
+
|
|
25
|
+
### Pure Function into Fixture Pattern
|
|
26
|
+
|
|
27
|
+
Always start with a pure function that accepts dependencies explicitly, then wrap it.
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
// Step 1: Pure function (unit-testable without Playwright)
|
|
31
|
+
// helpers/api-request.ts
|
|
32
|
+
type ApiRequestParams = {
|
|
33
|
+
request: APIRequestContext;
|
|
34
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
35
|
+
url: string;
|
|
36
|
+
data?: unknown;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export async function apiRequest({ request, method, url, data }: ApiRequestParams) {
|
|
40
|
+
const response = await request.fetch(url, {
|
|
41
|
+
method,
|
|
42
|
+
data,
|
|
43
|
+
headers: { 'Content-Type': 'application/json' },
|
|
44
|
+
});
|
|
45
|
+
if (!response.ok()) {
|
|
46
|
+
throw new Error(`API ${method} ${url} failed: ${response.status()}`);
|
|
47
|
+
}
|
|
48
|
+
return response.json();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Step 2: Fixture wrapper injects framework dependency
|
|
52
|
+
// fixtures/api-request-fixture.ts
|
|
53
|
+
import { test as base } from '@playwright/test';
|
|
54
|
+
import { apiRequest } from '../helpers/api-request';
|
|
55
|
+
|
|
56
|
+
export const test = base.extend<{ apiRequest: typeof apiRequest }>({
|
|
57
|
+
apiRequest: async ({ request }, use) => {
|
|
58
|
+
await use((params) => apiRequest({ request, ...params }));
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Composable Fixtures with mergeTests
|
|
64
|
+
|
|
65
|
+
Compose multiple focused fixtures instead of monolithic helpers.
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { test as base, mergeTests } from '@playwright/test';
|
|
69
|
+
import { test as apiFixture } from './api-request-fixture';
|
|
70
|
+
import { test as networkFixture } from './network-fixture';
|
|
71
|
+
import { test as authFixture } from './auth-fixture';
|
|
72
|
+
|
|
73
|
+
// Compose all capabilities -- no inheritance needed
|
|
74
|
+
export const test = mergeTests(base, apiFixture, networkFixture, authFixture);
|
|
75
|
+
export { expect } from '@playwright/test';
|
|
76
|
+
|
|
77
|
+
// Usage: import { test, expect } from './merged-fixtures';
|
|
78
|
+
// test('example', async ({ page, apiRequest, auth, network }) => { ... });
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Fixture Cleanup Pattern
|
|
82
|
+
|
|
83
|
+
Track resources created during a test and auto-cleanup in teardown.
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
export const test = base.extend<{ seedUser: (data: Partial<User>) => Promise<User> }>({
|
|
87
|
+
seedUser: async ({}, use) => {
|
|
88
|
+
const createdIds: string[] = [];
|
|
89
|
+
|
|
90
|
+
const seedUser = async (data: Partial<User>) => {
|
|
91
|
+
const user = await seedDatabase('users', data);
|
|
92
|
+
createdIds.push(user.id);
|
|
93
|
+
return user;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
await use(seedUser);
|
|
97
|
+
|
|
98
|
+
// Auto-cleanup: delete all created users after test
|
|
99
|
+
for (const id of createdIds) {
|
|
100
|
+
await deleteRecord('users', id);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Anti-Patterns
|
|
107
|
+
|
|
108
|
+
1. **Inheritance-based Page Objects** -- `AdminPage extends LoginPage extends BasePage`
|
|
109
|
+
creates fragile chains. Changes to `BasePage` break all descendants. Use pure
|
|
110
|
+
functions and fixture composition instead.
|
|
111
|
+
|
|
112
|
+
2. **Monolithic fixture files** -- A single fixture providing auth, API, network, and
|
|
113
|
+
database concerns violates single responsibility. Split into focused fixtures and
|
|
114
|
+
compose with `mergeTests`.
|
|
115
|
+
|
|
116
|
+
3. **Framework-coupled helpers** -- Writing helpers that directly import `page` or `cy`
|
|
117
|
+
makes them untestable in isolation. Accept dependencies as parameters.
|
|
118
|
+
|
|
119
|
+
4. **No cleanup in fixtures** -- Fixtures that create resources (DB records, files)
|
|
120
|
+
without tracking and deleting them cause test pollution and flakiness.
|
|
121
|
+
|
|
122
|
+
5. **Premature abstraction** -- Creating fixtures for code used only once. Use the
|
|
123
|
+
3+ uses rule: 3+ uses = fixture, 2-3 uses = utility module, 1 use = keep inline.
|
|
124
|
+
|
|
125
|
+
## Integration Points
|
|
126
|
+
|
|
127
|
+
- **Workflows**: `test-framework` (initial scaffold), `test-automation` (test generation),
|
|
128
|
+
`test-review` (fixture quality check)
|
|
129
|
+
- **Related fragments**: `data-factories` (factory functions for test data),
|
|
130
|
+
`test-isolation` (dependency injection patterns), `deterministic-testing` (cleanup
|
|
131
|
+
prevents state leaks)
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-isolation
|
|
3
|
+
tier: core
|
|
4
|
+
version: '1.0'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Test Isolation
|
|
8
|
+
|
|
9
|
+
## Principle
|
|
10
|
+
|
|
11
|
+
Tests must be deterministic and independent. A test that depends on another test's side
|
|
12
|
+
effects is a time bomb. Isolate via test doubles, dependency injection, per-test data
|
|
13
|
+
cleanup, and network mocking. Each test must be runnable alone, in any order, at any time.
|
|
14
|
+
|
|
15
|
+
## Rationale
|
|
16
|
+
|
|
17
|
+
Shared mutable state between tests causes cascading failures that are nearly impossible
|
|
18
|
+
to debug. Test A creates a user, test B assumes it exists, test C deletes it -- now B
|
|
19
|
+
and C fail when run without A. Proper isolation eliminates this class of bugs entirely
|
|
20
|
+
and enables parallel execution, which dramatically reduces CI time.
|
|
21
|
+
|
|
22
|
+
## Pattern Examples
|
|
23
|
+
|
|
24
|
+
### Test Doubles -- When to Use Each
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
// STUB: Returns canned data. Use when you need controlled input.
|
|
28
|
+
const priceService = { getPrice: () => 99.99 };
|
|
29
|
+
|
|
30
|
+
// MOCK: Verifies interactions. Use when you need to assert calls happened.
|
|
31
|
+
const emailService = { send: vi.fn() };
|
|
32
|
+
await registerUser(user, emailService);
|
|
33
|
+
expect(emailService.send).toHaveBeenCalledWith(user.email, expect.any(String));
|
|
34
|
+
|
|
35
|
+
// SPY: Wraps real implementation, records calls. Use for observation without replacement.
|
|
36
|
+
const spy = vi.spyOn(logger, 'warn');
|
|
37
|
+
await processOrder(invalidOrder);
|
|
38
|
+
expect(spy).toHaveBeenCalledWith('Invalid order data');
|
|
39
|
+
|
|
40
|
+
// FAKE: Simplified working implementation. Use for complex dependencies.
|
|
41
|
+
class InMemoryUserRepo implements UserRepository {
|
|
42
|
+
private users = new Map<string, User>();
|
|
43
|
+
async save(user: User) { this.users.set(user.id, user); }
|
|
44
|
+
async findById(id: string) { return this.users.get(id) ?? null; }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// DUMMY: Placeholder that is never used. Use to satisfy required parameters.
|
|
48
|
+
const unusedLogger = {} as Logger;
|
|
49
|
+
const calc = new PriceCalculator(unusedLogger); // logger not called in this test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Dependency Injection for Testability
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
// BAD: Hard dependency -- impossible to test without real DB
|
|
56
|
+
class UserService {
|
|
57
|
+
async getUser(id: string) {
|
|
58
|
+
return await database.query('SELECT * FROM users WHERE id = ?', [id]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// GOOD: Inject dependency -- testable with fake/mock
|
|
63
|
+
class UserService {
|
|
64
|
+
constructor(private repo: UserRepository) {}
|
|
65
|
+
|
|
66
|
+
async getUser(id: string) {
|
|
67
|
+
return this.repo.findById(id);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Test with fake
|
|
72
|
+
const repo = new InMemoryUserRepo();
|
|
73
|
+
await repo.save({ id: '1', name: 'Alice', email: 'alice@test.com' });
|
|
74
|
+
const service = new UserService(repo);
|
|
75
|
+
const user = await service.getUser('1');
|
|
76
|
+
expect(user?.name).toBe('Alice');
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Database Isolation
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
// Per-test truncation -- clean slate for every test
|
|
83
|
+
beforeEach(async () => {
|
|
84
|
+
await db.query('TRUNCATE users, orders, products CASCADE');
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Test containers -- isolated DB per test suite
|
|
88
|
+
import { PostgreSqlContainer } from '@testcontainers/postgresql';
|
|
89
|
+
|
|
90
|
+
let container: StartedPostgreSqlContainer;
|
|
91
|
+
beforeAll(async () => {
|
|
92
|
+
container = await new PostgreSqlContainer().start();
|
|
93
|
+
await runMigrations(container.getConnectionUri());
|
|
94
|
+
});
|
|
95
|
+
afterAll(async () => { await container.stop(); });
|
|
96
|
+
|
|
97
|
+
// Transaction rollback -- fastest, wraps each test in a transaction
|
|
98
|
+
beforeEach(async () => { await db.query('BEGIN'); });
|
|
99
|
+
afterEach(async () => { await db.query('ROLLBACK'); });
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Network Isolation
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
// Playwright: intercept all external calls
|
|
106
|
+
await page.route('**/api/**', (route) => {
|
|
107
|
+
route.fulfill({
|
|
108
|
+
status: 200,
|
|
109
|
+
body: JSON.stringify({ users: [{ id: 1, name: 'Test User' }] }),
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Intercept BEFORE navigate to prevent race conditions
|
|
114
|
+
const responsePromise = page.waitForResponse('**/api/dashboard');
|
|
115
|
+
await page.goto('/dashboard');
|
|
116
|
+
await responsePromise;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Anti-Patterns
|
|
120
|
+
|
|
121
|
+
1. **Shared mutable state** -- Global variables modified by tests. Use fresh instances
|
|
122
|
+
per test or factory functions that return new objects each time.
|
|
123
|
+
|
|
124
|
+
2. **Order-dependent tests** -- Test B relies on data created by test A. Each test must
|
|
125
|
+
set up and tear down its own data.
|
|
126
|
+
|
|
127
|
+
3. **Real network calls in tests** -- Tests hitting live APIs are slow, flaky, and
|
|
128
|
+
nondeterministic. Mock or intercept all external network calls.
|
|
129
|
+
|
|
130
|
+
4. **Mocking what you do not own** -- Mocking third-party library internals creates
|
|
131
|
+
brittle tests. Wrap the library in your own adapter, then mock the adapter.
|
|
132
|
+
|
|
133
|
+
5. **Over-mocking** -- Mocking every dependency reduces test confidence. Use fakes for
|
|
134
|
+
complex dependencies, mocks for interaction verification, and real implementations
|
|
135
|
+
when fast and deterministic.
|
|
136
|
+
|
|
137
|
+
## Integration Points
|
|
138
|
+
|
|
139
|
+
- **Workflows**: `test-framework` (isolation setup), `test-review` (isolation audit)
|
|
140
|
+
- **Related fragments**: `fixture-architecture` (cleanup in fixtures),
|
|
141
|
+
`deterministic-testing` (preventing flakiness), `data-factories` (per-test data
|
|
142
|
+
generation)
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-pyramid
|
|
3
|
+
tier: core
|
|
4
|
+
version: '1.0'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Test Pyramid
|
|
8
|
+
|
|
9
|
+
## Principle
|
|
10
|
+
|
|
11
|
+
Test at the lowest effective level. The pyramid is a risk allocation model, not a rigid
|
|
12
|
+
ratio. Unit tests (70%) cover business logic fast. Integration tests (20%) validate
|
|
13
|
+
component boundaries. E2E tests (10%) guard critical user journeys. Push tests down
|
|
14
|
+
the pyramid whenever possible.
|
|
15
|
+
|
|
16
|
+
## Rationale
|
|
17
|
+
|
|
18
|
+
Over-reliance on E2E tests creates slow, brittle, expensive suites. Under-investment in
|
|
19
|
+
unit tests means business logic bugs hide behind UI layers. The pyramid ensures fast
|
|
20
|
+
feedback for logic, focused validation for boundaries, and high-confidence checks for
|
|
21
|
+
critical paths -- without redundant coverage at multiple levels.
|
|
22
|
+
|
|
23
|
+
## Pattern Examples
|
|
24
|
+
|
|
25
|
+
### Unit Tests -- Pure Business Logic
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
// src/utils/price-calculator.test.ts
|
|
29
|
+
import { calculateDiscount, applyTaxes } from './price-calculator';
|
|
30
|
+
|
|
31
|
+
describe('PriceCalculator', () => {
|
|
32
|
+
it('applies percentage discount', () => {
|
|
33
|
+
expect(calculateDiscount(100, { type: 'percentage', value: 20 })).toBe(80);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('floors discount at zero', () => {
|
|
37
|
+
expect(calculateDiscount(10, { type: 'fixed', value: 20 })).toBe(0);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('calculates tax correctly', () => {
|
|
41
|
+
expect(applyTaxes(100, { country: 'US', rate: 0.08 })).toBe(108);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**When to use**: Pure functions, algorithms, input validation, complex calculations,
|
|
47
|
+
state machines. No external dependencies. Fast (milliseconds).
|
|
48
|
+
|
|
49
|
+
### Integration Tests -- Service Boundaries
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
// tests/integration/user-service.spec.ts
|
|
53
|
+
test('creates user with role assignment via API', async ({ request }) => {
|
|
54
|
+
const response = await request.post('/api/users', {
|
|
55
|
+
data: { name: 'Jane', email: 'jane@example.com', role: 'admin' },
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
expect(response.status()).toBe(201);
|
|
59
|
+
const user = await response.json();
|
|
60
|
+
expect(user.role).toBe('admin');
|
|
61
|
+
expect(user.permissions).toContain('user:delete');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('rejects duplicate email', async ({ request }) => {
|
|
65
|
+
await request.post('/api/users', { data: { email: 'dup@example.com' } });
|
|
66
|
+
const dup = await request.post('/api/users', { data: { email: 'dup@example.com' } });
|
|
67
|
+
expect(dup.status()).toBe(409);
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**When to use**: Database operations, API contracts, service-to-service communication,
|
|
72
|
+
middleware behavior. Moderate speed.
|
|
73
|
+
|
|
74
|
+
### E2E Tests -- Critical User Journeys
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
// tests/e2e/checkout.spec.ts
|
|
78
|
+
test('user completes purchase', async ({ page }) => {
|
|
79
|
+
const loginPromise = page.waitForResponse('**/api/auth/login');
|
|
80
|
+
await page.goto('/login');
|
|
81
|
+
await page.fill('[data-testid="email"]', 'buyer@example.com');
|
|
82
|
+
await page.fill('[data-testid="password"]', 'password123');
|
|
83
|
+
await page.click('[data-testid="login-button"]');
|
|
84
|
+
await loginPromise;
|
|
85
|
+
|
|
86
|
+
await page.goto('/checkout');
|
|
87
|
+
await page.click('[data-testid="place-order"]');
|
|
88
|
+
await expect(page.getByText('Order Confirmed')).toBeVisible();
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**When to use**: Revenue-critical paths, cross-system workflows, visual regression,
|
|
93
|
+
compliance requirements. Slowest -- reserve for what matters most.
|
|
94
|
+
|
|
95
|
+
### Decision Matrix
|
|
96
|
+
|
|
97
|
+
| Scenario | Unit | Integration | E2E |
|
|
98
|
+
|------------------------|--------------|---------------|--------------|
|
|
99
|
+
| Pure business logic | Primary | Overkill | Overkill |
|
|
100
|
+
| Database operations | Cannot test | Primary | Overkill |
|
|
101
|
+
| API contracts | Cannot test | Primary | Supplement |
|
|
102
|
+
| User journeys | Cannot test | Cannot test | Primary |
|
|
103
|
+
| Component props/events | Partial | Component test| Overkill |
|
|
104
|
+
| Visual regression | Cannot test | Component test| Primary |
|
|
105
|
+
|
|
106
|
+
## Anti-Patterns
|
|
107
|
+
|
|
108
|
+
1. **E2E testing business logic** -- Testing a discount calculation through the UI is
|
|
109
|
+
slow and brittle. Use a unit test. The UI is for validation, not computation.
|
|
110
|
+
|
|
111
|
+
2. **Unit testing framework behavior** -- Testing that React renders a component or
|
|
112
|
+
Express routes a request validates the framework, not your code.
|
|
113
|
+
|
|
114
|
+
3. **Duplicate coverage across levels** -- If a unit test covers discount math, do not
|
|
115
|
+
also write an integration test for the same math. Each level should test different
|
|
116
|
+
aspects.
|
|
117
|
+
|
|
118
|
+
4. **Inverted pyramid** -- More E2E than unit tests means slow CI, flaky suites, and
|
|
119
|
+
developers avoiding the test suite entirely.
|
|
120
|
+
|
|
121
|
+
5. **Skipping the duplicate coverage guard** -- Before adding any test, ask: is this
|
|
122
|
+
already tested at a lower level? Can a unit test cover this instead of integration?
|
|
123
|
+
|
|
124
|
+
## Integration Points
|
|
125
|
+
|
|
126
|
+
- **Workflows**: `test-design` (level selection), `teach-me-testing` (pyramid education)
|
|
127
|
+
- **Related fragments**: `fixture-architecture` (test helpers per level),
|
|
128
|
+
`test-isolation` (isolation strategies per level), `api-testing-patterns` (integration
|
|
129
|
+
layer patterns)
|