specweave 0.1.8 → 0.3.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.md +600 -0
- package/README.md +263 -88
- package/bin/install-all.sh +1 -1
- package/bin/install-commands.sh +3 -3
- package/bin/specweave.js +39 -9
- package/dist/adapters/adapter-base.d.ts +1 -1
- package/dist/adapters/adapter-base.d.ts.map +1 -1
- package/dist/adapters/adapter-base.js +6 -41
- package/dist/adapters/adapter-base.js.map +1 -1
- package/dist/adapters/adapter-interface.js +1 -2
- package/dist/adapters/adapter-interface.js.map +1 -1
- package/dist/adapters/adapter-loader.d.ts +86 -0
- package/dist/adapters/adapter-loader.d.ts.map +1 -0
- package/dist/adapters/adapter-loader.js +216 -0
- package/dist/adapters/adapter-loader.js.map +1 -0
- package/dist/adapters/agents-md-generator.d.ts +48 -0
- package/dist/adapters/agents-md-generator.d.ts.map +1 -0
- package/dist/adapters/agents-md-generator.js +132 -0
- package/dist/adapters/agents-md-generator.js.map +1 -0
- package/dist/adapters/claude/adapter.d.ts +2 -2
- package/dist/adapters/claude/adapter.d.ts.map +1 -1
- package/dist/adapters/claude/adapter.js +5 -42
- package/dist/adapters/claude/adapter.js.map +1 -1
- package/dist/adapters/claude-md-generator.d.ts +78 -0
- package/dist/adapters/claude-md-generator.d.ts.map +1 -0
- package/dist/adapters/claude-md-generator.js +246 -0
- package/dist/adapters/claude-md-generator.js.map +1 -0
- package/dist/adapters/codex/adapter.d.ts +50 -0
- package/dist/adapters/codex/adapter.d.ts.map +1 -0
- package/dist/adapters/codex/adapter.js +316 -0
- package/dist/adapters/codex/adapter.js.map +1 -0
- package/dist/adapters/copilot/adapter.d.ts +10 -9
- package/dist/adapters/copilot/adapter.d.ts.map +1 -1
- package/dist/adapters/copilot/adapter.js +35 -100
- package/dist/adapters/copilot/adapter.js.map +1 -1
- package/dist/adapters/cursor/adapter.d.ts +8 -6
- package/dist/adapters/cursor/adapter.d.ts.map +1 -1
- package/dist/adapters/cursor/adapter.js +47 -130
- package/dist/adapters/cursor/adapter.js.map +1 -1
- package/dist/adapters/doc-generator.d.ts +69 -0
- package/dist/adapters/doc-generator.d.ts.map +1 -0
- package/dist/adapters/doc-generator.js +247 -0
- package/dist/adapters/doc-generator.js.map +1 -0
- package/dist/adapters/gemini/adapter.d.ts +50 -0
- package/dist/adapters/gemini/adapter.d.ts.map +1 -0
- package/dist/adapters/gemini/adapter.js +281 -0
- package/dist/adapters/gemini/adapter.js.map +1 -0
- package/dist/adapters/generic/adapter.d.ts +7 -4
- package/dist/adapters/generic/adapter.d.ts.map +1 -1
- package/dist/adapters/generic/adapter.js +60 -59
- package/dist/adapters/generic/adapter.js.map +1 -1
- package/dist/cli/commands/init.d.ts +3 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +272 -170
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +22 -58
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/list.js +27 -64
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/core/credentials-manager.d.ts +90 -0
- package/dist/core/credentials-manager.d.ts.map +1 -0
- package/dist/core/credentials-manager.js +271 -0
- package/dist/core/credentials-manager.js.map +1 -0
- package/dist/core/project-structure-detector.d.ts +92 -0
- package/dist/core/project-structure-detector.d.ts.map +1 -0
- package/dist/core/project-structure-detector.js +289 -0
- package/dist/core/project-structure-detector.js.map +1 -0
- package/dist/core/rfc-generator-v2.d.ts +149 -0
- package/dist/core/rfc-generator-v2.d.ts.map +1 -0
- package/dist/core/rfc-generator-v2.js +399 -0
- package/dist/core/rfc-generator-v2.js.map +1 -0
- package/dist/core/rfc-generator.d.ts +147 -0
- package/dist/core/rfc-generator.d.ts.map +1 -0
- package/dist/core/rfc-generator.js +434 -0
- package/dist/core/rfc-generator.js.map +1 -0
- package/dist/integrations/ado/ado-client.d.ts +123 -0
- package/dist/integrations/ado/ado-client.d.ts.map +1 -0
- package/dist/integrations/ado/ado-client.js +398 -0
- package/dist/integrations/ado/ado-client.js.map +1 -0
- package/dist/integrations/jira/jira-client.d.ts +139 -0
- package/dist/integrations/jira/jira-client.d.ts.map +1 -0
- package/dist/integrations/jira/jira-client.js +386 -0
- package/dist/integrations/jira/jira-client.js.map +1 -0
- package/dist/integrations/jira/jira-incremental-mapper.d.ts +75 -0
- package/dist/integrations/jira/jira-incremental-mapper.d.ts.map +1 -0
- package/dist/integrations/jira/jira-incremental-mapper.js +474 -0
- package/dist/integrations/jira/jira-incremental-mapper.js.map +1 -0
- package/dist/integrations/jira/jira-mapper.d.ts +105 -0
- package/dist/integrations/jira/jira-mapper.d.ts.map +1 -0
- package/dist/integrations/jira/jira-mapper.js +494 -0
- package/dist/integrations/jira/jira-mapper.js.map +1 -0
- package/dist/testing/test-generator.d.ts +117 -0
- package/dist/testing/test-generator.d.ts.map +1 -0
- package/dist/testing/test-generator.js +370 -0
- package/dist/testing/test-generator.js.map +1 -0
- package/dist/utils/auto-install.d.ts +3 -0
- package/dist/utils/auto-install.d.ts.map +1 -1
- package/dist/utils/auto-install.js +16 -82
- package/dist/utils/auto-install.js.map +1 -1
- package/dist/utils/esm-helpers.d.ts +50 -0
- package/dist/utils/esm-helpers.d.ts.map +1 -0
- package/dist/utils/esm-helpers.js +57 -0
- package/dist/utils/esm-helpers.js.map +1 -0
- package/package.json +16 -7
- package/src/adapters/README.md +1 -2
- package/src/adapters/adapter-base.ts +6 -3
- package/src/adapters/adapter-loader.ts +261 -0
- package/src/adapters/agents-md-generator.ts +162 -0
- package/src/adapters/claude/README.md +6 -14
- package/src/adapters/claude/adapter.ts +4 -4
- package/src/adapters/claude-md-generator.ts +311 -0
- package/src/adapters/codex/README.md +105 -0
- package/src/adapters/codex/adapter.ts +333 -0
- package/src/adapters/copilot/adapter.ts +36 -65
- package/src/adapters/cursor/README.md +0 -2
- package/src/adapters/cursor/adapter.ts +46 -92
- package/src/adapters/doc-generator.ts +331 -0
- package/src/adapters/gemini/README.md +97 -0
- package/src/adapters/gemini/adapter.ts +298 -0
- package/src/adapters/generic/adapter.ts +61 -57
- package/src/adapters/registry.yaml +86 -25
- package/src/agents/devops/AGENT.md +16 -18
- package/src/agents/docs-writer/AGENT.md +2 -2
- package/src/agents/pm/AGENT.md +1 -50
- package/src/commands/README.md +134 -111
- package/src/commands/{build.md → specweave.do.md} +185 -72
- package/src/commands/{done.md → specweave.done.md} +3 -3
- package/src/commands/{inc.md → specweave.inc.md} +4 -4
- package/src/commands/specweave.increment.md +383 -0
- package/src/commands/specweave.md +430 -0
- package/src/commands/specweave.next.md +495 -0
- package/src/commands/specweave.progress.md +258 -0
- package/src/commands/specweave.sync-docs.md +665 -0
- package/src/commands/specweave.sync-github.md +269 -0
- package/src/commands/specweave.sync-jira.md +197 -0
- package/src/commands/{validate.md → specweave.validate.md} +4 -4
- package/src/hooks/README.md +19 -29
- package/src/hooks/post-task-completion.sh +25 -30
- package/src/skills/ado-sync/README.md +1 -36
- package/src/skills/bmad-method-expert/SKILL.md +1 -3
- package/src/skills/brownfield-analyzer/SKILL.md +429 -23
- package/src/skills/brownfield-onboarder/SKILL.md +221 -8
- package/src/skills/context-loader/SKILL.md +239 -617
- package/src/skills/context-optimizer/SKILL.md +0 -30
- package/src/skills/github-sync/SKILL.md +1 -19
- package/src/skills/increment-planner/SKILL.md +64 -18
- package/src/skills/increment-quality-judge/SKILL.md +1 -36
- package/src/skills/jira-sync/README.md +1 -38
- package/src/skills/role-orchestrator/README.md +1 -22
- package/src/skills/role-orchestrator/SKILL.md +1 -59
- package/src/skills/skill-router/SKILL.md +0 -18
- package/src/skills/spec-kit-expert/SKILL.md +1 -3
- package/src/skills/specweave-detector/SKILL.md +225 -275
- package/src/skills/task-builder/README.md +1 -7
- package/src/templates/AGENTS.md.template +334 -0
- package/src/templates/CLAUDE.md.template +131 -297
- package/src/templates/README.md.template +115 -23
- package/src/templates/environments/minimal/README.md +0 -1
- package/INSTALL.md +0 -848
- package/SPECWEAVE.md +0 -711
- package/src/adapters/copilot/.github/copilot/instructions.md +0 -376
- package/src/adapters/cursor/.cursorrules +0 -325
- package/src/adapters/generic/SPECWEAVE-MANUAL.md +0 -676
- package/src/commands/create-project.md +0 -528
- package/src/commands/generate-docs.md +0 -623
- package/src/commands/increment.md +0 -223
- package/src/commands/review-docs.md +0 -331
- package/src/commands/sync-github.md +0 -115
- package/src/skills/ado-sync/test-cases/test-1.yaml +0 -9
- package/src/skills/ado-sync/test-cases/test-2.yaml +0 -8
- package/src/skills/ado-sync/test-cases/test-3.yaml +0 -9
- package/src/skills/bmad-method-expert/test-cases/test-1-placeholder.yaml +0 -12
- package/src/skills/bmad-method-expert/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/bmad-method-expert/test-cases/test-3-placeholder.yaml +0 -12
- package/src/skills/brownfield-analyzer/test-cases/test-1-basic-analysis.yaml +0 -48
- package/src/skills/brownfield-analyzer/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/brownfield-analyzer/test-cases/test-3-placeholder.yaml +0 -12
- package/src/skills/brownfield-onboarder/test-cases/test-1-placeholder.yaml +0 -12
- package/src/skills/brownfield-onboarder/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/brownfield-onboarder/test-cases/test-3-placeholder.yaml +0 -12
- package/src/skills/calendar-system/test-cases/test-1-placeholder.yaml +0 -12
- package/src/skills/calendar-system/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/calendar-system/test-cases/test-3-placeholder.yaml +0 -12
- package/src/skills/context-loader/test-cases/test-1-basic-loading.yaml +0 -39
- package/src/skills/context-loader/test-cases/test-2-token-budget-exceeded.yaml +0 -44
- package/src/skills/context-loader/test-cases/test-3-section-anchors.yaml +0 -45
- package/src/skills/context-optimizer/test-cases/test-1-bug-fix-narrow.yaml +0 -97
- package/src/skills/context-optimizer/test-cases/test-2-feature-focused.yaml +0 -109
- package/src/skills/context-optimizer/test-cases/test-3-architecture-broad.yaml +0 -98
- package/src/skills/cost-optimizer/test-cases/test-1-basic-comparison.yaml +0 -75
- package/src/skills/cost-optimizer/test-cases/test-2-budget-constraint.yaml +0 -52
- package/src/skills/cost-optimizer/test-cases/test-3-scale-requirement.yaml +0 -63
- package/src/skills/cost-optimizer/test-results/README.md +0 -46
- package/src/skills/design-system-architect/test-cases/test-1-token-structure.yaml +0 -23
- package/src/skills/design-system-architect/test-cases/test-2-component-hierarchy.yaml +0 -24
- package/src/skills/design-system-architect/test-cases/test-3-accessibility-checklist.yaml +0 -23
- package/src/skills/diagrams-architect/test-cases/test-1-c4-context.yaml +0 -13
- package/src/skills/diagrams-architect/test-cases/test-2-sequence-diagram.yaml +0 -13
- package/src/skills/diagrams-architect/test-cases/test-3-er-diagram.yaml +0 -13
- package/src/skills/diagrams-generator/test-cases/test-1.yaml +0 -9
- package/src/skills/diagrams-generator/test-cases/test-2.yaml +0 -9
- package/src/skills/diagrams-generator/test-cases/test-3.yaml +0 -8
- package/src/skills/docs-updater/test-cases/test-1-placeholder.yaml +0 -12
- package/src/skills/docs-updater/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/docs-updater/test-cases/test-3-placeholder.yaml +0 -12
- package/src/skills/dotnet-backend/test-cases/test-1-rest-api.yaml +0 -14
- package/src/skills/dotnet-backend/test-cases/test-2-authentication.yaml +0 -13
- package/src/skills/dotnet-backend/test-cases/test-3-minimal-api.yaml +0 -13
- package/src/skills/e2e-playwright/test-cases/TC-001-basic-navigation.yaml +0 -54
- package/src/skills/e2e-playwright/test-cases/TC-002-form-interaction.yaml +0 -64
- package/src/skills/e2e-playwright/test-cases/TC-003-specweave-integration.yaml +0 -74
- package/src/skills/e2e-playwright/test-cases/TC-004-accessibility-check.yaml +0 -98
- package/src/skills/figma-designer/test-cases/test-1-design-system.yaml +0 -13
- package/src/skills/figma-designer/test-cases/test-2-component-library.yaml +0 -13
- package/src/skills/figma-designer/test-cases/test-3-responsive-layout.yaml +0 -13
- package/src/skills/figma-implementer/test-cases/test-1-design-to-react.yaml +0 -13
- package/src/skills/figma-implementer/test-cases/test-2-storybook.yaml +0 -13
- package/src/skills/figma-implementer/test-cases/test-3-design-tokens.yaml +0 -13
- package/src/skills/figma-mcp-connector/test-cases/test-1-read-file-desktop.yaml +0 -22
- package/src/skills/figma-mcp-connector/test-cases/test-2-read-file-framelink.yaml +0 -21
- package/src/skills/figma-mcp-connector/test-cases/test-3-error-handling.yaml +0 -18
- package/src/skills/figma-to-code/test-cases/test-1-token-generation.yaml +0 -29
- package/src/skills/figma-to-code/test-cases/test-2-component-generation.yaml +0 -27
- package/src/skills/figma-to-code/test-cases/test-3-typescript-generation.yaml +0 -28
- package/src/skills/frontend/test-cases/test-1-react-component.yaml +0 -13
- package/src/skills/frontend/test-cases/test-2-form-validation.yaml +0 -13
- package/src/skills/frontend/test-cases/test-3-state-management.yaml +0 -13
- package/src/skills/github-sync/test-cases/test-1-placeholder.yaml +0 -12
- package/src/skills/github-sync/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/github-sync/test-cases/test-3-placeholder.yaml +0 -12
- package/src/skills/hetzner-provisioner/test-cases/test-1-basic-provision.yaml +0 -71
- package/src/skills/hetzner-provisioner/test-cases/test-2-postgres-provision.yaml +0 -85
- package/src/skills/hetzner-provisioner/test-cases/test-3-ssl-config.yaml +0 -126
- package/src/skills/hetzner-provisioner/test-results/README.md +0 -259
- package/src/skills/increment-planner/test-cases/test-1-basic-feature.yaml +0 -27
- package/src/skills/increment-planner/test-cases/test-2-complex-feature.yaml +0 -30
- package/src/skills/increment-planner/test-cases/test-3-auto-numbering.yaml +0 -24
- package/src/skills/increment-quality-judge/test-cases/test-1-good-spec.yaml +0 -95
- package/src/skills/increment-quality-judge/test-cases/test-2-poor-spec.yaml +0 -108
- package/src/skills/increment-quality-judge/test-cases/test-3-export-suggestions.yaml +0 -87
- package/src/skills/jira-sync/test-cases/test-1.yaml +0 -9
- package/src/skills/jira-sync/test-cases/test-2.yaml +0 -9
- package/src/skills/jira-sync/test-cases/test-3.yaml +0 -10
- package/src/skills/nextjs/test-cases/test-1-app-router.yaml +0 -13
- package/src/skills/nextjs/test-cases/test-2-server-actions.yaml +0 -13
- package/src/skills/nextjs/test-cases/test-3-api-routes.yaml +0 -13
- package/src/skills/nodejs-backend/test-cases/test-1-express-api.yaml +0 -13
- package/src/skills/nodejs-backend/test-cases/test-2-prisma-orm.yaml +0 -13
- package/src/skills/nodejs-backend/test-cases/test-3-authentication.yaml +0 -13
- package/src/skills/notification-system/test-cases/test-1-placeholder.yaml +0 -12
- package/src/skills/notification-system/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/notification-system/test-cases/test-3-placeholder.yaml +0 -12
- package/src/skills/python-backend/test-cases/test-1-fastapi-crud.yaml +0 -13
- package/src/skills/python-backend/test-cases/test-2-sqlalchemy.yaml +0 -13
- package/src/skills/python-backend/test-cases/test-3-authentication.yaml +0 -13
- package/src/skills/role-orchestrator/test-cases/test-1-simple-product.yaml +0 -98
- package/src/skills/role-orchestrator/test-cases/test-2-quality-gate-failure.yaml +0 -73
- package/src/skills/role-orchestrator/test-cases/test-3-security-workflow.yaml +0 -121
- package/src/skills/role-orchestrator/test-cases/test-4-parallel-execution.yaml +0 -145
- package/src/skills/role-orchestrator/test-cases/test-5-feedback-loops.yaml +0 -149
- package/src/skills/skill-creator/test-cases/test-1-placeholder.yaml +0 -12
- package/src/skills/skill-creator/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/skill-creator/test-cases/test-3-placeholder.yaml +0 -12
- package/src/skills/skill-router/test-cases/test-1-basic-routing.yaml +0 -33
- package/src/skills/skill-router/test-cases/test-2-ambiguous-request.yaml +0 -42
- package/src/skills/skill-router/test-cases/test-3-nested-orchestration.yaml +0 -50
- package/src/skills/spec-driven-brainstorming/test-cases/TC-001-simple-idea-to-design.yaml +0 -148
- package/src/skills/spec-driven-brainstorming/test-cases/TC-002-complex-ultrathink-design.yaml +0 -190
- package/src/skills/spec-driven-brainstorming/test-cases/TC-003-unclear-requirements-socratic.yaml +0 -233
- package/src/skills/spec-driven-debugging/test-cases/TC-001-simple-auth-bug.yaml +0 -212
- package/src/skills/spec-driven-debugging/test-cases/TC-002-race-condition-ultrathink.yaml +0 -461
- package/src/skills/spec-driven-debugging/test-cases/TC-003-brownfield-missing-spec.yaml +0 -366
- package/src/skills/spec-kit-expert/test-cases/test-1-placeholder.yaml +0 -12
- package/src/skills/spec-kit-expert/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/spec-kit-expert/test-cases/test-3-placeholder.yaml +0 -12
- package/src/skills/specweave-ado-mapper/test-cases/test-1-export-to-ado.yaml +0 -13
- package/src/skills/specweave-ado-mapper/test-cases/test-2-import-from-ado.yaml +0 -13
- package/src/skills/specweave-ado-mapper/test-cases/test-3-bidirectional-sync.yaml +0 -13
- package/src/skills/specweave-detector/test-cases/test-1-basic-detection.yaml +0 -37
- package/src/skills/specweave-detector/test-cases/test-2-missing-config.yaml +0 -37
- package/src/skills/specweave-detector/test-cases/test-3-non-specweave-project.yaml +0 -34
- package/src/skills/specweave-jira-mapper/test-cases/test-1-export-to-jira.yaml +0 -13
- package/src/skills/specweave-jira-mapper/test-cases/test-2-import-from-jira.yaml +0 -13
- package/src/skills/specweave-jira-mapper/test-cases/test-3-sync-status.yaml +0 -13
- package/src/skills/stripe-integrator/test-cases/test-1-placeholder.yaml +0 -12
- package/src/skills/stripe-integrator/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/stripe-integrator/test-cases/test-3-placeholder.yaml +0 -12
- package/src/skills/task-builder/test-cases/test-1-placeholder.yaml +0 -12
- package/src/skills/task-builder/test-cases/test-2-placeholder.yaml +0 -12
- package/src/skills/task-builder/test-cases/test-3-placeholder.yaml +0 -12
- package/src/templates/config.yaml +0 -351
- /package/src/commands/{list-increments.md → specweave.list-increments.md} +0 -0
package/src/skills/spec-driven-brainstorming/test-cases/TC-002-complex-ultrathink-design.yaml
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Complex Problem with Ultrathink Mode"
|
|
3
|
-
description: "Handle a complex distributed systems problem using ultrathink for deep reasoning"
|
|
4
|
-
skill: spec-driven-brainstorming
|
|
5
|
-
priority: P2
|
|
6
|
-
estimated_time: "20-30 minutes"
|
|
7
|
-
|
|
8
|
-
input:
|
|
9
|
-
prompt: "I need a distributed task queue with exactly-once delivery guarantees for processing financial transactions"
|
|
10
|
-
context:
|
|
11
|
-
existing_project: false
|
|
12
|
-
complexity: "High"
|
|
13
|
-
domain: "Financial systems"
|
|
14
|
-
requirements:
|
|
15
|
-
- "Exactly-once delivery semantics"
|
|
16
|
-
- "High throughput (10K+ tasks/sec)"
|
|
17
|
-
- "Audit trail for compliance"
|
|
18
|
-
- "Fault tolerance and disaster recovery"
|
|
19
|
-
|
|
20
|
-
expected_output:
|
|
21
|
-
phase_1_understanding:
|
|
22
|
-
questions_asked:
|
|
23
|
-
- "What types of financial transactions?" # payments, transfers, reconciliation
|
|
24
|
-
- "What's your scale and peak load?" # concurrent tasks, daily volume
|
|
25
|
-
- "Compliance requirements?" # SOC2, PCI-DSS, audit logs
|
|
26
|
-
- "Acceptable latency?" # real-time vs batch processing
|
|
27
|
-
- "Budget constraints?" # cloud costs, team size
|
|
28
|
-
|
|
29
|
-
gathered_requirements:
|
|
30
|
-
purpose: "Process payment transactions with guaranteed exactly-once delivery"
|
|
31
|
-
constraints:
|
|
32
|
-
- "Must maintain audit trail for 7 years"
|
|
33
|
-
- "Compliance: PCI-DSS, SOC2"
|
|
34
|
-
- "Peak load: 10K tasks/sec"
|
|
35
|
-
- "Latency: <500ms p99"
|
|
36
|
-
success_criteria:
|
|
37
|
-
- "Zero duplicate transactions"
|
|
38
|
-
- "99.99% uptime SLA"
|
|
39
|
-
- "Complete audit trail"
|
|
40
|
-
|
|
41
|
-
phase_2_tech_stack:
|
|
42
|
-
detected_stack: null # greenfield
|
|
43
|
-
|
|
44
|
-
stack_question_asked: true
|
|
45
|
-
|
|
46
|
-
options_presented:
|
|
47
|
-
- "Go + PostgreSQL" # strong concurrency, SQL for audit
|
|
48
|
-
- "Node.js + Redis + PostgreSQL" # JavaScript ecosystem, Redis for queue
|
|
49
|
-
- "Python + Celery + RabbitMQ + PostgreSQL" # mature queue system
|
|
50
|
-
|
|
51
|
-
user_selection: "Go + PostgreSQL"
|
|
52
|
-
|
|
53
|
-
phase_3_exploration:
|
|
54
|
-
ultrathink_suggested: true
|
|
55
|
-
ultrathink_reason: "Complex distributed systems problem with many trade-offs around consistency, fault tolerance, and exactly-once semantics"
|
|
56
|
-
|
|
57
|
-
thinking_tokens_used: 31999 # full ultrathink budget
|
|
58
|
-
|
|
59
|
-
approaches_proposed: 3
|
|
60
|
-
|
|
61
|
-
approach_1:
|
|
62
|
-
name: "Event Sourcing with Outbox Pattern"
|
|
63
|
-
architecture: "Write events to DB, background processor publishes to queue"
|
|
64
|
-
trade_offs:
|
|
65
|
-
pros:
|
|
66
|
-
- "Exactly-once delivery via DB transactions"
|
|
67
|
-
- "Complete audit trail built-in"
|
|
68
|
-
- "Easy to replay events"
|
|
69
|
-
cons:
|
|
70
|
-
- "Higher latency (dual writes)"
|
|
71
|
-
- "Complex event schema evolution"
|
|
72
|
-
consistency: "Strong (ACID transactions)"
|
|
73
|
-
complexity: "High"
|
|
74
|
-
cost: "Medium (DB I/O intensive)"
|
|
75
|
-
|
|
76
|
-
approach_2:
|
|
77
|
-
name: "Idempotent Task Queue with Distributed Locks"
|
|
78
|
-
architecture: "Redis queue + PostgreSQL state tracking + distributed locks"
|
|
79
|
-
trade_offs:
|
|
80
|
-
pros:
|
|
81
|
-
- "Lower latency (in-memory queue)"
|
|
82
|
-
- "Horizontal scaling easier"
|
|
83
|
-
cons:
|
|
84
|
-
- "Requires careful lock management"
|
|
85
|
-
- "Risk of phantom duplicate if lock expires"
|
|
86
|
-
consistency: "Eventual (with idempotency keys)"
|
|
87
|
-
complexity: "Very High"
|
|
88
|
-
cost: "High (Redis cluster + PostgreSQL)"
|
|
89
|
-
|
|
90
|
-
approach_3:
|
|
91
|
-
name: "Transactional Outbox with Change Data Capture (CDC)"
|
|
92
|
-
architecture: "Write to DB, CDC streams changes to queue"
|
|
93
|
-
trade_offs:
|
|
94
|
-
pros:
|
|
95
|
-
- "Best of both worlds: ACID + async processing"
|
|
96
|
-
- "At-least-once delivery, idempotent consumers for exactly-once effect"
|
|
97
|
-
- "Built-in audit trail"
|
|
98
|
-
cons:
|
|
99
|
-
- "Requires CDC infrastructure (Debezium, Kafka Connect)"
|
|
100
|
-
- "Operational complexity"
|
|
101
|
-
consistency: "Strong write, eventual propagation"
|
|
102
|
-
complexity: "High (infrastructure)"
|
|
103
|
-
cost: "High (Kafka/CDC infrastructure)"
|
|
104
|
-
|
|
105
|
-
user_selection: "Approach 1" # Event Sourcing with Outbox
|
|
106
|
-
|
|
107
|
-
edge_cases_analyzed:
|
|
108
|
-
- "Database connection failure during transaction"
|
|
109
|
-
- "Task processor crashes mid-processing"
|
|
110
|
-
- "Network partition between queue and DB"
|
|
111
|
-
- "Clock skew in distributed environment"
|
|
112
|
-
- "Idempotency key collision"
|
|
113
|
-
|
|
114
|
-
phase_4_design_validation:
|
|
115
|
-
sections_presented:
|
|
116
|
-
- title: "Architecture Overview (Ultrathink Analysis)"
|
|
117
|
-
content: "Event sourcing + outbox pattern ensures exactly-once via DB transactions. Analyzed 5 edge cases for consistency guarantees."
|
|
118
|
-
validated: true
|
|
119
|
-
|
|
120
|
-
- title: "Components (with Fault Tolerance)"
|
|
121
|
-
content: "Event store (PostgreSQL), outbox processor (Go workers), task queue (Redis Streams), dead letter queue for failures"
|
|
122
|
-
validated: true
|
|
123
|
-
|
|
124
|
-
- title: "Data Flow (Transactional Guarantees)"
|
|
125
|
-
content: "Transaction starts → Write event to event_store → Write to outbox → Commit (ACID) → Background worker polls outbox → Publishes to queue → Marks processed"
|
|
126
|
-
validated: true
|
|
127
|
-
|
|
128
|
-
- title: "Exactly-Once Semantics (Implementation)"
|
|
129
|
-
content: "Idempotency keys (UUID v4), transaction boundaries, at-least-once delivery + idempotent consumers = exactly-once effect"
|
|
130
|
-
validated: true
|
|
131
|
-
|
|
132
|
-
- title: "Error Handling & Recovery"
|
|
133
|
-
content: "Retry with exponential backoff, dead letter queue after 3 retries, circuit breaker, health checks"
|
|
134
|
-
validated: true
|
|
135
|
-
|
|
136
|
-
- title: "Audit Trail & Compliance"
|
|
137
|
-
content: "Event sourcing provides complete history, immutable event log, 7-year retention in cold storage (S3 Glacier)"
|
|
138
|
-
validated: true
|
|
139
|
-
|
|
140
|
-
- title: "Testing Strategy (Chaos Engineering)"
|
|
141
|
-
content: "Unit tests (logic), integration tests (DB transactions), E2E tests (full flow), chaos tests (network failures, DB crashes)"
|
|
142
|
-
validated: true
|
|
143
|
-
|
|
144
|
-
- title: "Performance & Scale Analysis"
|
|
145
|
-
content: "Throughput: 10K tasks/sec achievable with 5 workers, latency: p99 <500ms, bottleneck: DB writes (optimize with batching)"
|
|
146
|
-
validated: true
|
|
147
|
-
|
|
148
|
-
design_complete: true
|
|
149
|
-
complexity_justified: true
|
|
150
|
-
|
|
151
|
-
phase_5_specweave_handoff:
|
|
152
|
-
handoff_type: "Full Increment Creation with Architecture Focus"
|
|
153
|
-
skill_invoked: "increment-planner"
|
|
154
|
-
|
|
155
|
-
expected_increment:
|
|
156
|
-
directory: ".specweave/increments/0001-distributed-task-queue/"
|
|
157
|
-
files:
|
|
158
|
-
- "spec.md" # references strategy/distributed-systems/
|
|
159
|
-
- "plan.md" # references architecture/distributed-systems/
|
|
160
|
-
- "tasks.md"
|
|
161
|
-
- "tests.md" # includes chaos engineering tests
|
|
162
|
-
- "context-manifest.yaml"
|
|
163
|
-
|
|
164
|
-
agents_invoked:
|
|
165
|
-
- "pm" # Financial transaction requirements
|
|
166
|
-
- "architect" # Distributed systems design + ADRs
|
|
167
|
-
- "security" # PCI-DSS, audit compliance
|
|
168
|
-
- "qa-lead" # Chaos engineering test strategy
|
|
169
|
-
|
|
170
|
-
validation:
|
|
171
|
-
- "Phase 1: Domain-specific questions asked (financial, compliance)"
|
|
172
|
-
- "Phase 2: Tech stack selection with 3 options"
|
|
173
|
-
- "Phase 3: Ultrathink mode suggested and used"
|
|
174
|
-
- "Phase 3: Edge cases explicitly analyzed"
|
|
175
|
-
- "Phase 3: Consistency models compared (strong vs eventual)"
|
|
176
|
-
- "Phase 4: Design sections include fault tolerance and recovery"
|
|
177
|
-
- "Phase 4: Performance analysis with specific numbers"
|
|
178
|
-
- "Phase 5: Security agent invoked due to compliance needs"
|
|
179
|
-
- "Exactly-once semantics clearly explained"
|
|
180
|
-
|
|
181
|
-
expected_errors: []
|
|
182
|
-
|
|
183
|
-
success_criteria:
|
|
184
|
-
- "Ultrathink mode activated for complex reasoning"
|
|
185
|
-
- "Edge cases thoroughly analyzed"
|
|
186
|
-
- "Consistency guarantees proven"
|
|
187
|
-
- "Compliance requirements addressed"
|
|
188
|
-
- "Performance targets validated"
|
|
189
|
-
- "Ready for production-grade implementation"
|
|
190
|
-
---
|
package/src/skills/spec-driven-brainstorming/test-cases/TC-003-unclear-requirements-socratic.yaml
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Unclear Requirements with Socratic Questioning"
|
|
3
|
-
description: "Handle vague user input through Socratic questioning to clarify requirements before design"
|
|
4
|
-
skill: spec-driven-brainstorming
|
|
5
|
-
priority: P1
|
|
6
|
-
estimated_time: "15-20 minutes"
|
|
7
|
-
|
|
8
|
-
input:
|
|
9
|
-
prompt: "I want to build something with crypto prices"
|
|
10
|
-
context:
|
|
11
|
-
existing_project: true
|
|
12
|
-
tech_stack: "Unknown (needs detection)"
|
|
13
|
-
requirements_clarity: "Very Low"
|
|
14
|
-
user_goal_clarity: "Unclear"
|
|
15
|
-
|
|
16
|
-
expected_output:
|
|
17
|
-
phase_1_understanding:
|
|
18
|
-
announcement: "I'm using spec-driven brainstorming to refine your idea. Let me understand what you're trying to achieve."
|
|
19
|
-
|
|
20
|
-
socratic_questioning_sequence:
|
|
21
|
-
question_1:
|
|
22
|
-
question: "What's your primary goal with crypto prices?"
|
|
23
|
-
tool_used: "AskUserQuestion"
|
|
24
|
-
options:
|
|
25
|
-
- "Real-time price tracking dashboard"
|
|
26
|
-
- "Price alerts and notifications"
|
|
27
|
-
- "Historical data analysis"
|
|
28
|
-
- "Automated trading bot"
|
|
29
|
-
user_answer: "Real-time price tracking dashboard"
|
|
30
|
-
|
|
31
|
-
question_2:
|
|
32
|
-
question: "Who will use this dashboard?"
|
|
33
|
-
tool_used: "Open-ended" # allowing freeform answer
|
|
34
|
-
user_answer: "Just me and maybe a few friends"
|
|
35
|
-
|
|
36
|
-
question_3:
|
|
37
|
-
question: "How many cryptocurrencies do you want to track?"
|
|
38
|
-
tool_used: "AskUserQuestion"
|
|
39
|
-
options:
|
|
40
|
-
- "Top 10 only (BTC, ETH, etc.)"
|
|
41
|
-
- "Top 100 cryptocurrencies"
|
|
42
|
-
- "Custom watchlist (user-selected)"
|
|
43
|
-
- "All available (1000+)"
|
|
44
|
-
user_answer: "Custom watchlist"
|
|
45
|
-
|
|
46
|
-
question_4:
|
|
47
|
-
question: "What's your update frequency requirement?"
|
|
48
|
-
tool_used: "AskUserQuestion"
|
|
49
|
-
options:
|
|
50
|
-
- "Real-time (every second, WebSocket)" # expensive
|
|
51
|
-
- "Near real-time (every 10-30 seconds, polling)" # balanced
|
|
52
|
-
- "Periodic (every few minutes, cron job)" # cheap
|
|
53
|
-
user_answer: "Near real-time (every 10-30 seconds)"
|
|
54
|
-
|
|
55
|
-
question_5:
|
|
56
|
-
question: "Any budget or hosting constraints?"
|
|
57
|
-
tool_used: "Open-ended"
|
|
58
|
-
user_answer: "Want to keep it cheap, maybe under $20/month"
|
|
59
|
-
|
|
60
|
-
question_6:
|
|
61
|
-
question: "Do you need historical price charts or just current prices?"
|
|
62
|
-
tool_used: "AskUserQuestion"
|
|
63
|
-
options:
|
|
64
|
-
- "Current prices only (simpler)"
|
|
65
|
-
- "Basic charts (1 day, 1 week, 1 month)" # medium complexity
|
|
66
|
-
- "Advanced charts with indicators (candlesticks, RSI, MACD)" # high complexity
|
|
67
|
-
user_answer: "Basic charts"
|
|
68
|
-
|
|
69
|
-
gathered_requirements:
|
|
70
|
-
purpose: "Personal crypto price dashboard with basic charts"
|
|
71
|
-
users: "Personal use (1-5 users)"
|
|
72
|
-
functional_requirements:
|
|
73
|
-
- "Track custom watchlist of cryptocurrencies"
|
|
74
|
-
- "Display current prices with 10-30 second updates"
|
|
75
|
-
- "Show basic charts (1 day, 1 week, 1 month)"
|
|
76
|
-
constraints:
|
|
77
|
-
- "Budget: $20/month or less"
|
|
78
|
-
- "Simple deployment (not enterprise-scale)"
|
|
79
|
-
success_criteria:
|
|
80
|
-
- "Dashboard loads in <2 seconds"
|
|
81
|
-
- "Prices update every 10-30 seconds"
|
|
82
|
-
- "Charts display historical data"
|
|
83
|
-
- "Add/remove cryptos from watchlist"
|
|
84
|
-
|
|
85
|
-
revisit_count: 1 # user revealed new constraint (budget) → re-clarified
|
|
86
|
-
flexibility_demonstrated: true # went back to refine budget impact
|
|
87
|
-
|
|
88
|
-
phase_2_tech_stack:
|
|
89
|
-
detection_attempt:
|
|
90
|
-
files_searched:
|
|
91
|
-
- "package.json"
|
|
92
|
-
- "requirements.txt"
|
|
93
|
-
- "*.csproj"
|
|
94
|
-
found: "package.json"
|
|
95
|
-
|
|
96
|
-
detected_stack:
|
|
97
|
-
framework: "Next.js 14"
|
|
98
|
-
language: "TypeScript"
|
|
99
|
-
database: null # needs to ask
|
|
100
|
-
|
|
101
|
-
database_question:
|
|
102
|
-
question: "Do you have a database set up, or should we use a lightweight option?"
|
|
103
|
-
tool_used: "AskUserQuestion"
|
|
104
|
-
options:
|
|
105
|
-
- "No database (store watchlist in localStorage)" # simplest, no backend needed
|
|
106
|
-
- "SQLite (lightweight, no hosting cost)" # simple, local file
|
|
107
|
-
- "PostgreSQL (more robust, requires hosting)" # production-ready, $5-10/month
|
|
108
|
-
user_answer: "SQLite"
|
|
109
|
-
|
|
110
|
-
skills_activated:
|
|
111
|
-
- "nextjs"
|
|
112
|
-
- "nodejs-backend"
|
|
113
|
-
- "frontend" # for React components
|
|
114
|
-
|
|
115
|
-
phase_3_exploration:
|
|
116
|
-
approaches_proposed: 3
|
|
117
|
-
|
|
118
|
-
approach_1:
|
|
119
|
-
name: "Server-Side Rendering (SSR) with API Polling"
|
|
120
|
-
architecture: "Next.js SSR fetches prices on each request"
|
|
121
|
-
trade_offs:
|
|
122
|
-
pros:
|
|
123
|
-
- "Simple implementation"
|
|
124
|
-
- "No WebSocket complexity"
|
|
125
|
-
- "Works on any hosting (Vercel free tier)"
|
|
126
|
-
cons:
|
|
127
|
-
- "Not truly real-time (page refresh needed)"
|
|
128
|
-
- "Higher API call volume (one per user request)"
|
|
129
|
-
cost: "$0 (Vercel free tier)"
|
|
130
|
-
complexity: "Low"
|
|
131
|
-
|
|
132
|
-
approach_2:
|
|
133
|
-
name: "Client-Side Polling with SWR"
|
|
134
|
-
architecture: "Next.js static + client polls API every 10 seconds"
|
|
135
|
-
trade_offs:
|
|
136
|
-
pros:
|
|
137
|
-
- "Near real-time without WebSockets"
|
|
138
|
-
- "SWR caching reduces API calls"
|
|
139
|
-
- "Static export possible"
|
|
140
|
-
cons:
|
|
141
|
-
- "More client-side logic"
|
|
142
|
-
- "Battery drain on mobile"
|
|
143
|
-
cost: "$0 (Vercel free tier or static hosting)"
|
|
144
|
-
complexity: "Low"
|
|
145
|
-
|
|
146
|
-
approach_3:
|
|
147
|
-
name: "Server-Sent Events (SSE) with Price Streaming"
|
|
148
|
-
architecture: "Backend streams price updates via SSE to clients"
|
|
149
|
-
trade_offs:
|
|
150
|
-
pros:
|
|
151
|
-
- "True push updates (no polling)"
|
|
152
|
-
- "Lower client battery usage"
|
|
153
|
-
- "More efficient than polling"
|
|
154
|
-
cons:
|
|
155
|
-
- "Requires long-lived server connections"
|
|
156
|
-
- "More complex backend"
|
|
157
|
-
- "Not supported on all hosting (Vercel has limits)"
|
|
158
|
-
cost: "$5-10/month (Railway or DigitalOcean)"
|
|
159
|
-
complexity: "Medium"
|
|
160
|
-
|
|
161
|
-
budget_impact_highlighted: true
|
|
162
|
-
user_selection: "Approach 2" # Client-side polling with SWR (fits budget)
|
|
163
|
-
|
|
164
|
-
phase_4_design_validation:
|
|
165
|
-
sections_presented:
|
|
166
|
-
- title: "Architecture Overview"
|
|
167
|
-
content: "Next.js 14 with App Router, client-side polling using SWR for price updates, SQLite for watchlist storage, CoinGecko API (free tier)"
|
|
168
|
-
validated: true
|
|
169
|
-
|
|
170
|
-
- title: "Components"
|
|
171
|
-
content: "Dashboard page (price grid), chart component (recharts), watchlist manager (add/remove), price API route (/api/prices)"
|
|
172
|
-
validated: true
|
|
173
|
-
|
|
174
|
-
- title: "Data Flow"
|
|
175
|
-
content: "User opens dashboard → SWR fetches /api/prices → Backend calls CoinGecko API → Cache for 10s → Return to client → Recharts renders → SWR auto-refetches every 10s"
|
|
176
|
-
validated: true
|
|
177
|
-
|
|
178
|
-
- title: "Error Handling"
|
|
179
|
-
content: "API rate limit → show cached data + warning, network failure → retry 3x with exponential backoff, invalid crypto symbol → show error state"
|
|
180
|
-
validated: true
|
|
181
|
-
|
|
182
|
-
- title: "Testing Strategy"
|
|
183
|
-
content: "Unit tests (price formatting), integration tests (API routes), E2E tests (Playwright: add crypto, view chart, polling works)"
|
|
184
|
-
validated: true
|
|
185
|
-
|
|
186
|
-
- title: "Performance & Cost"
|
|
187
|
-
content: "CoinGecko free tier: 50 calls/min (sufficient), Vercel free tier: unlimited deployments, estimated cost: $0/month"
|
|
188
|
-
validated: true
|
|
189
|
-
|
|
190
|
-
design_complete: true
|
|
191
|
-
budget_constraint_met: true
|
|
192
|
-
|
|
193
|
-
phase_5_specweave_handoff:
|
|
194
|
-
handoff_type: "Quick Increment (Fast Start)" # personal project, not enterprise
|
|
195
|
-
|
|
196
|
-
reason: "Personal project with clear, simple requirements - full documentation can be added incrementally"
|
|
197
|
-
|
|
198
|
-
expected_increment:
|
|
199
|
-
directory: ".specweave/increments/0001-crypto-dashboard/"
|
|
200
|
-
files:
|
|
201
|
-
- "spec.md" # WHAT & WHY (custom watchlist, near real-time, budget-conscious)
|
|
202
|
-
- "plan.md" # HOW (Next.js, SWR polling, SQLite, CoinGecko API)
|
|
203
|
-
- "tasks.md" # implementation checklist
|
|
204
|
-
- "tests.md" # E2E with Playwright (dashboard loads, prices update, chart renders)
|
|
205
|
-
- "context-manifest.yaml" # minimal context (nextjs, frontend skills)
|
|
206
|
-
|
|
207
|
-
agents_invoked:
|
|
208
|
-
- "pm" # minimal (personal project)
|
|
209
|
-
- "qa-lead" # E2E test strategy
|
|
210
|
-
|
|
211
|
-
validation:
|
|
212
|
-
- "Phase 1: Socratic questioning sequence (at least 5 questions)"
|
|
213
|
-
- "Phase 1: Requirements gathered incrementally through dialogue"
|
|
214
|
-
- "Phase 1: Demonstrated flexibility (revisited earlier question when new constraint revealed)"
|
|
215
|
-
- "Phase 2: Tech stack detected from existing files"
|
|
216
|
-
- "Phase 2: Database option asked separately"
|
|
217
|
-
- "Phase 3: Budget impact explicitly highlighted in approaches"
|
|
218
|
-
- "Phase 3: Cost estimates provided for each approach"
|
|
219
|
-
- "Phase 4: Budget constraint validated in performance section"
|
|
220
|
-
- "Phase 5: Quick increment chosen (appropriate for personal project)"
|
|
221
|
-
- "AskUserQuestion used for structured choices"
|
|
222
|
-
- "Open-ended questions used for context gathering"
|
|
223
|
-
- "ONE question at a time in Phase 1"
|
|
224
|
-
|
|
225
|
-
expected_errors: []
|
|
226
|
-
|
|
227
|
-
success_criteria:
|
|
228
|
-
- "Vague input clarified through questioning"
|
|
229
|
-
- "Requirements extracted from dialogue"
|
|
230
|
-
- "Budget constraint met ($0/month vs $20/month budget)"
|
|
231
|
-
- "Appropriate handoff type chosen (quick vs full)"
|
|
232
|
-
- "Design ready for implementation"
|
|
233
|
-
---
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Simple Authentication Bug with Spec Alignment"
|
|
3
|
-
description: "Debug a login failure where code doesn't match spec.md requirements"
|
|
4
|
-
skill: spec-driven-debugging
|
|
5
|
-
priority: P1
|
|
6
|
-
estimated_time: "15-20 minutes"
|
|
7
|
-
|
|
8
|
-
input:
|
|
9
|
-
prompt: "Login is failing with '401 Unauthorized' even with correct credentials"
|
|
10
|
-
context:
|
|
11
|
-
project_type: "Next.js 14 + TypeScript"
|
|
12
|
-
increment: ".specweave/increments/0001-user-authentication/"
|
|
13
|
-
files_exist:
|
|
14
|
-
- "spec.md"
|
|
15
|
-
- "plan.md"
|
|
16
|
-
- "tests.md"
|
|
17
|
-
- "src/app/api/auth/[...nextauth]/route.ts"
|
|
18
|
-
- "src/middleware.ts"
|
|
19
|
-
error_message: "401 Unauthorized - Invalid credentials"
|
|
20
|
-
reproduction: "Consistent - happens every login attempt"
|
|
21
|
-
|
|
22
|
-
expected_output:
|
|
23
|
-
phase_0_context_loading:
|
|
24
|
-
announcement: "Let me load the SpecWeave context before investigating."
|
|
25
|
-
|
|
26
|
-
files_loaded:
|
|
27
|
-
- path: ".specweave/increments/0001-user-authentication/spec.md"
|
|
28
|
-
key_findings:
|
|
29
|
-
- "FR-001: Users must be able to login with email and password"
|
|
30
|
-
- "FR-002: Passwords must be hashed with bcrypt (minimum 10 salt rounds)"
|
|
31
|
-
- "FR-003: JWT tokens expire after 7 days"
|
|
32
|
-
- "Acceptance: TC-001: Valid credentials → successful login"
|
|
33
|
-
|
|
34
|
-
- path: ".specweave/increments/0001-user-authentication/plan.md"
|
|
35
|
-
key_findings:
|
|
36
|
-
- "NextAuth.js v5 with Credentials provider"
|
|
37
|
-
- "PostgreSQL adapter for session storage"
|
|
38
|
-
- "bcrypt for password hashing"
|
|
39
|
-
|
|
40
|
-
- path: ".specweave/increments/0001-user-authentication/tests.md"
|
|
41
|
-
key_findings:
|
|
42
|
-
- "TC-005: Login with valid credentials should return 200"
|
|
43
|
-
- "TC-006: Login with invalid credentials should return 401"
|
|
44
|
-
|
|
45
|
-
bug_classification: "Likely code bug - implementation doesn't match spec"
|
|
46
|
-
|
|
47
|
-
phase_1_root_cause:
|
|
48
|
-
error_analysis:
|
|
49
|
-
message: "401 Unauthorized - Invalid credentials"
|
|
50
|
-
stack_trace_relevant: false # not a crash, just wrong response
|
|
51
|
-
line_numbers: "src/app/api/auth/[...nextauth]/route.ts:45"
|
|
52
|
-
|
|
53
|
-
reproduction:
|
|
54
|
-
consistent: true
|
|
55
|
-
steps:
|
|
56
|
-
- "Navigate to /login"
|
|
57
|
-
- "Enter email: test@example.com, password: Test123!"
|
|
58
|
-
- "Click submit"
|
|
59
|
-
- "Observe: 401 error"
|
|
60
|
-
|
|
61
|
-
recent_changes:
|
|
62
|
-
git_diff_findings:
|
|
63
|
-
- "Recently updated password hashing from md5 to bcrypt"
|
|
64
|
-
- "Changed salt rounds from 8 to 12"
|
|
65
|
-
|
|
66
|
-
spec_comparison:
|
|
67
|
-
spec_says: "Passwords must be hashed with bcrypt (minimum 10 salt rounds)"
|
|
68
|
-
actual_behavior: "Login always fails with valid credentials"
|
|
69
|
-
discrepancy: "Code may not be comparing hashed passwords correctly"
|
|
70
|
-
|
|
71
|
-
multi_component_check:
|
|
72
|
-
frontend: "✓ Sends correct email/password"
|
|
73
|
-
api_route: "⚠️ Receives correct data but returns 401"
|
|
74
|
-
database: "✓ User exists in DB with bcrypt hash"
|
|
75
|
-
|
|
76
|
-
data_flow_trace:
|
|
77
|
-
- step: "Frontend sends {email, password} to /api/auth/signin"
|
|
78
|
-
status: "✓ Correct"
|
|
79
|
-
- step: "API route calls authorize() function"
|
|
80
|
-
status: "⚠️ Here's where it fails"
|
|
81
|
-
- step: "authorize() queries user from DB"
|
|
82
|
-
status: "✓ User found"
|
|
83
|
-
- step: "authorize() compares passwords"
|
|
84
|
-
status: "❌ Always returns false"
|
|
85
|
-
|
|
86
|
-
root_cause_hypothesis: "Password comparison logic is incorrect after bcrypt migration"
|
|
87
|
-
|
|
88
|
-
phase_2_pattern_analysis:
|
|
89
|
-
working_examples_found:
|
|
90
|
-
- file: "src/app/api/users/[id]/route.ts"
|
|
91
|
-
pattern: "Uses bcrypt.compare(plaintext, hash) correctly"
|
|
92
|
-
code: |
|
|
93
|
-
const isValid = await bcrypt.compare(password, user.password);
|
|
94
|
-
|
|
95
|
-
broken_code:
|
|
96
|
-
file: "src/app/api/auth/[...nextauth]/route.ts:45"
|
|
97
|
-
code: |
|
|
98
|
-
const isValid = await bcrypt.compare(user.password, password); // WRONG ORDER!
|
|
99
|
-
|
|
100
|
-
difference_identified:
|
|
101
|
-
issue: "Arguments to bcrypt.compare() are reversed"
|
|
102
|
-
working: "bcrypt.compare(plaintext, hash)"
|
|
103
|
-
broken: "bcrypt.compare(hash, plaintext)"
|
|
104
|
-
impact: "Always returns false because it's trying to hash the hash"
|
|
105
|
-
|
|
106
|
-
phase_3_hypothesis:
|
|
107
|
-
hypothesis: "bcrypt.compare() arguments are in wrong order (hash first instead of plaintext first)"
|
|
108
|
-
|
|
109
|
-
classification: "Code bug - implementation error, spec is correct"
|
|
110
|
-
|
|
111
|
-
minimal_test:
|
|
112
|
-
approach: "Swap arguments in bcrypt.compare() call"
|
|
113
|
-
change_size: "Single line change"
|
|
114
|
-
one_variable: true
|
|
115
|
-
|
|
116
|
-
phase_4_implementation:
|
|
117
|
-
fix_level: "Code-level fix"
|
|
118
|
-
reason: "Spec is clear and correct, code has logic error"
|
|
119
|
-
|
|
120
|
-
test_creation:
|
|
121
|
-
level: "Level 3: Code Tests (Integration test)"
|
|
122
|
-
file: "tests/integration/auth.test.ts"
|
|
123
|
-
test_case: |
|
|
124
|
-
describe('Authentication', () => {
|
|
125
|
-
it('should login successfully with valid credentials', async () => {
|
|
126
|
-
const response = await fetch('/api/auth/signin', {
|
|
127
|
-
method: 'POST',
|
|
128
|
-
body: JSON.stringify({
|
|
129
|
-
email: 'test@example.com',
|
|
130
|
-
password: 'Test123!'
|
|
131
|
-
})
|
|
132
|
-
});
|
|
133
|
-
expect(response.status).toBe(200);
|
|
134
|
-
expect(response.body.user).toBeDefined();
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
test_fails_before_fix: true
|
|
139
|
-
|
|
140
|
-
spec_update_needed: false # spec was correct
|
|
141
|
-
|
|
142
|
-
code_fix:
|
|
143
|
-
file: "src/app/api/auth/[...nextauth]/route.ts"
|
|
144
|
-
before: |
|
|
145
|
-
const isValid = await bcrypt.compare(user.password, password);
|
|
146
|
-
after: |
|
|
147
|
-
const isValid = await bcrypt.compare(password, user.password);
|
|
148
|
-
|
|
149
|
-
verification:
|
|
150
|
-
test_passes: true
|
|
151
|
-
other_tests_broken: false
|
|
152
|
-
issue_resolved: true
|
|
153
|
-
spec_aligned: true
|
|
154
|
-
|
|
155
|
-
attempts_count: 1 # fixed on first try
|
|
156
|
-
ultrathink_needed: false
|
|
157
|
-
|
|
158
|
-
phase_5_documentation:
|
|
159
|
-
increment_updates:
|
|
160
|
-
- file: ".specweave/increments/0001-user-authentication/tests.md"
|
|
161
|
-
change: "Added TC-007: Regression test for bcrypt argument order"
|
|
162
|
-
|
|
163
|
-
architecture_updates: [] # no architectural change
|
|
164
|
-
|
|
165
|
-
strategy_updates: [] # requirements unchanged
|
|
166
|
-
|
|
167
|
-
new_increment_needed: false # small fix, no new increment
|
|
168
|
-
|
|
169
|
-
commit_message: |
|
|
170
|
-
fix(auth): correct bcrypt.compare argument order
|
|
171
|
-
|
|
172
|
-
Root cause: Arguments to bcrypt.compare() were reversed after
|
|
173
|
-
bcrypt migration. Function signature is compare(plaintext, hash)
|
|
174
|
-
but code was calling compare(hash, plaintext).
|
|
175
|
-
|
|
176
|
-
Solution: Swapped arguments to match bcrypt API correctly.
|
|
177
|
-
Spec alignment: Code now implements FR-002 correctly.
|
|
178
|
-
|
|
179
|
-
Test coverage:
|
|
180
|
-
- Added: TC-007 regression test for password comparison
|
|
181
|
-
- Verified: All existing auth tests pass
|
|
182
|
-
|
|
183
|
-
Documentation updated:
|
|
184
|
-
- tests.md: Added TC-007 for regression prevention
|
|
185
|
-
|
|
186
|
-
Fixes: #42
|
|
187
|
-
|
|
188
|
-
🤖 Generated with Claude Code
|
|
189
|
-
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
190
|
-
|
|
191
|
-
validation:
|
|
192
|
-
- "Phase 0: Loaded spec.md, plan.md, tests.md"
|
|
193
|
-
- "Phase 0: Classified as code bug (not spec bug)"
|
|
194
|
-
- "Phase 1: Traced data flow to identify failing component"
|
|
195
|
-
- "Phase 1: Compared behavior vs spec (spec was correct)"
|
|
196
|
-
- "Phase 2: Found working example in codebase"
|
|
197
|
-
- "Phase 2: Identified argument order difference"
|
|
198
|
-
- "Phase 3: Formed single, specific hypothesis"
|
|
199
|
-
- "Phase 4: Created failing test before fix"
|
|
200
|
-
- "Phase 4: Fixed on first attempt (no ultrathink needed)"
|
|
201
|
-
- "Phase 5: Updated tests.md with new test case"
|
|
202
|
-
- "Phase 5: Committed with proper documentation"
|
|
203
|
-
|
|
204
|
-
expected_errors: []
|
|
205
|
-
|
|
206
|
-
success_criteria:
|
|
207
|
-
- "Root cause identified (argument order)"
|
|
208
|
-
- "Fix verified with test"
|
|
209
|
-
- "Spec alignment confirmed"
|
|
210
|
-
- "Living documentation updated"
|
|
211
|
-
- "Single attempt (efficient debugging)"
|
|
212
|
-
---
|