specweave 1.0.137 → 1.0.139

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.
Files changed (38) hide show
  1. package/CLAUDE.md +26 -26
  2. package/bin/specweave.js +6 -4
  3. package/dist/src/adapters/claude/README.md +5 -3
  4. package/dist/src/adapters/cursor/README.md +4 -2
  5. package/dist/src/adapters/generic/README.md +5 -3
  6. package/dist/src/cli/commands/refresh-marketplace.d.ts +11 -0
  7. package/dist/src/cli/commands/refresh-marketplace.d.ts.map +1 -1
  8. package/dist/src/cli/commands/refresh-marketplace.js +301 -3
  9. package/dist/src/cli/commands/refresh-marketplace.js.map +1 -1
  10. package/dist/src/cli/commands/update.d.ts +10 -6
  11. package/dist/src/cli/commands/update.d.ts.map +1 -1
  12. package/dist/src/cli/commands/update.js +29 -20
  13. package/dist/src/cli/commands/update.js.map +1 -1
  14. package/dist/src/config/types.d.ts +4 -4
  15. package/dist/src/core/lazy-loading/cache-manager.d.ts +41 -5
  16. package/dist/src/core/lazy-loading/cache-manager.d.ts.map +1 -1
  17. package/dist/src/core/lazy-loading/cache-manager.js +185 -14
  18. package/dist/src/core/lazy-loading/cache-manager.js.map +1 -1
  19. package/dist/src/core/lazy-loading/keyword-detector.d.ts.map +1 -1
  20. package/dist/src/core/lazy-loading/keyword-detector.js +31 -0
  21. package/dist/src/core/lazy-loading/keyword-detector.js.map +1 -1
  22. package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts +126 -0
  23. package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -0
  24. package/dist/src/core/lazy-loading/llm-plugin-detector.js +577 -0
  25. package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -0
  26. package/dist/src/core/llm/providers/claude-code-provider.d.ts +2 -3
  27. package/dist/src/core/llm/providers/claude-code-provider.d.ts.map +1 -1
  28. package/dist/src/core/llm/providers/claude-code-provider.js +14 -24
  29. package/dist/src/core/llm/providers/claude-code-provider.js.map +1 -1
  30. package/dist/src/init/architecture/types.d.ts +2 -2
  31. package/dist/src/utils/execFileNoThrow.d.ts.map +1 -1
  32. package/dist/src/utils/execFileNoThrow.js +1 -0
  33. package/dist/src/utils/execFileNoThrow.js.map +1 -1
  34. package/package.json +1 -1
  35. package/plugins/specweave/commands/increment.md +18 -30
  36. package/plugins/specweave/hooks/startup-health-check.sh +17 -20
  37. package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +18 -0
  38. package/plugins/specweave/skills/increment-planner/SKILL.md +3 -3
package/CLAUDE.md CHANGED
@@ -1,10 +1,10 @@
1
- <!-- SW:META template="claude" version="1.0.135" sections="header,start,autodetect,metarule,rules,workflow,reflect,context,lsp,structure,taskformat,secrets,syncing,mapping,testing,api,limits,troubleshooting,lazyloading,principles,linking,mcp,autoexecute,auto,docs" -->
1
+ <!-- SW:META template="claude" version="1.0.138" sections="header,start,autodetect,metarule,rules,workflow,reflect,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.135" -->
3
+ <!-- SW:SECTION:header version="1.0.138" -->
4
4
  **Framework**: SpecWeave | **Truth**: `spec.md` + `tasks.md`
5
5
  <!-- SW:END:header -->
6
6
 
7
- <!-- SW:SECTION:start version="1.0.135" -->
7
+ <!-- SW:SECTION:start version="1.0.138" -->
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.135" -->
17
+ <!-- SW:SECTION:autodetect version="1.0.138" -->
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.135" -->
27
+ <!-- SW:SECTION:metarule version="1.0.138" -->
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.135" -->
38
+ <!-- SW:SECTION:rules version="1.0.138" -->
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.135" -->
51
+ <!-- SW:SECTION:workflow version="1.0.138" -->
52
52
  ## Workflow
53
53
 
54
54
  `/sw:increment "X"` → `/sw:do` → `/sw:progress` → `/sw:done 0001`
@@ -68,7 +68,7 @@ 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.135" -->
71
+ <!-- SW:SECTION:reflect version="1.0.138" -->
72
72
  ## Self-Improving Skills (Reflect)
73
73
 
74
74
  **Learn once, never repeat.** Claude learns from corrections and patterns across sessions.
@@ -112,7 +112,7 @@ ls ~/.specweave/memory/*.md 2>/dev/null
112
112
  **Enable auto-learning**: `/sw:reflect-on` → Stop hook analyzes sessions automatically
113
113
  <!-- SW:END:reflect -->
114
114
 
115
- <!-- SW:SECTION:context version="1.0.135" -->
115
+ <!-- SW:SECTION:context version="1.0.138" -->
116
116
  ## Living Docs Context
117
117
 
118
118
  **Before implementing features**: Check existing docs for patterns and decisions.
@@ -132,7 +132,7 @@ grep -ril "keyword" .specweave/docs/internal/
132
132
  **Use `/sw:context <topic>`** to load relevant living docs into conversation.
133
133
  <!-- SW:END:context -->
134
134
 
135
- <!-- SW:SECTION:lsp version="1.0.135" -->
135
+ <!-- SW:SECTION:lsp version="1.0.138" -->
136
136
  ## LSP-Enhanced Exploration
137
137
 
138
138
  **USE LSP ACTIVELY** for semantic code understanding (100x faster than grep).
@@ -149,7 +149,7 @@ go install golang.org/x/tools/gopls@latest # Go
149
149
  **Best Practices**: ALWAYS use `findReferences` before refactoring | Use `goToDefinition` instead of grep | Combine with Explore agent
150
150
  <!-- SW:END:lsp -->
151
151
 
152
- <!-- SW:SECTION:structure version="1.0.135" -->
152
+ <!-- SW:SECTION:structure version="1.0.138" -->
153
153
  ## Structure
154
154
 
155
155
  ```
@@ -219,7 +219,7 @@ my-project/
219
219
  ```
220
220
  <!-- SW:END:structure -->
221
221
 
222
- <!-- SW:SECTION:taskformat version="1.0.135" -->
222
+ <!-- SW:SECTION:taskformat version="1.0.138" -->
223
223
  ## Task Format
224
224
 
225
225
  ```markdown
@@ -229,7 +229,7 @@ my-project/
229
229
  ```
230
230
  <!-- SW:END:taskformat -->
231
231
 
232
- <!-- SW:SECTION:secrets version="1.0.135" -->
232
+ <!-- SW:SECTION:secrets version="1.0.138" -->
233
233
  ## Secrets Check
234
234
 
235
235
  **BEFORE CLI tools**: Check existing config first!
@@ -243,7 +243,7 @@ gh auth status
243
243
  **SECURITY**: NEVER use `grep TOKEN .env` without `-q` flag - it exposes credentials in terminal!
244
244
  <!-- SW:END:secrets -->
245
245
 
246
- <!-- SW:SECTION:syncing version="1.0.135" -->
246
+ <!-- SW:SECTION:syncing version="1.0.138" -->
247
247
  ## External Sync (GitHub/JIRA/ADO)
248
248
 
249
249
  **After increment creation**: Run `/sw-github:sync {id}` to create issues!
@@ -271,7 +271,7 @@ Living docs sync ≠ External sync. They are separate:
271
271
  **Verify tokens**: `grep -q GITHUB_TOKEN .env && echo "Token configured"` | `gh auth status`
272
272
  <!-- SW:END:syncing -->
273
273
 
274
- <!-- SW:SECTION:mapping version="1.0.135" -->
274
+ <!-- SW:SECTION:mapping version="1.0.138" -->
275
275
  ## GitHub Mapping
276
276
 
277
277
  | SpecWeave | GitHub |
@@ -281,7 +281,7 @@ Living docs sync ≠ External sync. They are separate:
281
281
  | Task T-XXX | Checkbox |
282
282
  <!-- SW:END:mapping -->
283
283
 
284
- <!-- SW:SECTION:testing version="1.0.135" -->
284
+ <!-- SW:SECTION:testing version="1.0.138" -->
285
285
  ## Testing
286
286
 
287
287
  BDD in tasks.md | Unit >80% | `.test.ts` (Vitest)
@@ -293,7 +293,7 @@ vi.mock('fs', () => ({ readFile: vi.fn() }));
293
293
  ```
294
294
  <!-- SW:END:testing -->
295
295
 
296
- <!-- SW:SECTION:api version="1.0.135" -->
296
+ <!-- SW:SECTION:api version="1.0.138" -->
297
297
  ## API Development (OpenAPI-First)
298
298
 
299
299
  **For API projects only.** OpenAPI = source of truth → Postman derived from it.
@@ -312,13 +312,13 @@ vi.mock('fs', () => ({ readFile: vi.fn() }));
312
312
  **Import**: Postman → Import collection + env → Fill secrets → Select env
313
313
  <!-- SW:END:api -->
314
314
 
315
- <!-- SW:SECTION:limits version="1.0.135" -->
315
+ <!-- SW:SECTION:limits version="1.0.138" -->
316
316
  ## Limits
317
317
 
318
318
  **Max 1500 lines/file** — extract before adding
319
319
  <!-- SW:END:limits -->
320
320
 
321
- <!-- SW:SECTION:troubleshooting version="1.0.135" -->
321
+ <!-- SW:SECTION:troubleshooting version="1.0.138" -->
322
322
  ## Troubleshooting
323
323
 
324
324
  | Issue | Fix |
@@ -340,7 +340,7 @@ vi.mock('fs', () => ({ readFile: vi.fn() }));
340
340
  | Need all plugins loaded | `specweave load-plugins all` (~60K tokens) |
341
341
  <!-- SW:END:troubleshooting -->
342
342
 
343
- <!-- SW:SECTION:lazyloading version="1.0.135" -->
343
+ <!-- SW:SECTION:lazyloading version="1.0.138" -->
344
344
  ## Lazy Plugin Loading (Auto-Loading)
345
345
 
346
346
  **SpecWeave automatically loads plugins** when you need them - no manual action required.
@@ -395,7 +395,7 @@ export SPECWEAVE_DISABLE_AUTO_LOAD=1 # Disable auto-loading
395
395
  | Agent spawn (forked) | 0 tokens in main context |
396
396
  <!-- SW:END:lazyloading -->
397
397
 
398
- <!-- SW:SECTION:principles version="1.0.135" -->
398
+ <!-- SW:SECTION:principles version="1.0.138" -->
399
399
  ## Principles
400
400
 
401
401
  1. **Spec-first**: `/sw:increment` before coding
@@ -405,7 +405,7 @@ export SPECWEAVE_DISABLE_AUTO_LOAD=1 # Disable auto-loading
405
405
  5. **Clean**: All files in increment folders
406
406
  <!-- SW:END:principles -->
407
407
 
408
- <!-- SW:SECTION:linking version="1.0.135" -->
408
+ <!-- SW:SECTION:linking version="1.0.138" -->
409
409
  ## Bidirectional Linking
410
410
 
411
411
  Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
@@ -413,7 +413,7 @@ Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
413
413
  Task format: `**AC**: AC-US1-01, AC-US1-02` (CRITICAL for linking)
414
414
  <!-- SW:END:linking -->
415
415
 
416
- <!-- SW:SECTION:mcp version="1.0.135" -->
416
+ <!-- SW:SECTION:mcp version="1.0.138" -->
417
417
  ## External Service Connection
418
418
 
419
419
  **Priority**: MCP Server → REST API → CLI → Direct Connection
@@ -438,7 +438,7 @@ wrangler whoami 2>/dev/null
438
438
  ```
439
439
  <!-- SW:END:mcp -->
440
440
 
441
- <!-- SW:SECTION:autoexecute version="1.0.135" -->
441
+ <!-- SW:SECTION:autoexecute version="1.0.138" -->
442
442
  ## Auto-Execute Rule
443
443
 
444
444
  **NEVER** output "Manual Step Required" when credentials exist. **EXECUTE DIRECTLY.**
@@ -453,7 +453,7 @@ wrangler whoami 2>/dev/null && gh auth status 2>/dev/null
453
453
  ```
454
454
  <!-- SW:END:autoexecute -->
455
455
 
456
- <!-- SW:SECTION:auto version="1.0.135" -->
456
+ <!-- SW:SECTION:auto version="1.0.138" -->
457
457
  ## Auto Mode (Autonomous Execution)
458
458
 
459
459
  **Continuous execution until all tasks complete.**
@@ -530,7 +530,7 @@ wrangler whoami 2>/dev/null && gh auth status 2>/dev/null
530
530
  **Circuit Breaker**: External API fails 3x? Queue & continue
531
531
  <!-- SW:END:auto -->
532
532
 
533
- <!-- SW:SECTION:docs version="1.0.135" -->
533
+ <!-- SW:SECTION:docs version="1.0.138" -->
534
534
  ## Docs
535
535
 
536
536
  [spec-weave.com](https://spec-weave.com) | `.specweave/docs/internal/`
package/bin/specweave.js CHANGED
@@ -508,13 +508,14 @@ program
508
508
  await updateInstructionsCommand(options);
509
509
  });
510
510
 
511
- // Unified update command - One-stop update for everything (self-updates CLI by default)
511
+ // Unified update command - One-stop update for everything (self-updates CLI AND plugins by default)
512
512
  program
513
513
  .command('update')
514
- .description('Update SpecWeave: CLI (via npm), instructions, config, and optionally plugins')
514
+ .description('Update SpecWeave: CLI, instructions, config, AND plugins (default)')
515
515
  .option('--no-self', 'Skip CLI self-update via npm')
516
- .option('--plugins', 'Also refresh marketplace plugins')
517
- .option('--all', 'Full update including all plugins (not just router)')
516
+ .option('--no-plugins', 'Skip marketplace plugins refresh')
517
+ .option('--all', 'Install ALL plugins (not just router)')
518
+ .option('--minimal', 'Clean /plugin output (removes marketplace, no lazy loading)')
518
519
  .option('--check', 'Dry run - show what would change without making changes')
519
520
  .option('-v, --verbose', 'Show detailed output')
520
521
  .option('-f, --force', 'Force refresh even if up to date')
@@ -817,6 +818,7 @@ program
817
818
  .option('--local', 'Use local development version (ONLY for active dev)')
818
819
  .option('--github', 'Pull latest from GitHub (default, recommended)')
819
820
  .option('--all', 'Install ALL plugins (legacy mode, ~60K tokens)')
821
+ .option('--minimal', 'Remove marketplace, install only core plugins (clean /plugin output, no lazy loading)')
820
822
  .option('-f, --force', 'Force reinstall all plugins (clears cache, ensures fresh copy)')
821
823
  .option('-v, --verbose', 'Show detailed error messages')
822
824
  .action(async (options) => {
@@ -194,14 +194,16 @@ Agents are invoked explicitly via Task tool:
194
194
 
195
195
  ```typescript
196
196
  await Task({
197
- subagent_type: "specweave:pm:pm",
198
- prompt: "Create product requirements for user authentication",
199
- description: "Product requirements analysis"
197
+ subagent_type: "sw-frontend:frontend-architect",
198
+ prompt: "Design React component architecture for dashboard",
199
+ description: "Frontend architecture design"
200
200
  });
201
201
  ```
202
202
 
203
203
  Agents have separate context windows to prevent pollution of main conversation.
204
204
 
205
+ **Note**: Skills like PM and Architect auto-activate based on keywords - you don't invoke them via Task. Only specialized plugin agents (sw-frontend, sw-testing, sw-k8s, etc.) use Task invocation.
206
+
205
207
  ### Hooks Execution
206
208
 
207
209
  Hooks run automatically on events:
@@ -107,10 +107,12 @@ User: "create increment for auth"
107
107
 
108
108
  **Claude Code (automatic)**:
109
109
  ```typescript
110
- Task({ subagent_type: "specweave:pm:pm", prompt: "create spec" })
111
- PM agent invoked with separate context window
110
+ Task({ subagent_type: "sw-frontend:frontend-architect", prompt: "design components" })
111
+ Frontend agent invoked with separate context window
112
112
  ```
113
113
 
114
+ **Note**: In Claude Code, PM/Architect are SKILLS that auto-activate on keywords, not agents you invoke via Task.
115
+
114
116
  **Cursor (manual adoption)**:
115
117
  ```typescript
116
118
  User: "act as PM and create spec"
@@ -152,14 +152,16 @@ You manually execute the entire workflow!
152
152
  **In Claude Code**: Specialized roles with separate context windows
153
153
  **In Generic**: YOU tell AI which role to adopt
154
154
 
155
- ### Example: PM Agent
155
+ ### Example: Frontend Agent
156
156
 
157
157
  **Claude Code (automatic)**:
158
158
  ```typescript
159
- Task({ subagent_type: "specweave:pm:pm", prompt: "create spec" })
160
- PM agent creates spec.md
159
+ Task({ subagent_type: "sw-frontend:frontend-architect", prompt: "design components" })
160
+ Frontend agent designs components with separate context window
161
161
  ```
162
162
 
163
+ **Note**: In Claude Code, PM/Architect are SKILLS that auto-activate on keywords, not agents invoked via Task.
164
+
163
165
  **Generic (manual)**:
164
166
  ```
165
167
  You paste to ChatGPT:
@@ -15,14 +15,22 @@
15
15
  * - No intermediate cache needed (marketplace IS the cache!)
16
16
  * - Result: ~5K tokens at startup instead of ~60K (90% savings!)
17
17
  *
18
+ * MINIMAL MODE (--minimal):
19
+ * - Removes specweave marketplace entirely
20
+ * - Installs only core plugins (sw, sw-router)
21
+ * - Clean /plugin output (only shows installed plugins)
22
+ * - Tradeoff: Lazy loading disabled (use --all to reinstall all)
23
+ *
18
24
  * Usage:
19
25
  * specweave refresh-marketplace # Lazy mode (default) - router only
20
26
  * specweave refresh-marketplace --all # Legacy mode - install all plugins
27
+ * specweave refresh-marketplace --minimal # Minimal mode - clean /plugin output
21
28
  * specweave refresh-marketplace --local # Use local dev version
22
29
  * specweave refresh-marketplace --github # Use GitHub version (default)
23
30
  *
24
31
  * @since 1.0.60
25
32
  * @updated 1.0.122 - Added lazy loading support
33
+ * @updated 1.0.138 - Added minimal mode for clean /plugin output
26
34
  */
27
35
  interface RefreshOptions {
28
36
  local?: boolean;
@@ -31,6 +39,9 @@ interface RefreshOptions {
31
39
  force?: boolean;
32
40
  /** Install ALL plugins (legacy mode). Default: false (lazy loading - router only) */
33
41
  all?: boolean;
42
+ /** Minimal mode: Remove marketplace entirely, install only core plugins directly.
43
+ * Results in clean /plugin output but disables lazy loading. */
44
+ minimal?: boolean;
34
45
  }
35
46
  export declare function refreshMarketplaceCommand(options?: RefreshOptions): Promise<void>;
36
47
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"refresh-marketplace.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/refresh-marketplace.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAkBH,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,qFAAqF;IACrF,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAseD,wBAAsB,yBAAyB,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgb3F"}
1
+ {"version":3,"file":"refresh-marketplace.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/refresh-marketplace.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAkBH,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,qFAAqF;IACrF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;oEACgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA0rBD,wBAAsB,yBAAyB,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+hB3F"}