specweave 1.0.265 → 1.0.266

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 (62) hide show
  1. package/CLAUDE.md +25 -25
  2. package/bin/specweave.js +39 -10
  3. package/dist/dashboard/assets/index-ChpKRRZZ.js +11 -0
  4. package/dist/dashboard/assets/index-Xlk5xDzZ.css +1 -0
  5. package/dist/dashboard/index.html +2 -2
  6. package/dist/src/cli/commands/docs.d.ts +4 -0
  7. package/dist/src/cli/commands/docs.d.ts.map +1 -1
  8. package/dist/src/cli/commands/docs.js +76 -60
  9. package/dist/src/cli/commands/docs.js.map +1 -1
  10. package/dist/src/core/llm/consent.d.ts.map +1 -1
  11. package/dist/src/core/llm/consent.js +2 -0
  12. package/dist/src/core/llm/consent.js.map +1 -1
  13. package/dist/src/core/llm/index.d.ts +2 -0
  14. package/dist/src/core/llm/index.d.ts.map +1 -1
  15. package/dist/src/core/llm/index.js +2 -0
  16. package/dist/src/core/llm/index.js.map +1 -1
  17. package/dist/src/core/llm/provider-factory.d.ts.map +1 -1
  18. package/dist/src/core/llm/provider-factory.js +1 -4
  19. package/dist/src/core/llm/provider-factory.js.map +1 -1
  20. package/dist/src/core/skills/skill-judge.d.ts +2 -0
  21. package/dist/src/core/skills/skill-judge.d.ts.map +1 -1
  22. package/dist/src/core/skills/skill-judge.js +5 -6
  23. package/dist/src/core/skills/skill-judge.js.map +1 -1
  24. package/dist/src/dashboard/server/dashboard-server.d.ts.map +1 -1
  25. package/dist/src/dashboard/server/dashboard-server.js +28 -5
  26. package/dist/src/dashboard/server/dashboard-server.js.map +1 -1
  27. package/dist/src/dashboard/server/data/claude-log-parser.d.ts +14 -10
  28. package/dist/src/dashboard/server/data/claude-log-parser.d.ts.map +1 -1
  29. package/dist/src/dashboard/server/data/claude-log-parser.js +83 -15
  30. package/dist/src/dashboard/server/data/claude-log-parser.js.map +1 -1
  31. package/dist/src/dashboard/server/data/cost-aggregator.d.ts +9 -1
  32. package/dist/src/dashboard/server/data/cost-aggregator.d.ts.map +1 -1
  33. package/dist/src/dashboard/server/data/cost-aggregator.js +10 -2
  34. package/dist/src/dashboard/server/data/cost-aggregator.js.map +1 -1
  35. package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts.map +1 -1
  36. package/dist/src/dashboard/server/data/dashboard-data-aggregator.js +1 -0
  37. package/dist/src/dashboard/server/data/dashboard-data-aggregator.js.map +1 -1
  38. package/dist/src/dashboard/types.d.ts +19 -1
  39. package/dist/src/dashboard/types.d.ts.map +1 -1
  40. package/dist/src/importers/import-coordinator.js +8 -8
  41. package/dist/src/importers/import-coordinator.js.map +1 -1
  42. package/dist/src/utils/docs-preview/config-generator.d.ts.map +1 -1
  43. package/dist/src/utils/docs-preview/config-generator.js +205 -62
  44. package/dist/src/utils/docs-preview/config-generator.js.map +1 -1
  45. package/dist/src/utils/docs-preview/docusaurus-setup.d.ts +7 -6
  46. package/dist/src/utils/docs-preview/docusaurus-setup.d.ts.map +1 -1
  47. package/dist/src/utils/docs-preview/docusaurus-setup.js +90 -57
  48. package/dist/src/utils/docs-preview/docusaurus-setup.js.map +1 -1
  49. package/dist/src/utils/docs-preview/index.d.ts +2 -0
  50. package/dist/src/utils/docs-preview/index.d.ts.map +1 -1
  51. package/dist/src/utils/docs-preview/index.js +1 -0
  52. package/dist/src/utils/docs-preview/index.js.map +1 -1
  53. package/dist/src/utils/docs-preview/project-detector.js +1 -1
  54. package/dist/src/utils/docs-preview/project-detector.js.map +1 -1
  55. package/dist/src/utils/docs-preview/types.d.ts +10 -0
  56. package/dist/src/utils/docs-preview/types.d.ts.map +1 -1
  57. package/dist/src/utils/docs-preview/types.js +15 -1
  58. package/dist/src/utils/docs-preview/types.js.map +1 -1
  59. package/package.json +1 -1
  60. package/plugins/specweave-docs/skills/preview/SKILL.md +13 -9
  61. package/dist/dashboard/assets/index-Cv1XUAKk.css +0 -1
  62. package/dist/dashboard/assets/index-DHOztQSu.js +0 -11
package/CLAUDE.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- SW:META template="claude" version="1.0.264" sections="header,lsp,start,autodetect,metarule,rules,workflow,reflect,context,structure,taskformat,secrets,syncing,testing,tdd,api,limits,troubleshooting,lazyloading,principles,linking,mcp,auto,docs" -->
1
+ <!-- SW:META template="claude" version="1.0.265" sections="header,lsp,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
3
  <!-- SW:SECTION:hook-priority version="1.0.171" -->
4
4
  ## ⛔ Hook Instructions Override Everything
@@ -11,7 +11,7 @@
11
11
  | **"SKILL FIRST"** | Call shown skill FIRST → chain domain skills → implement |
12
12
  <!-- SW:END:hook-priority -->
13
13
 
14
- <!-- SW:SECTION:header version="1.0.264" -->
14
+ <!-- SW:SECTION:header version="1.0.265" -->
15
15
  **Framework**: SpecWeave | **Truth**: `spec.md` + `tasks.md`
16
16
  <!-- SW:END:header -->
17
17
 
@@ -39,13 +39,13 @@ If auto-activation fails, invoke explicitly: `Skill({ skill: "name" })`
39
39
 
40
40
  Use: `specweave lsp refs|def|hover src/file.ts SymbolName`
41
41
 
42
- <!-- SW:SECTION:lsp version="1.0.264" -->
42
+ <!-- SW:SECTION:lsp version="1.0.265" -->
43
43
  ## LSP (Code Intelligence)
44
44
 
45
45
  **Native LSP broken in v2.1.0+.** Use: `specweave lsp refs|def|hover src/file.ts SymbolName`
46
46
  <!-- SW:END:lsp -->
47
47
 
48
- <!-- SW:SECTION:start version="1.0.264" -->
48
+ <!-- SW:SECTION:start version="1.0.265" -->
49
49
  ## Getting Started
50
50
 
51
51
  **Initial increment**: `0001-project-setup` (auto-created by `specweave init`)
@@ -55,7 +55,7 @@ Use: `specweave lsp refs|def|hover src/file.ts SymbolName`
55
55
  2. **Customize**: Edit spec.md and use for setup tasks
56
56
  <!-- SW:END:start -->
57
57
 
58
- <!-- SW:SECTION:autodetect version="1.0.264" -->
58
+ <!-- SW:SECTION:autodetect version="1.0.265" -->
59
59
  ## Auto-Detection
60
60
 
61
61
  SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
@@ -65,7 +65,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
65
65
  **Opt-out phrases**: "Just brainstorm first" | "Don't plan yet" | "Quick discussion" | "Let's explore ideas"
66
66
  <!-- SW:END:autodetect -->
67
67
 
68
- <!-- SW:SECTION:metarule version="1.0.264" -->
68
+ <!-- SW:SECTION:metarule version="1.0.265" -->
69
69
  ## Workflow Orchestration
70
70
 
71
71
  ### 1. Plan Mode Default
@@ -92,7 +92,7 @@ Good: npm run build → node script.js → Success
92
92
  ```
93
93
  <!-- SW:END:metarule -->
94
94
 
95
- <!-- SW:SECTION:rules version="1.0.264" -->
95
+ <!-- SW:SECTION:rules version="1.0.265" -->
96
96
  ## Rules
97
97
 
98
98
  1. **Files** → `.specweave/increments/####-name/` (see Structure section for details)
@@ -108,7 +108,7 @@ Good: npm run build → node script.js → Success
108
108
  8. **Multi-repo**: ALL repos MUST be at `repositories/{org}/{repo-name}/` — NEVER directly under `repositories/`
109
109
  <!-- SW:END:rules -->
110
110
 
111
- <!-- SW:SECTION:workflow version="1.0.264" -->
111
+ <!-- SW:SECTION:workflow version="1.0.265" -->
112
112
  ## Workflow
113
113
 
114
114
  `/sw:increment "X"` → `/sw:do` → `/sw:progress` → `/sw:done 0001`
@@ -148,7 +148,7 @@ Skills auto-recommend based on this matrix. In non-auto mode: ask user. In auto
148
148
  Before git operations, scan: `for d in repositories packages services apps libs workspace; do [ -d "$d" ] && find "$d" -maxdepth 2 -name ".git" -type d; done`
149
149
  <!-- SW:END:save-nested-repos -->
150
150
 
151
- <!-- SW:SECTION:reflect version="1.0.264" -->
151
+ <!-- SW:SECTION:reflect version="1.0.265" -->
152
152
  ## Skill Memories
153
153
 
154
154
  SpecWeave learns from corrections. Learnings saved here automatically. Edit or delete as needed.
@@ -170,7 +170,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
170
170
  - Auto mode: Stop hook creates implicit loops via block/approve pattern
171
171
  - **Team-lead for complex work**: After plan generation, ALWAYS assess complexity (task count + domain count). For 3+ domains or 15+ tasks, proactively recommend /sw:team-lead with token cost warning. In auto mode, auto-invoke team-lead for 3+ domains.
172
172
 
173
- <!-- SW:SECTION:context version="1.0.264" -->
173
+ <!-- SW:SECTION:context version="1.0.265" -->
174
174
  ## Context
175
175
 
176
176
  **Before implementing**: Check ADRs at `.specweave/docs/internal/architecture/adr/`
@@ -178,7 +178,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
178
178
  **Load context**: `/sw:docs <topic>` loads relevant living docs into conversation
179
179
  <!-- SW:END:context -->
180
180
 
181
- <!-- SW:SECTION:structure version="1.0.264" -->
181
+ <!-- SW:SECTION:structure version="1.0.265" -->
182
182
  ## Structure
183
183
 
184
184
  ```
@@ -193,7 +193,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
193
193
  **Everything else → subfolders**: `reports/` | `logs/` | `scripts/` | `backups/`
194
194
  <!-- SW:END:structure -->
195
195
 
196
- <!-- SW:SECTION:taskformat version="1.0.264" -->
196
+ <!-- SW:SECTION:taskformat version="1.0.265" -->
197
197
  ## Task Format
198
198
 
199
199
  ```markdown
@@ -203,41 +203,41 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
203
203
  ```
204
204
  <!-- SW:END:taskformat -->
205
205
 
206
- <!-- SW:SECTION:secrets version="1.0.264" -->
206
+ <!-- SW:SECTION:secrets version="1.0.265" -->
207
207
  ## Secrets
208
208
 
209
209
  Before CLI tools, check existing config (`grep -q` only — never display values).
210
210
  <!-- SW:END:secrets -->
211
211
 
212
- <!-- SW:SECTION:syncing version="1.0.264" -->
212
+ <!-- SW:SECTION:syncing version="1.0.265" -->
213
213
  ## External Sync
214
214
 
215
215
  Primary: `/sw:progress-sync`. Individual: `/sw-github:push`, `/sw-github:close`. Mapping: Feature→Milestone | Story→Issue | Task→Checkbox.
216
216
  <!-- SW:END:syncing -->
217
217
 
218
- <!-- SW:SECTION:testing version="1.0.264" -->
218
+ <!-- SW:SECTION:testing version="1.0.265" -->
219
219
  ## Testing
220
220
 
221
221
  BDD in tasks.md | Unit >80% | `.test.ts` (Vitest) | ESM mocking: `vi.hoisted()` + `vi.mock()`
222
222
  <!-- SW:END:testing -->
223
223
 
224
- <!-- SW:SECTION:tdd version="1.0.264" -->
224
+ <!-- SW:SECTION:tdd version="1.0.265" -->
225
225
  ## TDD
226
226
 
227
227
  When `testing.defaultTestMode: "TDD"` in config.json: RED→GREEN→REFACTOR. Use `/sw:tdd-cycle`. Enforcement via `testing.tddEnforcement` (strict|warn|off).
228
228
  <!-- SW:END:tdd -->
229
229
 
230
- <!-- SW:SECTION:api version="1.0.264" -->
230
+ <!-- SW:SECTION:api version="1.0.265" -->
231
231
  <!-- API: Enable `apiDocs` in config.json. Commands: /sw:api-docs -->
232
232
  <!-- SW:END:api -->
233
233
 
234
- <!-- SW:SECTION:limits version="1.0.264" -->
234
+ <!-- SW:SECTION:limits version="1.0.265" -->
235
235
  ## Limits
236
236
 
237
237
  **Max 1500 lines/file** — extract before adding
238
238
  <!-- SW:END:limits -->
239
239
 
240
- <!-- SW:SECTION:troubleshooting version="1.0.264" -->
240
+ <!-- SW:SECTION:troubleshooting version="1.0.265" -->
241
241
  ## Troubleshooting
242
242
 
243
243
  | Issue | Fix |
@@ -248,13 +248,13 @@ When `testing.defaultTestMode: "TDD"` in config.json: RED→GREEN→REFACTOR. Us
248
248
  | Session stuck | `rm -f .specweave/state/*.lock` + restart |
249
249
  <!-- SW:END:troubleshooting -->
250
250
 
251
- <!-- SW:SECTION:lazyloading version="1.0.264" -->
251
+ <!-- SW:SECTION:lazyloading version="1.0.265" -->
252
252
  ## Plugin Auto-Loading
253
253
 
254
254
  Plugins load automatically. Manual: `claude plugin install sw-frontend@specweave`. Disable: `export SPECWEAVE_DISABLE_AUTO_LOAD=1`
255
255
  <!-- SW:END:lazyloading -->
256
256
 
257
- <!-- SW:SECTION:principles version="1.0.264" -->
257
+ <!-- SW:SECTION:principles version="1.0.265" -->
258
258
  ## Principles
259
259
 
260
260
  1. **Spec-first**: `/sw:increment` before coding
@@ -263,7 +263,7 @@ Plugins load automatically. Manual: `claude plugin install sw-frontend@specweave
263
263
  4. **No Laziness**: Root causes, senior standards
264
264
  <!-- SW:END:principles -->
265
265
 
266
- <!-- SW:SECTION:linking version="1.0.264" -->
266
+ <!-- SW:SECTION:linking version="1.0.265" -->
267
267
  ## Bidirectional Linking
268
268
 
269
269
  Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
@@ -271,13 +271,13 @@ Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
271
271
  Task format: `**AC**: AC-US1-01, AC-US1-02` (CRITICAL for linking)
272
272
  <!-- SW:END:linking -->
273
273
 
274
- <!-- SW:SECTION:mcp version="1.0.264" -->
274
+ <!-- SW:SECTION:mcp version="1.0.265" -->
275
275
  ## External Services
276
276
 
277
277
  CLI tools first (`gh`, `wrangler`, `supabase`) → MCP for complex integrations.
278
278
  <!-- SW:END:mcp -->
279
279
 
280
- <!-- SW:SECTION:auto version="1.0.264" -->
280
+ <!-- SW:SECTION:auto version="1.0.265" -->
281
281
  ## Auto Mode
282
282
 
283
283
  `/sw:auto` (start) | `/sw:auto-status` (check) | `/sw:cancel-auto` (emergency)
@@ -285,7 +285,7 @@ CLI tools first (`gh`, `wrangler`, `supabase`) → MCP for complex integrations.
285
285
  Pattern: IMPLEMENT → TEST → FAIL? → FIX → PASS → NEXT. STOP & ASK if spec conflicts or ambiguity.
286
286
  <!-- SW:END:auto -->
287
287
 
288
- <!-- SW:SECTION:docs version="1.0.264" -->
288
+ <!-- SW:SECTION:docs version="1.0.265" -->
289
289
  ## Docs
290
290
 
291
291
  [spec-weave.com](https://spec-weave.com)
package/bin/specweave.js CHANGED
@@ -870,7 +870,8 @@ const docsCmd = program
870
870
  docsCmd
871
871
  .command('preview')
872
872
  .description('Start documentation preview server with hot reload')
873
- .option('-p, --port <number>', 'Port number (default: auto-find 3000-3010)')
873
+ .option('-p, --port <number>', 'Port number (default: 3015 internal, 3016 public)')
874
+ .option('-s, --scope <scope>', 'Documentation scope: internal or public (default: internal)')
874
875
  .option('-f, --force', 'Force reinstall Docusaurus')
875
876
  .option('--no-browser', 'Do not open browser automatically')
876
877
  .option('--no-validate', 'Skip pre-flight validation')
@@ -883,12 +884,14 @@ docsCmd
883
884
  noBrowser: !options.browser,
884
885
  validate: options.validate,
885
886
  autoFix: options.autoFix,
887
+ scope: options.scope || 'internal',
886
888
  });
887
889
  });
888
890
 
889
891
  docsCmd
890
892
  .command('build')
891
893
  .description('Build static documentation site for deployment')
894
+ .option('-s, --scope <scope>', 'Documentation scope: internal or public (default: internal)')
892
895
  .option('--no-validate', 'Skip pre-build validation')
893
896
  .option('--no-auto-fix', 'Do not auto-fix validation issues')
894
897
  .option('-o, --output <path>', 'Output directory')
@@ -898,17 +901,43 @@ docsCmd
898
901
  validate: options.validate,
899
902
  autoFix: options.autoFix,
900
903
  output: options.output,
904
+ scope: options.scope || 'internal',
901
905
  });
902
906
  });
903
907
 
904
908
  docsCmd
905
909
  .command('validate')
906
910
  .description('Validate documentation without starting server')
911
+ .option('-s, --scope <scope>', 'Documentation scope: internal or public (default: internal)')
907
912
  .option('--auto-fix', 'Auto-fix common issues')
908
913
  .option('-v, --verbose', 'Show all issues (not just errors)')
909
914
  .action(async (options) => {
910
915
  const { docsValidateCommand } = await import('../dist/src/cli/commands/docs.js');
911
- await docsValidateCommand(options);
916
+ await docsValidateCommand({
917
+ autoFix: options.autoFix,
918
+ verbose: options.verbose,
919
+ scope: options.scope || 'internal',
920
+ });
921
+ });
922
+
923
+ docsCmd
924
+ .command('public')
925
+ .description('Preview public documentation (shorthand for preview --scope public)')
926
+ .option('-p, --port <number>', 'Port number (default: 3016)')
927
+ .option('-f, --force', 'Force reinstall Docusaurus')
928
+ .option('--no-browser', 'Do not open browser automatically')
929
+ .option('--no-validate', 'Skip pre-flight validation')
930
+ .option('--no-auto-fix', 'Do not auto-fix validation issues')
931
+ .action(async (options) => {
932
+ const { docsPreviewCommand } = await import('../dist/src/cli/commands/docs.js');
933
+ await docsPreviewCommand({
934
+ port: options.port ? parseInt(options.port, 10) : undefined,
935
+ force: options.force,
936
+ noBrowser: !options.browser,
937
+ validate: options.validate,
938
+ autoFix: options.autoFix,
939
+ scope: 'public',
940
+ });
912
941
  });
913
942
 
914
943
  docsCmd
@@ -927,10 +956,10 @@ docsCmd
927
956
  await docsStatusCommand();
928
957
  });
929
958
 
930
- // Default action for 'specweave docs' without subcommand
959
+ // Default action for 'specweave docs' without subcommand — launches internal preview
931
960
  docsCmd.action(async () => {
932
- const { docsStatusCommand } = await import('../dist/src/cli/commands/docs.js');
933
- await docsStatusCommand();
961
+ const { docsPreviewCommand } = await import('../dist/src/cli/commands/docs.js');
962
+ await docsPreviewCommand({ scope: 'internal' });
934
963
  });
935
964
 
936
965
  // Context command - Get project/board context for increment planning
@@ -1166,12 +1195,12 @@ program.on('--help', () => {
1166
1195
  console.log(' $ specweave context projects # Get available projects as JSON');
1167
1196
  console.log(' $ specweave context boards --project myapp # Get boards for a project');
1168
1197
  console.log(' $ specweave context select # Interactive project/board selection');
1169
- console.log(' $ specweave docs # Show docs status and help');
1170
- console.log(' $ specweave docs preview # Start docs server with hot reload');
1171
- console.log(' $ specweave docs preview --port 3015 # Start on specific port');
1172
- console.log(' $ specweave docs build # Build static site for deployment');
1198
+ console.log(' $ specweave docs # Preview internal docs (port 3015)');
1199
+ console.log(' $ specweave docs public # Preview public docs (port 3016)');
1200
+ console.log(' $ specweave docs build # Build internal site');
1201
+ console.log(' $ specweave docs build --scope public # Build public site');
1173
1202
  console.log(' $ specweave docs validate # Check for docs errors');
1174
- console.log(' $ specweave docs validate --auto-fix # Fix common issues automatically');
1203
+ console.log(' $ specweave docs status # Show docs status');
1175
1204
  console.log(' $ specweave docs kill # Stop all docs servers');
1176
1205
  console.log(' $ specweave set-sync-target 0008 # Set sync target for increment');
1177
1206
  console.log(' $ specweave set-sync-target 0008 -v # Show resolution path');