specweave 0.21.3 β 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +409 -6
- package/README.md +38 -8
- package/bin/specweave.js +5 -8
- package/dist/plugins/specweave-github/lib/CodeValidator.d.ts +101 -0
- package/dist/plugins/specweave-github/lib/CodeValidator.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/CodeValidator.js +219 -0
- package/dist/plugins/specweave-github/lib/CodeValidator.js.map +1 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts +182 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js +603 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts +10 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client-v2.js +26 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.js +7 -0
- package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/types.d.ts +34 -0
- package/dist/plugins/specweave-github/lib/types.d.ts.map +1 -1
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +60 -5
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/migrate-to-profiles.d.ts +1 -0
- package/dist/src/cli/commands/migrate-to-profiles.d.ts.map +1 -1
- package/dist/src/cli/commands/migrate-to-profiles.js +12 -1
- package/dist/src/cli/commands/migrate-to-profiles.js.map +1 -1
- package/dist/src/cli/commands/next-command.d.ts +52 -0
- package/dist/src/cli/commands/next-command.d.ts.map +1 -0
- package/dist/src/cli/commands/next-command.js +204 -0
- package/dist/src/cli/commands/next-command.js.map +1 -0
- package/dist/src/cli/commands/sync-specs.d.ts +16 -0
- package/dist/src/cli/commands/sync-specs.d.ts.map +1 -0
- package/dist/src/cli/commands/sync-specs.js +130 -0
- package/dist/src/cli/commands/sync-specs.js.map +1 -0
- package/dist/src/cli/count-tasks.d.ts +20 -0
- package/dist/src/cli/count-tasks.d.ts.map +1 -0
- package/dist/src/cli/count-tasks.js +50 -0
- package/dist/src/cli/count-tasks.js.map +1 -0
- package/dist/src/config/ConfigManager.d.ts.map +1 -1
- package/dist/src/config/ConfigManager.js +2 -1
- package/dist/src/config/ConfigManager.js.map +1 -1
- package/dist/src/config/types.d.ts +58 -58
- package/dist/src/core/cicd/state-manager.d.ts +8 -0
- package/dist/src/core/cicd/state-manager.d.ts.map +1 -1
- package/dist/src/core/cicd/state-manager.js +60 -15
- package/dist/src/core/cicd/state-manager.js.map +1 -1
- package/dist/src/core/cost-tracker.d.ts.map +1 -1
- package/dist/src/core/cost-tracker.js +2 -1
- package/dist/src/core/cost-tracker.js.map +1 -1
- package/dist/src/core/iac/template-engine.d.ts.map +1 -1
- package/dist/src/core/iac/template-engine.js +28 -0
- package/dist/src/core/iac/template-engine.js.map +1 -1
- package/dist/src/core/iac/template-generator.d.ts +53 -0
- package/dist/src/core/iac/template-generator.d.ts.map +1 -0
- package/dist/src/core/iac/template-generator.js +125 -0
- package/dist/src/core/iac/template-generator.js.map +1 -0
- package/dist/src/core/increment/status-auto-transition.js +3 -3
- package/dist/src/core/increment/status-auto-transition.js.map +1 -1
- package/dist/src/core/living-docs/CodeValidator.js +1 -1
- package/dist/src/core/living-docs/CodeValidator.js.map +1 -1
- package/dist/src/core/living-docs/CompletionPropagator.d.ts.map +1 -1
- package/dist/src/core/living-docs/CompletionPropagator.js +4 -3
- package/dist/src/core/living-docs/CompletionPropagator.js.map +1 -1
- package/dist/src/core/living-docs/SpecDistributor.d.ts +5 -0
- package/dist/src/core/living-docs/SpecDistributor.d.ts.map +1 -1
- package/dist/src/core/living-docs/SpecDistributor.js +12 -0
- package/dist/src/core/living-docs/SpecDistributor.js.map +1 -1
- package/dist/src/core/living-docs/content-distributor.d.ts.map +1 -1
- package/dist/src/core/living-docs/content-distributor.js +11 -1
- package/dist/src/core/living-docs/content-distributor.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts +166 -0
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -0
- package/dist/src/core/living-docs/living-docs-sync.js +726 -0
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -0
- package/dist/src/core/living-docs/project-detector.d.ts.map +1 -1
- package/dist/src/core/living-docs/project-detector.js +38 -0
- package/dist/src/core/living-docs/project-detector.js.map +1 -1
- package/dist/src/core/living-docs/task-project-specific-generator.d.ts +7 -3
- package/dist/src/core/living-docs/task-project-specific-generator.d.ts.map +1 -1
- package/dist/src/core/living-docs/task-project-specific-generator.js +40 -24
- package/dist/src/core/living-docs/task-project-specific-generator.js.map +1 -1
- package/dist/src/core/plugin-loader.d.ts +7 -0
- package/dist/src/core/plugin-loader.d.ts.map +1 -1
- package/dist/src/core/plugin-loader.js +18 -1
- package/dist/src/core/plugin-loader.js.map +1 -1
- package/dist/src/core/serverless/platform-data-loader.d.ts +8 -0
- package/dist/src/core/serverless/platform-data-loader.d.ts.map +1 -1
- package/dist/src/core/serverless/platform-data-loader.js +14 -0
- package/dist/src/core/serverless/platform-data-loader.js.map +1 -1
- package/dist/src/core/serverless/types.d.ts +1 -1
- package/dist/src/core/serverless/types.d.ts.map +1 -1
- package/dist/src/core/status-line/status-line-manager.d.ts +6 -2
- package/dist/src/core/status-line/status-line-manager.d.ts.map +1 -1
- package/dist/src/core/status-line/status-line-manager.js +11 -5
- package/dist/src/core/status-line/status-line-manager.js.map +1 -1
- package/dist/src/core/status-line/task-counter.d.ts +69 -0
- package/dist/src/core/status-line/task-counter.d.ts.map +1 -0
- package/dist/src/core/status-line/task-counter.js +107 -0
- package/dist/src/core/status-line/task-counter.js.map +1 -0
- package/dist/src/core/types/config.d.ts +23 -0
- package/dist/src/core/types/config.d.ts.map +1 -1
- package/dist/src/core/types/config.js +10 -0
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/core/workflow/autonomous-executor.d.ts +111 -0
- package/dist/src/core/workflow/autonomous-executor.d.ts.map +1 -0
- package/dist/src/core/workflow/autonomous-executor.js +275 -0
- package/dist/src/core/workflow/autonomous-executor.js.map +1 -0
- package/dist/src/core/workflow/backlog-scanner.d.ts +94 -0
- package/dist/src/core/workflow/backlog-scanner.d.ts.map +1 -0
- package/dist/src/core/workflow/backlog-scanner.js +170 -0
- package/dist/src/core/workflow/backlog-scanner.js.map +1 -0
- package/dist/src/core/workflow/command-invoker.d.ts +86 -0
- package/dist/src/core/workflow/command-invoker.d.ts.map +1 -0
- package/dist/src/core/workflow/command-invoker.js +131 -0
- package/dist/src/core/workflow/command-invoker.js.map +1 -0
- package/dist/src/core/workflow/cost-estimator.d.ts +120 -0
- package/dist/src/core/workflow/cost-estimator.d.ts.map +1 -0
- package/dist/src/core/workflow/cost-estimator.js +222 -0
- package/dist/src/core/workflow/cost-estimator.js.map +1 -0
- package/dist/src/core/workflow/index.d.ts +20 -0
- package/dist/src/core/workflow/index.d.ts.map +1 -0
- package/dist/src/core/workflow/index.js +24 -0
- package/dist/src/core/workflow/index.js.map +1 -0
- package/dist/src/core/workflow/state-manager.d.ts +107 -0
- package/dist/src/core/workflow/state-manager.d.ts.map +1 -0
- package/dist/src/core/workflow/state-manager.js +126 -0
- package/dist/src/core/workflow/state-manager.js.map +1 -0
- package/dist/src/core/workflow/workflow-orchestrator.d.ts +93 -0
- package/dist/src/core/workflow/workflow-orchestrator.d.ts.map +1 -0
- package/dist/src/core/workflow/workflow-orchestrator.js +195 -0
- package/dist/src/core/workflow/workflow-orchestrator.js.map +1 -0
- package/dist/src/init/ArchitecturePresenter.d.ts +47 -0
- package/dist/src/init/ArchitecturePresenter.d.ts.map +1 -0
- package/dist/src/init/ArchitecturePresenter.js +180 -0
- package/dist/src/init/ArchitecturePresenter.js.map +1 -0
- package/dist/src/init/InitFlow.d.ts.map +1 -1
- package/dist/src/init/InitFlow.js +30 -1
- package/dist/src/init/InitFlow.js.map +1 -1
- package/dist/src/init/architecture/CostEstimator.d.ts +52 -0
- package/dist/src/init/architecture/CostEstimator.d.ts.map +1 -0
- package/dist/src/init/architecture/CostEstimator.js +107 -0
- package/dist/src/init/architecture/CostEstimator.js.map +1 -0
- package/dist/src/init/architecture/InfrastructureMapper.d.ts +41 -0
- package/dist/src/init/architecture/InfrastructureMapper.d.ts.map +1 -0
- package/dist/src/init/architecture/InfrastructureMapper.js +140 -0
- package/dist/src/init/architecture/InfrastructureMapper.js.map +1 -0
- package/dist/src/init/architecture/ProjectGenerator.d.ts +44 -0
- package/dist/src/init/architecture/ProjectGenerator.d.ts.map +1 -0
- package/dist/src/init/architecture/ProjectGenerator.js +216 -0
- package/dist/src/init/architecture/ProjectGenerator.js.map +1 -0
- package/dist/src/init/architecture/types.d.ts +10 -10
- package/dist/src/init/research/src/config/types.d.ts +8 -8
- package/dist/src/metrics/dora-calculator.js +2 -2
- package/dist/src/metrics/dora-calculator.js.map +1 -1
- package/dist/src/utils/pricing-constants.d.ts +5 -2
- package/dist/src/utils/pricing-constants.d.ts.map +1 -1
- package/dist/src/utils/pricing-constants.js +3 -2
- package/dist/src/utils/pricing-constants.js.map +1 -1
- package/package.json +9 -8
- package/plugins/specweave/agents/infrastructure/AGENT.md +88 -46
- package/plugins/specweave/agents/pm/AGENT.md +58 -1
- package/plugins/specweave/commands/specweave-archive-features.md +1 -1
- package/plugins/specweave/commands/specweave-archive-increments.md +1 -1
- package/plugins/specweave/commands/specweave-check-hooks.md +5 -0
- package/plugins/specweave/commands/specweave-done.md +12 -0
- package/plugins/specweave/commands/specweave-plan.md +1 -1
- package/plugins/specweave/commands/specweave-progress.md +108 -379
- package/plugins/specweave/commands/specweave-reopen.md +1 -1
- package/plugins/specweave/commands/specweave-restore-feature.md +1 -1
- package/plugins/specweave/commands/specweave-sync-specs.md +20 -48
- package/plugins/specweave/hooks/lib/update-status-line.sh +44 -35
- package/plugins/specweave/hooks/lib/validate-spec-status.sh +163 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +17 -35
- package/plugins/specweave/lib/hooks/update-tasks-md.js +52 -9
- package/plugins/specweave/lib/hooks/update-tasks-md.ts +77 -16
- package/plugins/specweave/templates/iac/aws-lambda/defaults.json +24 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/README.md.hbs +260 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/environments/dev.tfvars.hbs +34 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/environments/prod.tfvars.hbs +37 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/environments/staging.tfvars.hbs +35 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/outputs.tf.hbs +77 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/providers.tf.hbs +36 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/variables.tf.hbs +115 -0
- package/plugins/specweave/templates/iac/azure-functions/defaults.json +25 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/README.md.hbs +268 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/environments/dev.tfvars.hbs +34 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/environments/prod.tfvars.hbs +46 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/environments/staging.tfvars.hbs +34 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/main.tf.hbs +225 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/outputs.tf.hbs +89 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/provider.tf.hbs +27 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/providers.tf.hbs +35 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/variables.tf.hbs +124 -0
- package/plugins/specweave/templates/iac/firebase/defaults.json +29 -0
- package/plugins/specweave/templates/iac/firebase/templates/README.md.hbs +35 -0
- package/plugins/specweave/templates/iac/firebase/templates/environments/dev.tfvars.hbs +7 -0
- package/plugins/specweave/templates/iac/firebase/templates/environments/prod.tfvars.hbs +7 -0
- package/plugins/specweave/templates/iac/firebase/templates/environments/staging.tfvars.hbs +7 -0
- package/plugins/specweave/templates/iac/firebase/templates/main.tf.hbs +90 -0
- package/plugins/specweave/templates/iac/firebase/templates/outputs.tf.hbs +15 -0
- package/plugins/specweave/templates/iac/firebase/templates/providers.tf.hbs +23 -0
- package/plugins/specweave/templates/iac/firebase/templates/variables.tf.hbs +42 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/defaults.json +26 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/README.md.hbs +299 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/environments/dev.tfvars.hbs +36 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/environments/prod.tfvars.hbs +48 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/environments/staging.tfvars.hbs +41 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/main.tf.hbs +192 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/outputs.tf.hbs +66 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/providers.tf.hbs +25 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/variables.tf.hbs +119 -0
- package/plugins/specweave/templates/iac/supabase/defaults.json +15 -0
- package/plugins/specweave/templates/iac/supabase/templates/README.md.hbs +46 -0
- package/plugins/specweave/templates/iac/supabase/templates/main.tf.hbs +50 -0
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
- package/plugins/specweave-github/agents/github-manager/AGENT.md +39 -7
- package/plugins/specweave-github/commands/specweave-github-create-issue.md +5 -5
- package/plugins/specweave-github/lib/CodeValidator.js +195 -0
- package/plugins/specweave-github/lib/CodeValidator.ts +284 -0
- package/plugins/specweave-github/lib/ThreeLayerSyncManager.js +545 -0
- package/plugins/specweave-github/lib/ThreeLayerSyncManager.ts +809 -0
- package/plugins/specweave-github/lib/github-client-v2.js +29 -0
- package/plugins/specweave-github/lib/github-client-v2.ts +30 -0
- package/plugins/specweave-github/lib/task-sync.js +4 -0
- package/plugins/specweave-github/lib/task-sync.ts +7 -0
- package/plugins/specweave-github/lib/types.ts +38 -0
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +3222 -0
- package/src/templates/AGENTS.md.template +22 -1
- package/src/templates/CLAUDE.md.template +31 -0
- package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts +0 -116
- package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts.map +0 -1
- package/dist/src/core/living-docs/ThreeLayerSyncManager.js +0 -356
- package/dist/src/core/living-docs/ThreeLayerSyncManager.js.map +0 -1
package/CLAUDE.md
CHANGED
|
@@ -24,21 +24,23 @@ Users receive a different CLAUDE.md via the template system.
|
|
|
24
24
|
/SESSION-SUMMARY-2025-10-28.md # NO! Goes to increment reports/
|
|
25
25
|
/ADR-006-DEEP-ANALYSIS.md # NO! Goes to .specweave/docs/internal/architecture/adr/
|
|
26
26
|
/ANALYSIS-MULTI-TOOL-COMPARISON.md # NO! Goes to increment reports/
|
|
27
|
+
/QUICK-START.md # NO! Goes to increment reports/
|
|
27
28
|
/migration-helper.sh # NO! Goes to increment scripts/
|
|
28
29
|
/execution.log # NO! Goes to increment logs/
|
|
29
30
|
|
|
30
31
|
β
CORRECT - INCREMENT FOLDERS:
|
|
31
32
|
.specweave/increments/0004-plugin-architecture/
|
|
32
|
-
βββ spec.md #
|
|
33
|
+
βββ spec.md # β οΈ ONLY THESE 3 FILES in root!
|
|
33
34
|
βββ plan.md
|
|
34
35
|
βββ tasks.md # Tasks with embedded tests
|
|
35
|
-
βββ reports/ # β
|
|
36
|
+
βββ reports/ # β
ALL REPORTS HERE!
|
|
36
37
|
β βββ PLUGIN-MIGRATION-COMPLETE.md # β
Completion reports
|
|
37
38
|
β βββ SESSION-SUMMARY.md # β
Session summaries
|
|
39
|
+
β βββ QUICK-START.md # β
Quick start guides
|
|
38
40
|
β βββ ANALYSIS-*.md # β
Analysis files
|
|
39
|
-
βββ scripts/ # β
|
|
41
|
+
βββ scripts/ # β
ALL SCRIPTS HERE!
|
|
40
42
|
β βββ migration-helper.sh # β
Helper scripts
|
|
41
|
-
βββ logs/ # β
|
|
43
|
+
βββ logs/ # β
ALL LOGS HERE!
|
|
42
44
|
βββ execution.log # β
Execution logs
|
|
43
45
|
|
|
44
46
|
.specweave/docs/internal/architecture/ # β
PUT ADRS/DIAGRAMS HERE!
|
|
@@ -48,6 +50,215 @@ Users receive a different CLAUDE.md via the template system.
|
|
|
48
50
|
|
|
49
51
|
**Before committing, ALWAYS check**: `git status` - If you see `.md` files in root, MOVE THEM!
|
|
50
52
|
|
|
53
|
+
### π Increment Structure Rules (MANDATORY)
|
|
54
|
+
|
|
55
|
+
**ONLY 3 files allowed in increment root**:
|
|
56
|
+
1. β
`spec.md` - Specification
|
|
57
|
+
2. β
`plan.md` - Implementation plan
|
|
58
|
+
3. β
`tasks.md` - Tasks with embedded tests
|
|
59
|
+
|
|
60
|
+
**Everything else MUST be in subfolders**:
|
|
61
|
+
- `reports/` - Session summaries, completion reports, analysis files, quick-start guides
|
|
62
|
+
- `scripts/` - Helper scripts, migrations, utilities
|
|
63
|
+
- `logs/` - Execution logs, debug output, temp files
|
|
64
|
+
|
|
65
|
+
**Examples of files that belong in subfolders**:
|
|
66
|
+
- `QUICK-START.md` β `reports/QUICK-START.md`
|
|
67
|
+
- `SESSION-NOTES.md` β `reports/SESSION-NOTES.md`
|
|
68
|
+
- `ULTRATHINK-*.md` β `reports/ULTRATHINK-*.md`
|
|
69
|
+
- `validation.sh` β `scripts/validation.sh`
|
|
70
|
+
- `debug.log` β `logs/debug.log`
|
|
71
|
+
|
|
72
|
+
**Why this matters**:
|
|
73
|
+
- β
Clean, predictable structure
|
|
74
|
+
- β
Easy to find files by type
|
|
75
|
+
- β
No increment root clutter
|
|
76
|
+
- β
Consistent across all increments
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## π‘οΈ CRITICAL: NEVER DELETE .specweave/ DIRECTORIES!
|
|
81
|
+
|
|
82
|
+
**β MASS DELETION PROTECTION IS ACTIVE β**
|
|
83
|
+
|
|
84
|
+
**PROTECTED DIRECTORIES**:
|
|
85
|
+
- `.specweave/docs/` - All project documentation (internal + public)
|
|
86
|
+
- `.specweave/increments/` - All increment history and specifications
|
|
87
|
+
|
|
88
|
+
**WHAT THIS MEANS**:
|
|
89
|
+
- β **NEVER** run `rm -rf .specweave/docs` or `rm -rf .specweave/increments`
|
|
90
|
+
- β **NEVER** delete more than 50 files in these directories at once
|
|
91
|
+
- β
Pre-commit hook will **BLOCK** accidental mass deletions
|
|
92
|
+
- β
If intentional, bypass with `git commit --no-verify`
|
|
93
|
+
|
|
94
|
+
**WHY THIS EXISTS**:
|
|
95
|
+
On 2025-11-17, an accidental mass deletion occurred (1,200+ files). All files were recovered via `git restore`, but this protection prevents future incidents.
|
|
96
|
+
|
|
97
|
+
**IF YOU ACCIDENTALLY DELETE**:
|
|
98
|
+
```bash
|
|
99
|
+
# Immediately restore:
|
|
100
|
+
git restore .specweave/
|
|
101
|
+
|
|
102
|
+
# Verify restoration:
|
|
103
|
+
git status
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**See**: `.specweave/increments/0039/reports/ACCIDENTAL-DELETION-RECOVERY-2025-11-17.md`
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## π¨ CRITICAL: DANGEROUS TEST CLEANUP OPERATIONS!
|
|
111
|
+
|
|
112
|
+
**β WARNING: Test cleanup can cause CATASTROPHIC deletion β**
|
|
113
|
+
|
|
114
|
+
**INCIDENT**: On 2025-11-18, during increment 0042 (test infrastructure cleanup), a bash command nearly deleted the entire `tests/integration/` directory (209 test files). The command failed due to working directory confusion, but demonstrated the EXACT catastrophic risk identified in ultrathink analysis.
|
|
115
|
+
|
|
116
|
+
**THE DANGER**:
|
|
117
|
+
```bash
|
|
118
|
+
# β EXTREMELY DANGEROUS (can delete entire test suite):
|
|
119
|
+
cd tests/integration
|
|
120
|
+
find . -maxdepth 1 -type d ... -exec rm -rf {} +
|
|
121
|
+
# Risk: Working directory confusion + no confirmation = catastrophic deletion
|
|
122
|
+
|
|
123
|
+
# β DANGEROUS (no verification):
|
|
124
|
+
find tests/integration -type d -exec rm -rf {} +
|
|
125
|
+
# Risk: Too broad, deletes everything
|
|
126
|
+
|
|
127
|
+
# β DANGEROUS (assumes pwd):
|
|
128
|
+
rm -rf tests/integration/*/
|
|
129
|
+
# Risk: If pwd is wrong, deletes unintended directories
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**SAFE APPROACH** (MANDATORY for test cleanup):
|
|
133
|
+
```bash
|
|
134
|
+
# β
STEP 1: Verify working directory (ALWAYS FIRST!)
|
|
135
|
+
pwd
|
|
136
|
+
# Must output: /Users/antonabyzov/Projects/github/specweave
|
|
137
|
+
|
|
138
|
+
# β
STEP 2: DRY RUN (list only, NO deletion)
|
|
139
|
+
find tests/integration -maxdepth 1 -type d \
|
|
140
|
+
! -name "integration" \
|
|
141
|
+
! -name "core" ! -name "features" ! -name "external-tools" ! -name "generators" \
|
|
142
|
+
-print
|
|
143
|
+
# Review output MANUALLY before proceeding
|
|
144
|
+
|
|
145
|
+
# β
STEP 3: Count directories to delete
|
|
146
|
+
find tests/integration -maxdepth 1 -type d \
|
|
147
|
+
! -name "integration" \
|
|
148
|
+
! -name "core" ! -name "features" ! -name "external-tools" ! -name "generators" \
|
|
149
|
+
-print | wc -l
|
|
150
|
+
# Verify count matches expectations
|
|
151
|
+
|
|
152
|
+
# β
STEP 4: Manual confirmation (REQUIRED)
|
|
153
|
+
echo "About to delete XX directories. Type 'DELETE' to confirm:"
|
|
154
|
+
read confirmation
|
|
155
|
+
if [ "$confirmation" != "DELETE" ]; then
|
|
156
|
+
echo "Cancelled"
|
|
157
|
+
exit 1
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
# β
STEP 5: Execute deletion (ONLY after all checks pass)
|
|
161
|
+
find tests/integration -maxdepth 1 -type d \
|
|
162
|
+
! -name "integration" \
|
|
163
|
+
! -name "core" ! -name "features" ! -name "external-tools" ! -name "generators" \
|
|
164
|
+
-exec rm -rf {} +
|
|
165
|
+
|
|
166
|
+
# β
STEP 6: Verify results
|
|
167
|
+
ls tests/integration/
|
|
168
|
+
find tests/integration -name "*.test.ts" | wc -l
|
|
169
|
+
|
|
170
|
+
# β
STEP 7: Run tests (MANDATORY)
|
|
171
|
+
npm run test:integration
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**MANDATORY SAFETY RULES**:
|
|
175
|
+
1. β
**ALWAYS** verify `pwd` before ANY deletion command
|
|
176
|
+
2. β
**ALWAYS** use dry-run (`-print`) before `-exec rm`
|
|
177
|
+
3. β
**ALWAYS** count directories/files before deletion
|
|
178
|
+
4. β
**ALWAYS** require manual confirmation for deletion
|
|
179
|
+
5. β
**ALWAYS** verify results after deletion
|
|
180
|
+
6. β
**ALWAYS** run tests after structural changes
|
|
181
|
+
7. β
**NEVER** use `rm -rf` without multiple safety checks
|
|
182
|
+
|
|
183
|
+
**WHY THIS MATTERS**:
|
|
184
|
+
- π΄ One wrong command = entire test suite deleted
|
|
185
|
+
- π΄ 213 unsafe `process.cwd()` patterns exist in tests (increment 0042 audit)
|
|
186
|
+
- π΄ Working directory confusion is COMMON
|
|
187
|
+
- π΄ Recovery requires git restore (assumes uncommitted changes)
|
|
188
|
+
- π΄ If changes committed, recovery requires time-consuming rollback
|
|
189
|
+
|
|
190
|
+
**LESSONS FROM INCIDENT 0042**:
|
|
191
|
+
1. **Dry-run is NOT optional** - Always list before deleting
|
|
192
|
+
2. **Working directory matters** - Verify pwd FIRST
|
|
193
|
+
3. **Confirmation prevents accidents** - Require manual "DELETE" confirmation
|
|
194
|
+
4. **Test after changes** - Structural changes can break tests
|
|
195
|
+
5. **Incremental commits** - Commit after each phase (easier rollback)
|
|
196
|
+
|
|
197
|
+
**IF CATASTROPHIC DELETION OCCURS**:
|
|
198
|
+
```bash
|
|
199
|
+
# Immediately restore from git (if not committed):
|
|
200
|
+
git restore tests/
|
|
201
|
+
|
|
202
|
+
# If committed, restore from previous commit:
|
|
203
|
+
git log --oneline -- tests/
|
|
204
|
+
git checkout <previous-commit-hash> -- tests/
|
|
205
|
+
|
|
206
|
+
# Verify restoration:
|
|
207
|
+
find tests -name "*.test.ts" | wc -l
|
|
208
|
+
npm run test:all
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**REFERENCES**:
|
|
212
|
+
- Incident report: `.specweave/increments/0042-test-infrastructure-cleanup/reports/CATASTROPHIC-DELETION-INCIDENT-2025-11-18.md`
|
|
213
|
+
- Ultrathink analysis: `.specweave/increments/0041-living-docs-test-fixes/reports/ULTRATHINK-TEST-DUPLICATION-ANALYSIS-2025-11-18.md`
|
|
214
|
+
- Safe cleanup approach: Increment 0042 Phase 1 tasks
|
|
215
|
+
|
|
216
|
+
**NEVER delete test directories without following ALL safety steps above!**
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## β οΈ CRITICAL: NEVER USE `specweave init . --force` FOR REINSTALLS!
|
|
221
|
+
|
|
222
|
+
**β COMMON MISTAKE THAT DELETES ALL DATA β**
|
|
223
|
+
|
|
224
|
+
**THE DANGER**:
|
|
225
|
+
```bash
|
|
226
|
+
# β DANGEROUS (deletes ALL increments and docs):
|
|
227
|
+
specweave init . --force
|
|
228
|
+
|
|
229
|
+
# What --force actually does:
|
|
230
|
+
# 1. Skips all confirmation prompts
|
|
231
|
+
# 2. AUTOMATICALLY DELETES .specweave/ entirely
|
|
232
|
+
# 3. Loses all increments, docs, and history
|
|
233
|
+
# 4. No backup unless you create one manually
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**SAFE ALTERNATIVES**:
|
|
237
|
+
```bash
|
|
238
|
+
# β
SAFE - Update files, keep all data:
|
|
239
|
+
specweave init .
|
|
240
|
+
# When prompted, select: "Continue working"
|
|
241
|
+
|
|
242
|
+
# β
SAFE - Always interactive, never deletes:
|
|
243
|
+
npx specweave init .
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**WHY THIS MATTERS**:
|
|
247
|
+
- Documentation used to recommend `--force` for troubleshooting (FIXED in v0.21.4+)
|
|
248
|
+
- Users followed the docs and lost all their work
|
|
249
|
+
- Now `--force` has multiple safeguards:
|
|
250
|
+
- β οΈ BIG RED WARNING before deletion
|
|
251
|
+
- β
ALWAYS requires confirmation (even in force mode)
|
|
252
|
+
- π¦ Automatic backup created before deletion
|
|
253
|
+
- π Pre-commit hook blocks accidental commits
|
|
254
|
+
|
|
255
|
+
**IF YOU NEED A FRESH START**:
|
|
256
|
+
1. Backup first: `cp -r .specweave .specweave.backup-$(date +%Y%m%d)`
|
|
257
|
+
2. Run: `specweave init .` (select "Fresh start" option)
|
|
258
|
+
3. Or: `specweave init . --force` (requires confirmation + creates auto-backup)
|
|
259
|
+
|
|
260
|
+
**NEVER use `--force` unless you want to DELETE EVERYTHING!**
|
|
261
|
+
|
|
51
262
|
---
|
|
52
263
|
|
|
53
264
|
## Tool Support
|
|
@@ -353,12 +564,204 @@ npm run build # Compile TypeScript
|
|
|
353
564
|
|
|
354
565
|
### Testing
|
|
355
566
|
|
|
567
|
+
**Test Framework**: **Vitest** (migrated from Jest on 2025-11-17)
|
|
568
|
+
|
|
356
569
|
```bash
|
|
357
|
-
npm test #
|
|
358
|
-
npm run test:
|
|
570
|
+
npm test # Smoke tests (quick validation)
|
|
571
|
+
npm run test:unit # Unit tests with Vitest
|
|
572
|
+
npm run test:integration # Integration tests with Vitest
|
|
359
573
|
npm run test:e2e # E2E tests (Playwright)
|
|
574
|
+
npm run test:all # All tests
|
|
575
|
+
npm run test:coverage # Coverage report
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
**Why Vitest?**
|
|
579
|
+
- β
ESM-native (no tsconfig hacks)
|
|
580
|
+
- β
Faster than Jest
|
|
581
|
+
- β
Better TypeScript integration
|
|
582
|
+
- β
Native import.meta.url support
|
|
583
|
+
- β
Modern, actively maintained
|
|
584
|
+
|
|
585
|
+
**Test Organization** (4 categories):
|
|
586
|
+
- `tests/unit/` - Pure logic tests (no I/O) - **Vitest**
|
|
587
|
+
- `tests/plugin-validation/` - Plugin structure contracts
|
|
588
|
+
- `tests/integration/` - 4 semantic categories - **Vitest**:
|
|
589
|
+
- `external-tools/` - GitHub, JIRA, ADO, Kafka sync
|
|
590
|
+
- `core/` - Core framework + workflows
|
|
591
|
+
- `generators/` - Code generation (frontend, backend, ML)
|
|
592
|
+
- `features/` - Feature plugins (Figma, i18n, diagrams, etc.)
|
|
593
|
+
- `tests/e2e/` - Full user scenarios - **Playwright**
|
|
594
|
+
|
|
595
|
+
**Test Naming Convention** (standardized 2025-11-18):
|
|
596
|
+
- β
ALL tests use `.test.ts` extension (unit, integration, E2E)
|
|
597
|
+
- β NEVER use `.spec.ts` extension (deprecated)
|
|
598
|
+
- **Why**: Consistent glob patterns, simpler test discovery, aligned with Vitest conventions
|
|
599
|
+
|
|
600
|
+
**Writing Tests**:
|
|
601
|
+
```typescript
|
|
602
|
+
// Import from vitest (NOT jest)
|
|
603
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
604
|
+
|
|
605
|
+
// Mocking
|
|
606
|
+
vi.mock('fs/promises');
|
|
607
|
+
const mockFn = vi.fn();
|
|
608
|
+
vi.clearAllMocks();
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
**Details**: `.specweave/docs/internal/architecture/TEST-ORGANIZATION-PROPOSAL.md`
|
|
612
|
+
|
|
613
|
+
### Test Isolation (CRITICAL - Prevents .specweave/ Deletion!)
|
|
614
|
+
|
|
615
|
+
**π¨ MANDATORY FOR ALL TESTS creating .specweave/ structures:**
|
|
616
|
+
|
|
617
|
+
**THE PROBLEM**: Tests using `process.cwd()` can accidentally delete the project `.specweave/` folder containing all your work!
|
|
618
|
+
|
|
619
|
+
**CORRECT PATTERN** (ALWAYS use this):
|
|
620
|
+
```typescript
|
|
621
|
+
import * as os from 'os';
|
|
622
|
+
import * as path from 'path';
|
|
623
|
+
|
|
624
|
+
// β
SAFE: Uses isolated temp directory
|
|
625
|
+
const testRoot = path.join(os.tmpdir(), 'test-name-' + Date.now());
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
**DANGEROUS PATTERN** (NEVER use this):
|
|
629
|
+
```typescript
|
|
630
|
+
// β DANGER: Creates directories in project root!
|
|
631
|
+
const testRoot = path.join(process.cwd(), '.test-something');
|
|
632
|
+
const testPath = path.join(__dirname, '..', '.specweave', 'increments');
|
|
360
633
|
```
|
|
361
634
|
|
|
635
|
+
### Vitest Mock Best Practices
|
|
636
|
+
|
|
637
|
+
**π¨ MANDATORY FOR ALL TESTS using mocks:**
|
|
638
|
+
|
|
639
|
+
**CORRECT PATTERN** (vi.mocked() for type-safe mocks):
|
|
640
|
+
```typescript
|
|
641
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
642
|
+
import fs from 'fs-extra';
|
|
643
|
+
|
|
644
|
+
// Mock fs-extra BEFORE using it
|
|
645
|
+
vi.mock('fs-extra');
|
|
646
|
+
|
|
647
|
+
// Type-safe mocked functions
|
|
648
|
+
const mockReadFile = vi.mocked(fs.readFile);
|
|
649
|
+
const mockWriteFile = vi.mocked(fs.writeFile);
|
|
650
|
+
const mockExistsSync = vi.mocked(fs.existsSync);
|
|
651
|
+
|
|
652
|
+
beforeEach(() => {
|
|
653
|
+
vi.clearAllMocks();
|
|
654
|
+
mockExistsSync.mockReturnValue(true);
|
|
655
|
+
mockReadFile.mockResolvedValue('content');
|
|
656
|
+
});
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
**DANGEROUS PATTERN** (NEVER use this):
|
|
660
|
+
```typescript
|
|
661
|
+
// β WRONG: Invalid anyed<> syntax (pre-Vitest migration)
|
|
662
|
+
const mockFs = fs as anyed<typeof fs> & {
|
|
663
|
+
readFile: anyedFunction<typeof fs.readFile>;
|
|
664
|
+
};
|
|
665
|
+
// This causes TypeScript errors and test failures!
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
**Why This Matters**:
|
|
669
|
+
1. `vi.mocked()` provides full type safety
|
|
670
|
+
2. Catches mock setup errors at compile time
|
|
671
|
+
3. Works correctly with Vitest's mock system
|
|
672
|
+
4. Prevents runtime "Cannot read properties of undefined" errors
|
|
673
|
+
|
|
674
|
+
**Common Mock Gotchas**:
|
|
675
|
+
- Always call `vi.clearAllMocks()` in beforeEach
|
|
676
|
+
- Use `mockResolvedValue` for async functions
|
|
677
|
+
- Use `mockReturnValue` for sync functions
|
|
678
|
+
- Check that mocks are actually called: `expect(mockFn).toHaveBeenCalled()`
|
|
679
|
+
|
|
680
|
+
### Testing Best Practices & Anti-Patterns
|
|
681
|
+
|
|
682
|
+
**Lessons from fixing 72+ test failures (2025-11-17 Vitest migration)**
|
|
683
|
+
|
|
684
|
+
#### Critical Rules (Will Fail Tests)
|
|
685
|
+
|
|
686
|
+
```typescript
|
|
687
|
+
// β WRONG // β
CORRECT
|
|
688
|
+
require('../src/module') import { Module } from '../src/module.js'
|
|
689
|
+
jest.fn() vi.fn()
|
|
690
|
+
jest.mock() vi.mock()
|
|
691
|
+
fs as anyed<typeof fs> vi.mocked(fs.readFile)
|
|
692
|
+
const mock = vi.fn() vi.mock('mod', () => ({
|
|
693
|
+
vi.mock('mod', () => ({ mock })) method: vi.fn() // inline!
|
|
694
|
+
}))
|
|
695
|
+
mockReadJson.mockResolvedValue(arr) mockReadJson.mockResolvedValue([...arr]) // copy!
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
#### Quick Template
|
|
699
|
+
|
|
700
|
+
```typescript
|
|
701
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
702
|
+
vi.mock('fs-extra', () => ({ default: { readFile: vi.fn() } }));
|
|
703
|
+
import fs from 'fs-extra';
|
|
704
|
+
|
|
705
|
+
describe('Feature', () => {
|
|
706
|
+
const mockReadFile = vi.mocked(fs.readFile);
|
|
707
|
+
|
|
708
|
+
beforeEach(() => {
|
|
709
|
+
vi.clearAllMocks();
|
|
710
|
+
mockReadFile.mockResolvedValue('data');
|
|
711
|
+
});
|
|
712
|
+
|
|
713
|
+
it('works', async () => {
|
|
714
|
+
const result = await MyModule.doSomething();
|
|
715
|
+
expect(mockReadFile).toHaveBeenCalled();
|
|
716
|
+
});
|
|
717
|
+
});
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
#### Pre-Commit Checklist
|
|
721
|
+
|
|
722
|
+
- [ ] ES6 imports (NOT require())
|
|
723
|
+
- [ ] vi.* APIs (NOT jest.*)
|
|
724
|
+
- [ ] vi.mocked() for mocks (NOT anyed<>)
|
|
725
|
+
- [ ] Inline mock factories (NO external variables)
|
|
726
|
+
- [ ] Array copies in mocks (NO shared references)
|
|
727
|
+
- [ ] vi.clearAllMocks() in beforeEach()
|
|
728
|
+
|
|
729
|
+
**Full guide**: `tests/test-template.test.ts`
|
|
730
|
+
|
|
731
|
+
**Why This Matters**:
|
|
732
|
+
1. Tests create mock `.specweave/` structures for testing
|
|
733
|
+
2. Cleanup uses `fs.rm(testRoot, { recursive: true })`
|
|
734
|
+
3. If `testRoot` points to project root β **DELETES REAL .specweave/!**
|
|
735
|
+
4. You lose all increments, docs, and history
|
|
736
|
+
|
|
737
|
+
**Use Test Utilities** (RECOMMENDED):
|
|
738
|
+
```typescript
|
|
739
|
+
import { createIsolatedTestDir, createSpecweaveStructure } from '../test-utils/isolated-test-dir';
|
|
740
|
+
|
|
741
|
+
test('my test', async () => {
|
|
742
|
+
const { testDir, cleanup } = await createIsolatedTestDir('my-test');
|
|
743
|
+
|
|
744
|
+
try {
|
|
745
|
+
// Setup .specweave structure in isolated directory
|
|
746
|
+
await createSpecweaveStructure(testDir);
|
|
747
|
+
|
|
748
|
+
// Test code here - NEVER touches project .specweave/
|
|
749
|
+
const incrementPath = path.join(testDir, '.specweave', 'increments', '0001-test');
|
|
750
|
+
// ...
|
|
751
|
+
} finally {
|
|
752
|
+
await cleanup(); // ALWAYS cleanup
|
|
753
|
+
}
|
|
754
|
+
});
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
**Protection Layers**:
|
|
758
|
+
1. β
**Pre-commit hook**: Blocks commits with dangerous test patterns
|
|
759
|
+
2. β
**Test utilities**: `tests/test-utils/isolated-test-dir.ts`
|
|
760
|
+
3. β
**Documentation**: This section
|
|
761
|
+
|
|
762
|
+
**Related Incident**: 2025-11-17 - Multiple `.specweave/` deletions traced to dangerous test patterns
|
|
763
|
+
**Root Cause Analysis**: `.specweave/increments/0037/reports/DELETION-ROOT-CAUSE-2025-11-17.md`
|
|
764
|
+
|
|
362
765
|
### Build Health Checks
|
|
363
766
|
|
|
364
767
|
**CRITICAL**: TypeScript ES Modules require specific practices:
|
package/README.md
CHANGED
|
@@ -14,14 +14,14 @@ The framework that turns solo builders into unicorn-level engineering teams.
|
|
|
14
14
|
|
|
15
15
|
## π Engineering Metrics (DORA)
|
|
16
16
|
|
|
17
|
-
[](https://github.com/anton-abyzov/specweave/blob/develop/.specweave/docs/internal/delivery/dora-metrics.md)
|
|
18
|
-
[](https://github.com/anton-abyzov/specweave/blob/develop/.specweave/docs/internal/delivery/dora-metrics.md)
|
|
19
|
-
[](https://github.com/anton-abyzov/specweave/blob/develop/.specweave/docs/internal/delivery/dora-metrics.md)
|
|
20
|
-
[](https://github.com/anton-abyzov/specweave/blob/develop/.specweave/docs/internal/delivery/dora-metrics.md)
|
|
17
|
+
[](https://github.com/anton-abyzov/specweave/blob/develop/.specweave/docs/internal/delivery/dora-metrics.md)
|
|
18
|
+
[](https://github.com/anton-abyzov/specweave/blob/develop/.specweave/docs/internal/delivery/dora-metrics.md)
|
|
19
|
+
[](https://github.com/anton-abyzov/specweave/blob/develop/.specweave/docs/internal/delivery/dora-metrics.md)
|
|
20
|
+
[](https://github.com/anton-abyzov/specweave/blob/develop/.specweave/docs/internal/delivery/dora-metrics.md)
|
|
21
21
|
|
|
22
22
|
**SpecWeave builds SpecWeave using SpecWeave.** These are real metrics from our own development.
|
|
23
23
|
|
|
24
|
-
**[β Live Dashboard](https://spec-weave.com/docs/metrics)** | **[β Detailed Report](https://github.com/anton-abyzov/specweave/blob/develop/metrics/dora-report.md)**
|
|
24
|
+
**[β Live Dashboard](https://spec-weave.com/docs/metrics)** | **[β Detailed Report](https://github.com/anton-abyzov/specweave/blob/develop/.specweave/metrics/dora-report.md)**
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
@@ -232,8 +232,18 @@ Claude implements Task 1:
|
|
|
232
232
|
# Install SpecWeave
|
|
233
233
|
npm install -g specweave
|
|
234
234
|
|
|
235
|
-
# Initialize
|
|
235
|
+
# Initialize with Strategic Init (AI-powered research)
|
|
236
236
|
specweave init my-project
|
|
237
|
+
|
|
238
|
+
# Strategic Init guides you through 6 phases:
|
|
239
|
+
# Phase 1: Vision & Market Research
|
|
240
|
+
# Phase 2: Scaling & Performance Goals
|
|
241
|
+
# Phase 3: Data & Compliance Detection
|
|
242
|
+
# Phase 4: Budget & Cloud Credits
|
|
243
|
+
# Phase 5: Methodology & Organization
|
|
244
|
+
# Phase 6: Repository Selection (optional)
|
|
245
|
+
|
|
246
|
+
# Result: Architecture recommendation, team plan, cost estimates
|
|
237
247
|
cd my-project
|
|
238
248
|
|
|
239
249
|
# Start building
|
|
@@ -242,6 +252,15 @@ cd my-project
|
|
|
242
252
|
/specweave:done 0001 # Complete increment
|
|
243
253
|
```
|
|
244
254
|
|
|
255
|
+
### Multi-Project Setup
|
|
256
|
+
```bash
|
|
257
|
+
# Initialize with multiple projects
|
|
258
|
+
specweave init --projects backend,frontend,mobile
|
|
259
|
+
|
|
260
|
+
# Tasks automatically split by project keyword detection
|
|
261
|
+
# Each project gets its own user stories and GitHub issues
|
|
262
|
+
```
|
|
263
|
+
|
|
245
264
|
### Brownfield (Existing Project)
|
|
246
265
|
```bash
|
|
247
266
|
# Initialize SpecWeave in existing project
|
|
@@ -255,7 +274,7 @@ specweave init .
|
|
|
255
274
|
/specweave:increment "Add dark mode"
|
|
256
275
|
```
|
|
257
276
|
|
|
258
|
-
**[β Complete Quickstart Guide](https://spec-weave.com/docs/guides/getting-started/quickstart)**
|
|
277
|
+
**[β Complete Quickstart Guide](https://spec-weave.com/docs/guides/getting-started/quickstart)** | **[β Strategic Init Guide](https://spec-weave.com/docs/guides/strategic-init)**
|
|
259
278
|
|
|
260
279
|
---
|
|
261
280
|
|
|
@@ -296,12 +315,23 @@ specweave init .
|
|
|
296
315
|
|
|
297
316
|
## Key Features
|
|
298
317
|
|
|
318
|
+
### Strategic Init - AI-Powered Architecture Planning (NEW!)
|
|
319
|
+
|
|
320
|
+
- π― **Research-Driven Discovery** - Answer 6 phases of questions about your product
|
|
321
|
+
- ποΈ **Architecture Recommendations** - Tech stack, scaling strategy, cost projections
|
|
322
|
+
- π **Compliance Detection** - Auto-detects 30+ standards (HIPAA, GDPR, SOC2, etc.)
|
|
323
|
+
- π₯ **Smart Team Planning** - Current and future team structure, hiring roadmap
|
|
324
|
+
- βοΈ **Cloud Credits Discovery** - AWS Activate, Azure Startup, GCP eligibility
|
|
325
|
+
- π¦ **Repository Selection** - Batch select 1-100+ repos with intelligent routing
|
|
326
|
+
|
|
327
|
+
### Production Features
|
|
328
|
+
|
|
299
329
|
- π€ **AI-Native Enterprise Sync** - Claude updates JIRA/GitHub/ADO automatically (bidirectional!)
|
|
300
330
|
- π **Living Documentation** - Auto-updates after every task (no manual sync!)
|
|
301
331
|
- π§ͺ **Test-Aware Planning** - Embedded tests in BDD format (Given/When/Then)
|
|
302
332
|
- π― **Disciplined Progress** - Can't start increment N+1 until N is DONE
|
|
303
333
|
- βΈοΈ **Intelligent Pausing** - Auto-detects blockers, pauses with context, resumes when ready
|
|
304
|
-
- π **Smart Reopen
|
|
334
|
+
- π **Smart Reopen** - Report "broken" β Auto-detects what to reopen, respects WIP limits
|
|
305
335
|
- π₯ **Multi-Project Tracking** - Unlimited JIRA/ADO/GitHub repos, intelligent routing
|
|
306
336
|
- π€ **AI Agents** - PM, Architect, Quality Judge guide your work
|
|
307
337
|
- π§ **CI/CD Auto-Fix** - Workflow failures auto-fixed by Claude (just mention `@claude`)
|
package/bin/specweave.js
CHANGED
|
@@ -311,20 +311,17 @@ async function checkForDuplicates() {
|
|
|
311
311
|
const report = await detectAllDuplicates(process.cwd());
|
|
312
312
|
|
|
313
313
|
if (report.duplicateCount > 0) {
|
|
314
|
-
console.log(chalk.yellow('\nβ οΈ
|
|
314
|
+
console.log(chalk.yellow('\nβ οΈ Duplicate increment(s) detected:\n'));
|
|
315
315
|
|
|
316
316
|
for (const duplicate of report.duplicates) {
|
|
317
|
-
console.log(chalk.
|
|
317
|
+
console.log(chalk.dim(` ${duplicate.incrementNumber}:`));
|
|
318
318
|
for (const location of duplicate.locations) {
|
|
319
|
-
const indicator = location === duplicate.recommendedWinner ? chalk.green('
|
|
320
|
-
console.log(` ${indicator} ${location.name} [${location.status}]
|
|
319
|
+
const indicator = location === duplicate.recommendedWinner ? chalk.green('β') : chalk.red('β');
|
|
320
|
+
console.log(` ${indicator} ${location.name} [${location.status}]`);
|
|
321
321
|
}
|
|
322
|
-
console.log(chalk.dim(` Reason: ${duplicate.resolutionReason}\n`));
|
|
323
322
|
}
|
|
324
323
|
|
|
325
|
-
console.log(chalk.
|
|
326
|
-
console.log(chalk.dim(' Run /specweave:fix-duplicates to automatically resolve conflicts'));
|
|
327
|
-
console.log(chalk.dim(' or manually delete/archive the losing versions\n'));
|
|
324
|
+
console.log(chalk.dim('\n Run /specweave:fix-duplicates to resolve\n'));
|
|
328
325
|
}
|
|
329
326
|
} catch (error) {
|
|
330
327
|
// Silently ignore errors (don't block CLI startup)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Validator
|
|
3
|
+
*
|
|
4
|
+
* Validates that completed tasks have actual code implementation.
|
|
5
|
+
* Prevents marking tasks as complete when:
|
|
6
|
+
* - Files don't exist
|
|
7
|
+
* - Files are empty or have trivial content
|
|
8
|
+
* - Implementation is incomplete
|
|
9
|
+
*
|
|
10
|
+
* Used by GitHub sync to enforce code-completion discipline.
|
|
11
|
+
*
|
|
12
|
+
* @module CodeValidator
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* File validation result
|
|
16
|
+
*/
|
|
17
|
+
export interface FileValidationResult {
|
|
18
|
+
path: string;
|
|
19
|
+
exists: boolean;
|
|
20
|
+
hasContent: boolean;
|
|
21
|
+
lineCount: number;
|
|
22
|
+
reason?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Task validation result
|
|
26
|
+
*/
|
|
27
|
+
export interface TaskValidationResult {
|
|
28
|
+
taskId: string;
|
|
29
|
+
valid: boolean;
|
|
30
|
+
files: FileValidationResult[];
|
|
31
|
+
reason?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* CodeValidator options
|
|
35
|
+
*/
|
|
36
|
+
export interface CodeValidatorOptions {
|
|
37
|
+
minLines?: number;
|
|
38
|
+
minChars?: number;
|
|
39
|
+
projectRoot?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare class CodeValidator {
|
|
42
|
+
private options;
|
|
43
|
+
constructor(options?: CodeValidatorOptions);
|
|
44
|
+
/**
|
|
45
|
+
* Validate that code exists for a task
|
|
46
|
+
*
|
|
47
|
+
* Extracts file paths from task description and verifies:
|
|
48
|
+
* 1. Files exist
|
|
49
|
+
* 2. Files have meaningful content
|
|
50
|
+
* 3. Files are not just stubs
|
|
51
|
+
*
|
|
52
|
+
* @param taskDescription - Task description with file paths
|
|
53
|
+
* @param taskId - Task ID for error messages
|
|
54
|
+
* @returns Validation result
|
|
55
|
+
*/
|
|
56
|
+
validateTask(taskDescription: string, taskId: string): Promise<TaskValidationResult>;
|
|
57
|
+
/**
|
|
58
|
+
* Validate a single file
|
|
59
|
+
*
|
|
60
|
+
* @param filePath - Path to file (relative or absolute)
|
|
61
|
+
* @returns File validation result
|
|
62
|
+
*/
|
|
63
|
+
validateFile(filePath: string): Promise<FileValidationResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Extract file paths from task description
|
|
66
|
+
*
|
|
67
|
+
* Supports multiple formats:
|
|
68
|
+
* - **Files**: src/foo.ts, src/bar.ts
|
|
69
|
+
* - **Files to create**: src/foo.ts
|
|
70
|
+
* - **Files to modify**: src/bar.ts
|
|
71
|
+
* - Inline code blocks with file paths
|
|
72
|
+
*
|
|
73
|
+
* @param description - Task description text
|
|
74
|
+
* @returns Array of file paths
|
|
75
|
+
*/
|
|
76
|
+
extractFilePaths(description: string): string[];
|
|
77
|
+
/**
|
|
78
|
+
* Batch validate multiple tasks
|
|
79
|
+
*
|
|
80
|
+
* @param tasks - Array of {taskId, description}
|
|
81
|
+
* @returns Array of validation results
|
|
82
|
+
*/
|
|
83
|
+
validateTasks(tasks: Array<{
|
|
84
|
+
taskId: string;
|
|
85
|
+
description: string;
|
|
86
|
+
}>): Promise<TaskValidationResult[]>;
|
|
87
|
+
/**
|
|
88
|
+
* Get summary of validation results
|
|
89
|
+
*
|
|
90
|
+
* @param results - Array of task validation results
|
|
91
|
+
* @returns Summary statistics
|
|
92
|
+
*/
|
|
93
|
+
summarizeResults(results: TaskValidationResult[]): {
|
|
94
|
+
total: number;
|
|
95
|
+
valid: number;
|
|
96
|
+
invalid: number;
|
|
97
|
+
noFiles: number;
|
|
98
|
+
invalidTasks: string[];
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=CodeValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeValidator.d.ts","sourceRoot":"","sources":["../../../../plugins/specweave-github/lib/CodeValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAiC;gBAEpC,OAAO,GAAE,oBAAyB;IAQ9C;;;;;;;;;;;OAWG;IACG,YAAY,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAsC1F;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA4EnE;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE;IAuC/C;;;;;OAKG;IACG,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAS3G;;;;;OAKG;IACH,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG;QACjD,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,EAAE,CAAC;KACxB;CAeF"}
|