@therocketcode/gsd-core 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +23 -0
- package/GEMINI.md +53 -0
- package/LICENSE +21 -0
- package/README.ja-JP.md +125 -0
- package/README.ko-KR.md +125 -0
- package/README.md +144 -0
- package/README.pt-BR.md +125 -0
- package/README.zh-CN.md +125 -0
- package/agents/gsd-advisor-researcher.md +108 -0
- package/agents/gsd-ai-researcher.md +114 -0
- package/agents/gsd-assumptions-analyzer.md +105 -0
- package/agents/gsd-code-fixer.md +668 -0
- package/agents/gsd-code-reviewer.md +387 -0
- package/agents/gsd-codebase-mapper.md +853 -0
- package/agents/gsd-debug-session-manager.md +314 -0
- package/agents/gsd-debugger.md +1452 -0
- package/agents/gsd-doc-classifier.md +168 -0
- package/agents/gsd-doc-synthesizer.md +204 -0
- package/agents/gsd-doc-verifier.md +217 -0
- package/agents/gsd-doc-writer.md +616 -0
- package/agents/gsd-domain-researcher.md +147 -0
- package/agents/gsd-eval-auditor.md +191 -0
- package/agents/gsd-eval-planner.md +154 -0
- package/agents/gsd-executor.md +785 -0
- package/agents/gsd-framework-selector.md +160 -0
- package/agents/gsd-integration-checker.md +470 -0
- package/agents/gsd-intel-updater.md +342 -0
- package/agents/gsd-nyquist-auditor.md +203 -0
- package/agents/gsd-pattern-mapper.md +335 -0
- package/agents/gsd-phase-researcher.md +867 -0
- package/agents/gsd-plan-checker.md +978 -0
- package/agents/gsd-planner.md +1204 -0
- package/agents/gsd-project-researcher.md +611 -0
- package/agents/gsd-research-synthesizer.md +259 -0
- package/agents/gsd-roadmapper.md +688 -0
- package/agents/gsd-security-auditor.md +155 -0
- package/agents/gsd-ui-auditor.md +495 -0
- package/agents/gsd-ui-checker.md +309 -0
- package/agents/gsd-ui-researcher.md +374 -0
- package/agents/gsd-user-profiler.md +171 -0
- package/agents/gsd-verifier.md +923 -0
- package/assets/gsd-logo-2000-transparent.png +0 -0
- package/assets/gsd-logo-2000-transparent.svg +17 -0
- package/assets/gsd-logo-2000.png +0 -0
- package/assets/gsd-logo-2000.svg +21 -0
- package/assets/terminal.svg +68 -0
- package/bin/install.js +12726 -0
- package/bin/lib/ui-safety-gate.cjs +107 -0
- package/commands/gsd/add-tests.md +42 -0
- package/commands/gsd/ai-integration-phase.md +37 -0
- package/commands/gsd/audit-fix.md +34 -0
- package/commands/gsd/audit-milestone.md +37 -0
- package/commands/gsd/audit-uat.md +24 -0
- package/commands/gsd/autonomous.md +48 -0
- package/commands/gsd/capture.md +62 -0
- package/commands/gsd/cleanup.md +24 -0
- package/commands/gsd/code-review.md +59 -0
- package/commands/gsd/complete-milestone.md +143 -0
- package/commands/gsd/config.md +56 -0
- package/commands/gsd/debug.md +52 -0
- package/commands/gsd/discover-product.md +65 -0
- package/commands/gsd/discuss-phase.md +77 -0
- package/commands/gsd/docs-update.md +49 -0
- package/commands/gsd/eval-review.md +33 -0
- package/commands/gsd/execute-phase.md +66 -0
- package/commands/gsd/explore.md +27 -0
- package/commands/gsd/extract-learnings.md +23 -0
- package/commands/gsd/fast.md +31 -0
- package/commands/gsd/forensics.md +57 -0
- package/commands/gsd/graphify.md +204 -0
- package/commands/gsd/health.md +31 -0
- package/commands/gsd/help.md +28 -0
- package/commands/gsd/import.md +45 -0
- package/commands/gsd/inbox.md +39 -0
- package/commands/gsd/ingest-docs.md +42 -0
- package/commands/gsd/manager.md +45 -0
- package/commands/gsd/map-codebase.md +83 -0
- package/commands/gsd/milestone-summary.md +51 -0
- package/commands/gsd/model-domain.md +65 -0
- package/commands/gsd/mvp-phase.md +45 -0
- package/commands/gsd/new-milestone.md +45 -0
- package/commands/gsd/new-project.md +47 -0
- package/commands/gsd/ns-context.md +23 -0
- package/commands/gsd/ns-ideate.md +24 -0
- package/commands/gsd/ns-manage.md +29 -0
- package/commands/gsd/ns-project.md +22 -0
- package/commands/gsd/ns-review.md +26 -0
- package/commands/gsd/ns-workflow.md +28 -0
- package/commands/gsd/pause-work.md +43 -0
- package/commands/gsd/phase.md +56 -0
- package/commands/gsd/plan-phase.md +64 -0
- package/commands/gsd/plan-review-convergence.md +59 -0
- package/commands/gsd/pr-branch.md +26 -0
- package/commands/gsd/profile-user.md +46 -0
- package/commands/gsd/progress.md +48 -0
- package/commands/gsd/quick.md +174 -0
- package/commands/gsd/recommend-architecture.md +64 -0
- package/commands/gsd/resume-work.md +30 -0
- package/commands/gsd/review-backlog.md +63 -0
- package/commands/gsd/review.md +42 -0
- package/commands/gsd/secure-phase.md +36 -0
- package/commands/gsd/settings.md +29 -0
- package/commands/gsd/ship.md +24 -0
- package/commands/gsd/sketch.md +60 -0
- package/commands/gsd/spec-phase.md +63 -0
- package/commands/gsd/spike.md +57 -0
- package/commands/gsd/stats.md +20 -0
- package/commands/gsd/surface.md +155 -0
- package/commands/gsd/testing-strategy.md +65 -0
- package/commands/gsd/thread.md +24 -0
- package/commands/gsd/ui-phase.md +35 -0
- package/commands/gsd/ui-review.md +33 -0
- package/commands/gsd/ultraplan-phase.md +34 -0
- package/commands/gsd/undo.md +35 -0
- package/commands/gsd/update.md +49 -0
- package/commands/gsd/validate-phase.md +36 -0
- package/commands/gsd/verify-work.md +39 -0
- package/commands/gsd/workspace.md +52 -0
- package/commands/gsd/workstreams.md +70 -0
- package/gemini-extension.json +6 -0
- package/gsd-core/bin/check-latest-version.cjs +161 -0
- package/gsd-core/bin/gsd-tools.cjs +1928 -0
- package/gsd-core/bin/lib/active-workstream-store.cjs +291 -0
- package/gsd-core/bin/lib/adr-parser.cjs +399 -0
- package/gsd-core/bin/lib/agent-command-router.cjs +68 -0
- package/gsd-core/bin/lib/artifacts.cjs +51 -0
- package/gsd-core/bin/lib/audit.cjs +743 -0
- package/gsd-core/bin/lib/check-command-router.cjs +343 -0
- package/gsd-core/bin/lib/cjs-command-router-adapter.cjs +81 -0
- package/gsd-core/bin/lib/cli-exit.cjs +42 -0
- package/gsd-core/bin/lib/clock.cjs +95 -0
- package/gsd-core/bin/lib/clusters.cjs +132 -0
- package/gsd-core/bin/lib/code-review-flags.cjs +59 -0
- package/gsd-core/bin/lib/command-aliases.cjs +809 -0
- package/gsd-core/bin/lib/command-arg-projection.cjs +55 -0
- package/gsd-core/bin/lib/command-routing-hub.cjs +300 -0
- package/gsd-core/bin/lib/commands.cjs +1203 -0
- package/gsd-core/bin/lib/config-schema.cjs +29 -0
- package/gsd-core/bin/lib/config-types.cjs +19 -0
- package/gsd-core/bin/lib/config.cjs +738 -0
- package/gsd-core/bin/lib/configuration.cjs +239 -0
- package/gsd-core/bin/lib/context-utilization.cjs +48 -0
- package/gsd-core/bin/lib/core.cjs +2051 -0
- package/gsd-core/bin/lib/decisions.cjs +118 -0
- package/gsd-core/bin/lib/docs.cjs +252 -0
- package/gsd-core/bin/lib/drift.cjs +364 -0
- package/gsd-core/bin/lib/fallow-runner.cjs +115 -0
- package/gsd-core/bin/lib/frontmatter.cjs +442 -0
- package/gsd-core/bin/lib/gap-checker.cjs +257 -0
- package/gsd-core/bin/lib/graphify.cjs +496 -0
- package/gsd-core/bin/lib/gsd2-import.cjs +456 -0
- package/gsd-core/bin/lib/init-command-router.cjs +62 -0
- package/gsd-core/bin/lib/init.cjs +1815 -0
- package/gsd-core/bin/lib/install-profiles.cjs +584 -0
- package/gsd-core/bin/lib/installer-migration-authoring.cjs +122 -0
- package/gsd-core/bin/lib/installer-migration-report.cjs +350 -0
- package/gsd-core/bin/lib/installer-migrations/000-first-time-baseline.cjs +218 -0
- package/gsd-core/bin/lib/installer-migrations/001-legacy-orphan-files.cjs +48 -0
- package/gsd-core/bin/lib/installer-migrations/002-codex-legacy-hooks-json.cjs +94 -0
- package/gsd-core/bin/lib/installer-migrations/003-rename-get-shit-done-to-gsd-core.cjs +108 -0
- package/gsd-core/bin/lib/installer-migrations.cjs +823 -0
- package/gsd-core/bin/lib/intel.cjs +590 -0
- package/gsd-core/bin/lib/learnings.cjs +270 -0
- package/gsd-core/bin/lib/legacy-cleanup.cjs +253 -0
- package/gsd-core/bin/lib/milestone.cjs +373 -0
- package/gsd-core/bin/lib/model-catalog.cjs +154 -0
- package/gsd-core/bin/lib/model-profiles.cjs +24 -0
- package/gsd-core/bin/lib/observability/event.cjs +51 -0
- package/gsd-core/bin/lib/observability/logger.cjs +146 -0
- package/gsd-core/bin/lib/observability/redaction.cjs +48 -0
- package/gsd-core/bin/lib/package-identity.cjs +35 -0
- package/gsd-core/bin/lib/package-legitimacy.cjs +368 -0
- package/gsd-core/bin/lib/phase-command-router.cjs +189 -0
- package/gsd-core/bin/lib/phase-lifecycle.cjs +74 -0
- package/gsd-core/bin/lib/phase.cjs +1307 -0
- package/gsd-core/bin/lib/phases-command-router.cjs +43 -0
- package/gsd-core/bin/lib/plan-scan.cjs +91 -0
- package/gsd-core/bin/lib/planning-workspace.cjs +245 -0
- package/gsd-core/bin/lib/profile-output.cjs +1120 -0
- package/gsd-core/bin/lib/profile-pipeline.cjs +517 -0
- package/gsd-core/bin/lib/project-root.cjs +119 -0
- package/gsd-core/bin/lib/prompt-budget.cjs +305 -0
- package/gsd-core/bin/lib/research-provider.cjs +137 -0
- package/gsd-core/bin/lib/research-store.cjs +167 -0
- package/gsd-core/bin/lib/review-reviewer-selection.cjs +121 -0
- package/gsd-core/bin/lib/roadmap-command-router.cjs +166 -0
- package/gsd-core/bin/lib/roadmap-upgrade.cjs +476 -0
- package/gsd-core/bin/lib/roadmap.cjs +600 -0
- package/gsd-core/bin/lib/runtime-artifact-layout.cjs +312 -0
- package/gsd-core/bin/lib/runtime-config-adapter-registry.cjs +56 -0
- package/gsd-core/bin/lib/runtime-homes.cjs +190 -0
- package/gsd-core/bin/lib/runtime-name-policy.cjs +96 -0
- package/gsd-core/bin/lib/runtime-slash.cjs +119 -0
- package/gsd-core/bin/lib/schema-detect.cjs +159 -0
- package/gsd-core/bin/lib/secrets.cjs +34 -0
- package/gsd-core/bin/lib/security.cjs +480 -0
- package/gsd-core/bin/lib/semver-compare.cjs +42 -0
- package/gsd-core/bin/lib/shell-command-projection.cjs +533 -0
- package/gsd-core/bin/lib/state-command-router.cjs +160 -0
- package/gsd-core/bin/lib/state-document.cjs +259 -0
- package/gsd-core/bin/lib/state.cjs +2010 -0
- package/gsd-core/bin/lib/surface.cjs +449 -0
- package/gsd-core/bin/lib/task-command-router.cjs +85 -0
- package/gsd-core/bin/lib/template.cjs +237 -0
- package/gsd-core/bin/lib/uat.cjs +297 -0
- package/gsd-core/bin/lib/ui-safety-gate.cjs +98 -0
- package/gsd-core/bin/lib/update-context.cjs +218 -0
- package/gsd-core/bin/lib/validate-command-router.cjs +91 -0
- package/gsd-core/bin/lib/validate.cjs +112 -0
- package/gsd-core/bin/lib/verification-command-router.cjs +31 -0
- package/gsd-core/bin/lib/verification.cjs +193 -0
- package/gsd-core/bin/lib/verify-command-router.cjs +44 -0
- package/gsd-core/bin/lib/verify.cjs +1451 -0
- package/gsd-core/bin/lib/workstream-inventory-builder.cjs +81 -0
- package/gsd-core/bin/lib/workstream-inventory.cjs +147 -0
- package/gsd-core/bin/lib/workstream-name-policy.cjs +91 -0
- package/gsd-core/bin/lib/workstream.cjs +380 -0
- package/gsd-core/bin/lib/worktree-base-ref.cjs +325 -0
- package/gsd-core/bin/lib/worktree-safety.cjs +943 -0
- package/gsd-core/bin/shared/config-defaults.manifest.json +98 -0
- package/gsd-core/bin/shared/config-schema.manifest.json +192 -0
- package/gsd-core/bin/shared/model-catalog.json +149 -0
- package/gsd-core/bin/shared/runtime-aliases.manifest.json +75 -0
- package/gsd-core/bin/verify-reapply-patches.cjs +349 -0
- package/gsd-core/contexts/dev.md +21 -0
- package/gsd-core/contexts/research.md +22 -0
- package/gsd-core/contexts/review.md +23 -0
- package/gsd-core/references/agent-contracts.md +79 -0
- package/gsd-core/references/ai-evals.md +156 -0
- package/gsd-core/references/ai-frameworks.md +186 -0
- package/gsd-core/references/architecture-decision.md +74 -0
- package/gsd-core/references/artifact-types.md +131 -0
- package/gsd-core/references/auth-in-tests.md +91 -0
- package/gsd-core/references/autonomous-smart-discuss.md +277 -0
- package/gsd-core/references/checkpoints.md +814 -0
- package/gsd-core/references/common-bug-patterns.md +114 -0
- package/gsd-core/references/context-budget.md +85 -0
- package/gsd-core/references/continuation-format.md +253 -0
- package/gsd-core/references/db-test-isolation.md +54 -0
- package/gsd-core/references/debugger-philosophy.md +76 -0
- package/gsd-core/references/decimal-phase-calculation.md +64 -0
- package/gsd-core/references/doc-conflict-engine.md +91 -0
- package/gsd-core/references/domain-modeling.md +80 -0
- package/gsd-core/references/domain-probes.md +125 -0
- package/gsd-core/references/e2e-tiering.md +35 -0
- package/gsd-core/references/execute-mvp-tdd.md +81 -0
- package/gsd-core/references/executor-examples.md +110 -0
- package/gsd-core/references/few-shot-examples/plan-checker.md +73 -0
- package/gsd-core/references/few-shot-examples/verifier.md +109 -0
- package/gsd-core/references/flaky-test-checklist.md +22 -0
- package/gsd-core/references/gate-prompts.md +100 -0
- package/gsd-core/references/gates.md +70 -0
- package/gsd-core/references/git-integration.md +298 -0
- package/gsd-core/references/git-planning-commit.md +40 -0
- package/gsd-core/references/ios-scaffold.md +123 -0
- package/gsd-core/references/mandatory-initial-read.md +2 -0
- package/gsd-core/references/model-profile-resolution.md +38 -0
- package/gsd-core/references/model-profiles.md +245 -0
- package/gsd-core/references/mvp-concepts.md +49 -0
- package/gsd-core/references/phase-argument-parsing.md +61 -0
- package/gsd-core/references/planner-antipatterns.md +89 -0
- package/gsd-core/references/planner-chunked.md +49 -0
- package/gsd-core/references/planner-gap-closure.md +62 -0
- package/gsd-core/references/planner-graphify-auto-update.md +67 -0
- package/gsd-core/references/planner-human-verify-mode.md +57 -0
- package/gsd-core/references/planner-interface-context.md +62 -0
- package/gsd-core/references/planner-load-graph-context.md +36 -0
- package/gsd-core/references/planner-mvp-mode.md +53 -0
- package/gsd-core/references/planner-reviews.md +39 -0
- package/gsd-core/references/planner-revision.md +87 -0
- package/gsd-core/references/planner-source-audit.md +73 -0
- package/gsd-core/references/planning-config.md +473 -0
- package/gsd-core/references/product-discovery.md +49 -0
- package/gsd-core/references/project-skills-discovery.md +19 -0
- package/gsd-core/references/questioning.md +162 -0
- package/gsd-core/references/realistic-test-data.md +44 -0
- package/gsd-core/references/research-documentation-lookup.md +29 -0
- package/gsd-core/references/research-philosophy.md +29 -0
- package/gsd-core/references/research-verification-protocol.md +27 -0
- package/gsd-core/references/revision-loop.md +97 -0
- package/gsd-core/references/scout-codebase.md +51 -0
- package/gsd-core/references/skeleton-template.md +48 -0
- package/gsd-core/references/sketch-interactivity.md +41 -0
- package/gsd-core/references/sketch-theme-system.md +94 -0
- package/gsd-core/references/sketch-tooling.md +45 -0
- package/gsd-core/references/sketch-variant-patterns.md +81 -0
- package/gsd-core/references/spidr-splitting.md +69 -0
- package/gsd-core/references/tdd.md +330 -0
- package/gsd-core/references/test-containers.md +55 -0
- package/gsd-core/references/test-strategy.md +75 -0
- package/gsd-core/references/thinking-models-debug.md +44 -0
- package/gsd-core/references/thinking-models-execution.md +50 -0
- package/gsd-core/references/thinking-models-planning.md +62 -0
- package/gsd-core/references/thinking-models-research.md +50 -0
- package/gsd-core/references/thinking-models-verification.md +55 -0
- package/gsd-core/references/thinking-partner.md +96 -0
- package/gsd-core/references/ui-brand.md +162 -0
- package/gsd-core/references/universal-anti-patterns.md +63 -0
- package/gsd-core/references/user-profiling.md +681 -0
- package/gsd-core/references/user-story-template.md +58 -0
- package/gsd-core/references/verification-overrides.md +227 -0
- package/gsd-core/references/verification-patterns.md +612 -0
- package/gsd-core/references/verify-mvp-mode.md +85 -0
- package/gsd-core/references/workstream-flag.md +111 -0
- package/gsd-core/references/worktree-branch-check.md +38 -0
- package/gsd-core/references/worktree-path-safety.md +67 -0
- package/gsd-core/templates/AI-SPEC.md +246 -0
- package/gsd-core/templates/DEBUG.md +169 -0
- package/gsd-core/templates/README.md +77 -0
- package/gsd-core/templates/SECURITY.md +61 -0
- package/gsd-core/templates/UAT.md +265 -0
- package/gsd-core/templates/UI-SPEC.md +100 -0
- package/gsd-core/templates/VALIDATION.md +76 -0
- package/gsd-core/templates/adr.md +58 -0
- package/gsd-core/templates/claude-md.md +145 -0
- package/gsd-core/templates/codebase/architecture.md +255 -0
- package/gsd-core/templates/codebase/concerns.md +310 -0
- package/gsd-core/templates/codebase/conventions.md +307 -0
- package/gsd-core/templates/codebase/integrations.md +280 -0
- package/gsd-core/templates/codebase/stack.md +186 -0
- package/gsd-core/templates/codebase/structure.md +285 -0
- package/gsd-core/templates/codebase/testing.md +480 -0
- package/gsd-core/templates/config.json +62 -0
- package/gsd-core/templates/context.md +352 -0
- package/gsd-core/templates/continue-here.md +78 -0
- package/gsd-core/templates/copilot-instructions.md +7 -0
- package/gsd-core/templates/debug-subagent-prompt.md +91 -0
- package/gsd-core/templates/dev-preferences.md +21 -0
- package/gsd-core/templates/discovery.md +146 -0
- package/gsd-core/templates/discussion-log.md +63 -0
- package/gsd-core/templates/domain-model.md +54 -0
- package/gsd-core/templates/milestone-archive.md +123 -0
- package/gsd-core/templates/milestone.md +115 -0
- package/gsd-core/templates/phase-prompt.md +610 -0
- package/gsd-core/templates/planner-subagent-prompt.md +117 -0
- package/gsd-core/templates/product-brief.md +55 -0
- package/gsd-core/templates/project.md +186 -0
- package/gsd-core/templates/requirements.md +231 -0
- package/gsd-core/templates/research-project/ARCHITECTURE.md +204 -0
- package/gsd-core/templates/research-project/FEATURES.md +147 -0
- package/gsd-core/templates/research-project/PITFALLS.md +200 -0
- package/gsd-core/templates/research-project/STACK.md +120 -0
- package/gsd-core/templates/research-project/SUMMARY.md +170 -0
- package/gsd-core/templates/research.md +592 -0
- package/gsd-core/templates/retrospective.md +54 -0
- package/gsd-core/templates/roadmap.md +202 -0
- package/gsd-core/templates/spec.md +307 -0
- package/gsd-core/templates/state.md +195 -0
- package/gsd-core/templates/summary-complex.md +59 -0
- package/gsd-core/templates/summary-minimal.md +41 -0
- package/gsd-core/templates/summary-standard.md +48 -0
- package/gsd-core/templates/summary.md +248 -0
- package/gsd-core/templates/test-strategy.md +50 -0
- package/gsd-core/templates/user-profile.md +146 -0
- package/gsd-core/templates/user-setup.md +311 -0
- package/gsd-core/templates/verification-report.md +322 -0
- package/gsd-core/workflows/_runtime-launcher.snippet.sh +1 -0
- package/gsd-core/workflows/add-backlog.md +91 -0
- package/gsd-core/workflows/add-phase.md +113 -0
- package/gsd-core/workflows/add-tests.md +355 -0
- package/gsd-core/workflows/add-todo.md +161 -0
- package/gsd-core/workflows/ai-integration-phase.md +295 -0
- package/gsd-core/workflows/analyze-dependencies.md +96 -0
- package/gsd-core/workflows/audit-fix.md +178 -0
- package/gsd-core/workflows/audit-milestone.md +360 -0
- package/gsd-core/workflows/audit-uat.md +110 -0
- package/gsd-core/workflows/autonomous.md +797 -0
- package/gsd-core/workflows/check-todos.md +180 -0
- package/gsd-core/workflows/cleanup.md +195 -0
- package/gsd-core/workflows/code-review-fix.md +502 -0
- package/gsd-core/workflows/code-review.md +658 -0
- package/gsd-core/workflows/complete-milestone.md +855 -0
- package/gsd-core/workflows/debug.md +237 -0
- package/gsd-core/workflows/diagnose-issues.md +245 -0
- package/gsd-core/workflows/discover-product.md +112 -0
- package/gsd-core/workflows/discovery-phase.md +291 -0
- package/gsd-core/workflows/discuss-phase/modes/advisor.md +176 -0
- package/gsd-core/workflows/discuss-phase/modes/all.md +28 -0
- package/gsd-core/workflows/discuss-phase/modes/analyze.md +44 -0
- package/gsd-core/workflows/discuss-phase/modes/auto.md +57 -0
- package/gsd-core/workflows/discuss-phase/modes/batch.md +52 -0
- package/gsd-core/workflows/discuss-phase/modes/chain.md +98 -0
- package/gsd-core/workflows/discuss-phase/modes/default.md +141 -0
- package/gsd-core/workflows/discuss-phase/modes/power.md +44 -0
- package/gsd-core/workflows/discuss-phase/modes/text.md +55 -0
- package/gsd-core/workflows/discuss-phase/templates/checkpoint.json +18 -0
- package/gsd-core/workflows/discuss-phase/templates/context.md +136 -0
- package/gsd-core/workflows/discuss-phase/templates/discussion-log.md +50 -0
- package/gsd-core/workflows/discuss-phase-assumptions.md +675 -0
- package/gsd-core/workflows/discuss-phase-power.md +291 -0
- package/gsd-core/workflows/discuss-phase.md +499 -0
- package/gsd-core/workflows/do.md +111 -0
- package/gsd-core/workflows/docs-update.md +1176 -0
- package/gsd-core/workflows/edit-phase.md +295 -0
- package/gsd-core/workflows/eval-review.md +156 -0
- package/gsd-core/workflows/execute-phase/steps/codebase-drift-gate.md +95 -0
- package/gsd-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +94 -0
- package/gsd-core/workflows/execute-phase/steps/post-merge-gate.md +117 -0
- package/gsd-core/workflows/execute-phase.md +1752 -0
- package/gsd-core/workflows/execute-plan.md +526 -0
- package/gsd-core/workflows/explore.md +146 -0
- package/gsd-core/workflows/extract-learnings.md +243 -0
- package/gsd-core/workflows/fast.md +124 -0
- package/gsd-core/workflows/forensics.md +279 -0
- package/gsd-core/workflows/graduation.md +196 -0
- package/gsd-core/workflows/health.md +224 -0
- package/gsd-core/workflows/help/modes/brief.md +22 -0
- package/gsd-core/workflows/help/modes/default.md +50 -0
- package/gsd-core/workflows/help/modes/full.md +789 -0
- package/gsd-core/workflows/help/modes/topic.md +74 -0
- package/gsd-core/workflows/help.md +24 -0
- package/gsd-core/workflows/import.md +256 -0
- package/gsd-core/workflows/inbox.md +387 -0
- package/gsd-core/workflows/ingest-docs.md +340 -0
- package/gsd-core/workflows/insert-phase.md +152 -0
- package/gsd-core/workflows/list-phase-assumptions.md +178 -0
- package/gsd-core/workflows/list-workspaces.md +57 -0
- package/gsd-core/workflows/manager.md +393 -0
- package/gsd-core/workflows/map-codebase.md +446 -0
- package/gsd-core/workflows/milestone-summary.md +224 -0
- package/gsd-core/workflows/model-domain.md +162 -0
- package/gsd-core/workflows/mvp-phase.md +222 -0
- package/gsd-core/workflows/new-milestone.md +635 -0
- package/gsd-core/workflows/new-project.md +1555 -0
- package/gsd-core/workflows/new-workspace.md +240 -0
- package/gsd-core/workflows/next.md +299 -0
- package/gsd-core/workflows/node-repair.md +92 -0
- package/gsd-core/workflows/note.md +158 -0
- package/gsd-core/workflows/pause-work.md +244 -0
- package/gsd-core/workflows/plan-milestone-gaps.md +281 -0
- package/gsd-core/workflows/plan-phase.md +1814 -0
- package/gsd-core/workflows/plan-review-convergence.md +346 -0
- package/gsd-core/workflows/plant-seed.md +230 -0
- package/gsd-core/workflows/pr-branch.md +157 -0
- package/gsd-core/workflows/profile-user.md +453 -0
- package/gsd-core/workflows/progress.md +699 -0
- package/gsd-core/workflows/quick.md +1017 -0
- package/gsd-core/workflows/reapply-patches.md +426 -0
- package/gsd-core/workflows/recommend-architecture.md +135 -0
- package/gsd-core/workflows/remove-phase.md +156 -0
- package/gsd-core/workflows/remove-workspace.md +108 -0
- package/gsd-core/workflows/resume-project.md +332 -0
- package/gsd-core/workflows/review.md +748 -0
- package/gsd-core/workflows/scan.md +107 -0
- package/gsd-core/workflows/secure-phase.md +182 -0
- package/gsd-core/workflows/session-report.md +146 -0
- package/gsd-core/workflows/settings-advanced.md +810 -0
- package/gsd-core/workflows/settings-integrations.md +312 -0
- package/gsd-core/workflows/settings.md +566 -0
- package/gsd-core/workflows/ship.md +405 -0
- package/gsd-core/workflows/sketch-wrap-up.md +286 -0
- package/gsd-core/workflows/sketch.md +361 -0
- package/gsd-core/workflows/spec-phase.md +263 -0
- package/gsd-core/workflows/spike-wrap-up.md +307 -0
- package/gsd-core/workflows/spike.md +453 -0
- package/gsd-core/workflows/stats.md +80 -0
- package/gsd-core/workflows/sync-skills.md +182 -0
- package/gsd-core/workflows/testing-strategy.md +122 -0
- package/gsd-core/workflows/thread.md +222 -0
- package/gsd-core/workflows/transition.md +694 -0
- package/gsd-core/workflows/ui-phase.md +328 -0
- package/gsd-core/workflows/ui-review.md +193 -0
- package/gsd-core/workflows/ultraplan-phase.md +199 -0
- package/gsd-core/workflows/undo.md +314 -0
- package/gsd-core/workflows/update.md +496 -0
- package/gsd-core/workflows/validate-phase.md +181 -0
- package/gsd-core/workflows/verify-phase.md +544 -0
- package/gsd-core/workflows/verify-work.md +781 -0
- package/hooks/dist/gsd-check-update-worker.js +108 -0
- package/hooks/dist/gsd-check-update.js +66 -0
- package/hooks/dist/gsd-config-reload.js +133 -0
- package/hooks/dist/gsd-context-monitor.js +195 -0
- package/hooks/dist/gsd-cursor-post-tool.js +75 -0
- package/hooks/dist/gsd-cursor-session-start.js +52 -0
- package/hooks/dist/gsd-graphify-update.sh +158 -0
- package/hooks/dist/gsd-phase-boundary.sh +47 -0
- package/hooks/dist/gsd-prompt-guard.js +97 -0
- package/hooks/dist/gsd-read-guard.js +101 -0
- package/hooks/dist/gsd-read-injection-scanner.js +203 -0
- package/hooks/dist/gsd-session-state.sh +59 -0
- package/hooks/dist/gsd-statusline.js +566 -0
- package/hooks/dist/gsd-update-banner.js +138 -0
- package/hooks/dist/gsd-validate-commit.sh +57 -0
- package/hooks/dist/gsd-workflow-guard.js +167 -0
- package/hooks/dist/gsd-worktree-path-guard.js +169 -0
- package/hooks/dist/lib/git-cmd.js +150 -0
- package/hooks/dist/lib/gsd-graphify-rebuild.sh +65 -0
- package/hooks/dist/managed-hooks-registry.cjs +38 -0
- package/hooks/gsd-check-update-worker.js +108 -0
- package/hooks/gsd-check-update.js +66 -0
- package/hooks/gsd-config-reload.js +133 -0
- package/hooks/gsd-context-monitor.js +195 -0
- package/hooks/gsd-cursor-post-tool.js +75 -0
- package/hooks/gsd-cursor-session-start.js +52 -0
- package/hooks/gsd-graphify-update.sh +158 -0
- package/hooks/gsd-phase-boundary.sh +47 -0
- package/hooks/gsd-prompt-guard.js +97 -0
- package/hooks/gsd-read-guard.js +101 -0
- package/hooks/gsd-read-injection-scanner.js +203 -0
- package/hooks/gsd-session-state.sh +59 -0
- package/hooks/gsd-statusline.js +566 -0
- package/hooks/gsd-update-banner.js +138 -0
- package/hooks/gsd-validate-commit.sh +57 -0
- package/hooks/gsd-workflow-guard.js +167 -0
- package/hooks/gsd-worktree-path-guard.js +169 -0
- package/hooks/hooks.json +69 -0
- package/hooks/lib/git-cmd.js +150 -0
- package/hooks/lib/gsd-graphify-rebuild.sh +65 -0
- package/hooks/managed-hooks-registry.cjs +38 -0
- package/package.json +115 -0
- package/scripts/affected-tests-lib.cjs +542 -0
- package/scripts/audit-workflow-script-paths.cjs +73 -0
- package/scripts/base64-scan.sh +351 -0
- package/scripts/build-hooks.js +247 -0
- package/scripts/changeset/README.md +129 -0
- package/scripts/changeset/cli.cjs +590 -0
- package/scripts/changeset/github-release-notes.cjs +199 -0
- package/scripts/changeset/lint.cjs +111 -0
- package/scripts/changeset/new.cjs +137 -0
- package/scripts/changeset/parse.cjs +114 -0
- package/scripts/changeset/render.cjs +34 -0
- package/scripts/changeset/serialize.cjs +130 -0
- package/scripts/check-alias-drift.cjs +114 -0
- package/scripts/check-env.cjs +312 -0
- package/scripts/check-npm-integrity.cjs +215 -0
- package/scripts/ci-guard-runner.cjs +22 -0
- package/scripts/ci-prepare-test-scope.cjs +51 -0
- package/scripts/ci-rebase-check.cjs +86 -0
- package/scripts/ci-test-scope.cjs +431 -0
- package/scripts/command-contract-helpers.cjs +64 -0
- package/scripts/diff-touches-shipped-paths.cjs +155 -0
- package/scripts/fix-slash-commands.cjs +147 -0
- package/scripts/gen-inventory-manifest.cjs +115 -0
- package/scripts/gen-research-agents.cjs +276 -0
- package/scripts/generate-package-identity.cjs +125 -0
- package/scripts/issue-dedupe.cjs +278 -0
- package/scripts/lib/allowlist-ratchet.cjs +136 -0
- package/scripts/lib/cli-exit.cjs +56 -0
- package/scripts/lint-command-contract.cjs +114 -0
- package/scripts/lint-descriptions.cjs +87 -0
- package/scripts/lint-docs-required.cjs +222 -0
- package/scripts/lint-legacy-dir-name.cjs +160 -0
- package/scripts/lint-package-identity-drift.cjs +141 -0
- package/scripts/lint-pr-check-project-dir.cjs +99 -0
- package/scripts/lint-shell-command-projection-drift.cjs +62 -0
- package/scripts/lint-skill-deps.cjs +185 -0
- package/scripts/lint-test-file-count.allowlist.json +135 -0
- package/scripts/lint-test-file-count.cjs +246 -0
- package/scripts/mutation-matrix.cjs +222 -0
- package/scripts/pr-template-policy.cjs +268 -0
- package/scripts/prompt-injection-scan.sh +207 -0
- package/scripts/release-notes/discord-release-summary.cjs +373 -0
- package/scripts/release-notes/format-github-release-notes.cjs +261 -0
- package/scripts/release-tarball-smoke.cjs +629 -0
- package/scripts/research-profiles.cjs +149 -0
- package/scripts/run-affected-tests.cjs +7 -0
- package/scripts/run-cross-platform-tests.cjs +67 -0
- package/scripts/run-tests.cjs +315 -0
- package/scripts/secret-scan-lint.sh +231 -0
- package/scripts/secret-scan.sh +358 -0
- package/scripts/setup-branch-protection.sh +236 -0
- package/scripts/strip-prose-atrefs.cjs +106 -0
- package/scripts/sync-manifest-versions.cjs +119 -0
- package/scripts/sync-rulesets.sh +34 -0
- package/scripts/sync-runtime-launcher.cjs +399 -0
- package/scripts/test-failure-reasons.cjs +34 -0
- package/scripts/verify-npm-publish.cjs +240 -0
- package/scripts/workflow-policy.cjs +450 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Multi-Variant HTML Patterns
|
|
2
|
+
|
|
3
|
+
Every sketch produces 2-3 variants in the same HTML file. The user switches between them to compare.
|
|
4
|
+
|
|
5
|
+
## Tab-Based Variants
|
|
6
|
+
|
|
7
|
+
The standard approach: a tab bar at the top of the page, each tab shows a different variant.
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<div id="variant-nav" style="position:fixed;top:0;left:0;right:0;z-index:9998;background:var(--color-surface, #fff);border-bottom:1px solid var(--color-border, #e5e5e5);padding:8px 16px;display:flex;gap:8px;font-family:system-ui;">
|
|
11
|
+
<button class="variant-tab active" onclick="showVariant('a')">A: Sidebar Layout</button>
|
|
12
|
+
<button class="variant-tab" onclick="showVariant('b')">B: Top Nav</button>
|
|
13
|
+
<button class="variant-tab" onclick="showVariant('c')">C: Floating Panels</button>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div id="variant-a" class="variant active">
|
|
17
|
+
<!-- Variant A content -->
|
|
18
|
+
</div>
|
|
19
|
+
<div id="variant-b" class="variant" style="display:none">
|
|
20
|
+
<!-- Variant B content -->
|
|
21
|
+
</div>
|
|
22
|
+
<div id="variant-c" class="variant" style="display:none">
|
|
23
|
+
<!-- Variant C content -->
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
function showVariant(id) {
|
|
28
|
+
document.querySelectorAll('.variant').forEach(v => v.style.display = 'none');
|
|
29
|
+
document.querySelectorAll('.variant-tab').forEach(t => t.classList.remove('active'));
|
|
30
|
+
document.getElementById('variant-' + id).style.display = 'block';
|
|
31
|
+
event.target.classList.add('active');
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Add `padding-top` to the body to account for the fixed tab bar.
|
|
37
|
+
|
|
38
|
+
## Marking the Winner
|
|
39
|
+
|
|
40
|
+
After the user picks a direction, add a visual indicator to the winning tab:
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<button class="variant-tab active">A: Sidebar Layout ★ Selected</button>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Keep all variants visible and navigable — the winner is highlighted, not the only option.
|
|
47
|
+
|
|
48
|
+
## Side-by-Side (for small variants)
|
|
49
|
+
|
|
50
|
+
When comparing small elements (button styles, card layouts, icon treatments), render them next to each other with labels rather than using tabs:
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<div style="display:grid;grid-template-columns:repeat(3,1fr);gap:24px;padding:24px;">
|
|
54
|
+
<div>
|
|
55
|
+
<h3>A: Rounded</h3>
|
|
56
|
+
<!-- variant content -->
|
|
57
|
+
</div>
|
|
58
|
+
<div>
|
|
59
|
+
<h3>B: Sharp</h3>
|
|
60
|
+
<!-- variant content -->
|
|
61
|
+
</div>
|
|
62
|
+
<div>
|
|
63
|
+
<h3>C: Pill</h3>
|
|
64
|
+
<!-- variant content -->
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Variant Count
|
|
70
|
+
|
|
71
|
+
- **First round (dramatic):** 2-3 meaningfully different approaches
|
|
72
|
+
- **Refinement rounds:** 2-3 subtle variations within the chosen direction
|
|
73
|
+
- **Never more than 4** — more than that overwhelms. If there are 5+ options, narrow before showing.
|
|
74
|
+
|
|
75
|
+
## Synthesis Variants
|
|
76
|
+
|
|
77
|
+
When the user cherry-picks elements across variants, create a new variant tab labeled descriptively:
|
|
78
|
+
|
|
79
|
+
```html
|
|
80
|
+
<button class="variant-tab" onclick="showVariant('synth1')">Synthesis: A's layout + C's palette</button>
|
|
81
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# SPIDR Story Splitting Rules
|
|
2
|
+
|
|
3
|
+
> Used by `mvp-phase` workflow when the user-supplied story is too large for a single phase. Per PRD decision Q3, SPIDR runs as a **full interactive flow** — not a lightweight check.
|
|
4
|
+
|
|
5
|
+
## When SPIDR triggers
|
|
6
|
+
|
|
7
|
+
Trigger SPIDR splitting if **any** of these size signals fire on the user story:
|
|
8
|
+
|
|
9
|
+
1. **Compound capabilities.** The story names two or more independent user actions joined by "and" (e.g., "register **and** log in **and** reset their password"). Each "and" is a candidate split point.
|
|
10
|
+
2. **Multi-actor.** The story names more than one `[user role]` (e.g., "As a user or admin..."). Each role is a candidate split.
|
|
11
|
+
3. **Length.** The assembled story exceeds ~120 chars on a single line.
|
|
12
|
+
4. **Vague capability.** The capability is a noun phrase, not a verb-noun pair (e.g., "I want to use the dashboard" — needs to specify *which interaction* with the dashboard).
|
|
13
|
+
|
|
14
|
+
If none of these fire, skip SPIDR entirely and proceed to ROADMAP write.
|
|
15
|
+
|
|
16
|
+
## The five SPIDR axes
|
|
17
|
+
|
|
18
|
+
For each axis, ask one targeted question. The user picks the axis that best fits their story; only one axis is applied per split.
|
|
19
|
+
|
|
20
|
+
### Spike
|
|
21
|
+
|
|
22
|
+
> "Is there an unknown that needs research before this can be implemented? If so, the spike is its own phase."
|
|
23
|
+
|
|
24
|
+
If yes: split out a research phase (no acceptance criteria except "we know enough to plan the rest"). The remaining story becomes a follow-up phase.
|
|
25
|
+
|
|
26
|
+
### Paths
|
|
27
|
+
|
|
28
|
+
> "Does this feature have a happy path and one or more error/edge paths?"
|
|
29
|
+
|
|
30
|
+
If yes: split happy path into the first phase, edge paths into follow-ups. Order: happy path first (it proves the slice works), then progressively edge cases.
|
|
31
|
+
|
|
32
|
+
### Interfaces
|
|
33
|
+
|
|
34
|
+
> "Does this feature need to work on more than one interface (web, mobile, API, CLI)?"
|
|
35
|
+
|
|
36
|
+
If yes: split by interface. Web first if user-facing; API first if integration-driven; mobile last unless it's the primary platform.
|
|
37
|
+
|
|
38
|
+
### Data
|
|
39
|
+
|
|
40
|
+
> "Does this feature touch multiple data scopes (one user vs. many, single team vs. multi-tenant, small CSV vs. large dataset)?"
|
|
41
|
+
|
|
42
|
+
If yes: split by scope. Smallest scope first (one user, single team, small data), then expand.
|
|
43
|
+
|
|
44
|
+
### Rules
|
|
45
|
+
|
|
46
|
+
> "Does this feature have multiple business rules that could be added incrementally (basic validation first, then complex policy)?"
|
|
47
|
+
|
|
48
|
+
If yes: split by rule complexity. Minimum viable rules first; complex policy in follow-ups.
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
When SPIDR triggers, the workflow:
|
|
53
|
+
|
|
54
|
+
1. Restates the user-supplied story.
|
|
55
|
+
2. Asks "Which SPIDR axis fits best?" with the five options above.
|
|
56
|
+
3. Walks through the chosen axis interactively (one focused question), produces a split proposal: "Phase N (this one): X. Phase N+1: Y. Phase N+2: Z."
|
|
57
|
+
4. Confirms the split with the user.
|
|
58
|
+
5. On accept: writes the FIRST phase's story to the current ROADMAP entry; defers creating new phases for the splits to a follow-up step (the workflow surfaces a list of `/gsd add-phase` invocations the user can run after `mvp-phase` completes — but does not run them automatically, to preserve user control over phase numbering).
|
|
59
|
+
6. On reject: proceeds with the original story unchanged.
|
|
60
|
+
|
|
61
|
+
## Anti-patterns to reject
|
|
62
|
+
|
|
63
|
+
- **Splitting by technical layer.** "Phase 1: schema. Phase 2: API. Phase 3: UI." That's horizontal planning. Reject.
|
|
64
|
+
- **Pre-splitting before the user even sees the original.** Always show the user-supplied story first; only offer split if it triggers a size signal.
|
|
65
|
+
- **Splitting more than one axis at once.** SPIDR is one axis per split. If a story needs splitting on two axes (e.g., paths AND data), do paths first, then re-evaluate the resulting smaller stories.
|
|
66
|
+
|
|
67
|
+
## Reference
|
|
68
|
+
|
|
69
|
+
See [Mike Cohn — Five Simple But Powerful Ways to Split User Stories](https://www.mountaingoatsoftware.com/blog/five-simple-but-powerful-ways-to-split-user-stories).
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
TDD is about design quality, not coverage metrics. The red-green-refactor cycle forces you to think about behavior before implementation, producing cleaner interfaces and more testable code.
|
|
3
|
+
|
|
4
|
+
**Principle:** If you can describe the behavior as `expect(fn(input)).toBe(output)` before writing `fn`, TDD improves the result.
|
|
5
|
+
|
|
6
|
+
**Key insight:** TDD work is fundamentally heavier than standard tasks—it requires 2-3 execution cycles (RED → GREEN → REFACTOR), each with file reads, test runs, and potential debugging. TDD features get dedicated plans to ensure full context is available throughout the cycle.
|
|
7
|
+
</overview>
|
|
8
|
+
|
|
9
|
+
<when_to_use_tdd>
|
|
10
|
+
## When TDD Improves Quality
|
|
11
|
+
|
|
12
|
+
**TDD candidates (create a TDD plan):**
|
|
13
|
+
- Business logic with defined inputs/outputs
|
|
14
|
+
- API endpoints with request/response contracts
|
|
15
|
+
- Data transformations, parsing, formatting
|
|
16
|
+
- Validation rules and constraints
|
|
17
|
+
- Algorithms with testable behavior
|
|
18
|
+
- State machines and workflows
|
|
19
|
+
- Utility functions with clear specifications
|
|
20
|
+
|
|
21
|
+
**Skip TDD (use standard plan with `type="auto"` tasks):**
|
|
22
|
+
- UI layout, styling, visual components
|
|
23
|
+
- Configuration changes
|
|
24
|
+
- Glue code connecting existing components
|
|
25
|
+
- One-off scripts and migrations
|
|
26
|
+
- Simple CRUD with no business logic
|
|
27
|
+
- Exploratory prototyping
|
|
28
|
+
|
|
29
|
+
**Heuristic:** Can you write `expect(fn(input)).toBe(output)` before writing `fn`?
|
|
30
|
+
→ Yes: Create a TDD plan
|
|
31
|
+
→ No: Use standard plan, add tests after if needed
|
|
32
|
+
</when_to_use_tdd>
|
|
33
|
+
|
|
34
|
+
<tdd_plan_structure>
|
|
35
|
+
## TDD Plan Structure
|
|
36
|
+
|
|
37
|
+
Each TDD plan implements **one feature** through the full RED-GREEN-REFACTOR cycle.
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
---
|
|
41
|
+
phase: XX-name
|
|
42
|
+
plan: NN
|
|
43
|
+
type: tdd
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
<objective>
|
|
47
|
+
[What feature and why]
|
|
48
|
+
Purpose: [Design benefit of TDD for this feature]
|
|
49
|
+
Output: [Working, tested feature]
|
|
50
|
+
</objective>
|
|
51
|
+
|
|
52
|
+
<context>
|
|
53
|
+
@.planning/PROJECT.md
|
|
54
|
+
@.planning/ROADMAP.md
|
|
55
|
+
@relevant/source/files.ts
|
|
56
|
+
</context>
|
|
57
|
+
|
|
58
|
+
<feature>
|
|
59
|
+
<name>[Feature name]</name>
|
|
60
|
+
<files>[source file, test file]</files>
|
|
61
|
+
<behavior>
|
|
62
|
+
[Expected behavior in testable terms]
|
|
63
|
+
Cases: input → expected output
|
|
64
|
+
</behavior>
|
|
65
|
+
<implementation>[How to implement once tests pass]</implementation>
|
|
66
|
+
</feature>
|
|
67
|
+
|
|
68
|
+
<verification>
|
|
69
|
+
[Test command that proves feature works]
|
|
70
|
+
</verification>
|
|
71
|
+
|
|
72
|
+
<success_criteria>
|
|
73
|
+
- Failing test written and committed
|
|
74
|
+
- Implementation passes test
|
|
75
|
+
- Refactor complete (if needed)
|
|
76
|
+
- All 2-3 commits present
|
|
77
|
+
</success_criteria>
|
|
78
|
+
|
|
79
|
+
<output>
|
|
80
|
+
After completion, create SUMMARY.md with:
|
|
81
|
+
- RED: What test was written, why it failed
|
|
82
|
+
- GREEN: What implementation made it pass
|
|
83
|
+
- REFACTOR: What cleanup was done (if any)
|
|
84
|
+
- Commits: List of commits produced
|
|
85
|
+
</output>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**One feature per TDD plan.** If features are trivial enough to batch, they're trivial enough to skip TDD—use a standard plan and add tests after.
|
|
89
|
+
</tdd_plan_structure>
|
|
90
|
+
|
|
91
|
+
<execution_flow>
|
|
92
|
+
## Red-Green-Refactor Cycle
|
|
93
|
+
|
|
94
|
+
**RED - Write failing test:**
|
|
95
|
+
1. Create test file following project conventions
|
|
96
|
+
2. Write test describing expected behavior (from `<behavior>` element)
|
|
97
|
+
3. Run test - it MUST fail
|
|
98
|
+
4. If test passes: feature exists or test is wrong. Investigate.
|
|
99
|
+
5. Commit: `test({phase}-{plan}): add failing test for [feature]`
|
|
100
|
+
|
|
101
|
+
**GREEN - Implement to pass:**
|
|
102
|
+
1. Write minimal code to make test pass
|
|
103
|
+
2. No cleverness, no optimization - just make it work
|
|
104
|
+
3. Run test - it MUST pass
|
|
105
|
+
4. Commit: `feat({phase}-{plan}): implement [feature]`
|
|
106
|
+
|
|
107
|
+
**REFACTOR (if needed):**
|
|
108
|
+
1. Clean up implementation if obvious improvements exist
|
|
109
|
+
2. Run tests - MUST still pass
|
|
110
|
+
3. Only commit if changes made: `refactor({phase}-{plan}): clean up [feature]`
|
|
111
|
+
|
|
112
|
+
**Result:** Each TDD plan produces 2-3 atomic commits.
|
|
113
|
+
</execution_flow>
|
|
114
|
+
|
|
115
|
+
<test_quality>
|
|
116
|
+
## Good Tests vs Bad Tests
|
|
117
|
+
|
|
118
|
+
**Test behavior, not implementation:**
|
|
119
|
+
- Good: "returns formatted date string"
|
|
120
|
+
- Bad: "calls formatDate helper with correct params"
|
|
121
|
+
- Tests should survive refactors
|
|
122
|
+
|
|
123
|
+
**One concept per test:**
|
|
124
|
+
- Good: Separate tests for valid input, empty input, malformed input
|
|
125
|
+
- Bad: Single test checking all edge cases with multiple assertions
|
|
126
|
+
|
|
127
|
+
**Descriptive names:**
|
|
128
|
+
- Good: "should reject empty email", "returns null for invalid ID"
|
|
129
|
+
- Bad: "test1", "handles error", "works correctly"
|
|
130
|
+
|
|
131
|
+
**No implementation details:**
|
|
132
|
+
- Good: Test public API, observable behavior
|
|
133
|
+
- Bad: Mock internals, test private methods, assert on internal state
|
|
134
|
+
</test_quality>
|
|
135
|
+
|
|
136
|
+
<framework_setup>
|
|
137
|
+
## Test Framework Setup (If None Exists)
|
|
138
|
+
|
|
139
|
+
When executing a TDD plan but no test framework is configured, set it up as part of the RED phase:
|
|
140
|
+
|
|
141
|
+
**1. Detect project type:**
|
|
142
|
+
```bash
|
|
143
|
+
# JavaScript/TypeScript
|
|
144
|
+
if [ -f package.json ]; then echo "node"; fi
|
|
145
|
+
|
|
146
|
+
# Python
|
|
147
|
+
if [ -f requirements.txt ] || [ -f pyproject.toml ]; then echo "python"; fi
|
|
148
|
+
|
|
149
|
+
# Go
|
|
150
|
+
if [ -f go.mod ]; then echo "go"; fi
|
|
151
|
+
|
|
152
|
+
# Rust
|
|
153
|
+
if [ -f Cargo.toml ]; then echo "rust"; fi
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**2. Install minimal framework:**
|
|
157
|
+
| Project | Framework | Install |
|
|
158
|
+
|---------|-----------|---------|
|
|
159
|
+
| Node.js | Jest | `npm install -D jest @types/jest ts-jest` |
|
|
160
|
+
| Node.js (Vite) | Vitest | `npm install -D vitest` |
|
|
161
|
+
| Python | pytest | `pip install pytest` |
|
|
162
|
+
| Go | testing | Built-in |
|
|
163
|
+
| Rust | cargo test | Built-in |
|
|
164
|
+
|
|
165
|
+
**3. Create config if needed:**
|
|
166
|
+
- Jest: `jest.config.js` with ts-jest preset
|
|
167
|
+
- Vitest: `vitest.config.ts` with test globals
|
|
168
|
+
- pytest: `pytest.ini` or `pyproject.toml` section
|
|
169
|
+
|
|
170
|
+
**4. Verify setup:**
|
|
171
|
+
```bash
|
|
172
|
+
# Run empty test suite - should pass with 0 tests
|
|
173
|
+
npm test # Node
|
|
174
|
+
pytest # Python
|
|
175
|
+
go test ./... # Go
|
|
176
|
+
cargo test # Rust
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**5. Create first test file:**
|
|
180
|
+
Follow project conventions for test location:
|
|
181
|
+
- `*.test.ts` / `*.spec.ts` next to source
|
|
182
|
+
- `__tests__/` directory
|
|
183
|
+
- `tests/` directory at root
|
|
184
|
+
|
|
185
|
+
Framework setup is a one-time cost included in the first TDD plan's RED phase.
|
|
186
|
+
</framework_setup>
|
|
187
|
+
|
|
188
|
+
<error_handling>
|
|
189
|
+
## Error Handling
|
|
190
|
+
|
|
191
|
+
**Test doesn't fail in RED phase:**
|
|
192
|
+
- Feature may already exist - investigate
|
|
193
|
+
- Test may be wrong (not testing what you think)
|
|
194
|
+
- Fix before proceeding
|
|
195
|
+
|
|
196
|
+
**Test doesn't pass in GREEN phase:**
|
|
197
|
+
- Debug implementation
|
|
198
|
+
- Don't skip to refactor
|
|
199
|
+
- Keep iterating until green
|
|
200
|
+
|
|
201
|
+
**Tests fail in REFACTOR phase:**
|
|
202
|
+
- Undo refactor
|
|
203
|
+
- Commit was premature
|
|
204
|
+
- Refactor in smaller steps
|
|
205
|
+
|
|
206
|
+
**Unrelated tests break:**
|
|
207
|
+
- Stop and investigate
|
|
208
|
+
- May indicate coupling issue
|
|
209
|
+
- Fix before proceeding
|
|
210
|
+
</error_handling>
|
|
211
|
+
|
|
212
|
+
<commit_pattern>
|
|
213
|
+
## Commit Pattern for TDD Plans
|
|
214
|
+
|
|
215
|
+
TDD plans produce 2-3 atomic commits (one per phase):
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
test(08-02): add failing test for email validation
|
|
219
|
+
|
|
220
|
+
- Tests valid email formats accepted
|
|
221
|
+
- Tests invalid formats rejected
|
|
222
|
+
- Tests empty input handling
|
|
223
|
+
|
|
224
|
+
feat(08-02): implement email validation
|
|
225
|
+
|
|
226
|
+
- Regex pattern matches RFC 5322
|
|
227
|
+
- Returns boolean for validity
|
|
228
|
+
- Handles edge cases (empty, null)
|
|
229
|
+
|
|
230
|
+
refactor(08-02): extract regex to constant (optional)
|
|
231
|
+
|
|
232
|
+
- Moved pattern to EMAIL_REGEX constant
|
|
233
|
+
- No behavior changes
|
|
234
|
+
- Tests still pass
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Comparison with standard plans:**
|
|
238
|
+
- Standard plans: 1 commit per task, 2-4 commits per plan
|
|
239
|
+
- TDD plans: 2-3 commits for single feature
|
|
240
|
+
|
|
241
|
+
Both follow same format: `{type}({phase}-{plan}): {description}`
|
|
242
|
+
|
|
243
|
+
**Benefits:**
|
|
244
|
+
- Each commit independently revertable
|
|
245
|
+
- Git bisect works at commit level
|
|
246
|
+
- Clear history showing TDD discipline
|
|
247
|
+
- Consistent with overall commit strategy
|
|
248
|
+
</commit_pattern>
|
|
249
|
+
|
|
250
|
+
<gate_enforcement>
|
|
251
|
+
## Gate Enforcement Rules
|
|
252
|
+
|
|
253
|
+
When `workflow.tdd_mode` is enabled in config, the RED/GREEN/REFACTOR gate sequence is enforced for all `type: tdd` plans.
|
|
254
|
+
|
|
255
|
+
### Gate Definitions
|
|
256
|
+
|
|
257
|
+
| Gate | Required | Commit Pattern | Validation |
|
|
258
|
+
|------|----------|---------------|------------|
|
|
259
|
+
| RED | Yes | `test({phase}-{plan}): ...` | Test exists AND fails before implementation |
|
|
260
|
+
| GREEN | Yes | `feat({phase}-{plan}): ...` | Test passes after implementation |
|
|
261
|
+
| REFACTOR | No | `refactor({phase}-{plan}): ...` | Tests still pass after cleanup |
|
|
262
|
+
|
|
263
|
+
### Fail-Fast Rules
|
|
264
|
+
|
|
265
|
+
1. **Unexpected GREEN in RED phase:** If the test passes before any implementation code is written, STOP. The feature may already exist or the test is wrong. Investigate before proceeding.
|
|
266
|
+
2. **Missing RED commit:** If no `test(...)` commit precedes the `feat(...)` commit, the TDD discipline was violated. Flag in SUMMARY.md.
|
|
267
|
+
3. **REFACTOR breaks tests:** Undo the refactor immediately. Commit was premature — refactor in smaller steps.
|
|
268
|
+
|
|
269
|
+
### Executor Gate Validation
|
|
270
|
+
|
|
271
|
+
After completing a `type: tdd` plan, the executor validates the git log:
|
|
272
|
+
```bash
|
|
273
|
+
# Check for RED gate commit
|
|
274
|
+
git log --oneline --grep="^test(${PHASE}-${PLAN})" | head -1
|
|
275
|
+
# Check for GREEN gate commit
|
|
276
|
+
git log --oneline --grep="^feat(${PHASE}-${PLAN})" | head -1
|
|
277
|
+
# Check for optional REFACTOR gate commit
|
|
278
|
+
git log --oneline --grep="^refactor(${PHASE}-${PLAN})" | head -1
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
If RED or GREEN gate commits are missing, add a `## TDD Gate Compliance` section to SUMMARY.md with the violation details.
|
|
282
|
+
</gate_enforcement>
|
|
283
|
+
|
|
284
|
+
<end_of_phase_review>
|
|
285
|
+
## End-of-Phase TDD Review Checkpoint
|
|
286
|
+
|
|
287
|
+
When `workflow.tdd_mode` is enabled, the execute-phase orchestrator inserts a collaborative review checkpoint after all waves complete but before phase verification.
|
|
288
|
+
|
|
289
|
+
### Review Checkpoint Format
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
293
|
+
TDD REVIEW — Phase {X}
|
|
294
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
295
|
+
|
|
296
|
+
TDD Plans: {count} | Gate violations: {count}
|
|
297
|
+
|
|
298
|
+
| Plan | RED | GREEN | REFACTOR | Status |
|
|
299
|
+
|------|-----|-------|----------|--------|
|
|
300
|
+
| {id} | ✓ | ✓ | ✓ | Pass |
|
|
301
|
+
| {id} | ✓ | ✗ | — | FAIL |
|
|
302
|
+
|
|
303
|
+
{If violations exist:}
|
|
304
|
+
⚠ Gate violations are advisory — review before advancing.
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### What the Review Checks
|
|
308
|
+
|
|
309
|
+
1. **Gate sequence:** Each TDD plan has RED → GREEN commits in order
|
|
310
|
+
2. **Test quality:** RED phase tests fail for the right reason (not import errors or syntax)
|
|
311
|
+
3. **Minimal GREEN:** Implementation is minimal — no premature optimization in GREEN phase
|
|
312
|
+
4. **Refactor discipline:** If REFACTOR commit exists, tests still pass
|
|
313
|
+
|
|
314
|
+
This checkpoint is advisory — it does not block phase completion but surfaces TDD discipline issues for human review.
|
|
315
|
+
</end_of_phase_review>
|
|
316
|
+
|
|
317
|
+
<context_budget>
|
|
318
|
+
## Context Budget
|
|
319
|
+
|
|
320
|
+
TDD plans target **~40% context usage** (lower than standard plans' ~50%).
|
|
321
|
+
|
|
322
|
+
Why lower:
|
|
323
|
+
- RED phase: write test, run test, potentially debug why it didn't fail
|
|
324
|
+
- GREEN phase: implement, run test, potentially iterate on failures
|
|
325
|
+
- REFACTOR phase: modify code, run tests, verify no regressions
|
|
326
|
+
|
|
327
|
+
Each phase involves reading files, running commands, analyzing output. The back-and-forth is inherently heavier than linear task execution.
|
|
328
|
+
|
|
329
|
+
Single feature focus ensures full quality throughout the cycle.
|
|
330
|
+
</context_budget>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Testcontainers — Real Dependencies in Integration Tests
|
|
2
|
+
|
|
3
|
+
How-to reference for spinning up real databases/services (Postgres, Redis, etc.) in integration tests with Testcontainers. Read this when writing integration tests against a real dependency. Pairs with `db-test-isolation.md`.
|
|
4
|
+
|
|
5
|
+
## Core rules
|
|
6
|
+
|
|
7
|
+
1. **Pin exact image tags** — `postgres:16-alpine`, never `latest` (reproducibility).
|
|
8
|
+
2. **Singleton container, started once** — one container per test run, reused across all test files/classes. Do **not** combine the singleton with per-class lifecycle annotations/extensions (they stop the container after each class and break the next one).
|
|
9
|
+
3. **Wait on a real readiness signal, never `sleep`** — a health check, a log message, or a DB-ready probe.
|
|
10
|
+
4. **`withReuse` is local-dev-only** — it keeps containers alive between runs (fast inner loop), but **Ryuk does not reap reused containers**, and CI wants fresh, reproducible environments. **Never enable reuse in CI.**
|
|
11
|
+
5. **Run migrations in test setup** so schema drift surfaces immediately.
|
|
12
|
+
|
|
13
|
+
## Canonical pattern (TypeScript/Node — ports to Java/Go/.NET)
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// test/support/postgres.ts — one container, started once for the whole run
|
|
17
|
+
import { PostgreSqlContainer, StartedPostgreSqlContainer } from '@testcontainers/postgresql';
|
|
18
|
+
|
|
19
|
+
let container: StartedPostgreSqlContainer | undefined;
|
|
20
|
+
|
|
21
|
+
export async function getDb(): Promise<StartedPostgreSqlContainer> {
|
|
22
|
+
if (!container) {
|
|
23
|
+
container = await new PostgreSqlContainer('postgres:16-alpine') // pinned tag, never :latest
|
|
24
|
+
.withDatabase('app_test')
|
|
25
|
+
// built-in wait for postgres; for custom services:
|
|
26
|
+
// .withWaitStrategy(Wait.forLogMessage(/ready to accept connections/))
|
|
27
|
+
.start();
|
|
28
|
+
// run migrations ONCE here, against the base/template DB
|
|
29
|
+
}
|
|
30
|
+
return container;
|
|
31
|
+
}
|
|
32
|
+
// Vitest/Jest: start in globalSetup, stop in globalTeardown — NOT in beforeEach.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Java/JUnit 5 equivalent: a `static` field started in a `static {}` block on an abstract base class every test class `extends` — and do **not** put `@Container`/`@Testcontainers` on it (that hands lifecycle to the extension, which stops it per class).
|
|
36
|
+
|
|
37
|
+
## Cleanup
|
|
38
|
+
|
|
39
|
+
Testcontainers labels its containers; **Ryuk** removes them when the run's process exits — an explicit `stop()` is optional. Reused containers are the exception (not reaped).
|
|
40
|
+
|
|
41
|
+
## CI considerations
|
|
42
|
+
|
|
43
|
+
- **Ryuk under Docker-in-Docker / restricted CI** sometimes fails. Mitigate: set `TESTCONTAINERS_RYUK_DISABLED=true` **and** add an explicit cleanup step — `docker container prune -f --filter "label=org.testcontainers=true"` (or stop containers in global teardown).
|
|
44
|
+
- Cache Docker layers; prefer `alpine` images; cap memory on heavy services (e.g. Elasticsearch `ES_JAVA_OPTS=-Xms512m -Xmx1g`).
|
|
45
|
+
- **First run pulls the image** — pre-pull images in CI, or set a generous `withStartupTimeout(...)`, so the first test doesn't time out on a cold pull.
|
|
46
|
+
- **Parallelize at the file level**, not within a file, to bound container count and resource use.
|
|
47
|
+
|
|
48
|
+
## Anti-patterns
|
|
49
|
+
|
|
50
|
+
- `:latest` image tags (non-reproducible).
|
|
51
|
+
- A fresh container per test (slow — use the singleton + per-test **data** isolation, see `db-test-isolation.md`).
|
|
52
|
+
- `sleep(2000)` for readiness (flaky) — use a wait strategy.
|
|
53
|
+
- `withReuse(true)` in CI (leaks containers; not reproducible).
|
|
54
|
+
|
|
55
|
+
*Sources: testcontainers.com & Docker Testcontainers official guides; qaskills 2026 best practices.*
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Testing Strategy — Shape Follows Architecture
|
|
2
|
+
|
|
3
|
+
Reference for `/gsd:testing-strategy`. Decides WHAT to test, at WHICH level, and HOW MUCH — matched to the architecture (from the ADR / SKELETON). **Extends, not replaces,** the project's existing rigor in `TESTING-STANDARDS.md` (real-code-only, no-vacuous-assertions, typed surface, `fast-check` property tests, Stryker mutation ≥80%). Recommends; the user decides.
|
|
4
|
+
|
|
5
|
+
## Core principles (the consensus)
|
|
6
|
+
|
|
7
|
+
1. **Behavior over implementation — the strongest consensus.** Test through public APIs / observable behavior so tests survive refactoring; a test changes only when *behavior* changes. Default to **sociable** tests (real collaborators); **mock ONLY at architectural boundaries** (ports / external systems). Mockist/solitary tests are exactly the brittle, implementation-coupled tests everyone warns against.
|
|
8
|
+
2. **Test each behavior ONCE, at the cheapest level that gives confidence.** Push tests down; drop a higher-level test once lower levels cover the condition. Avoid the **ice-cream cone** (mostly e2e) and **hourglass** (no integration) anti-patterns.
|
|
9
|
+
3. **Coverage is a FLOOR, not a target.** High line coverage is a vanity metric ("a line ran" ≠ "a line is asserted"). Use **mutation testing** (Stryker — already in the project) on critical modules to prove the assertions actually check something; use coverage as the allow-list of what to mutate.
|
|
10
|
+
4. **Shape FOLLOWS architecture — framed correctly.** Don't "pick the diamond/pyramid/trophy." The architecture determines where the testable behavior *lives* → the shape **emerges**. Reason in test **size** (Google): *small* (in-process, no I/O) / *medium* (localhost, real DB) / *large* (multi-machine, e2e).
|
|
11
|
+
|
|
12
|
+
## Shape follows architecture (consume the ADR)
|
|
13
|
+
|
|
14
|
+
Read the architecture decision (`.planning/adr/*.md` or SKELETON). Per subdomain / Axis-A rung:
|
|
15
|
+
|
|
16
|
+
| Architecture (per subdomain) | Primary test level | Why |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| **Domain Model / rich core** | more **small (unit)** tests of the domain logic, through its public API | lots of pure logic, few dependencies — cheap and high-value to unit-test |
|
|
19
|
+
| **Transaction Script / CRUD-over-DB** | more **medium (integration)** tests against a real DB | thin logic, DB-bound — little pure logic to isolate; confidence lives at the DB boundary |
|
|
20
|
+
| **Hexagonal core** | unit-test the domain in isolation (no mocks — it's pure); integration-test the **adapters** against real systems | the architecture literally separates the two |
|
|
21
|
+
| **Many integrations / external APIs** | medium integration tests at the ports; **contract tests** where a 3rd-party can't be seeded | confidence is in the integration, not mock existence |
|
|
22
|
+
| **Bought / off-the-shelf (Generic)** | thin integration smoke at your adapter seam only | don't test the vendor's internals — test your seam |
|
|
23
|
+
|
|
24
|
+
The resulting distribution is an **output** (pyramid-ish for logic-heavy, diamond/trophy-ish for integration-heavy) — never an input you pick.
|
|
25
|
+
|
|
26
|
+
## When unit tests pay off (the gnarly bits)
|
|
27
|
+
|
|
28
|
+
Pure, dependency-light, logic-dense code: **money/currency (integer minor units or exact decimal — NEVER binary float)**, complex conditionals / **state machines**, **parsers**, **algorithms**, pure functions. High branching, cheap to unit-test. Do **not** unit-test trivial glue, getters/setters, or framework code.
|
|
29
|
+
|
|
30
|
+
## What NOT to test / avoiding duplicate coverage
|
|
31
|
+
|
|
32
|
+
- Don't test the same behavior at unit AND integration AND e2e — each behavior once, at the cheapest level.
|
|
33
|
+
- Don't test framework/library code, trivial accessors, or **mock behavior** (testing a mock means you violated behavior-testing).
|
|
34
|
+
- Don't chase a coverage % as a goal; chase behavior coverage + mutation score on critical modules.
|
|
35
|
+
|
|
36
|
+
## TDD — honestly
|
|
37
|
+
|
|
38
|
+
The quality benefit is real, but the evidence favors **small, uniform increments** over *test-first specifically* (controlled studies found test-first vs test-after didn't differ; granularity did). So **mandate: behavior-level tests + small increments + a regression floor.** Keep the **RED step** (watch a test fail) so tests actually test something. Test-first vs test-after is a **knob** (`workflow.tdd_mode`), not dogma.
|
|
39
|
+
|
|
40
|
+
## Persistent vs transient E2E
|
|
41
|
+
|
|
42
|
+
- **Persistent:** a small **smoke / critical-user-journey** suite (auth, payment, core nav) in CI on every PR (<5 min). Keep it lean (≈50–200 well-chosen e2e tests) — e2e is slow/flaky; push coverage down to integration.
|
|
43
|
+
- **Transient:** throwaway e2e to validate a freshly-built flow during the dev loop; **not** kept in CI. Once the behavior is covered more cheaply (integration), delete or demote it.
|
|
44
|
+
|
|
45
|
+
## Output (`TEST-STRATEGY.md`)
|
|
46
|
+
|
|
47
|
+
- Per subdomain/component: the recommended level emphasis (small/medium/large) + the architecture rung that justifies it.
|
|
48
|
+
- The critical-path e2e **smoke list** (persistent).
|
|
49
|
+
- What to unit-test (the gnarly bits) and what **not** to test.
|
|
50
|
+
- Coverage stance (floor) + where mutation testing applies.
|
|
51
|
+
- TDD stance (behavior + small increments; test-first knob).
|
|
52
|
+
|
|
53
|
+
Feeds `add-tests`, `execute-phase`, and `plan-phase`.
|
|
54
|
+
|
|
55
|
+
## Extends existing rigor (keep it all)
|
|
56
|
+
|
|
57
|
+
`TESTING-STANDARDS.md` already enforces real-code-only, no-vacuous-assertions, the typed-surface mandate, `fast-check` property tests for bijective/invariant logic, and Stryker mutation ≥80% on critical modules. This skill adds the **strategic layer** on top — the shape, the what/what-not, the level-per-subdomain. Do not weaken any existing standard.
|
|
58
|
+
|
|
59
|
+
## Test-infrastructure how-to references (read when writing the tests)
|
|
60
|
+
|
|
61
|
+
When the strategy calls for real-dependency integration tests, auth, or e2e, load the focused how-to reference:
|
|
62
|
+
- `@~/.claude/gsd-core/references/test-containers.md` — real DBs/services via Testcontainers (singleton pattern, pinned tags, CI/Ryuk).
|
|
63
|
+
- `@~/.claude/gsd-core/references/db-test-isolation.md` — parallel-safe DB isolation (template DB, db/schema-per-worker, txn rollback).
|
|
64
|
+
- `@~/.claude/gsd-core/references/auth-in-tests.md` — authenticate-once/storageState, token minting, multi-role, JWT vs cookie, one-account-per-worker.
|
|
65
|
+
- `@~/.claude/gsd-core/references/realistic-test-data.md` — synthetic factories by default; anonymized/subset dumps only.
|
|
66
|
+
- `@~/.claude/gsd-core/references/e2e-tiering.md` — persistent smoke vs transient e2e; keep e2e lean.
|
|
67
|
+
- `@~/.claude/gsd-core/references/flaky-test-checklist.md` — fixed clock, seeded RNG, poll-don't-sleep, per-worker isolation.
|
|
68
|
+
|
|
69
|
+
## Anti-patterns
|
|
70
|
+
|
|
71
|
+
- Picking a shape (pyramid/diamond/trophy) as an input instead of letting architecture determine it.
|
|
72
|
+
- Mockist/solitary tests coupled to implementation → brittle, break on refactor.
|
|
73
|
+
- Coverage % as a goal; duplicate coverage across levels.
|
|
74
|
+
- A fat, slow e2e suite as the primary safety net (ice-cream cone).
|
|
75
|
+
- `float` for money.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Thinking Models: Debug Cluster
|
|
2
|
+
|
|
3
|
+
Structured reasoning models for the **debugger** agent. Apply these at decision points during investigation, not continuously. Each model counters a specific documented failure mode.
|
|
4
|
+
|
|
5
|
+
Source: Curated from [thinking-partner](https://github.com/mattnowdev/thinking-partner) model catalog (150+ models). Selected for direct applicability to GSD debugging workflow.
|
|
6
|
+
|
|
7
|
+
## Conflict Resolution
|
|
8
|
+
|
|
9
|
+
**Fault Tree and Hypothesis-Driven are sequential:** Fault Tree FIRST (generate the tree of possible causes), Hypothesis-Driven SECOND (test each branch systematically). Fault Tree provides the map; Hypothesis-Driven provides the discipline to traverse it.
|
|
10
|
+
|
|
11
|
+
## 1. Fault Tree Analysis
|
|
12
|
+
|
|
13
|
+
**Counters:** Jumping to conclusions without systematically mapping failure paths.
|
|
14
|
+
|
|
15
|
+
Before testing any hypothesis, build a fault tree: start with the observed symptom as the root node, then branch into all possible causes at each level (hardware, software, configuration, data, environment). Use AND/OR gates -- some failures require multiple conditions (AND), others have independent triggers (OR). This tree becomes your investigation roadmap. Prioritize branches by likelihood and testability, but do NOT prune branches just because they seem unlikely -- unlikely causes that are easy to test should be tested early.
|
|
16
|
+
|
|
17
|
+
## 2. Hypothesis-Driven Investigation
|
|
18
|
+
|
|
19
|
+
**Counters:** Making random changes and hoping something works -- the "shotgun debugging" anti-pattern.
|
|
20
|
+
|
|
21
|
+
For each hypothesis from the fault tree, follow the strict protocol: PREDICT ("If hypothesis H is correct, then test T should produce result R"), TEST (execute exactly one test), OBSERVE (record the actual result), CONCLUDE (matched = SUPPORTED, failed = ELIMINATED, unexpected = new evidence). Never skip the PREDICT step -- without a prediction, you cannot distinguish a meaningful result from noise. Never change more than one variable per test -- if you change two things and the bug disappears, you don't know which change fixed it.
|
|
22
|
+
|
|
23
|
+
## 3. Occam's Razor
|
|
24
|
+
|
|
25
|
+
**Counters:** Pursuing elaborate explanations when simple ones have not been ruled out.
|
|
26
|
+
|
|
27
|
+
Before investigating complex multi-component interaction bugs, race conditions, or framework-level issues, verify the simple explanations first: typo in variable name, wrong file path, missing import, incorrect config value, stale cache, wrong environment variable. These "boring" causes account for the majority of bugs. Only escalate to complex hypotheses AFTER the simple ones are eliminated. If your current hypothesis requires 3+ things to go wrong simultaneously, step back and look for a single-point failure.
|
|
28
|
+
|
|
29
|
+
## 4. Counterfactual Thinking
|
|
30
|
+
|
|
31
|
+
**Counters:** Failing to isolate causation by not asking "what if we changed just this one thing?"
|
|
32
|
+
|
|
33
|
+
When you have a hypothesis about the root cause, construct a counterfactual: "If I change ONLY this one variable/config/line, the bug should disappear (or appear)." Execute the counterfactual test. If the bug persists after your targeted change, your hypothesis is wrong -- the cause is elsewhere. If the bug disappears, you have strong causal evidence. This is more powerful than correlation ("the bug appeared after deploy X") because it tests the mechanism, not just the timeline.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## When NOT to Think
|
|
38
|
+
|
|
39
|
+
Skip structured reasoning models when the situation does not benefit from them:
|
|
40
|
+
|
|
41
|
+
- **Obvious single-cause bugs** -- If the error message names the exact file, line, and cause (e.g., `TypeError: Cannot read property 'x' of undefined at foo.js:42`), fix it directly. Do not build a fault tree for a null reference with a stack trace.
|
|
42
|
+
- **Reproducing a known fix** -- If you already know the root cause from a previous investigation or the user told you exactly what is wrong, skip hypothesis-driven investigation and go straight to the fix.
|
|
43
|
+
- **Typos, missing imports, wrong paths** -- If Occam's Razor would immediately resolve it, apply the fix without invoking the full model. The model exists for when simple checks fail, not to gate simple checks.
|
|
44
|
+
- **Reading error logs** -- Reading and understanding error output is normal debugging, not a "decision point." Only invoke models when you have multiple plausible hypotheses and need to choose which to test first.
|