specweave 1.0.140 → 1.0.142
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 +171 -404
- package/README.md +16 -12
- package/bin/specweave.js +35 -124
- package/dist/src/cli/commands/auto.d.ts.map +1 -1
- package/dist/src/cli/commands/auto.js +58 -8
- package/dist/src/cli/commands/auto.js.map +1 -1
- package/dist/src/cli/commands/detect-intent.d.ts +24 -3
- package/dist/src/cli/commands/detect-intent.d.ts.map +1 -1
- package/dist/src/cli/commands/detect-intent.js +107 -15
- package/dist/src/cli/commands/detect-intent.js.map +1 -1
- package/dist/src/cli/commands/evaluate-completion.d.ts +37 -0
- package/dist/src/cli/commands/evaluate-completion.d.ts.map +1 -0
- package/dist/src/cli/commands/evaluate-completion.js +100 -0
- package/dist/src/cli/commands/evaluate-completion.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +22 -9
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/list.d.ts.map +1 -1
- package/dist/src/cli/commands/list.js +2 -1
- package/dist/src/cli/commands/list.js.map +1 -1
- package/dist/src/cli/commands/migrate-lazy.js +1 -1
- package/dist/src/cli/commands/migrate-lazy.js.map +1 -1
- package/dist/src/cli/commands/migrate-to-profiles.d.ts.map +1 -1
- package/dist/src/cli/commands/migrate-to-profiles.js +2 -2
- package/dist/src/cli/commands/migrate-to-profiles.js.map +1 -1
- package/dist/src/cli/commands/plan/plan-orchestrator.d.ts.map +1 -1
- package/dist/src/cli/commands/plan/plan-orchestrator.js +3 -3
- package/dist/src/cli/commands/plan/plan-orchestrator.js.map +1 -1
- package/dist/src/cli/commands/reflect-stop.d.ts +30 -0
- package/dist/src/cli/commands/reflect-stop.d.ts.map +1 -0
- package/dist/src/cli/commands/reflect-stop.js +63 -0
- package/dist/src/cli/commands/reflect-stop.js.map +1 -0
- package/dist/src/cli/commands/refresh-marketplace.d.ts.map +1 -1
- package/dist/src/cli/commands/refresh-marketplace.js +3 -28
- package/dist/src/cli/commands/refresh-marketplace.js.map +1 -1
- package/dist/src/cli/commands/sync-spec-commits.js +3 -2
- package/dist/src/cli/commands/sync-spec-commits.js.map +1 -1
- package/dist/src/cli/commands/sync-spec-content.js +2 -1
- package/dist/src/cli/commands/sync-spec-content.js.map +1 -1
- package/dist/src/cli/commands/update.d.ts.map +1 -1
- package/dist/src/cli/commands/update.js +18 -0
- package/dist/src/cli/commands/update.js.map +1 -1
- package/dist/src/cli/helpers/init/directory-structure.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/directory-structure.js +0 -9
- package/dist/src/cli/helpers/init/directory-structure.js.map +1 -1
- package/dist/src/cli/helpers/init/git-hooks-installer.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/git-hooks-installer.js +2 -4
- package/dist/src/cli/helpers/init/git-hooks-installer.js.map +1 -1
- package/dist/src/cli/helpers/init/plugin-installer.js +52 -16
- package/dist/src/cli/helpers/init/plugin-installer.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/jira.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/jira.js +11 -11
- package/dist/src/cli/helpers/issue-tracker/jira.js.map +1 -1
- package/dist/src/core/ac-test-validator.d.ts.map +1 -1
- package/dist/src/core/ac-test-validator.js +5 -1
- package/dist/src/core/ac-test-validator.js.map +1 -1
- package/dist/src/core/auto/completion-evaluator.d.ts +62 -0
- package/dist/src/core/auto/completion-evaluator.d.ts.map +1 -0
- package/dist/src/core/auto/completion-evaluator.js +498 -0
- package/dist/src/core/auto/completion-evaluator.js.map +1 -0
- package/dist/src/core/auto/types.d.ts +45 -0
- package/dist/src/core/auto/types.d.ts.map +1 -1
- package/dist/src/core/auto/types.js +17 -0
- package/dist/src/core/auto/types.js.map +1 -1
- package/dist/src/core/config/config-manager.d.ts.map +1 -1
- package/dist/src/core/config/config-manager.js +1 -2
- package/dist/src/core/config/config-manager.js.map +1 -1
- package/dist/src/core/hooks/HookExecutor.d.ts.map +1 -1
- package/dist/src/core/hooks/HookExecutor.js +5 -1
- package/dist/src/core/hooks/HookExecutor.js.map +1 -1
- package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
- package/dist/src/core/increment/increment-archiver.js +7 -0
- package/dist/src/core/increment/increment-archiver.js.map +1 -1
- package/dist/src/core/increment/metadata-validator.d.ts.map +1 -1
- package/dist/src/core/increment/metadata-validator.js +1 -1
- package/dist/src/core/increment/metadata-validator.js.map +1 -1
- package/dist/src/core/lazy-loading/cache-manager.d.ts +35 -9
- package/dist/src/core/lazy-loading/cache-manager.d.ts.map +1 -1
- package/dist/src/core/lazy-loading/cache-manager.js +155 -56
- package/dist/src/core/lazy-loading/cache-manager.js.map +1 -1
- package/dist/src/core/lazy-loading/keyword-detector.d.ts.map +1 -1
- package/dist/src/core/lazy-loading/keyword-detector.js +152 -151
- package/dist/src/core/lazy-loading/keyword-detector.js.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts +31 -3
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.js +155 -66
- package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
- package/dist/src/core/living-docs/intelligent-analyzer/repo-scanner.d.ts.map +1 -1
- package/dist/src/core/living-docs/intelligent-analyzer/repo-scanner.js +1 -1
- package/dist/src/core/living-docs/intelligent-analyzer/repo-scanner.js.map +1 -1
- package/dist/src/core/llm/providers/claude-code-provider.d.ts.map +1 -1
- package/dist/src/core/llm/providers/claude-code-provider.js +5 -2
- package/dist/src/core/llm/providers/claude-code-provider.js.map +1 -1
- package/dist/src/core/reflection/index.d.ts +15 -55
- package/dist/src/core/reflection/index.d.ts.map +1 -1
- package/dist/src/core/reflection/index.js +16 -58
- package/dist/src/core/reflection/index.js.map +1 -1
- package/dist/src/core/reflection/reflect-handler.d.ts +112 -0
- package/dist/src/core/reflection/reflect-handler.d.ts.map +1 -0
- package/dist/src/core/reflection/reflect-handler.js +525 -0
- package/dist/src/core/reflection/reflect-handler.js.map +1 -0
- package/dist/src/core/skills/skill-validator.js +2 -2
- package/dist/src/core/skills/skill-validator.js.map +1 -1
- package/dist/src/core/types/config.d.ts +56 -0
- package/dist/src/core/types/config.d.ts.map +1 -1
- package/dist/src/core/types/config.js +6 -0
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/hooks/platform.d.ts.map +1 -1
- package/dist/src/hooks/platform.js +5 -1
- package/dist/src/hooks/platform.js.map +1 -1
- package/dist/src/integrations/jira/jira-incremental-mapper.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-incremental-mapper.js +1 -1
- package/dist/src/integrations/jira/jira-incremental-mapper.js.map +1 -1
- package/dist/src/integrations/jira/jira-mapper.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-mapper.js +1 -1
- package/dist/src/integrations/jira/jira-mapper.js.map +1 -1
- package/dist/src/utils/claude-cli-detector.d.ts +2 -0
- package/dist/src/utils/claude-cli-detector.d.ts.map +1 -1
- package/dist/src/utils/claude-cli-detector.js +6 -30
- package/dist/src/utils/claude-cli-detector.js.map +1 -1
- package/dist/src/utils/claude-cli-runner.d.ts +101 -0
- package/dist/src/utils/claude-cli-runner.d.ts.map +1 -0
- package/dist/src/utils/claude-cli-runner.js +265 -0
- package/dist/src/utils/claude-cli-runner.js.map +1 -0
- package/dist/src/utils/clean-env.d.ts +44 -0
- package/dist/src/utils/clean-env.d.ts.map +1 -0
- package/dist/src/utils/clean-env.js +55 -0
- package/dist/src/utils/clean-env.js.map +1 -0
- package/dist/src/utils/execFileNoThrow.d.ts.map +1 -1
- package/dist/src/utils/execFileNoThrow.js +11 -0
- package/dist/src/utils/execFileNoThrow.js.map +1 -1
- package/dist/src/utils/fs-native.d.ts +3 -2
- package/dist/src/utils/fs-native.d.ts.map +1 -1
- package/dist/src/utils/fs-native.js +3 -2
- package/dist/src/utils/fs-native.js.map +1 -1
- package/dist/src/utils/platform-utils.d.ts.map +1 -1
- package/dist/src/utils/platform-utils.js +2 -2
- package/dist/src/utils/platform-utils.js.map +1 -1
- package/package.json +1 -2
- package/plugins/specweave/hooks/reflect-stop-hook.sh +57 -95
- package/plugins/specweave/hooks/stop-auto.sh +63 -1
- package/plugins/specweave/hooks/user-prompt-submit.sh +158 -10
- package/plugins/specweave/lib/vendor/core/ac-test-validator.js +5 -1
- package/plugins/specweave/lib/vendor/core/ac-test-validator.js.map +1 -1
- package/plugins/specweave/lib/vendor/utils/fs-native.d.ts +3 -2
- package/plugins/specweave/lib/vendor/utils/fs-native.js +3 -2
- package/plugins/specweave/lib/vendor/utils/fs-native.js.map +1 -1
- package/plugins/specweave-ado/lib/ado-multi-project-sync.js +1 -0
- package/plugins/specweave-router/skills/router/SKILL.md +8 -8
- package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +223 -0
- package/src/templates/CLAUDE.md.template +67 -348
- package/src/templates/git-hooks/pre-commit.template +3 -3
- package/dist/src/cli/commands/load-plugins.d.ts +0 -41
- package/dist/src/cli/commands/load-plugins.d.ts.map +0 -1
- package/dist/src/cli/commands/load-plugins.js +0 -263
- package/dist/src/cli/commands/load-plugins.js.map +0 -1
- package/dist/src/cli/commands/merge-skill-memories.d.ts +0 -36
- package/dist/src/cli/commands/merge-skill-memories.d.ts.map +0 -1
- package/dist/src/cli/commands/merge-skill-memories.js +0 -174
- package/dist/src/cli/commands/merge-skill-memories.js.map +0 -1
- package/dist/src/cli/commands/migrate-memory.d.ts +0 -38
- package/dist/src/cli/commands/migrate-memory.d.ts.map +0 -1
- package/dist/src/cli/commands/migrate-memory.js +0 -141
- package/dist/src/cli/commands/migrate-memory.js.map +0 -1
- package/dist/src/cli/commands/plugin-status.d.ts +0 -15
- package/dist/src/cli/commands/plugin-status.d.ts.map +0 -1
- package/dist/src/cli/commands/plugin-status.js +0 -264
- package/dist/src/cli/commands/plugin-status.js.map +0 -1
- package/dist/src/cli/commands/unload-plugins.d.ts +0 -36
- package/dist/src/cli/commands/unload-plugins.d.ts.map +0 -1
- package/dist/src/cli/commands/unload-plugins.js +0 -180
- package/dist/src/cli/commands/unload-plugins.js.map +0 -1
- package/dist/src/core/reflection/learning-validator.d.ts +0 -102
- package/dist/src/core/reflection/learning-validator.d.ts.map +0 -1
- package/dist/src/core/reflection/learning-validator.js +0 -351
- package/dist/src/core/reflection/learning-validator.js.map +0 -1
- package/dist/src/core/reflection/skill-memory-merger.d.ts +0 -112
- package/dist/src/core/reflection/skill-memory-merger.d.ts.map +0 -1
- package/dist/src/core/reflection/skill-memory-merger.js +0 -413
- package/dist/src/core/reflection/skill-memory-merger.js.map +0 -1
- package/dist/src/core/reflection/skill-memory-paths.d.ts +0 -163
- package/dist/src/core/reflection/skill-memory-paths.d.ts.map +0 -1
- package/dist/src/core/reflection/skill-memory-paths.js +0 -379
- package/dist/src/core/reflection/skill-memory-paths.js.map +0 -1
- package/dist/src/core/reflection/skill-reflection-manager.d.ts +0 -148
- package/dist/src/core/reflection/skill-reflection-manager.d.ts.map +0 -1
- package/dist/src/core/reflection/skill-reflection-manager.js +0 -531
- package/dist/src/core/reflection/skill-reflection-manager.js.map +0 -1
- package/dist/src/reporters/playwright-coverage-reporter.d.ts +0 -60
- package/dist/src/reporters/playwright-coverage-reporter.d.ts.map +0 -1
- package/dist/src/reporters/playwright-coverage-reporter.js +0 -200
- package/dist/src/reporters/playwright-coverage-reporter.js.map +0 -1
- package/plugins/specweave/hooks/.specweave/logs/auto-iterations.log +0 -1
- package/plugins/specweave/hooks/.specweave/logs/auto-stop-reasons.log +0 -1
- package/plugins/specweave/hooks/docs-changed.sh.backup +0 -79
- package/plugins/specweave/hooks/human-input-required.sh.backup +0 -75
- package/plugins/specweave/hooks/post-first-increment.sh.backup +0 -61
- package/plugins/specweave/hooks/post-increment-change.sh.backup +0 -98
- package/plugins/specweave/hooks/post-increment-completion.sh.backup +0 -231
- package/plugins/specweave/hooks/post-increment-planning.sh.backup +0 -1048
- package/plugins/specweave/hooks/post-increment-status-change.sh.backup +0 -147
- package/plugins/specweave/hooks/post-spec-update.sh.backup +0 -158
- package/plugins/specweave/hooks/post-user-story-complete.sh.backup +0 -179
- package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +0 -83
- package/plugins/specweave/hooks/pre-implementation.sh.backup +0 -67
- package/plugins/specweave/hooks/pre-task-completion.sh.backup +0 -194
- package/plugins/specweave/hooks/pre-tool-use.sh.backup +0 -133
- package/plugins/specweave/hooks/user-prompt-submit.sh.backup +0 -386
- package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +0 -353
- package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +0 -172
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +0 -1266
- package/plugins/specweave-github/hooks/post-task-completion.sh.backup +0 -258
- package/plugins/specweave-github/lib/enhanced-github-sync.js +0 -220
- package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +0 -172
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -134
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -1260
- package/plugins/specweave-release/hooks/post-task-completion.sh.backup +0 -110
package/CLAUDE.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<!-- SW:META template="claude" version="1.0.
|
|
1
|
+
<!-- SW:META template="claude" version="1.0.141" sections="header,start,autodetect,metarule,rules,workflow,reflect,skillmemories,context,lsp,structure,taskformat,secrets,syncing,mapping,testing,api,limits,troubleshooting,lazyloading,principles,linking,mcp,autoexecute,auto,docs" -->
|
|
2
2
|
|
|
3
|
-
<!-- SW:SECTION:header version="1.0.
|
|
3
|
+
<!-- SW:SECTION:header version="1.0.141" -->
|
|
4
4
|
**Framework**: SpecWeave | **Truth**: `spec.md` + `tasks.md`
|
|
5
5
|
<!-- SW:END:header -->
|
|
6
6
|
|
|
7
|
-
<!-- SW:SECTION:start version="1.0.
|
|
7
|
+
<!-- SW:SECTION:start version="1.0.141" -->
|
|
8
8
|
## Getting Started
|
|
9
9
|
|
|
10
10
|
**Initial increment**: `0001-project-setup` (auto-created by `specweave init`)
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
2. **Customize**: Edit spec.md and use for setup tasks
|
|
15
15
|
<!-- SW:END:start -->
|
|
16
16
|
|
|
17
|
-
<!-- SW:SECTION:autodetect version="1.0.
|
|
17
|
+
<!-- SW:SECTION:autodetect version="1.0.141" -->
|
|
18
18
|
## Auto-Detection
|
|
19
19
|
|
|
20
20
|
SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
@@ -24,7 +24,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
24
24
|
**Opt-out phrases**: "Just brainstorm first" | "Don't plan yet" | "Quick discussion" | "Let's explore ideas"
|
|
25
25
|
<!-- SW:END:autodetect -->
|
|
26
26
|
|
|
27
|
-
<!-- SW:SECTION:metarule version="1.0.
|
|
27
|
+
<!-- SW:SECTION:metarule version="1.0.141" -->
|
|
28
28
|
## Meta-Rule: Think-Before-Act
|
|
29
29
|
|
|
30
30
|
**Satisfy dependencies BEFORE dependent operations.**
|
|
@@ -35,7 +35,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
35
35
|
```
|
|
36
36
|
<!-- SW:END:metarule -->
|
|
37
37
|
|
|
38
|
-
<!-- SW:SECTION:rules version="1.0.
|
|
38
|
+
<!-- SW:SECTION:rules version="1.0.141" -->
|
|
39
39
|
## Rules
|
|
40
40
|
|
|
41
41
|
1. **Files** → `.specweave/increments/####-name/` (spec.md, plan.md, tasks.md at root; reports/, scripts/, logs/ subfolders)
|
|
@@ -48,7 +48,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
48
48
|
8. **⛔ Marketplace refresh**: ALWAYS use `specweave refresh-marketplace` CLI command. NEVER suggest `scripts/refresh-marketplace.sh` - end users don't have the scripts folder (npm global install).
|
|
49
49
|
<!-- SW:END:rules -->
|
|
50
50
|
|
|
51
|
-
<!-- SW:SECTION:workflow version="1.0.
|
|
51
|
+
<!-- SW:SECTION:workflow version="1.0.141" -->
|
|
52
52
|
## Workflow
|
|
53
53
|
|
|
54
54
|
`/sw:increment "X"` → `/sw:do` → `/sw:progress` → `/sw:done 0001`
|
|
@@ -68,51 +68,46 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
68
68
|
**Natural language**: "Let's build X" → `/sw:increment` | "What's status?" → `/sw:progress` | "We're done" → `/sw:done` | "Ship while sleeping" → `/sw:auto`
|
|
69
69
|
<!-- SW:END:workflow -->
|
|
70
70
|
|
|
71
|
-
<!-- SW:SECTION:reflect version="1.0.
|
|
71
|
+
<!-- SW:SECTION:reflect version="1.0.141" -->
|
|
72
72
|
## Self-Improving Skills (Reflect)
|
|
73
73
|
|
|
74
74
|
**Learn once, never repeat.** Claude learns from corrections and patterns across sessions.
|
|
75
75
|
|
|
76
|
-
| Cmd | Action |
|
|
77
|
-
|-----|--------|
|
|
78
|
-
| `/sw:reflect` | Analyze session, extract learnings |
|
|
79
|
-
| `/sw:reflect-on` | Enable auto-reflection on session end |
|
|
80
|
-
| `/sw:reflect-off` | Disable auto-reflection |
|
|
81
|
-
| `/sw:reflect-status` | Show memory status |
|
|
82
|
-
|
|
83
76
|
**How it works**:
|
|
84
|
-
1.
|
|
85
|
-
2.
|
|
86
|
-
3. Future sessions
|
|
77
|
+
1. Session ends → Stop hook runs LLM extraction
|
|
78
|
+
2. Learnings saved to **Skill Memories** section below (organized by skill)
|
|
79
|
+
3. Future sessions see learnings immediately (they're in this file!)
|
|
87
80
|
|
|
88
|
-
**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
# Also check global memory
|
|
93
|
-
ls ~/.specweave/memory/*.md 2>/dev/null
|
|
94
|
-
```
|
|
81
|
+
**What gets captured** (SpecWeave-specific only):
|
|
82
|
+
- Skill behavior preferences: "mobile: Run expo tests on localhost:8081"
|
|
83
|
+
- Workflow preferences: "general: User prefers small increments (max 5 tasks)"
|
|
84
|
+
- Tech stack choices: "frontend: Prefer Vercel over Cloudflare for this project"
|
|
95
85
|
|
|
96
|
-
**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
├── component-usage.md # UI patterns
|
|
100
|
-
├── api-patterns.md # API patterns
|
|
101
|
-
├── testing.md # Test patterns
|
|
102
|
-
├── deployment.md # Deploy patterns
|
|
103
|
-
└── general.md # Misc patterns
|
|
104
|
-
|
|
105
|
-
~/.specweave/memory/ # Global learnings (all projects)
|
|
106
|
-
```
|
|
86
|
+
**What does NOT get captured**:
|
|
87
|
+
- Generic coding patterns (not SpecWeave's job)
|
|
88
|
+
- One-time fixes that won't recur
|
|
107
89
|
|
|
108
|
-
**
|
|
109
|
-
|
|
110
|
-
|
|
90
|
+
**Config** (`.specweave/config.json`):
|
|
91
|
+
```json
|
|
92
|
+
{ "reflect": { "enabled": true, "model": "haiku", "maxLearningsPerSession": 3 } }
|
|
93
|
+
```
|
|
111
94
|
|
|
112
|
-
**
|
|
95
|
+
**Disable**: Set `"reflect": { "enabled": false }` in config
|
|
113
96
|
<!-- SW:END:reflect -->
|
|
114
97
|
|
|
115
|
-
|
|
98
|
+
## Skill Memories
|
|
99
|
+
|
|
100
|
+
<!-- Auto-captured by SpecWeave reflect. Edit or delete as needed. -->
|
|
101
|
+
<!-- Learnings are organized by skill name. User edits override SpecWeave defaults. -->
|
|
102
|
+
|
|
103
|
+
<!-- SW:SECTION:skillmemories version="1.0.141" -->
|
|
104
|
+
## Skill Memories
|
|
105
|
+
|
|
106
|
+
<!-- Auto-captured by SpecWeave reflect. Edit or delete as needed. -->
|
|
107
|
+
<!-- Learnings are organized by skill name. User edits override SpecWeave defaults. -->
|
|
108
|
+
<!-- SW:END:skillmemories -->
|
|
109
|
+
|
|
110
|
+
<!-- SW:SECTION:context version="1.0.141" -->
|
|
116
111
|
## Living Docs Context
|
|
117
112
|
|
|
118
113
|
**Before implementing features**: Check existing docs for patterns and decisions.
|
|
@@ -132,7 +127,7 @@ grep -ril "keyword" .specweave/docs/internal/
|
|
|
132
127
|
**Use `/sw:context <topic>`** to load relevant living docs into conversation.
|
|
133
128
|
<!-- SW:END:context -->
|
|
134
129
|
|
|
135
|
-
<!-- SW:SECTION:lsp version="1.0.
|
|
130
|
+
<!-- SW:SECTION:lsp version="1.0.141" -->
|
|
136
131
|
## LSP-Enhanced Exploration
|
|
137
132
|
|
|
138
133
|
**USE LSP ACTIVELY** for semantic code understanding (100x faster than grep).
|
|
@@ -149,7 +144,7 @@ go install golang.org/x/tools/gopls@latest # Go
|
|
|
149
144
|
**Best Practices**: ALWAYS use `findReferences` before refactoring | Use `goToDefinition` instead of grep | Combine with Explore agent
|
|
150
145
|
<!-- SW:END:lsp -->
|
|
151
146
|
|
|
152
|
-
<!-- SW:SECTION:structure version="1.0.
|
|
147
|
+
<!-- SW:SECTION:structure version="1.0.141" -->
|
|
153
148
|
## Structure
|
|
154
149
|
|
|
155
150
|
```
|
|
@@ -219,7 +214,7 @@ my-project/
|
|
|
219
214
|
```
|
|
220
215
|
<!-- SW:END:structure -->
|
|
221
216
|
|
|
222
|
-
<!-- SW:SECTION:taskformat version="1.0.
|
|
217
|
+
<!-- SW:SECTION:taskformat version="1.0.141" -->
|
|
223
218
|
## Task Format
|
|
224
219
|
|
|
225
220
|
```markdown
|
|
@@ -229,13 +224,13 @@ my-project/
|
|
|
229
224
|
```
|
|
230
225
|
<!-- SW:END:taskformat -->
|
|
231
226
|
|
|
232
|
-
<!-- SW:SECTION:secrets version="1.0.
|
|
227
|
+
<!-- SW:SECTION:secrets version="1.0.141" -->
|
|
233
228
|
## Secrets Check
|
|
234
229
|
|
|
235
230
|
**BEFORE CLI tools**: Check existing config first!
|
|
236
231
|
```bash
|
|
237
232
|
# Check if credentials EXIST (never display values!)
|
|
238
|
-
grep -qE "(GITHUB_TOKEN|JIRA_|ADO_)" .env 2>/dev/null && echo "Credentials found in .env"
|
|
233
|
+
grep -qE "(GITHUB_TOKEN|GH_TOKEN|JIRA_|AZURE_DEVOPS_|ADO_)" .env 2>/dev/null && echo "Credentials found in .env"
|
|
239
234
|
cat .specweave/config.json | grep -A5 '"sync"'
|
|
240
235
|
gh auth status
|
|
241
236
|
```
|
|
@@ -243,7 +238,7 @@ gh auth status
|
|
|
243
238
|
**SECURITY**: NEVER use `grep TOKEN .env` without `-q` flag - it exposes credentials in terminal!
|
|
244
239
|
<!-- SW:END:secrets -->
|
|
245
240
|
|
|
246
|
-
<!-- SW:SECTION:syncing version="1.0.
|
|
241
|
+
<!-- SW:SECTION:syncing version="1.0.141" -->
|
|
247
242
|
## External Sync (GitHub/JIRA/ADO)
|
|
248
243
|
|
|
249
244
|
**After increment creation**: Run `/sw-github:sync {id}` to create issues!
|
|
@@ -271,7 +266,7 @@ Living docs sync ≠ External sync. They are separate:
|
|
|
271
266
|
**Verify tokens**: `grep -q GITHUB_TOKEN .env && echo "Token configured"` | `gh auth status`
|
|
272
267
|
<!-- SW:END:syncing -->
|
|
273
268
|
|
|
274
|
-
<!-- SW:SECTION:mapping version="1.0.
|
|
269
|
+
<!-- SW:SECTION:mapping version="1.0.141" -->
|
|
275
270
|
## GitHub Mapping
|
|
276
271
|
|
|
277
272
|
| SpecWeave | GitHub |
|
|
@@ -281,19 +276,19 @@ Living docs sync ≠ External sync. They are separate:
|
|
|
281
276
|
| Task T-XXX | Checkbox |
|
|
282
277
|
<!-- SW:END:mapping -->
|
|
283
278
|
|
|
284
|
-
<!-- SW:SECTION:testing version="1.0.
|
|
279
|
+
<!-- SW:SECTION:testing version="1.0.141" -->
|
|
285
280
|
## Testing
|
|
286
281
|
|
|
287
282
|
BDD in tasks.md | Unit >80% | `.test.ts` (Vitest)
|
|
288
283
|
|
|
289
284
|
```typescript
|
|
290
|
-
//
|
|
291
|
-
|
|
292
|
-
vi.mock('
|
|
285
|
+
// ESM mocking: vi.hoisted() + vi.mock() (Vitest 4.x+)
|
|
286
|
+
const { mockFn } = vi.hoisted(() => ({ mockFn: vi.fn() }));
|
|
287
|
+
vi.mock('./module', () => ({ func: mockFn }));
|
|
293
288
|
```
|
|
294
289
|
<!-- SW:END:testing -->
|
|
295
290
|
|
|
296
|
-
<!-- SW:SECTION:api version="1.0.
|
|
291
|
+
<!-- SW:SECTION:api version="1.0.141" -->
|
|
297
292
|
## API Development (OpenAPI-First)
|
|
298
293
|
|
|
299
294
|
**For API projects only.** OpenAPI = source of truth → Postman derived from it.
|
|
@@ -312,13 +307,13 @@ vi.mock('fs', () => ({ readFile: vi.fn() }));
|
|
|
312
307
|
**Import**: Postman → Import collection + env → Fill secrets → Select env
|
|
313
308
|
<!-- SW:END:api -->
|
|
314
309
|
|
|
315
|
-
<!-- SW:SECTION:limits version="1.0.
|
|
310
|
+
<!-- SW:SECTION:limits version="1.0.141" -->
|
|
316
311
|
## Limits
|
|
317
312
|
|
|
318
313
|
**Max 1500 lines/file** — extract before adding
|
|
319
314
|
<!-- SW:END:limits -->
|
|
320
315
|
|
|
321
|
-
<!-- SW:SECTION:troubleshooting version="1.0.
|
|
316
|
+
<!-- SW:SECTION:troubleshooting version="1.0.141" -->
|
|
322
317
|
## Troubleshooting
|
|
323
318
|
|
|
324
319
|
| Issue | Fix |
|
|
@@ -337,10 +332,12 @@ vi.mock('fs', () => ({ readFile: vi.fn() }));
|
|
|
337
332
|
| Edits blocked in repositories/ | Add `"additionalDirectories":["repositories"]` + `Write(//**)`, `Edit(//**)` to `.claude/settings.json` |
|
|
338
333
|
| Path patterns not working | `//path` = absolute, `/path` = relative to settings file, `additionalDirectories` for explicit working dirs |
|
|
339
334
|
| Router not spawning agents | Restart Claude Code; check `/plugin` shows `sw-router` |
|
|
340
|
-
| Need all plugins loaded | `
|
|
335
|
+
| Need all plugins loaded | Install via `/plugin` UI or `claude plugin install sw-*@specweave` |
|
|
336
|
+
| Plugin install fails "Source path does not exist" | Run: `cd ~/.claude/plugins/marketplaces/specweave && git checkout HEAD -- plugins` |
|
|
337
|
+
| Marketplace shows 0 installed | Normal if using auto-load; check `/plugin list` for actual status |
|
|
341
338
|
<!-- SW:END:troubleshooting -->
|
|
342
339
|
|
|
343
|
-
<!-- SW:SECTION:lazyloading version="1.0.
|
|
340
|
+
<!-- SW:SECTION:lazyloading version="1.0.141" -->
|
|
344
341
|
## Lazy Plugin Loading (Auto-Loading)
|
|
345
342
|
|
|
346
343
|
**SpecWeave automatically loads plugins** when you need them - no manual action required.
|
|
@@ -371,15 +368,28 @@ vi.mock('fs', () => ({ readFile: vi.fn() }));
|
|
|
371
368
|
| test, tdd, playwright, vitest | `sw-testing` |
|
|
372
369
|
| ml, pytorch, tensorflow, training | `sw-ml` |
|
|
373
370
|
|
|
374
|
-
### Manual
|
|
371
|
+
### Manual Plugin Installation
|
|
375
372
|
|
|
376
|
-
If auto-loading misses something,
|
|
373
|
+
If auto-loading misses something, use Claude's native plugin commands:
|
|
377
374
|
```bash
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
375
|
+
# Install plugins (uses short names from marketplace.json)
|
|
376
|
+
claude plugin install sw@specweave # Core framework
|
|
377
|
+
claude plugin install sw-frontend@specweave # Frontend development
|
|
378
|
+
claude plugin install sw-github@specweave # GitHub integration
|
|
379
|
+
|
|
380
|
+
# Enable/disable installed plugins
|
|
381
|
+
claude plugin enable sw-frontend@specweave
|
|
382
|
+
claude plugin disable sw-frontend@specweave
|
|
383
|
+
|
|
384
|
+
# List installed plugins
|
|
385
|
+
claude plugin list
|
|
386
|
+
|
|
387
|
+
# Update marketplace cache (if plugins folder missing)
|
|
388
|
+
claude plugin marketplace update specweave
|
|
381
389
|
```
|
|
382
390
|
|
|
391
|
+
**Plugin names** use SHORT format: `sw`, `sw-frontend`, `sw-github` (NOT `specweave-frontend`)
|
|
392
|
+
|
|
383
393
|
### Disable Auto-Loading
|
|
384
394
|
|
|
385
395
|
```bash
|
|
@@ -391,11 +401,11 @@ export SPECWEAVE_DISABLE_AUTO_LOAD=1 # Disable auto-loading
|
|
|
391
401
|
| Mode | Context Usage |
|
|
392
402
|
|------|---------------|
|
|
393
403
|
| Default (core + auto-load) | ~3-5K tokens |
|
|
394
|
-
| All
|
|
404
|
+
| All plugins loaded | ~60K+ tokens |
|
|
395
405
|
| Agent spawn (forked) | 0 tokens in main context |
|
|
396
406
|
<!-- SW:END:lazyloading -->
|
|
397
407
|
|
|
398
|
-
<!-- SW:SECTION:principles version="1.0.
|
|
408
|
+
<!-- SW:SECTION:principles version="1.0.141" -->
|
|
399
409
|
## Principles
|
|
400
410
|
|
|
401
411
|
1. **Spec-first**: `/sw:increment` before coding
|
|
@@ -405,7 +415,7 @@ export SPECWEAVE_DISABLE_AUTO_LOAD=1 # Disable auto-loading
|
|
|
405
415
|
5. **Clean**: All files in increment folders
|
|
406
416
|
<!-- SW:END:principles -->
|
|
407
417
|
|
|
408
|
-
<!-- SW:SECTION:linking version="1.0.
|
|
418
|
+
<!-- SW:SECTION:linking version="1.0.141" -->
|
|
409
419
|
## Bidirectional Linking
|
|
410
420
|
|
|
411
421
|
Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
|
|
@@ -413,124 +423,41 @@ Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
|
|
|
413
423
|
Task format: `**AC**: AC-US1-01, AC-US1-02` (CRITICAL for linking)
|
|
414
424
|
<!-- SW:END:linking -->
|
|
415
425
|
|
|
416
|
-
<!-- SW:SECTION:mcp version="1.0.
|
|
417
|
-
## External
|
|
418
|
-
|
|
419
|
-
**Priority**: MCP Server → REST API → CLI → Direct Connection
|
|
426
|
+
<!-- SW:SECTION:mcp version="1.0.142" -->
|
|
427
|
+
## External Services
|
|
420
428
|
|
|
421
|
-
**
|
|
422
|
-
```bash
|
|
423
|
-
# MCP (restart Claude Code after)
|
|
424
|
-
npx @anthropic-ai/claude-code-mcp add supabase
|
|
425
|
-
|
|
426
|
-
# CLI Auth
|
|
427
|
-
wrangler login && vercel login && supabase login
|
|
428
|
-
```
|
|
429
|
+
**Priority**: CLI tools first (simpler) → MCP for complex integrations
|
|
429
430
|
|
|
430
|
-
**
|
|
431
|
-
**Cloudflare**: `wrangler login` once, then `wrangler deploy/secret put/kv:key put`
|
|
432
|
-
|
|
433
|
-
**Check credentials before ops**:
|
|
431
|
+
**CLI tools** (check auth first):
|
|
434
432
|
```bash
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
433
|
+
gh auth status # GitHub
|
|
434
|
+
wrangler whoami # Cloudflare
|
|
435
|
+
supabase status # Supabase
|
|
438
436
|
```
|
|
439
|
-
<!-- SW:END:mcp -->
|
|
440
437
|
|
|
441
|
-
|
|
442
|
-
## Auto-Execute Rule
|
|
443
|
-
|
|
444
|
-
**NEVER** output "Manual Step Required" when credentials exist. **EXECUTE DIRECTLY.**
|
|
445
|
-
|
|
446
|
-
**Flow**: Check `.env` → If exists, EXECUTE | If missing, ASK for credentials → Save → EXECUTE
|
|
447
|
-
|
|
448
|
-
**Check before ops**:
|
|
438
|
+
**MCP servers** (for richer integrations):
|
|
449
439
|
```bash
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
440
|
+
claude mcp add --transport http github https://api.github.com/mcp
|
|
441
|
+
claude mcp add --transport stdio postgres -- npx -y @modelcontextprotocol/server-postgres
|
|
442
|
+
/mcp # Check status in Claude Code
|
|
453
443
|
```
|
|
454
|
-
<!-- SW:END:autoexecute -->
|
|
455
|
-
|
|
456
|
-
<!-- SW:SECTION:auto version="1.0.139" -->
|
|
457
|
-
## Auto Mode (Autonomous Execution)
|
|
458
|
-
|
|
459
|
-
**Continuous execution until all tasks complete.**
|
|
460
|
-
|
|
461
|
-
### Zero Manual Steps
|
|
462
|
-
|
|
463
|
-
**NEVER ask user to**: Open dashboards | Copy/paste | Run commands manually
|
|
464
|
-
|
|
465
|
-
**Instead**: Check `.env` → Use CLI (`wrangler`, `gh`, `aws`) → Use MCP → If missing, ASK → Save → EXECUTE
|
|
466
|
-
|
|
467
|
-
### Test Loop (MANDATORY)
|
|
468
|
-
|
|
469
|
-
**After EVERY task**: `npm test` → If E2E exists: `npx playwright test` → Fail? FIX → Rerun (max 3x) → Pass → Next
|
|
470
|
-
|
|
471
|
-
**Pattern**: IMPLEMENT → TEST → FAIL? → FIX → TEST → PASS → NEXT
|
|
472
|
-
|
|
473
|
-
**MVP paths**: Auth (login/logout) | Core CRUD | Payments | Data integrity
|
|
474
|
-
|
|
475
|
-
### Pragmatic Completion
|
|
476
|
-
|
|
477
|
-
**Don't blindly follow 100%!** Specs have bugs, requirements change, some tasks become irrelevant.
|
|
478
444
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
**CAN SKIP**: Conflicts (ask user) | Over-engineered cases | Obsolete tasks
|
|
482
|
-
|
|
483
|
-
**STOP & ASK** if: Spec conflicts | Task seems unnecessary | Requirement ambiguous
|
|
484
|
-
|
|
485
|
-
### Test User Strategy
|
|
486
|
-
|
|
487
|
-
**Multiple users**: RBAC | Subscription tiers | User states | Multi-user interactions
|
|
488
|
-
**One user**: CRUD | Form validation | Component tests | Mocked auth
|
|
489
|
-
|
|
490
|
-
**E2E**: Seed DB with known users → Use fixtures → `storageState` (auth once, reuse)
|
|
491
|
-
|
|
492
|
-
### E2E Authentication
|
|
493
|
-
|
|
494
|
-
**Auth = #1 flaky test cause.** Use `storageState` (login ONCE, reuse) | API auth (UI unstable) | UI login (only for login tests)
|
|
495
|
-
|
|
496
|
-
**Setup**: Global auth.setup.ts → Save to `playwright/.auth/user.json` → Reuse in config
|
|
497
|
-
|
|
498
|
-
**Fixes**: Session expires? Increase TTL | Rate limited? API auth | Captcha? Disable in test env
|
|
499
|
-
|
|
500
|
-
**Checklist**: Seed users | Gen auth state | Tests DON'T login | Disable captcha/2FA
|
|
501
|
-
|
|
502
|
-
### Refactoring & Reporting
|
|
503
|
-
|
|
504
|
-
**Every 3-5 tasks**: Extract fixtures | Remove duplication | Split if >300 lines | Clean imports
|
|
505
|
-
|
|
506
|
-
**Triggers**: Test >200 lines? Split | Duplicate setup? Extract | Same assertion 3x? Helper
|
|
507
|
-
|
|
508
|
-
**Report after EVERY task**: Pass/Total | Coverage | Failing tests | Next steps
|
|
509
|
-
|
|
510
|
-
### Local-First & Infrastructure
|
|
511
|
-
|
|
512
|
-
**No deploy instructions?** Build locally → Test all → Verify → ASK user about deploy target
|
|
513
|
-
|
|
514
|
-
**Infra Decision Tree**:
|
|
515
|
-
- **Cron**: <1/hr → Vercel/GitHub Actions | ≥1/hr → Railway/Render
|
|
516
|
-
- **Storage**: KV → Upstash/Vercel KV | SQL → Supabase/Neon | Docs → MongoDB | Files → R2/S3
|
|
517
|
-
|
|
518
|
-
**Process**: Ultrathink options → Research costs → Propose 2-3 → Build local → User confirms → Deploy
|
|
519
|
-
|
|
520
|
-
### Implementation
|
|
445
|
+
MCP supports lazy-loading (auto mode) - tools load on-demand when >10% context.
|
|
446
|
+
<!-- SW:END:mcp -->
|
|
521
447
|
|
|
522
|
-
|
|
448
|
+
<!-- SW:SECTION:auto version="1.0.142" -->
|
|
449
|
+
## Auto Mode
|
|
523
450
|
|
|
524
|
-
**
|
|
451
|
+
**Commands**: `/sw:auto` (start) | `/sw:auto-status` (check) | `/sw:cancel-auto` (emergency only)
|
|
525
452
|
|
|
526
|
-
**
|
|
453
|
+
**Pattern**: IMPLEMENT → TEST → FAIL? → FIX → PASS → NEXT
|
|
527
454
|
|
|
528
|
-
**
|
|
455
|
+
**Pragmatic completion**: MUST (MVP, security, data integrity) | SHOULD (edge cases) | CAN SKIP (conflicts - ask user)
|
|
529
456
|
|
|
530
|
-
**
|
|
457
|
+
**STOP & ASK** if: Spec conflicts | Task unnecessary | Requirement ambiguous
|
|
531
458
|
<!-- SW:END:auto -->
|
|
532
459
|
|
|
533
|
-
<!-- SW:SECTION:docs version="1.0.
|
|
460
|
+
<!-- SW:SECTION:docs version="1.0.141" -->
|
|
534
461
|
## Docs
|
|
535
462
|
|
|
536
463
|
[spec-weave.com](https://spec-weave.com) | `.specweave/docs/internal/`
|
|
@@ -556,256 +483,56 @@ For **contributors to SpecWeave itself** (not users).
|
|
|
556
483
|
|
|
557
484
|
---
|
|
558
485
|
|
|
559
|
-
## Marketplace
|
|
560
|
-
|
|
561
|
-
**⚠️ CRITICAL: NEVER suggest `bash scripts/refresh-marketplace.sh` to end users!**
|
|
562
|
-
|
|
563
|
-
End users **don't have the `scripts/` folder** - they installed SpecWeave via npm globally.
|
|
564
|
-
|
|
565
|
-
**Correct commands**:
|
|
566
|
-
- **Contributors** (in specweave repo): `bash scripts/refresh-marketplace.sh`
|
|
567
|
-
- **End Users** (user projects): `specweave refresh-marketplace`
|
|
568
|
-
|
|
569
|
-
---
|
|
570
|
-
|
|
571
|
-
### For SpecWeave Contributors (Development)
|
|
572
|
-
|
|
573
|
-
**ALWAYS use GitHub marketplace mode. NEVER use local symlinks or directory mode.**
|
|
574
|
-
|
|
575
|
-
```bash
|
|
576
|
-
# ✅ CORRECT: Install from GitHub (production, stable)
|
|
577
|
-
bash scripts/refresh-marketplace.sh --github
|
|
578
|
-
|
|
579
|
-
# ❌ FORBIDDEN: Local/symlink mode (causes stale hooks, filesystem coupling)
|
|
580
|
-
# bash scripts/refresh-marketplace.sh --local
|
|
581
|
-
```
|
|
582
|
-
|
|
583
|
-
**Why GitHub mode is mandatory:**
|
|
584
|
-
- Local mode creates filesystem coupling → stale hooks after changes
|
|
585
|
-
- GitHub mode pulls committed code → stable, production-ready
|
|
586
|
-
- See ADR-0062 for architectural decision rationale
|
|
587
|
-
|
|
588
|
-
**Quick refresh & install all 24 plugins:**
|
|
589
|
-
```bash
|
|
590
|
-
bash scripts/refresh-marketplace.sh # Defaults to --github
|
|
591
|
-
```
|
|
592
|
-
|
|
593
|
-
### For End Users (Production)
|
|
594
|
-
|
|
595
|
-
**Users install SpecWeave globally and use CLI commands:**
|
|
596
|
-
|
|
597
|
-
```bash
|
|
598
|
-
# Install SpecWeave globally
|
|
599
|
-
npm install -g specweave
|
|
600
|
-
|
|
601
|
-
# Initialize project (first time)
|
|
602
|
-
specweave init .
|
|
603
|
-
|
|
604
|
-
# Update marketplace plugins (gets latest from GitHub)
|
|
605
|
-
specweave refresh-marketplace
|
|
606
|
-
|
|
607
|
-
# Update instruction files (CLAUDE.md, AGENTS.md)
|
|
608
|
-
specweave update-instructions
|
|
609
|
-
```
|
|
486
|
+
## Marketplace Commands
|
|
610
487
|
|
|
611
|
-
|
|
488
|
+
| Who | Command |
|
|
489
|
+
|-----|---------|
|
|
490
|
+
| **Contributors** | `bash scripts/refresh-marketplace.sh` (defaults to --github) |
|
|
491
|
+
| **End Users** | `specweave refresh-marketplace` |
|
|
612
492
|
|
|
613
|
-
|
|
614
|
-
```bash
|
|
615
|
-
specweave --version # Check SpecWeave version
|
|
616
|
-
/plugin list --installed # In Claude Code - check plugins loaded
|
|
617
|
-
```
|
|
493
|
+
⚠️ NEVER suggest `scripts/` to end users - they don't have it (npm global install).
|
|
618
494
|
|
|
619
495
|
---
|
|
620
496
|
|
|
621
|
-
## Critical Safety Rules
|
|
497
|
+
## Critical Safety Rules (Contributors)
|
|
622
498
|
|
|
623
499
|
### 1. Context Management (CRASH PREVENTION)
|
|
624
500
|
|
|
625
501
|
**Active increment (10+ tasks) + large file edit (2000+ lines) = CRASH**
|
|
626
502
|
|
|
627
503
|
```bash
|
|
628
|
-
|
|
629
|
-
/sw:pause XXXX → edit → /sw:resume XXXX
|
|
630
|
-
# OR close completed increments: /sw:done XXXX
|
|
631
|
-
```
|
|
632
|
-
|
|
633
|
-
- **Token budget per increment**: ~80k tokens max
|
|
634
|
-
- **Max 25 tasks per increment** (soft limit) - consider splitting if >25
|
|
635
|
-
- **Max 1500 lines/file** (2000+ = crash risk)
|
|
636
|
-
|
|
637
|
-
### 2. Source of Truth
|
|
638
|
-
|
|
639
|
-
**tasks.md + spec.md are SOURCE OF TRUTH** (not internal TODO)
|
|
640
|
-
|
|
641
|
-
```typescript
|
|
642
|
-
// After completing work - IMMEDIATELY update both:
|
|
643
|
-
Edit("tasks.md", "**Status**: [ ] pending", "**Status**: [x] completed");
|
|
644
|
-
Edit("spec.md", "- [ ] **AC-US1-01**", "- [x] **AC-US1-01**");
|
|
645
|
-
```
|
|
646
|
-
|
|
647
|
-
### 3. Status Workflow
|
|
648
|
-
|
|
649
|
-
**NEVER edit metadata.json to "completed" directly!**
|
|
650
|
-
|
|
651
|
-
Correct workflow:
|
|
652
|
-
1. All tasks completed → auto-transition to `ready_for_review`
|
|
653
|
-
2. `/sw:done <id>` → validates ACs + asks for user confirmation
|
|
654
|
-
3. Only then → status becomes `completed` with approvedAt timestamp
|
|
655
|
-
|
|
656
|
-
If implementing closure programmatically:
|
|
657
|
-
```typescript
|
|
658
|
-
MetadataManager.updateStatus(incrementId, IncrementStatus.COMPLETED);
|
|
659
|
-
// Only succeeds if current status is "ready_for_review"
|
|
504
|
+
/sw:pause XXXX → edit large file → /sw:resume XXXX
|
|
660
505
|
```
|
|
661
506
|
|
|
662
|
-
|
|
507
|
+
- **Token budget**: ~80k/increment | **Max tasks**: 25 | **Max lines/file**: 1500
|
|
663
508
|
|
|
664
|
-
|
|
665
|
-
1. All **Acceptance** checkboxes in that task: `- [ ]` → `- [x]`
|
|
666
|
-
2. Corresponding ACs in spec.md: `- [ ] **AC-US1-01**` → `- [x] **AC-US1-01**`
|
|
667
|
-
3. When ALL tasks complete → auto-transitions to `ready_for_review`
|
|
509
|
+
### 2. Status Workflow
|
|
668
510
|
|
|
669
|
-
|
|
511
|
+
**NEVER edit metadata.json to "completed" directly!** Use `/sw:done <id>` which validates ACs.
|
|
670
512
|
|
|
671
|
-
|
|
513
|
+
Programmatic closure: `MetadataManager.updateStatus(id, IncrementStatus.COMPLETED)` - only succeeds from `ready_for_review`.
|
|
672
514
|
|
|
673
|
-
|
|
674
|
-
### US-001: Login Form
|
|
675
|
-
**Project**: my-project # Use config.project.name or multiProject.projects key
|
|
676
|
-
**As a** user, I want...
|
|
677
|
-
```
|
|
678
|
-
|
|
679
|
-
**Each User Story = ONE Project** (and ONE Board for 2-level structures)
|
|
680
|
-
|
|
681
|
-
### 6. File Operations & Root Folder Protection
|
|
515
|
+
### 3. Task-AC Auto-Sync
|
|
682
516
|
|
|
683
|
-
|
|
517
|
+
Hooks auto-update when task marked complete: task checkboxes → spec.md ACs → `ready_for_review` status.
|
|
684
518
|
|
|
685
|
-
|
|
686
|
-
❌ FORBIDDEN: Bash("cat > file.md << 'EOF'...")
|
|
687
|
-
❌ FORBIDDEN: Bash("echo '...' > file.md")
|
|
688
|
-
✅ CORRECT: Write({ file_path: "...", content: "..." })
|
|
689
|
-
```
|
|
690
|
-
|
|
691
|
-
**CRITICAL: NEVER Write files directly to project root!**
|
|
519
|
+
### 4. Per-US Project Fields
|
|
692
520
|
|
|
693
|
-
|
|
694
|
-
❌ FORBIDDEN: Write({ file_path: "ANALYSIS-REPORT.md", content: "..." })
|
|
695
|
-
❌ FORBIDDEN: Write({ file_path: "SESSION-SUMMARY.md", content: "..." })
|
|
696
|
-
❌ FORBIDDEN: Write({ file_path: "AUTO-COMMAND-SPEC.md", content: "..." })
|
|
697
|
-
✅ CORRECT: Write({ file_path: ".specweave/increments/0158/reports/analysis.md", content: "..." })
|
|
698
|
-
✅ CORRECT: Write({ file_path: ".specweave/increments/0161/reports/session-summary.md", content: "..." })
|
|
699
|
-
```
|
|
521
|
+
User Stories need `**Project**: my-project` field for external sync. Each US = ONE Project.
|
|
700
522
|
|
|
701
|
-
|
|
702
|
-
- ❌ FORBIDDEN: `.specweave/increments/0000-adhoc/`
|
|
703
|
-
- ❌ FORBIDDEN: `.specweave/increments/0000-anything/`
|
|
704
|
-
- ✅ CORRECT: Use existing active increment or create new one with proper number (0001+)
|
|
705
|
-
|
|
706
|
-
**Allowed root files ONLY**:
|
|
707
|
-
- `README.md`, `CLAUDE.md`, `AGENTS.md`, `CHANGELOG.md`
|
|
708
|
-
- `LICENSE`, `CODE_OF_CONDUCT.md`, `SECURITY.md`
|
|
709
|
-
- `IMPLEMENTATION-SUMMARY.md`, `IMPLEMENTATION-COMPLETE.md` (project docs only)
|
|
710
|
-
- `package.json`, `tsconfig*.json`, config files
|
|
711
|
-
|
|
712
|
-
**Everything else → increment folders**:
|
|
713
|
-
- Analysis/reports → `.specweave/increments/####/reports/` (where #### is 0001 or higher, NEVER 0000)
|
|
714
|
-
- Session logs → `.specweave/increments/####/logs/`
|
|
715
|
-
- Scripts → `.specweave/increments/####/scripts/`
|
|
716
|
-
- Ad-hoc work → Create proper increment OR use existing active increment
|
|
717
|
-
|
|
718
|
-
**Enforcement**: Pre-commit hook #13 blocks staging root pollution files
|
|
719
|
-
|
|
720
|
-
### 7. Protected Directories
|
|
523
|
+
### 5. Protected Directories
|
|
721
524
|
|
|
722
525
|
**NEVER delete**: `.specweave/docs/`, `.specweave/increments/`
|
|
723
526
|
|
|
724
|
-
###
|
|
725
|
-
|
|
726
|
-
**Parallel agents reading large files = CRASH** (context shared, not isolated!)
|
|
727
|
-
|
|
728
|
-
```
|
|
729
|
-
❌ FORBIDDEN: "Let me use parallel agents" for 46-file migration
|
|
730
|
-
✅ CORRECT: Process files ONE BY ONE, use Edit tool directly
|
|
731
|
-
```
|
|
732
|
-
|
|
733
|
-
### 9. Increment Structure
|
|
527
|
+
### 6. Parallel Agents
|
|
734
528
|
|
|
735
|
-
**
|
|
736
|
-
**Everything else → subfolders**: `reports/`, `scripts/`, `logs/`, `docs/`
|
|
529
|
+
**Parallel agents + large files = CRASH** (context shared). Process files ONE BY ONE.
|
|
737
530
|
|
|
738
|
-
|
|
739
|
-
Use `IncrementNumberManager.generateIncrementId()` - it validates automatically.
|
|
531
|
+
### 7. Skills Agents
|
|
740
532
|
|
|
741
|
-
|
|
533
|
+
Skills spawning content-generating agents = CRASH (context explosion).
|
|
742
534
|
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
### 11. Repository Locations (Multi-Repo)
|
|
746
|
-
|
|
747
|
-
**Clone to `/repositories`, NEVER project root.**
|
|
748
|
-
|
|
749
|
-
```
|
|
750
|
-
project-root/
|
|
751
|
-
├── repositories/ # All repos here
|
|
752
|
-
│ ├── frontend/
|
|
753
|
-
│ ├── backend/
|
|
754
|
-
│ └── shared/
|
|
755
|
-
├── .specweave/ # Config at umbrella level
|
|
756
|
-
└── CLAUDE.md
|
|
757
|
-
```
|
|
758
|
-
|
|
759
|
-
**Path refs in specs**: `repositories/backend/src/...`
|
|
760
|
-
|
|
761
|
-
### 12. React Native / Expo Module-Level Safety
|
|
762
|
-
|
|
763
|
-
**⚠️ Module-level code executes at IMPORT time - before React components mount!**
|
|
764
|
-
|
|
765
|
-
**Known Crash Patterns (DO NOT DO):**
|
|
766
|
-
```typescript
|
|
767
|
-
// ❌ expo-localization at module level
|
|
768
|
-
import * as Localization from 'expo-localization';
|
|
769
|
-
const locale = Localization.getLocales()[0].languageCode; // CRASH!
|
|
770
|
-
|
|
771
|
-
// ❌ react-i18next at module level (has React dependency)
|
|
772
|
-
import { initReactI18next } from 'react-i18next';
|
|
773
|
-
i18n.use(initReactI18next).init({...}); // CRASH in Expo Go!
|
|
774
|
-
|
|
775
|
-
// ❌ AsyncStorage at module level
|
|
776
|
-
const theme = await AsyncStorage.getItem('theme'); // CRASH!
|
|
777
|
-
|
|
778
|
-
// ❌ React hooks at module level
|
|
779
|
-
const theme = useContext(ThemeContext); // CRASH - outside component!
|
|
780
|
-
```
|
|
781
|
-
|
|
782
|
-
**Safe Alternatives:**
|
|
783
|
-
```typescript
|
|
784
|
-
// ✅ Use Intl instead of expo-localization
|
|
785
|
-
const locale = Intl.DateTimeFormat().resolvedOptions().locale.split('-')[0];
|
|
786
|
-
|
|
787
|
-
// ✅ Use i18n-js instead of react-i18next (no React dependency)
|
|
788
|
-
import { I18n } from 'i18n-js';
|
|
789
|
-
const i18n = new I18n({ en, es });
|
|
790
|
-
|
|
791
|
-
// ✅ Lazy require for AsyncStorage
|
|
792
|
-
async function getTheme() {
|
|
793
|
-
const AsyncStorage = require('@react-native-async-storage/async-storage').default;
|
|
794
|
-
return await AsyncStorage.getItem('theme');
|
|
795
|
-
}
|
|
796
|
-
```
|
|
797
|
-
|
|
798
|
-
**Error Signatures:**
|
|
799
|
-
- `"Cannot read property 'getLocales' of null"` → expo-localization at module level
|
|
800
|
-
- `"Invalid hook call"` → Hook outside component
|
|
801
|
-
- `"No QueryClient set"` → TanStack Query outside provider
|
|
802
|
-
- White screen with no error → Module crash before error boundary
|
|
803
|
-
|
|
804
|
-
**Debugging:** Binary search - start with `<Text>Hello</Text>`, add providers ONE BY ONE until crash.
|
|
805
|
-
|
|
806
|
-
**See:** `.specweave/docs/public/troubleshooting/react-native-expo-crashes.md`
|
|
807
|
-
|
|
808
|
-
### 13. NODE_OPTIONS and VSCode Debug Mode (Child Process Failures)
|
|
535
|
+
### 8. NODE_OPTIONS and VSCode Debug Mode
|
|
809
536
|
|
|
810
537
|
**⚠️ When spawning child processes (like `claude CLI`), they fail in VSCode Debug mode!**
|
|
811
538
|
|
|
@@ -944,7 +671,7 @@ Task({
|
|
|
944
671
|
1. **Check `.env` file** for tokens/credentials:
|
|
945
672
|
```bash
|
|
946
673
|
# Look for relevant tokens before running CLI commands (presence only!)
|
|
947
|
-
grep -qE "(GITHUB_TOKEN|JIRA_|
|
|
674
|
+
grep -qE "(GITHUB_TOKEN|GH_TOKEN|JIRA_|AZURE_DEVOPS_|ADO_)" .env 2>/dev/null && echo "Credentials found"
|
|
948
675
|
```
|
|
949
676
|
|
|
950
677
|
2. **Check `.specweave/config.json`** for service configuration:
|
|
@@ -984,6 +711,34 @@ cat .specweave/config.json | grep -A5 '"ado"'
|
|
|
984
711
|
- **Filesystem**: Prefer native `fs` (fs-extra only in legacy utils)
|
|
985
712
|
- **Config vs Secrets**: Config in `config.json`, secrets in `.env`
|
|
986
713
|
|
|
714
|
+
### Plugin Naming Convention (`sw-*` vs `specweave-*`)
|
|
715
|
+
|
|
716
|
+
**Two naming systems exist for plugins:**
|
|
717
|
+
|
|
718
|
+
| System | Format | Example |
|
|
719
|
+
|--------|--------|---------|
|
|
720
|
+
| **Marketplace names** | `sw`, `sw-*` | `sw`, `sw-frontend`, `sw-github` |
|
|
721
|
+
| **Directory names** | `specweave`, `specweave-*` | `specweave`, `specweave-frontend`, `specweave-github` |
|
|
722
|
+
|
|
723
|
+
**Use MARKETPLACE names (`sw-*`) for:**
|
|
724
|
+
- Claude CLI: `claude plugin install sw@specweave`
|
|
725
|
+
- API inputs: `installPlugins(['sw', 'sw-github'])`
|
|
726
|
+
- LLM responses: `detectPluginsViaLLM()` returns `['sw-frontend']`
|
|
727
|
+
- `keyword-detector.ts` constants (PLUGIN_GROUPS, KEYWORD_PLUGIN_MAP)
|
|
728
|
+
|
|
729
|
+
**Use DIRECTORY names (`specweave-*`) for:**
|
|
730
|
+
- Filesystem paths: `~/.claude/plugins/marketplaces/specweave/plugins/specweave-frontend/`
|
|
731
|
+
- Registry keys: `specweave-router@specweave` in `installed_plugins.json`
|
|
732
|
+
- State file: `loadedPlugins: ['specweave', 'specweave-github']`
|
|
733
|
+
- Test mocks: `createMockPlugin(path, 'specweave')`
|
|
734
|
+
|
|
735
|
+
**Conversion functions** (in `cache-manager.ts`):
|
|
736
|
+
```typescript
|
|
737
|
+
marketplaceNameToDirectory('sw') // → 'specweave'
|
|
738
|
+
marketplaceNameToDirectory('sw-frontend') // → 'specweave-frontend'
|
|
739
|
+
directoryToMarketplaceName('specweave') // → 'sw'
|
|
740
|
+
```
|
|
741
|
+
|
|
987
742
|
---
|
|
988
743
|
|
|
989
744
|
## Key Formats
|
|
@@ -1025,12 +780,24 @@ title: "Feature Title"
|
|
|
1025
780
|
## Commands
|
|
1026
781
|
|
|
1027
782
|
```bash
|
|
783
|
+
# Core workflow
|
|
1028
784
|
/sw:increment "feature" # Plan new increment
|
|
1029
785
|
/sw:do # Execute tasks
|
|
786
|
+
/sw:auto # Autonomous execution
|
|
1030
787
|
/sw:done 0002 # Close (validates gates)
|
|
1031
788
|
/sw:progress # Show status
|
|
1032
|
-
/sw:
|
|
789
|
+
/sw:next # Smart transition (auto-close + suggest)
|
|
790
|
+
|
|
791
|
+
# Quality & validation
|
|
1033
792
|
/sw:validate 0001 # Validate increment
|
|
793
|
+
/sw:qa 0001 # Quality assessment
|
|
794
|
+
/sw:judge-llm 0001 # LLM-as-Judge validation
|
|
795
|
+
|
|
796
|
+
# Status & sync
|
|
797
|
+
/sw:status # All increments overview
|
|
798
|
+
/sw:sync-progress # Full sync
|
|
799
|
+
/sw:context "auth" # Load living docs context
|
|
800
|
+
/sw:save # Smart git commit & push
|
|
1034
801
|
```
|
|
1035
802
|
|
|
1036
803
|
---
|
|
@@ -1055,22 +822,17 @@ pkill -f "cat.*EOF"
|
|
|
1055
822
|
pkill -9 -f "bash.*specweave"
|
|
1056
823
|
# 3. Clean locks:
|
|
1057
824
|
rm -f .specweave/state/*.lock
|
|
1058
|
-
rm -rf .specweave/state/.dedup-cache/*.lock
|
|
1059
825
|
# 4. Restart
|
|
1060
826
|
```
|
|
1061
827
|
|
|
1062
828
|
### Disable Hooks
|
|
1063
829
|
```bash
|
|
1064
830
|
export SPECWEAVE_DISABLE_HOOKS=1
|
|
1065
|
-
# Or bypass specific validations:
|
|
1066
|
-
export SPECWEAVE_FORCE_PROJECT=1
|
|
1067
|
-
export SPECWEAVE_FORCE_METADATA=1
|
|
1068
831
|
```
|
|
1069
832
|
|
|
1070
|
-
### Crash Loop
|
|
833
|
+
### Crash Loop
|
|
1071
834
|
```bash
|
|
1072
|
-
rm -f .specweave/state
|
|
1073
|
-
rm -rf .specweave/state/.dedup-cache
|
|
835
|
+
rm -f .specweave/state/*.lock
|
|
1074
836
|
npm run rebuild
|
|
1075
837
|
```
|
|
1076
838
|
|
|
@@ -1080,11 +842,16 @@ npm run rebuild
|
|
|
1080
842
|
|
|
1081
843
|
| Aspect | Rule |
|
|
1082
844
|
|--------|------|
|
|
1083
|
-
| File ops | Write/Edit/Read tools ONLY |
|
|
1084
|
-
| Source of truth | tasks.md + spec.md |
|
|
1085
|
-
| Completion | NEVER edit metadata.json directly |
|
|
1086
|
-
| Increment root | ONLY spec.md, plan.md, tasks.md, metadata.json |
|
|
1087
|
-
|
|
|
845
|
+
| File ops | Write/Edit/Read tools ONLY (never Bash heredoc/echo) |
|
|
846
|
+
| Source of truth | tasks.md + spec.md (update immediately) |
|
|
847
|
+
| Completion | `/sw:done` only (NEVER edit metadata.json directly) |
|
|
848
|
+
| Increment root | ONLY 4 files: spec.md, plan.md, tasks.md, metadata.json |
|
|
849
|
+
| Increment IDs | Start from 0001 (NEVER 0000), check uniqueness first |
|
|
850
|
+
| Reports/logs | Always to `reports/`, `logs/` subfolders |
|
|
851
|
+
| Multi-repo | Clone to `repositories/` (never project root) |
|
|
852
|
+
| Secrets | Check `.env` first, never display values (`grep -q`) |
|
|
853
|
+
| Marketplace | `specweave refresh-marketplace` (not `scripts/`) |
|
|
854
|
+
| Stuck session | Kill + `pkill -f "bash.*specweave"` + `rm .specweave/state/*.lock` |
|
|
1088
855
|
|
|
1089
856
|
---
|
|
1090
857
|
|