specweave 1.0.159 → 1.0.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +0 -11
- package/CLAUDE.md +48 -24
- package/bin/specweave.js +9 -1
- package/dist/src/cli/commands/refresh-marketplace.d.ts +7 -6
- package/dist/src/cli/commands/refresh-marketplace.d.ts.map +1 -1
- package/dist/src/cli/commands/refresh-marketplace.js +30 -40
- package/dist/src/cli/commands/refresh-marketplace.js.map +1 -1
- package/dist/src/cli/helpers/init/initial-increment-generator.d.ts +10 -3
- package/dist/src/cli/helpers/init/initial-increment-generator.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/initial-increment-generator.js +29 -18
- package/dist/src/cli/helpers/init/initial-increment-generator.js.map +1 -1
- package/dist/src/cli/helpers/init/plugin-installer.d.ts +4 -3
- package/dist/src/cli/helpers/init/plugin-installer.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/plugin-installer.js +15 -40
- package/dist/src/cli/helpers/init/plugin-installer.js.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts +2 -2
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.js +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/commands/increment.md +10 -5
- package/plugins/specweave/hooks/user-prompt-submit.sh +11 -4
- package/plugins/specweave/skills/increment-planner/SKILL.md +3 -1
- package/plugins/specweave-router/skills/router/SKILL.md +75 -146
|
@@ -7,17 +7,6 @@
|
|
|
7
7
|
"email": "anton.abyzov@gmail.com"
|
|
8
8
|
},
|
|
9
9
|
"plugins": [
|
|
10
|
-
{
|
|
11
|
-
"name": "sw-router",
|
|
12
|
-
"description": "ACTIVE router - spawns specialized agents for React/frontend (sw-frontend), GitHub (sw-github), TDD/testing (sw-testing), K8s/DevOps (sw-infra), ML/AI (sw-ml), mobile (sw-mobile), payments (sw-payments). MANDATORY agent spawning for domain tasks.",
|
|
13
|
-
"source": "./plugins/specweave-router",
|
|
14
|
-
"category": "development",
|
|
15
|
-
"version": "1.0.1",
|
|
16
|
-
"author": {
|
|
17
|
-
"name": "Anton Abyzov",
|
|
18
|
-
"email": "anton.abyzov@gmail.com"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
10
|
{
|
|
22
11
|
"name": "sw",
|
|
23
12
|
"description": "SpecWeave framework - increment lifecycle, living docs, PM-led planning",
|
package/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<!-- SW:META template="claude" version="1.0.
|
|
1
|
+
<!-- SW:META template="claude" version="1.0.160" sections="header,start,autodetect,metarule,rules,workflow,reflect,context,structure,taskformat,secrets,syncing,testing,tdd,api,limits,troubleshooting,lazyloading,principles,linking,mcp,auto,docs" -->
|
|
2
2
|
|
|
3
|
-
<!-- SW:SECTION:header version="1.0.
|
|
3
|
+
<!-- SW:SECTION:header version="1.0.160" -->
|
|
4
4
|
**Framework**: SpecWeave | **Truth**: `spec.md` + `tasks.md`
|
|
5
5
|
<!-- SW:END:header -->
|
|
6
6
|
|
|
@@ -58,7 +58,7 @@ plugins/specweave/
|
|
|
58
58
|
**Old "commands" are just skills with `disable-model-invocation: true`** - they only respond to explicit `/name` invocation, not keyword detection.
|
|
59
59
|
<!-- SW:END:claude-code-concepts -->
|
|
60
60
|
|
|
61
|
-
<!-- SW:SECTION:start version="1.0.
|
|
61
|
+
<!-- SW:SECTION:start version="1.0.160" -->
|
|
62
62
|
## Getting Started
|
|
63
63
|
|
|
64
64
|
**Initial increment**: `0001-project-setup` (auto-created by `specweave init`)
|
|
@@ -68,7 +68,7 @@ plugins/specweave/
|
|
|
68
68
|
2. **Customize**: Edit spec.md and use for setup tasks
|
|
69
69
|
<!-- SW:END:start -->
|
|
70
70
|
|
|
71
|
-
<!-- SW:SECTION:autodetect version="1.0.
|
|
71
|
+
<!-- SW:SECTION:autodetect version="1.0.160" -->
|
|
72
72
|
## Auto-Detection
|
|
73
73
|
|
|
74
74
|
SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
@@ -78,7 +78,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
78
78
|
**Opt-out phrases**: "Just brainstorm first" | "Don't plan yet" | "Quick discussion" | "Let's explore ideas"
|
|
79
79
|
<!-- SW:END:autodetect -->
|
|
80
80
|
|
|
81
|
-
<!-- SW:SECTION:metarule version="1.0.
|
|
81
|
+
<!-- SW:SECTION:metarule version="1.0.160" -->
|
|
82
82
|
## Meta-Rule: Think-Before-Act
|
|
83
83
|
|
|
84
84
|
**Satisfy dependencies BEFORE dependent operations.**
|
|
@@ -89,7 +89,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
89
89
|
```
|
|
90
90
|
<!-- SW:END:metarule -->
|
|
91
91
|
|
|
92
|
-
<!-- SW:SECTION:rules version="1.0.
|
|
92
|
+
<!-- SW:SECTION:rules version="1.0.160" -->
|
|
93
93
|
## Rules
|
|
94
94
|
|
|
95
95
|
1. **Files** → `.specweave/increments/####-name/` (see Structure section for details)
|
|
@@ -100,7 +100,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
100
100
|
6. **⛔ Marketplace refresh**: Use `specweave refresh-marketplace` CLI (not `scripts/refresh-marketplace.sh`)
|
|
101
101
|
<!-- SW:END:rules -->
|
|
102
102
|
|
|
103
|
-
<!-- SW:SECTION:workflow version="1.0.
|
|
103
|
+
<!-- SW:SECTION:workflow version="1.0.160" -->
|
|
104
104
|
## Workflow
|
|
105
105
|
|
|
106
106
|
`/sw:increment "X"` → `/sw:do` → `/sw:progress` → `/sw:done 0001`
|
|
@@ -120,7 +120,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
120
120
|
**Natural language**: "Let's build X" → `/sw:increment` | "What's status?" → `/sw:progress` | "We're done" → `/sw:done` | "Ship while sleeping" → `/sw:auto`
|
|
121
121
|
<!-- SW:END:workflow -->
|
|
122
122
|
|
|
123
|
-
<!-- SW:SECTION:reflect version="1.0.
|
|
123
|
+
<!-- SW:SECTION:reflect version="1.0.160" -->
|
|
124
124
|
## Skill Memories
|
|
125
125
|
|
|
126
126
|
SpecWeave learns from corrections. Learnings saved here automatically. Edit or delete as needed.
|
|
@@ -133,7 +133,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
|
|
|
133
133
|
<!-- Auto-captured by SpecWeave reflect. Edit or delete as needed. -->
|
|
134
134
|
<!-- Learnings are organized by skill name. User edits override SpecWeave defaults. -->
|
|
135
135
|
|
|
136
|
-
<!-- SW:SECTION:context version="1.0.
|
|
136
|
+
<!-- SW:SECTION:context version="1.0.160" -->
|
|
137
137
|
## Context
|
|
138
138
|
|
|
139
139
|
**Before implementing**: Check ADRs at `.specweave/docs/internal/architecture/adr/`
|
|
@@ -141,7 +141,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
|
|
|
141
141
|
**Load context**: `/sw:context <topic>` loads relevant living docs into conversation
|
|
142
142
|
<!-- SW:END:context -->
|
|
143
143
|
|
|
144
|
-
<!-- SW:SECTION:structure version="1.0.
|
|
144
|
+
<!-- SW:SECTION:structure version="1.0.160" -->
|
|
145
145
|
## Structure
|
|
146
146
|
|
|
147
147
|
```
|
|
@@ -156,7 +156,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
|
|
|
156
156
|
**Everything else → subfolders**: `reports/` | `logs/` | `scripts/` | `backups/`
|
|
157
157
|
<!-- SW:END:structure -->
|
|
158
158
|
|
|
159
|
-
<!-- SW:SECTION:taskformat version="1.0.
|
|
159
|
+
<!-- SW:SECTION:taskformat version="1.0.160" -->
|
|
160
160
|
## Task Format
|
|
161
161
|
|
|
162
162
|
```markdown
|
|
@@ -166,7 +166,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
|
|
|
166
166
|
```
|
|
167
167
|
<!-- SW:END:taskformat -->
|
|
168
168
|
|
|
169
|
-
<!-- SW:SECTION:secrets version="1.0.
|
|
169
|
+
<!-- SW:SECTION:secrets version="1.0.160" -->
|
|
170
170
|
## Secrets Check
|
|
171
171
|
|
|
172
172
|
**BEFORE CLI tools**: Check existing config first!
|
|
@@ -180,7 +180,7 @@ gh auth status
|
|
|
180
180
|
**SECURITY**: NEVER use `grep TOKEN .env` without `-q` flag - it exposes credentials in terminal!
|
|
181
181
|
<!-- SW:END:secrets -->
|
|
182
182
|
|
|
183
|
-
<!-- SW:SECTION:syncing version="1.0.
|
|
183
|
+
<!-- SW:SECTION:syncing version="1.0.160" -->
|
|
184
184
|
## External Sync (GitHub/JIRA/ADO)
|
|
185
185
|
|
|
186
186
|
**Commands**: `/sw-github:sync {id}` (issues) | `/sw:sync-specs` (living docs only)
|
|
@@ -190,7 +190,7 @@ gh auth status
|
|
|
190
190
|
**Config**: Set `sync.github.enabled: true` + `canUpdateExternalItems: true` in config.json
|
|
191
191
|
<!-- SW:END:syncing -->
|
|
192
192
|
|
|
193
|
-
<!-- SW:SECTION:testing version="1.0.
|
|
193
|
+
<!-- SW:SECTION:testing version="1.0.160" -->
|
|
194
194
|
## Testing
|
|
195
195
|
|
|
196
196
|
BDD in tasks.md | Unit >80% | `.test.ts` (Vitest)
|
|
@@ -202,7 +202,7 @@ vi.mock('./module', () => ({ func: mockFn }));
|
|
|
202
202
|
```
|
|
203
203
|
<!-- SW:END:testing -->
|
|
204
204
|
|
|
205
|
-
<!-- SW:SECTION:tdd version="1.0.
|
|
205
|
+
<!-- SW:SECTION:tdd version="1.0.160" -->
|
|
206
206
|
## TDD Mode (Test-Driven Development)
|
|
207
207
|
|
|
208
208
|
**When `testing.defaultTestMode: "TDD"` is configured**, follow RED-GREEN-REFACTOR discipline:
|
|
@@ -263,7 +263,7 @@ When TDD is enabled, tasks include phase markers:
|
|
|
263
263
|
**Rule**: Complete dependencies BEFORE dependent tasks (RED before GREEN).
|
|
264
264
|
<!-- SW:END:tdd -->
|
|
265
265
|
|
|
266
|
-
<!-- SW:SECTION:api version="1.0.
|
|
266
|
+
<!-- SW:SECTION:api version="1.0.160" -->
|
|
267
267
|
## API Development (OpenAPI-First)
|
|
268
268
|
|
|
269
269
|
**For API projects only.** Commands: `/sw:api-docs --all` | `--openapi` | `--postman` | `--validate`
|
|
@@ -271,13 +271,13 @@ When TDD is enabled, tasks include phase markers:
|
|
|
271
271
|
Enable in config: `{"apiDocs":{"enabled":true,"openApiPath":"openapi.yaml"}}`
|
|
272
272
|
<!-- SW:END:api -->
|
|
273
273
|
|
|
274
|
-
<!-- SW:SECTION:limits version="1.0.
|
|
274
|
+
<!-- SW:SECTION:limits version="1.0.160" -->
|
|
275
275
|
## Limits
|
|
276
276
|
|
|
277
277
|
**Max 1500 lines/file** — extract before adding
|
|
278
278
|
<!-- SW:END:limits -->
|
|
279
279
|
|
|
280
|
-
<!-- SW:SECTION:troubleshooting version="1.0.
|
|
280
|
+
<!-- SW:SECTION:troubleshooting version="1.0.160" -->
|
|
281
281
|
## Troubleshooting
|
|
282
282
|
|
|
283
283
|
| Issue | Fix |
|
|
@@ -293,7 +293,7 @@ Enable in config: `{"apiDocs":{"enabled":true,"openApiPath":"openapi.yaml"}}`
|
|
|
293
293
|
| Marketplace shows 0 | Normal with auto-load; `/plugin list` shows actual |
|
|
294
294
|
<!-- SW:END:troubleshooting -->
|
|
295
295
|
|
|
296
|
-
<!-- SW:SECTION:lazyloading version="1.0.
|
|
296
|
+
<!-- SW:SECTION:lazyloading version="1.0.160" -->
|
|
297
297
|
## Plugin Auto-Loading
|
|
298
298
|
|
|
299
299
|
Plugins load automatically based on project type and keywords. Manual install if needed:
|
|
@@ -307,7 +307,7 @@ export SPECWEAVE_DISABLE_AUTO_LOAD=1 # Disable auto-load
|
|
|
307
307
|
**Token savings**: Core ~3-5K tokens vs all plugins ~60K+
|
|
308
308
|
<!-- SW:END:lazyloading -->
|
|
309
309
|
|
|
310
|
-
<!-- SW:SECTION:principles version="1.0.
|
|
310
|
+
<!-- SW:SECTION:principles version="1.0.160" -->
|
|
311
311
|
## Principles
|
|
312
312
|
|
|
313
313
|
1. **Spec-first**: `/sw:increment` before coding
|
|
@@ -316,7 +316,7 @@ export SPECWEAVE_DISABLE_AUTO_LOAD=1 # Disable auto-load
|
|
|
316
316
|
4. **Traceable**: All work → specs → ACs
|
|
317
317
|
<!-- SW:END:principles -->
|
|
318
318
|
|
|
319
|
-
<!-- SW:SECTION:linking version="1.0.
|
|
319
|
+
<!-- SW:SECTION:linking version="1.0.160" -->
|
|
320
320
|
## Bidirectional Linking
|
|
321
321
|
|
|
322
322
|
Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
|
|
@@ -324,7 +324,7 @@ Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
|
|
|
324
324
|
Task format: `**AC**: AC-US1-01, AC-US1-02` (CRITICAL for linking)
|
|
325
325
|
<!-- SW:END:linking -->
|
|
326
326
|
|
|
327
|
-
<!-- SW:SECTION:mcp version="1.0.
|
|
327
|
+
<!-- SW:SECTION:mcp version="1.0.160" -->
|
|
328
328
|
## External Services
|
|
329
329
|
|
|
330
330
|
**Priority**: CLI tools first (simpler) → MCP for complex integrations
|
|
@@ -346,7 +346,7 @@ claude mcp add --transport stdio postgres -- npx -y @modelcontextprotocol/server
|
|
|
346
346
|
MCP supports lazy-loading (auto mode) - tools load on-demand when >10% context.
|
|
347
347
|
<!-- SW:END:mcp -->
|
|
348
348
|
|
|
349
|
-
<!-- SW:SECTION:auto version="1.0.
|
|
349
|
+
<!-- SW:SECTION:auto version="1.0.160" -->
|
|
350
350
|
## Auto Mode
|
|
351
351
|
|
|
352
352
|
**Commands**: `/sw:auto` (start) | `/sw:auto-status` (check) | `/sw:cancel-auto` (emergency only)
|
|
@@ -363,7 +363,7 @@ MCP supports lazy-loading (auto mode) - tools load on-demand when >10% context.
|
|
|
363
363
|
**STOP & ASK** if: Spec conflicts | Task unnecessary | Requirement ambiguous
|
|
364
364
|
<!-- SW:END:auto -->
|
|
365
365
|
|
|
366
|
-
<!-- SW:SECTION:docs version="1.0.
|
|
366
|
+
<!-- SW:SECTION:docs version="1.0.160" -->
|
|
367
367
|
## Docs
|
|
368
368
|
|
|
369
369
|
[spec-weave.com](https://spec-weave.com)
|
|
@@ -506,6 +506,30 @@ claude -p "Say hello" --model haiku --setting-sources ""
|
|
|
506
506
|
**Files using this pattern:**
|
|
507
507
|
- `src/core/lazy-loading/llm-plugin-detector.ts` - Plugin detection via CLI
|
|
508
508
|
|
|
509
|
+
### 10. Increment ID Collision Prevention (v1.0.160)
|
|
510
|
+
|
|
511
|
+
**⚠️ Increment IDs MUST be unique across BOTH active AND _archive folders!**
|
|
512
|
+
|
|
513
|
+
**Root Cause**: Archived increments retain their IDs (e.g., `0001-core-framework` in `_archive/`). Creating a new increment with the same base number causes structural violations.
|
|
514
|
+
|
|
515
|
+
**Symptoms:**
|
|
516
|
+
- Two increments with same number (e.g., `0001-project-setup` active + `0001-core-framework` archived)
|
|
517
|
+
- GitHub sync confusion (which 0001 is which?)
|
|
518
|
+
- Feature ID collisions in living docs
|
|
519
|
+
|
|
520
|
+
**Solution - ALWAYS use IncrementNumberManager:**
|
|
521
|
+
```typescript
|
|
522
|
+
// ✅ CORRECT: Scans all folders (active, _archive, _abandoned, _paused)
|
|
523
|
+
const nextId = IncrementNumberManager.getNextIncrementNumber(projectRoot);
|
|
524
|
+
|
|
525
|
+
// ❌ WRONG: Hardcoding IDs
|
|
526
|
+
const incrementId = '0001-project-setup'; // May collide with archived!
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
**Files using this pattern:**
|
|
530
|
+
- `src/core/increment/increment-utils.ts` - `getAllIncrementNumbers()` scans all directories
|
|
531
|
+
- `src/cli/helpers/init/initial-increment-generator.ts` - Uses IncrementNumberManager (fixed v1.0.160)
|
|
532
|
+
|
|
509
533
|
---
|
|
510
534
|
|
|
511
535
|
## Skills vs Agents (Automatic vs Explicit)
|
package/bin/specweave.js
CHANGED
|
@@ -204,6 +204,7 @@ program
|
|
|
204
204
|
program
|
|
205
205
|
.command('init [project-name]')
|
|
206
206
|
.description('Initialize a new SpecWeave project')
|
|
207
|
+
.option('-n, --name <name>', 'Project name (alternative to positional argument)')
|
|
207
208
|
.option('-t, --template <type>', 'Project template (saas, api, fullstack)', 'saas')
|
|
208
209
|
.option('-a, --adapter <tool>', 'AI tool adapter (claude, cursor, copilot, generic)', undefined)
|
|
209
210
|
.option('--tech-stack <language>', 'Technology stack (nodejs, python, etc.)', undefined)
|
|
@@ -213,9 +214,16 @@ program
|
|
|
213
214
|
.option('--no-living-docs', 'Skip living docs builder setup')
|
|
214
215
|
.option('--full', 'Install all plugins (skip lazy loading, longer init but all skills available immediately)')
|
|
215
216
|
.option('-q, --quick', 'Quick mode: skip all prompts, use sensible defaults (local git, no external tools, minimal setup)')
|
|
217
|
+
.option('--non-interactive', 'Alias for --quick (skip all prompts)')
|
|
216
218
|
.action(async (projectName, options) => {
|
|
217
219
|
const { initCommand } = await import('../dist/src/cli/commands/init.js');
|
|
218
|
-
|
|
220
|
+
// Support --name as alternative to positional argument
|
|
221
|
+
const resolvedName = projectName || options.name;
|
|
222
|
+
// Support --non-interactive as alias for --quick
|
|
223
|
+
if (options.nonInteractive) {
|
|
224
|
+
options.quick = true;
|
|
225
|
+
}
|
|
226
|
+
await initCommand(resolvedName, options);
|
|
219
227
|
});
|
|
220
228
|
|
|
221
229
|
// Increment commands (TODO: Implement in future versions)
|
|
@@ -4,25 +4,26 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Automates the complete marketplace refresh process with LAZY LOADING support:
|
|
6
6
|
* 1. Updates or adds marketplace (GitHub or local)
|
|
7
|
-
* 2. Installs
|
|
7
|
+
* 2. Installs core plugin (sw) only (default) OR all plugins (--all)
|
|
8
8
|
* 3. Populates lazy loading cache for on-demand plugin loading
|
|
9
9
|
* 4. Merges skill memories (preserves user learnings)
|
|
10
10
|
* 5. Updates instruction files (CLAUDE.md, AGENTS.md)
|
|
11
11
|
*
|
|
12
|
-
* LAZY LOADING (default - v1.0.
|
|
13
|
-
* - Installs only `
|
|
14
|
-
* - Other plugins
|
|
12
|
+
* LAZY LOADING (default - v1.0.160+):
|
|
13
|
+
* - Installs only core `sw` plugin (~3K tokens)
|
|
14
|
+
* - Other plugins detected & loaded on-demand via LLM (detect-intent)
|
|
15
15
|
* - No intermediate cache needed (marketplace IS the cache!)
|
|
16
16
|
* - Result: ~5K tokens at startup instead of ~60K (90% savings!)
|
|
17
|
+
* - NOTE: sw-router is OBSOLETE - detect-intent handles plugin detection
|
|
17
18
|
*
|
|
18
19
|
* MINIMAL MODE (--minimal):
|
|
19
20
|
* - Removes specweave marketplace entirely
|
|
20
|
-
* - Installs only core
|
|
21
|
+
* - Installs only core plugin (sw)
|
|
21
22
|
* - Clean /plugin output (only shows installed plugins)
|
|
22
23
|
* - Tradeoff: Lazy loading disabled (use --all to reinstall all)
|
|
23
24
|
*
|
|
24
25
|
* Usage:
|
|
25
|
-
* specweave refresh-marketplace # Lazy mode (default) -
|
|
26
|
+
* specweave refresh-marketplace # Lazy mode (default) - core only
|
|
26
27
|
* specweave refresh-marketplace --all # Legacy mode - install all plugins
|
|
27
28
|
* specweave refresh-marketplace --minimal # Minimal mode - clean /plugin output
|
|
28
29
|
* specweave refresh-marketplace --local # Use local dev version
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-marketplace.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/refresh-marketplace.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"refresh-marketplace.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/refresh-marketplace.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAiBH,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,CA2f3F"}
|
|
@@ -4,25 +4,26 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Automates the complete marketplace refresh process with LAZY LOADING support:
|
|
6
6
|
* 1. Updates or adds marketplace (GitHub or local)
|
|
7
|
-
* 2. Installs
|
|
7
|
+
* 2. Installs core plugin (sw) only (default) OR all plugins (--all)
|
|
8
8
|
* 3. Populates lazy loading cache for on-demand plugin loading
|
|
9
9
|
* 4. Merges skill memories (preserves user learnings)
|
|
10
10
|
* 5. Updates instruction files (CLAUDE.md, AGENTS.md)
|
|
11
11
|
*
|
|
12
|
-
* LAZY LOADING (default - v1.0.
|
|
13
|
-
* - Installs only `
|
|
14
|
-
* - Other plugins
|
|
12
|
+
* LAZY LOADING (default - v1.0.160+):
|
|
13
|
+
* - Installs only core `sw` plugin (~3K tokens)
|
|
14
|
+
* - Other plugins detected & loaded on-demand via LLM (detect-intent)
|
|
15
15
|
* - No intermediate cache needed (marketplace IS the cache!)
|
|
16
16
|
* - Result: ~5K tokens at startup instead of ~60K (90% savings!)
|
|
17
|
+
* - NOTE: sw-router is OBSOLETE - detect-intent handles plugin detection
|
|
17
18
|
*
|
|
18
19
|
* MINIMAL MODE (--minimal):
|
|
19
20
|
* - Removes specweave marketplace entirely
|
|
20
|
-
* - Installs only core
|
|
21
|
+
* - Installs only core plugin (sw)
|
|
21
22
|
* - Clean /plugin output (only shows installed plugins)
|
|
22
23
|
* - Tradeoff: Lazy loading disabled (use --all to reinstall all)
|
|
23
24
|
*
|
|
24
25
|
* Usage:
|
|
25
|
-
* specweave refresh-marketplace # Lazy mode (default) -
|
|
26
|
+
* specweave refresh-marketplace # Lazy mode (default) - core only
|
|
26
27
|
* specweave refresh-marketplace --all # Legacy mode - install all plugins
|
|
27
28
|
* specweave refresh-marketplace --minimal # Minimal mode - clean /plugin output
|
|
28
29
|
* specweave refresh-marketplace --local # Use local dev version
|
|
@@ -492,7 +493,7 @@ async function runMinimalMode(options) {
|
|
|
492
493
|
console.log(chalk.blue.bold('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
|
|
493
494
|
console.log(chalk.yellow('⚠️ Minimal mode:'));
|
|
494
495
|
console.log(chalk.gray(' • Removes specweave marketplace entirely'));
|
|
495
|
-
console.log(chalk.gray(' • Installs only core
|
|
496
|
+
console.log(chalk.gray(' • Installs only core plugin (sw)'));
|
|
496
497
|
console.log(chalk.gray(' • /plugin will show only installed plugins'));
|
|
497
498
|
console.log(chalk.gray(' • Lazy loading will NOT work (use --all to reload)\n'));
|
|
498
499
|
// Step 1: Uninstall all specweave plugins
|
|
@@ -608,8 +609,8 @@ async function runMinimalMode(options) {
|
|
|
608
609
|
console.log(chalk.gray(addResult.output));
|
|
609
610
|
process.exit(1);
|
|
610
611
|
}
|
|
611
|
-
// Install core
|
|
612
|
-
const corePlugins = ['sw'
|
|
612
|
+
// Install core plugin only (sw-router is obsolete as of v1.0.160)
|
|
613
|
+
const corePlugins = ['sw'];
|
|
613
614
|
let installedCount = 0;
|
|
614
615
|
for (const plugin of corePlugins) {
|
|
615
616
|
console.log(chalk.blue(` Installing ${plugin}...`));
|
|
@@ -662,7 +663,7 @@ export async function refreshMarketplaceCommand(options = {}) {
|
|
|
662
663
|
console.log(chalk.blue.bold('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
|
|
663
664
|
if (lazyMode) {
|
|
664
665
|
console.log(chalk.cyan('🚀 Lazy loading mode (default):'));
|
|
665
|
-
console.log(chalk.gray(' • Install only
|
|
666
|
+
console.log(chalk.gray(' • Install only core plugin (~500 tokens)'));
|
|
666
667
|
console.log(chalk.gray(' • Other plugins cached for on-demand loading'));
|
|
667
668
|
console.log(chalk.gray(' • Use --all flag to install all plugins'));
|
|
668
669
|
console.log(chalk.gray(' • Use --minimal flag for clean /plugin output (no lazy loading)\n'));
|
|
@@ -780,10 +781,9 @@ export async function refreshMarketplaceCommand(options = {}) {
|
|
|
780
781
|
// Step 3: Install plugins (LAZY LOADING AWARE - v1.0.122+)
|
|
781
782
|
const results = [];
|
|
782
783
|
if (lazyMode) {
|
|
783
|
-
// LAZY MODE: Install only
|
|
784
|
-
//
|
|
785
|
-
const
|
|
786
|
-
const corePlugins = ['sw', 'sw-router']; // Plugins to keep in lazy mode
|
|
784
|
+
// LAZY MODE: Install only core plugin (sw)
|
|
785
|
+
// NOTE: sw-router is OBSOLETE as of v1.0.160 - detect-intent handles plugin detection
|
|
786
|
+
const corePlugins = ['sw']; // Only core plugin kept in lazy mode
|
|
787
787
|
// Step 3a: Uninstall non-core plugins to match fresh install state
|
|
788
788
|
console.log(chalk.yellow('⚙️ Step 3a: Cleaning up non-core plugins...'));
|
|
789
789
|
const installedPlugins = getInstalledSpecweavePlugins();
|
|
@@ -807,7 +807,7 @@ export async function refreshMarketplaceCommand(options = {}) {
|
|
|
807
807
|
// Also clean up ~/.claude/skills/ directory for non-core plugins
|
|
808
808
|
// (claude plugin uninstall may not always clean this up)
|
|
809
809
|
const skillsDir = path.join(os.homedir(), '.claude', 'skills');
|
|
810
|
-
const coreSkillDirs = ['specweave'
|
|
810
|
+
const coreSkillDirs = ['specweave']; // Only core plugin folder kept
|
|
811
811
|
if (fs.existsSync(skillsDir)) {
|
|
812
812
|
const skillDirs = fs.readdirSync(skillsDir).filter(name => {
|
|
813
813
|
const dirPath = path.join(skillsDir, name);
|
|
@@ -832,7 +832,7 @@ export async function refreshMarketplaceCommand(options = {}) {
|
|
|
832
832
|
// CRITICAL: Also clean up ~/.claude/plugins/cache/specweave/ for non-core plugins
|
|
833
833
|
// This is where Claude Code discovers plugins from, even if not "installed"
|
|
834
834
|
const pluginCacheDir = path.join(os.homedir(), '.claude', 'plugins', 'cache', 'specweave');
|
|
835
|
-
const corePluginCacheDirs = ['sw'
|
|
835
|
+
const corePluginCacheDirs = ['sw']; // Only core plugin cache kept
|
|
836
836
|
if (fs.existsSync(pluginCacheDir)) {
|
|
837
837
|
const cacheDirs = fs.readdirSync(pluginCacheDir).filter(name => {
|
|
838
838
|
const dirPath = path.join(pluginCacheDir, name);
|
|
@@ -860,7 +860,7 @@ export async function refreshMarketplaceCommand(options = {}) {
|
|
|
860
860
|
}
|
|
861
861
|
// Also clean up settings.json enabledPlugins for non-core specweave plugins
|
|
862
862
|
const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
|
|
863
|
-
const coreEnabledPlugins = ['sw@specweave'
|
|
863
|
+
const coreEnabledPlugins = ['sw@specweave']; // Only core plugin enabled
|
|
864
864
|
if (fs.existsSync(settingsPath)) {
|
|
865
865
|
try {
|
|
866
866
|
const settingsContent = fs.readFileSync(settingsPath, 'utf8');
|
|
@@ -925,29 +925,19 @@ export async function refreshMarketplaceCommand(options = {}) {
|
|
|
925
925
|
else {
|
|
926
926
|
console.log(chalk.green(`✓ No non-core plugins to disable\n`));
|
|
927
927
|
}
|
|
928
|
-
// Step 3c: Install router
|
|
929
|
-
console.log(chalk.yellow(`⚙️ Step 3c: Installing
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
}
|
|
937
|
-
else {
|
|
938
|
-
console.log(chalk.red(` ✗ ${routerPlugin} failed`));
|
|
939
|
-
if (options.verbose && result.error) {
|
|
940
|
-
console.log(chalk.gray(` ${result.error}`));
|
|
941
|
-
}
|
|
942
|
-
}
|
|
928
|
+
// Step 3c: Install core plugin only (sw-router is obsolete - detect-intent handles routing)
|
|
929
|
+
console.log(chalk.yellow(`⚙️ Step 3c: Installing core plugin only${forceMode ? ' + force' : ''}...\n`));
|
|
930
|
+
const corePlugin = 'sw'; // Marketplace name for core specweave plugin
|
|
931
|
+
console.log(chalk.blue(` ${forceMode ? 'Force reinstalling' : 'Installing'} ${corePlugin}...`));
|
|
932
|
+
const result = installPlugin(corePlugin, forceMode);
|
|
933
|
+
results.push(result);
|
|
934
|
+
if (result.success) {
|
|
935
|
+
console.log(chalk.green(` ✓ ${corePlugin} (core) installed`));
|
|
943
936
|
}
|
|
944
937
|
else {
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
results.push(result);
|
|
949
|
-
if (result.success) {
|
|
950
|
-
console.log(chalk.green(` ✓ specweave (core) installed`));
|
|
938
|
+
console.log(chalk.red(` ✗ ${corePlugin} failed`));
|
|
939
|
+
if (options.verbose && result.error) {
|
|
940
|
+
console.log(chalk.gray(` ${result.error}`));
|
|
951
941
|
}
|
|
952
942
|
}
|
|
953
943
|
console.log('');
|
|
@@ -955,12 +945,12 @@ export async function refreshMarketplaceCommand(options = {}) {
|
|
|
955
945
|
console.log(chalk.blue.bold(' Lazy Loading Summary'));
|
|
956
946
|
console.log(chalk.blue.bold('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
|
|
957
947
|
console.log(` Total plugins available: ${plugins.length}`);
|
|
958
|
-
console.log(chalk.green(` Installed now: 1 (
|
|
948
|
+
console.log(chalk.green(` Installed now: 1 (core only)`));
|
|
959
949
|
console.log(chalk.cyan(` Cached for on-demand: ${plugins.length - 1}`));
|
|
960
950
|
console.log('');
|
|
961
951
|
console.log(chalk.green(' 💡 Token savings:'));
|
|
962
952
|
console.log(chalk.gray(` Before: ~60,000 tokens (all plugins)`));
|
|
963
|
-
console.log(chalk.gray(` After: ~500 tokens (
|
|
953
|
+
console.log(chalk.gray(` After: ~500 tokens (core only)`));
|
|
964
954
|
console.log(chalk.green(` Saved: ~59,500 tokens (99% reduction!)`));
|
|
965
955
|
}
|
|
966
956
|
else {
|