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,157 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: git-workflow
|
|
3
|
-
version: '1.0'
|
|
4
|
-
applicable_agents: [typescript-dev, angular-dev, flutter-dev, java-dev, python-dev, mobile-dev]
|
|
5
|
-
test_scenarios:
|
|
6
|
-
- scenario: Feature branch creation and naming
|
|
7
|
-
expected: Branch name follows convention {type}/{ticket}-{description}
|
|
8
|
-
- scenario: Conventional commit message
|
|
9
|
-
expected: Message follows type(scope): description format
|
|
10
|
-
- scenario: PR creation with template
|
|
11
|
-
expected: PR body includes all required sections
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<!-- SECTION: branching -->
|
|
15
|
-
## Branching Strategy
|
|
16
|
-
|
|
17
|
-
### Trunk-Based Development
|
|
18
|
-
- `main` is always deployable
|
|
19
|
-
- Short-lived feature branches (max 2-3 days)
|
|
20
|
-
- Use feature flags for incomplete features in production
|
|
21
|
-
|
|
22
|
-
### Branch Naming Convention
|
|
23
|
-
```
|
|
24
|
-
{type}/{ticket-key}-{short-description}
|
|
25
|
-
```
|
|
26
|
-
Types: `feature/`, `fix/`, `hotfix/`, `refactor/`, `chore/`, `test/`
|
|
27
|
-
|
|
28
|
-
Examples:
|
|
29
|
-
```
|
|
30
|
-
feature/PROJ-123-user-auth
|
|
31
|
-
fix/PROJ-456-login-redirect
|
|
32
|
-
hotfix/PROJ-789-payment-null
|
|
33
|
-
refactor/PROJ-101-extract-service
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Branch Rules
|
|
37
|
-
- Never commit directly to `main`
|
|
38
|
-
- Delete branches after merge
|
|
39
|
-
- Rebase feature branches on `main` before PR
|
|
40
|
-
- One branch per story/ticket
|
|
41
|
-
|
|
42
|
-
### Release Branches
|
|
43
|
-
- Create `release/v{major}.{minor}.{patch}` for release candidates
|
|
44
|
-
- Cherry-pick fixes to release branch if needed
|
|
45
|
-
- Tag release commits: `v{major}.{minor}.{patch}`
|
|
46
|
-
|
|
47
|
-
<!-- SECTION: commits -->
|
|
48
|
-
## Conventional Commits
|
|
49
|
-
|
|
50
|
-
### Format
|
|
51
|
-
```
|
|
52
|
-
type(scope): description
|
|
53
|
-
|
|
54
|
-
[optional body]
|
|
55
|
-
|
|
56
|
-
[optional footer(s)]
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Types
|
|
60
|
-
| Type | Use When |
|
|
61
|
-
|------|----------|
|
|
62
|
-
| `feat` | New feature or capability |
|
|
63
|
-
| `fix` | Bug fix |
|
|
64
|
-
| `refactor` | Code restructuring, no behavior change |
|
|
65
|
-
| `test` | Adding or updating tests |
|
|
66
|
-
| `docs` | Documentation only |
|
|
67
|
-
| `chore` | Build, tooling, dependencies |
|
|
68
|
-
| `style` | Formatting, whitespace, semicolons |
|
|
69
|
-
| `perf` | Performance improvement |
|
|
70
|
-
| `ci` | CI/CD configuration |
|
|
71
|
-
|
|
72
|
-
### Scope
|
|
73
|
-
- Use the component or module name: `feat(auth): add JWT refresh`
|
|
74
|
-
- Use the file or layer: `fix(api): handle null response`
|
|
75
|
-
- Omit scope for broad changes: `chore: update dependencies`
|
|
76
|
-
|
|
77
|
-
### Examples
|
|
78
|
-
```
|
|
79
|
-
feat(auth): add password reset flow
|
|
80
|
-
fix(cart): prevent negative quantities
|
|
81
|
-
refactor(user-service): extract validation logic
|
|
82
|
-
test(payment): add integration tests for Stripe webhook
|
|
83
|
-
docs(api): update endpoint documentation
|
|
84
|
-
perf(search): add database index for full-text queries
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Breaking Changes
|
|
88
|
-
- Add `!` after type/scope: `feat(api)!: change response format`
|
|
89
|
-
- Add `BREAKING CHANGE:` footer with migration instructions
|
|
90
|
-
|
|
91
|
-
<!-- SECTION: pull-requests -->
|
|
92
|
-
## Pull Requests
|
|
93
|
-
|
|
94
|
-
### PR Template
|
|
95
|
-
```markdown
|
|
96
|
-
## Summary
|
|
97
|
-
Brief description of changes and motivation.
|
|
98
|
-
|
|
99
|
-
## Changes
|
|
100
|
-
- List of specific changes made
|
|
101
|
-
|
|
102
|
-
## Testing
|
|
103
|
-
- [ ] Unit tests added/updated
|
|
104
|
-
- [ ] Integration tests pass
|
|
105
|
-
- [ ] Manual testing completed
|
|
106
|
-
|
|
107
|
-
## Checklist
|
|
108
|
-
- [ ] Code follows project conventions
|
|
109
|
-
- [ ] No console.log/print statements left
|
|
110
|
-
- [ ] Documentation updated if needed
|
|
111
|
-
- [ ] No secrets or credentials committed
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Review Checklist
|
|
115
|
-
- Correctness: Does the code do what it claims?
|
|
116
|
-
- Tests: Are changes covered by tests?
|
|
117
|
-
- Security: Any new attack vectors introduced?
|
|
118
|
-
- Performance: Any N+1 queries, unnecessary re-renders?
|
|
119
|
-
- Readability: Can a new team member understand this?
|
|
120
|
-
|
|
121
|
-
### Merge Strategies
|
|
122
|
-
- **Squash merge** for feature branches (clean history)
|
|
123
|
-
- **Merge commit** for release branches (preserve history)
|
|
124
|
-
- **Rebase** for keeping branch up to date with main
|
|
125
|
-
- Never force push to shared branches
|
|
126
|
-
|
|
127
|
-
<!-- SECTION: conflict-resolution -->
|
|
128
|
-
## Conflict Resolution
|
|
129
|
-
|
|
130
|
-
### Merge vs Rebase
|
|
131
|
-
- **Rebase** for local feature branches before PR
|
|
132
|
-
- **Merge** when integrating shared branches
|
|
133
|
-
- Never rebase public/shared branches
|
|
134
|
-
|
|
135
|
-
### Conflict Markers
|
|
136
|
-
```
|
|
137
|
-
<<<<<<< HEAD (your changes)
|
|
138
|
-
current code
|
|
139
|
-
=======
|
|
140
|
-
incoming code
|
|
141
|
-
>>>>>>> feature/branch-name
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Resolution Steps
|
|
145
|
-
1. Identify all conflicts: `git diff --name-only --diff-filter=U`
|
|
146
|
-
2. Open each file, understand both sides of the conflict
|
|
147
|
-
3. Choose the correct resolution (not always "ours" or "theirs")
|
|
148
|
-
4. Remove all conflict markers
|
|
149
|
-
5. Run tests after resolution
|
|
150
|
-
6. Stage resolved files: `git add {file}`
|
|
151
|
-
7. Complete the merge/rebase: `git rebase --continue` or `git merge --continue`
|
|
152
|
-
|
|
153
|
-
### Prevention
|
|
154
|
-
- Rebase frequently on main (daily)
|
|
155
|
-
- Communicate with team about shared file changes
|
|
156
|
-
- Keep PRs small to reduce conflict surface
|
|
157
|
-
- Use CODEOWNERS to assign clear file ownership
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: security-basics
|
|
3
|
-
version: '1.0'
|
|
4
|
-
applicable_agents: [typescript-dev, angular-dev, flutter-dev, java-dev, python-dev, mobile-dev]
|
|
5
|
-
test_scenarios:
|
|
6
|
-
- scenario: Input validation implementation
|
|
7
|
-
expected: All user inputs are validated at the boundary with allowlists and type checks
|
|
8
|
-
- scenario: Secrets management setup
|
|
9
|
-
expected: Secrets are loaded from environment variables or vault, never hardcoded
|
|
10
|
-
- scenario: CORS configuration
|
|
11
|
-
expected: CORS allows only specific origins, methods, and headers for the application
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<!-- SECTION: owasp-top-10 -->
|
|
15
|
-
## OWASP Top 10 Prevention
|
|
16
|
-
|
|
17
|
-
### A01: Broken Access Control
|
|
18
|
-
- Deny by default; require explicit grants for each resource
|
|
19
|
-
- Enforce ownership checks: users can only access their own data
|
|
20
|
-
- Disable directory listing on web servers
|
|
21
|
-
- Log and alert on access control failures
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
// Always check resource ownership
|
|
25
|
-
async function getOrder(userId: string, orderId: string) {
|
|
26
|
-
const order = await orderRepo.findById(orderId);
|
|
27
|
-
if (!order) throw new NotFoundError('Order not found');
|
|
28
|
-
if (order.userId !== userId) throw new ForbiddenError('Access denied');
|
|
29
|
-
return order;
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### A02: Cryptographic Failures
|
|
34
|
-
- Use TLS 1.2+ for all data in transit
|
|
35
|
-
- Hash passwords with bcrypt (cost factor >= 12) or argon2
|
|
36
|
-
- Never roll your own cryptography
|
|
37
|
-
- Encrypt sensitive data at rest (PII, payment info)
|
|
38
|
-
|
|
39
|
-
### A03: Injection
|
|
40
|
-
- Use parameterized queries for all database operations
|
|
41
|
-
- Never concatenate user input into queries, commands, or templates
|
|
42
|
-
```typescript
|
|
43
|
-
// BAD: SQL injection risk
|
|
44
|
-
const query = `SELECT * FROM users WHERE id = '${userId}'`;
|
|
45
|
-
|
|
46
|
-
// GOOD: Parameterized query
|
|
47
|
-
const query = 'SELECT * FROM users WHERE id = $1';
|
|
48
|
-
const result = await db.query(query, [userId]);
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### A05: Security Misconfiguration
|
|
52
|
-
- Remove default accounts and passwords
|
|
53
|
-
- Disable stack traces and debug info in production
|
|
54
|
-
- Keep dependencies updated; automate vulnerability scanning
|
|
55
|
-
- Use security headers: `Strict-Transport-Security`, `X-Content-Type-Options`
|
|
56
|
-
|
|
57
|
-
### A07: Identification and Authentication Failures
|
|
58
|
-
- Enforce strong passwords (min 12 chars, check against breached lists)
|
|
59
|
-
- Implement rate limiting on login endpoints
|
|
60
|
-
- Use multi-factor authentication for admin accounts
|
|
61
|
-
- Invalidate sessions on password change
|
|
62
|
-
|
|
63
|
-
### A09: Security Logging and Monitoring
|
|
64
|
-
- Log authentication events (success and failure)
|
|
65
|
-
- Log authorization failures and input validation rejections
|
|
66
|
-
- Never log sensitive data (passwords, tokens, PII)
|
|
67
|
-
- Set up alerts for anomalous patterns (brute force, unusual access)
|
|
68
|
-
|
|
69
|
-
<!-- SECTION: input-validation -->
|
|
70
|
-
## Input Validation
|
|
71
|
-
|
|
72
|
-
### Validate at Boundaries
|
|
73
|
-
Apply validation at every entry point into the system:
|
|
74
|
-
- HTTP request bodies, query params, path params, headers
|
|
75
|
-
- Message queue payloads
|
|
76
|
-
- File uploads
|
|
77
|
-
- Third-party API responses
|
|
78
|
-
|
|
79
|
-
### Validation Strategy
|
|
80
|
-
```typescript
|
|
81
|
-
// Use a schema validation library (e.g., Zod, Joi, class-validator)
|
|
82
|
-
import { z } from 'zod';
|
|
83
|
-
|
|
84
|
-
const CreateUserSchema = z.object({
|
|
85
|
-
email: z.string().email().max(255),
|
|
86
|
-
name: z.string().min(2).max(100).trim(),
|
|
87
|
-
age: z.number().int().min(13).max(150).optional(),
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
// Validate at the controller boundary
|
|
91
|
-
function createUser(req: Request, res: Response) {
|
|
92
|
-
const result = CreateUserSchema.safeParse(req.body);
|
|
93
|
-
if (!result.success) {
|
|
94
|
-
return res.status(422).json({
|
|
95
|
-
type: 'validation-error',
|
|
96
|
-
errors: result.error.issues,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
// result.data is typed and safe to use
|
|
100
|
-
return userService.create(result.data);
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Validation Rules
|
|
105
|
-
- **Allowlist over denylist**: Define what is accepted, not what is rejected
|
|
106
|
-
- **Type coercion**: Parse strings to expected types explicitly
|
|
107
|
-
- **Length limits**: Enforce max length on all string inputs
|
|
108
|
-
- **Range checks**: Enforce min/max on numeric inputs
|
|
109
|
-
- **Format validation**: Use regex or parsers for emails, URLs, dates
|
|
110
|
-
- **Sanitization**: Strip HTML/script tags from text that will be rendered
|
|
111
|
-
|
|
112
|
-
### File Upload Validation
|
|
113
|
-
- Validate MIME type against an allowlist
|
|
114
|
-
- Enforce maximum file size
|
|
115
|
-
- Generate new filenames; never use user-provided names
|
|
116
|
-
- Scan uploaded files for malware if possible
|
|
117
|
-
- Store uploads outside the web root
|
|
118
|
-
|
|
119
|
-
<!-- SECTION: secrets-management -->
|
|
120
|
-
## Secrets Management
|
|
121
|
-
|
|
122
|
-
### Environment-Based Secrets
|
|
123
|
-
- Load secrets from environment variables, never from source code
|
|
124
|
-
- Use `.env` files for local development only (git-ignored)
|
|
125
|
-
- Use a secrets manager in production (AWS Secrets Manager, Vault, GCP Secret Manager)
|
|
126
|
-
|
|
127
|
-
### .env File Pattern
|
|
128
|
-
```bash
|
|
129
|
-
# .env.example (committed -- shows structure, no real values)
|
|
130
|
-
DATABASE_URL=postgres://user:password@localhost:5432/dbname
|
|
131
|
-
JWT_SECRET=replace-with-a-real-secret
|
|
132
|
-
STRIPE_API_KEY=sk_test_replace_me
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
# .env (git-ignored -- contains real local values)
|
|
137
|
-
DATABASE_URL=postgres://dev:devpass@localhost:5432/myapp_dev
|
|
138
|
-
JWT_SECRET=local-dev-secret-not-for-production
|
|
139
|
-
STRIPE_API_KEY=sk_test_abc123
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Configuration Loading
|
|
143
|
-
```typescript
|
|
144
|
-
// Validate required env vars at startup, fail fast if missing
|
|
145
|
-
function loadConfig() {
|
|
146
|
-
const required = ['DATABASE_URL', 'JWT_SECRET'];
|
|
147
|
-
const missing = required.filter((key) => !process.env[key]);
|
|
148
|
-
if (missing.length > 0) {
|
|
149
|
-
throw new Error(`Missing required env vars: ${missing.join(', ')}`);
|
|
150
|
-
}
|
|
151
|
-
return {
|
|
152
|
-
databaseUrl: process.env.DATABASE_URL,
|
|
153
|
-
jwtSecret: process.env.JWT_SECRET,
|
|
154
|
-
port: parseInt(process.env.PORT || '3000', 10),
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### Secrets Hygiene
|
|
160
|
-
- Rotate secrets on a regular schedule (at minimum annually)
|
|
161
|
-
- Use separate secrets per environment (dev, staging, production)
|
|
162
|
-
- Never log secrets, even at debug level
|
|
163
|
-
- If a secret is leaked, rotate it immediately
|
|
164
|
-
- Use short-lived tokens (JWTs, OAuth tokens) where possible
|
|
165
|
-
- Use pre-commit hooks (`git-secrets`, `gitleaks`) to prevent accidental commits
|
|
166
|
-
|
|
167
|
-
<!-- SECTION: cors-csrf -->
|
|
168
|
-
## CORS and CSRF
|
|
169
|
-
|
|
170
|
-
### CORS Configuration
|
|
171
|
-
Cross-Origin Resource Sharing controls which domains can call your API.
|
|
172
|
-
|
|
173
|
-
```typescript
|
|
174
|
-
// Express CORS configuration
|
|
175
|
-
import cors from 'cors';
|
|
176
|
-
|
|
177
|
-
app.use(cors({
|
|
178
|
-
origin: ['https://app.example.com', 'https://admin.example.com'],
|
|
179
|
-
methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
|
|
180
|
-
allowedHeaders: ['Content-Type', 'Authorization'],
|
|
181
|
-
credentials: true,
|
|
182
|
-
maxAge: 86400, // cache preflight for 24 hours
|
|
183
|
-
}));
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### CORS Rules
|
|
187
|
-
- Never use `origin: '*'` with `credentials: true`
|
|
188
|
-
- Allowlist specific origins; do not reflect the `Origin` header blindly
|
|
189
|
-
- Restrict methods and headers to what the application actually uses
|
|
190
|
-
- Use `maxAge` to reduce preflight requests
|
|
191
|
-
|
|
192
|
-
### CSRF Protection
|
|
193
|
-
Cross-Site Request Forgery tricks a user's browser into making unwanted requests.
|
|
194
|
-
|
|
195
|
-
**Token-based CSRF prevention**:
|
|
196
|
-
```typescript
|
|
197
|
-
// Server: generate token and set as cookie
|
|
198
|
-
import csrf from 'csurf';
|
|
199
|
-
app.use(csrf({ cookie: true }));
|
|
200
|
-
|
|
201
|
-
// Client: include token in request header
|
|
202
|
-
fetch('/api/transfer', {
|
|
203
|
-
method: 'POST',
|
|
204
|
-
headers: {
|
|
205
|
-
'Content-Type': 'application/json',
|
|
206
|
-
'X-CSRF-Token': getCsrfToken(), // read from cookie or meta tag
|
|
207
|
-
},
|
|
208
|
-
body: JSON.stringify({ amount: 100, to: 'account-456' }),
|
|
209
|
-
});
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### CSRF Prevention Strategies
|
|
213
|
-
| Strategy | How It Works |
|
|
214
|
-
|----------|--------------|
|
|
215
|
-
| Synchronizer token | Server generates token, client sends it back with each state-changing request |
|
|
216
|
-
| Double-submit cookie | Token in cookie + token in header; server compares both |
|
|
217
|
-
| SameSite cookies | Set `SameSite=Strict` or `Lax` on session cookies |
|
|
218
|
-
| Custom request header | Require a custom header (e.g., `X-Requested-With`) that browsers block cross-origin |
|
|
219
|
-
|
|
220
|
-
### Security Headers Checklist
|
|
221
|
-
```
|
|
222
|
-
Strict-Transport-Security: max-age=31536000; includeSubDomains
|
|
223
|
-
X-Content-Type-Options: nosniff
|
|
224
|
-
X-Frame-Options: DENY
|
|
225
|
-
Content-Security-Policy: default-src 'self'
|
|
226
|
-
Referrer-Policy: strict-origin-when-cross-origin
|
|
227
|
-
Permissions-Policy: camera=(), microphone=(), geolocation=()
|
|
228
|
-
```
|
|
229
|
-
- Apply these headers globally via middleware or reverse proxy
|
|
230
|
-
- Test header configuration with securityheaders.com
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: testing-patterns
|
|
3
|
-
version: '1.0'
|
|
4
|
-
applicable_agents: [typescript-dev, angular-dev, flutter-dev, java-dev, python-dev, mobile-dev]
|
|
5
|
-
test_scenarios:
|
|
6
|
-
- scenario: Unit test structure
|
|
7
|
-
expected: Test follows Arrange-Act-Assert pattern with descriptive naming
|
|
8
|
-
- scenario: Integration test isolation
|
|
9
|
-
expected: Test uses dedicated database/container and cleans up after execution
|
|
10
|
-
- scenario: Test double selection
|
|
11
|
-
expected: Appropriate double type chosen (mock for behavior, stub for state, fake for complex deps)
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<!-- SECTION: tdd-cycle -->
|
|
15
|
-
## TDD Cycle
|
|
16
|
-
|
|
17
|
-
### Red-Green-Refactor
|
|
18
|
-
1. **Red**: Write a failing test that defines the desired behavior
|
|
19
|
-
2. **Green**: Write the minimum code to make the test pass
|
|
20
|
-
3. **Refactor**: Improve the code while keeping all tests green
|
|
21
|
-
|
|
22
|
-
### TDD Rules
|
|
23
|
-
- Never write production code without a failing test
|
|
24
|
-
- Write only enough test to fail (compilation failures count)
|
|
25
|
-
- Write only enough production code to pass the failing test
|
|
26
|
-
- Refactor only when all tests are green
|
|
27
|
-
|
|
28
|
-
### Test Pyramid
|
|
29
|
-
```
|
|
30
|
-
/ E2E \ Few, slow, expensive
|
|
31
|
-
/----------\
|
|
32
|
-
/ Integration \ Moderate count
|
|
33
|
-
/----------------\
|
|
34
|
-
/ Unit Tests \ Many, fast, cheap
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
- **Unit tests** (70%): Test individual functions and classes in isolation
|
|
38
|
-
- **Integration tests** (20%): Test component interactions and external boundaries
|
|
39
|
-
- **E2E tests** (10%): Test critical user journeys through the full stack
|
|
40
|
-
|
|
41
|
-
### When to Use TDD
|
|
42
|
-
- New features with clear acceptance criteria
|
|
43
|
-
- Bug fixes (write test that reproduces bug first)
|
|
44
|
-
- Complex business logic with edge cases
|
|
45
|
-
- API contracts (test expected inputs/outputs)
|
|
46
|
-
|
|
47
|
-
### When TDD May Not Fit
|
|
48
|
-
- Exploratory prototyping (write tests after design stabilizes)
|
|
49
|
-
- Pure UI layout work (use visual regression tests instead)
|
|
50
|
-
- Generated code (test the generator, not every output)
|
|
51
|
-
|
|
52
|
-
<!-- SECTION: unit-testing -->
|
|
53
|
-
## Unit Testing
|
|
54
|
-
|
|
55
|
-
### Arrange-Act-Assert (AAA)
|
|
56
|
-
```typescript
|
|
57
|
-
describe('OrderService', () => {
|
|
58
|
-
it('should apply 10% discount for orders over $100', () => {
|
|
59
|
-
// Arrange
|
|
60
|
-
const order = new Order([
|
|
61
|
-
new LineItem('Widget', 60.00),
|
|
62
|
-
new LineItem('Gadget', 50.00),
|
|
63
|
-
]);
|
|
64
|
-
const service = new OrderService();
|
|
65
|
-
|
|
66
|
-
// Act
|
|
67
|
-
const total = service.calculateTotal(order);
|
|
68
|
-
|
|
69
|
-
// Assert
|
|
70
|
-
expect(total).toBe(99.00); // 110 - 10% = 99
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Naming Conventions
|
|
76
|
-
Use descriptive names that document behavior:
|
|
77
|
-
```
|
|
78
|
-
should_[expected behavior]_when_[condition]
|
|
79
|
-
```
|
|
80
|
-
Examples:
|
|
81
|
-
- `should_reject_order_when_cart_is_empty`
|
|
82
|
-
- `should_apply_discount_when_total_exceeds_threshold`
|
|
83
|
-
- `should_send_notification_when_payment_succeeds`
|
|
84
|
-
|
|
85
|
-
### Test Organization
|
|
86
|
-
- One test file per source file: `user.service.ts` -> `user.service.spec.ts`
|
|
87
|
-
- Group related tests with `describe` blocks
|
|
88
|
-
- Keep each test focused on a single behavior
|
|
89
|
-
- Avoid logic in tests (no if/else, loops, or try/catch)
|
|
90
|
-
|
|
91
|
-
### Edge Cases to Cover
|
|
92
|
-
- Empty inputs (null, undefined, empty string, empty array)
|
|
93
|
-
- Boundary values (min, max, zero, negative)
|
|
94
|
-
- Error conditions (invalid input, network failure, timeout)
|
|
95
|
-
- Concurrent access (if applicable)
|
|
96
|
-
|
|
97
|
-
### Test Independence
|
|
98
|
-
- Tests must not depend on execution order
|
|
99
|
-
- Each test sets up its own state and tears it down
|
|
100
|
-
- No shared mutable state between tests
|
|
101
|
-
- Use `beforeEach` for common setup, not `beforeAll` with mutations
|
|
102
|
-
|
|
103
|
-
<!-- SECTION: integration-testing -->
|
|
104
|
-
## Integration Testing
|
|
105
|
-
|
|
106
|
-
### What to Integration Test
|
|
107
|
-
- Database queries and transactions
|
|
108
|
-
- HTTP API endpoints (request/response cycle)
|
|
109
|
-
- Message queue producers and consumers
|
|
110
|
-
- External service integrations (with contract tests)
|
|
111
|
-
- Authentication and authorization flows
|
|
112
|
-
|
|
113
|
-
### Database Integration Tests
|
|
114
|
-
```typescript
|
|
115
|
-
describe('UserRepository', () => {
|
|
116
|
-
let db: TestDatabase;
|
|
117
|
-
|
|
118
|
-
beforeAll(async () => {
|
|
119
|
-
db = await TestDatabase.create(); // isolated test DB
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
afterAll(async () => {
|
|
123
|
-
await db.destroy();
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
beforeEach(async () => {
|
|
127
|
-
await db.truncateAll(); // clean state per test
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('should find user by email', async () => {
|
|
131
|
-
await db.seed('users', { email: 'test@example.com', name: 'Test' });
|
|
132
|
-
const repo = new UserRepository(db.connection);
|
|
133
|
-
|
|
134
|
-
const user = await repo.findByEmail('test@example.com');
|
|
135
|
-
|
|
136
|
-
expect(user).toBeDefined();
|
|
137
|
-
expect(user.name).toBe('Test');
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### API Integration Tests
|
|
143
|
-
```typescript
|
|
144
|
-
describe('POST /api/users', () => {
|
|
145
|
-
it('should create a user and return 201', async () => {
|
|
146
|
-
const response = await request(app)
|
|
147
|
-
.post('/api/users')
|
|
148
|
-
.send({ email: 'new@example.com', name: 'New User' })
|
|
149
|
-
.expect(201);
|
|
150
|
-
|
|
151
|
-
expect(response.body.data.email).toBe('new@example.com');
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
it('should return 422 for invalid email', async () => {
|
|
155
|
-
const response = await request(app)
|
|
156
|
-
.post('/api/users')
|
|
157
|
-
.send({ email: 'not-an-email', name: 'Bad User' })
|
|
158
|
-
.expect(422);
|
|
159
|
-
|
|
160
|
-
expect(response.body.errors[0].field).toBe('email');
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Isolation Strategies
|
|
166
|
-
- Use test containers (Testcontainers) for databases, Redis, etc.
|
|
167
|
-
- Truncate tables between tests, not between suites
|
|
168
|
-
- Use separate database schemas or databases per test suite
|
|
169
|
-
- Never run integration tests against shared environments
|
|
170
|
-
|
|
171
|
-
<!-- SECTION: test-doubles -->
|
|
172
|
-
## Test Doubles
|
|
173
|
-
|
|
174
|
-
### Types of Test Doubles
|
|
175
|
-
| Type | Purpose | Verifies |
|
|
176
|
-
|------|---------|----------|
|
|
177
|
-
| **Stub** | Returns pre-configured responses | State (return values) |
|
|
178
|
-
| **Mock** | Records and verifies interactions | Behavior (method calls) |
|
|
179
|
-
| **Spy** | Wraps real object, records calls | Both state and behavior |
|
|
180
|
-
| **Fake** | Simplified working implementation | State via simplified logic |
|
|
181
|
-
| **Dummy** | Fills a parameter, never actually used | Nothing |
|
|
182
|
-
|
|
183
|
-
### When to Use Each
|
|
184
|
-
- **Stub**: Replace a dependency to control inputs to the system under test
|
|
185
|
-
- **Mock**: Verify the system under test calls a dependency correctly
|
|
186
|
-
- **Spy**: Keep real behavior but verify interactions happened
|
|
187
|
-
- **Fake**: Replace complex infrastructure (in-memory DB, fake HTTP server)
|
|
188
|
-
- **Dummy**: Satisfy a function signature for a parameter you do not care about
|
|
189
|
-
|
|
190
|
-
### Stub Example
|
|
191
|
-
```typescript
|
|
192
|
-
const priceService = {
|
|
193
|
-
getPrice: jest.fn().mockReturnValue(25.00),
|
|
194
|
-
};
|
|
195
|
-
const calculator = new OrderCalculator(priceService);
|
|
196
|
-
const total = calculator.calculate(['item-1', 'item-2']);
|
|
197
|
-
expect(total).toBe(50.00);
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### Mock Example
|
|
201
|
-
```typescript
|
|
202
|
-
const emailService = { send: jest.fn() };
|
|
203
|
-
const registration = new RegistrationService(emailService);
|
|
204
|
-
|
|
205
|
-
await registration.register({ email: 'user@example.com' });
|
|
206
|
-
|
|
207
|
-
expect(emailService.send).toHaveBeenCalledWith(
|
|
208
|
-
expect.objectContaining({ to: 'user@example.com', template: 'welcome' })
|
|
209
|
-
);
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Fake Example
|
|
213
|
-
```typescript
|
|
214
|
-
class FakeUserRepository implements UserRepository {
|
|
215
|
-
private users: Map<string, User> = new Map();
|
|
216
|
-
|
|
217
|
-
async save(user: User): Promise<void> {
|
|
218
|
-
this.users.set(user.id, user);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
async findById(id: string): Promise<User | null> {
|
|
222
|
-
return this.users.get(id) ?? null;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### Test Double Guidelines
|
|
228
|
-
- Prefer stubs over mocks -- test behavior outcomes, not implementation
|
|
229
|
-
- Do not mock what you do not own (wrap third-party libs in adapters)
|
|
230
|
-
- If you need more than 3 mocks in a test, the class has too many dependencies
|
|
231
|
-
- Fakes are the best choice for repositories and external services
|
|
232
|
-
- Reset all mocks/stubs in `beforeEach` to prevent test pollution
|
|
File without changes
|