specweave 0.33.3 → 0.33.5

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 (106) hide show
  1. package/CLAUDE.md +85 -19
  2. package/dist/src/cli/cleanup-zombies.js +8 -5
  3. package/dist/src/cli/cleanup-zombies.js.map +1 -1
  4. package/dist/src/cli/commands/jobs.js +19 -2
  5. package/dist/src/cli/commands/jobs.js.map +1 -1
  6. package/dist/src/cli/commands/living-docs.js +1 -1
  7. package/dist/src/cli/commands/living-docs.js.map +1 -1
  8. package/dist/src/cli/helpers/init/external-import-grouping.d.ts.map +1 -1
  9. package/dist/src/cli/helpers/init/external-import-grouping.js +11 -7
  10. package/dist/src/cli/helpers/init/external-import-grouping.js.map +1 -1
  11. package/dist/src/cli/workers/clone-worker.js +22 -5
  12. package/dist/src/cli/workers/clone-worker.js.map +1 -1
  13. package/dist/src/config/types.d.ts +203 -1208
  14. package/dist/src/config/types.d.ts.map +1 -1
  15. package/dist/src/core/background/job-dependency.d.ts.map +1 -1
  16. package/dist/src/core/background/job-dependency.js +1 -0
  17. package/dist/src/core/background/job-dependency.js.map +1 -1
  18. package/dist/src/core/background/job-launcher.js +2 -2
  19. package/dist/src/core/background/job-launcher.js.map +1 -1
  20. package/dist/src/core/background/job-manager.d.ts +8 -0
  21. package/dist/src/core/background/job-manager.d.ts.map +1 -1
  22. package/dist/src/core/background/job-manager.js +19 -1
  23. package/dist/src/core/background/job-manager.js.map +1 -1
  24. package/dist/src/core/background/types.d.ts +9 -1
  25. package/dist/src/core/background/types.d.ts.map +1 -1
  26. package/dist/src/core/background/types.js +8 -1
  27. package/dist/src/core/background/types.js.map +1 -1
  28. package/dist/src/importers/external-importer.d.ts +26 -5
  29. package/dist/src/importers/external-importer.d.ts.map +1 -1
  30. package/dist/src/importers/item-converter.d.ts.map +1 -1
  31. package/dist/src/importers/item-converter.js +18 -1
  32. package/dist/src/importers/item-converter.js.map +1 -1
  33. package/dist/src/importers/jira-importer.d.ts +10 -0
  34. package/dist/src/importers/jira-importer.d.ts.map +1 -1
  35. package/dist/src/importers/jira-importer.js +70 -6
  36. package/dist/src/importers/jira-importer.js.map +1 -1
  37. package/dist/src/init/architecture/types.d.ts +33 -140
  38. package/dist/src/init/architecture/types.d.ts.map +1 -1
  39. package/dist/src/init/compliance/types.d.ts +30 -27
  40. package/dist/src/init/compliance/types.d.ts.map +1 -1
  41. package/dist/src/init/repo/types.d.ts +11 -34
  42. package/dist/src/init/repo/types.d.ts.map +1 -1
  43. package/dist/src/init/research/src/config/types.d.ts +15 -82
  44. package/dist/src/init/research/src/config/types.d.ts.map +1 -1
  45. package/dist/src/init/research/types.d.ts +38 -93
  46. package/dist/src/init/research/types.d.ts.map +1 -1
  47. package/dist/src/init/team/types.d.ts +4 -42
  48. package/dist/src/init/team/types.d.ts.map +1 -1
  49. package/dist/src/living-docs/smart-doc-organizer.js +1 -1
  50. package/dist/src/living-docs/smart-doc-organizer.js.map +1 -1
  51. package/dist/src/sync/closure-metrics.d.ts +102 -0
  52. package/dist/src/sync/closure-metrics.d.ts.map +1 -0
  53. package/dist/src/sync/closure-metrics.js +267 -0
  54. package/dist/src/sync/closure-metrics.js.map +1 -0
  55. package/dist/src/sync/sync-coordinator.d.ts +29 -0
  56. package/dist/src/sync/sync-coordinator.d.ts.map +1 -1
  57. package/dist/src/sync/sync-coordinator.js +153 -16
  58. package/dist/src/sync/sync-coordinator.js.map +1 -1
  59. package/dist/src/utils/docs-preview/config-generator.d.ts.map +1 -1
  60. package/dist/src/utils/docs-preview/config-generator.js +4 -0
  61. package/dist/src/utils/docs-preview/config-generator.js.map +1 -1
  62. package/dist/src/utils/notification-constants.d.ts +87 -0
  63. package/dist/src/utils/notification-constants.d.ts.map +1 -0
  64. package/dist/src/utils/notification-constants.js +131 -0
  65. package/dist/src/utils/notification-constants.js.map +1 -0
  66. package/dist/src/utils/notification-manager.d.ts +24 -0
  67. package/dist/src/utils/notification-manager.d.ts.map +1 -1
  68. package/dist/src/utils/notification-manager.js +29 -0
  69. package/dist/src/utils/notification-manager.js.map +1 -1
  70. package/dist/src/utils/platform-utils.d.ts +13 -3
  71. package/dist/src/utils/platform-utils.d.ts.map +1 -1
  72. package/dist/src/utils/platform-utils.js +17 -6
  73. package/dist/src/utils/platform-utils.js.map +1 -1
  74. package/package.json +1 -1
  75. package/plugins/specweave/commands/specweave-increment.md +46 -0
  76. package/plugins/specweave/commands/specweave-jobs.md +153 -8
  77. package/plugins/specweave/commands/specweave-judge-llm.md +296 -0
  78. package/plugins/specweave/commands/specweave-organize-docs.md +2 -2
  79. package/plugins/specweave/hooks/hooks.json +10 -0
  80. package/plugins/specweave/hooks/spec-project-validator.sh +24 -2
  81. package/plugins/specweave/hooks/universal/hook-wrapper.cmd +26 -26
  82. package/plugins/specweave/hooks/universal/session-start.cmd +16 -16
  83. package/plugins/specweave/hooks/universal/session-start.ps1 +16 -16
  84. package/plugins/specweave/hooks/v2/guards/metadata-json-guard.sh +87 -0
  85. package/plugins/specweave/hooks/v2/guards/metadata-json-guard.test.sh +302 -0
  86. package/plugins/specweave/hooks/v2/guards/per-us-project-validator.sh +72 -18
  87. package/plugins/specweave/hooks/v2/guards/per-us-project-validator.test.sh +406 -0
  88. package/plugins/specweave/scripts/session-watchdog.sh +288 -134
  89. package/plugins/specweave/skills/increment-planner/SKILL.md +48 -18
  90. package/plugins/specweave/skills/increment-planner/templates/spec-multi-project.md +27 -14
  91. package/plugins/specweave/skills/increment-planner/templates/spec-single-project.md +16 -5
  92. package/plugins/specweave/skills/spec-generator/SKILL.md +74 -15
  93. package/plugins/specweave-docs/commands/build.md +4 -4
  94. package/plugins/specweave-docs/commands/generate.md +1 -1
  95. package/plugins/specweave-docs/commands/health.md +1 -1
  96. package/plugins/specweave-docs/commands/init.md +1 -1
  97. package/plugins/specweave-docs/commands/organize.md +2 -2
  98. package/plugins/specweave-docs/commands/validate.md +1 -1
  99. package/plugins/specweave-docs/commands/view.md +391 -0
  100. package/plugins/specweave-docs/skills/preview/SKILL.md +56 -17
  101. package/src/templates/AGENTS.md.template +24 -28
  102. package/src/templates/CLAUDE.md.template +12 -8
  103. package/plugins/specweave/commands/specweave-judge.md +0 -276
  104. package/plugins/specweave-docs/commands/preview.md +0 -274
  105. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +0 -738
  106. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -1107
@@ -0,0 +1,391 @@
1
+ ---
2
+ name: specweave-docs:view
3
+ description: Launch Docusaurus documentation server for living docs. Supports internal (default, port 3015) and public (--public, port 3016) docs. Validates docs first, auto-fixes issues, auto-setup on first run.
4
+ ---
5
+
6
+ # Documentation View Command
7
+
8
+ Launch Docusaurus development server with hot reload, Mermaid diagrams, and auto-generated sidebar.
9
+
10
+ **CRITICAL**: Runs pre-flight validation to catch issues BEFORE starting the server.
11
+
12
+ ## Usage
13
+
14
+ ```bash
15
+ # View internal docs (default) - port 3015
16
+ /specweave-docs:view
17
+
18
+ # View public docs - port 3016
19
+ /specweave-docs:view --public
20
+ /specweave-docs:view public
21
+ ```
22
+
23
+ ## Your Task
24
+
25
+ **IMPORTANT**: This command must work in ANY SpecWeave user project, not just the SpecWeave repo itself.
26
+
27
+ ### Step 0: Parse Arguments
28
+
29
+ ```typescript
30
+ // Determine which docs to view
31
+ const args = process.argv.slice(2);
32
+ const isPublic = args.includes('--public') || args.includes('public');
33
+
34
+ const config = isPublic
35
+ ? {
36
+ docsPath: '.specweave/docs/public',
37
+ port: 3016,
38
+ title: 'Public Documentation',
39
+ cachePath: '.specweave/cache/docs-site-public',
40
+ navbarTitle: 'Public Docs'
41
+ }
42
+ : {
43
+ docsPath: '.specweave/docs/internal',
44
+ port: 3015,
45
+ title: 'Internal Documentation',
46
+ cachePath: '.specweave/cache/docs-site',
47
+ navbarTitle: 'Internal Docs'
48
+ };
49
+
50
+ console.log(`\n📚 Starting ${config.title} server...\n`);
51
+ ```
52
+
53
+ ### Step 1: Check Prerequisites
54
+
55
+ ```bash
56
+ # Verify docs exist at the selected path
57
+ ls -la ${config.docsPath}/
58
+
59
+ # If missing, inform user:
60
+ # "No documentation found at ${config.docsPath}/.
61
+ # Run 'specweave init' first or create the folder structure."
62
+ ```
63
+
64
+ ### Step 1.5: CRITICAL - Run Pre-Flight Validation
65
+
66
+ **ALWAYS run validation BEFORE starting the server!**
67
+
68
+ ```typescript
69
+ import { DocsValidator } from '../../../src/utils/docs-validator.js';
70
+
71
+ const validator = new DocsValidator({
72
+ docsPath: config.docsPath,
73
+ autoFix: true, // Auto-fix common issues
74
+ });
75
+
76
+ console.log('\n🔍 Running pre-flight validation...\n');
77
+ const result = await validator.validate();
78
+
79
+ // Show summary
80
+ console.log(DocsValidator.formatResult(result));
81
+
82
+ // If errors remain after auto-fix, STOP and report
83
+ if (!result.valid) {
84
+ console.log('\n❌ Documentation has errors that must be fixed before preview.');
85
+ console.log(' Fix the issues above, then try again.\n');
86
+ process.exit(1);
87
+ }
88
+
89
+ console.log('\n✅ Validation passed! Starting server...\n');
90
+ ```
91
+
92
+ **What this catches:**
93
+ - YAML frontmatter errors (unquoted colons, tabs)
94
+ - MDX compatibility issues (unquoted attributes, unclosed tags)
95
+ - Duplicate routes
96
+ - Broken internal links
97
+
98
+ **Auto-fixes applied:**
99
+ - Wraps YAML values with colons in quotes
100
+ - Quotes HTML attributes
101
+ - Adds closing slashes to void elements (`<br>` → `<br />`)
102
+ - Converts tabs to spaces in YAML
103
+
104
+ ### Step 2: Check for Cached Installation
105
+
106
+ ```bash
107
+ # Check if Docusaurus is already set up in cache
108
+ if [ -d "${config.cachePath}/node_modules" ]; then
109
+ echo "✓ Docusaurus installation found in cache"
110
+ NEEDS_INSTALL=false
111
+ else
112
+ echo "⚙ First-time setup: Installing Docusaurus (~30 seconds)..."
113
+ NEEDS_INSTALL=true
114
+ fi
115
+ ```
116
+
117
+ ### Step 3: First-Time Setup (if needed)
118
+
119
+ If `NEEDS_INSTALL=true`, create the cached Docusaurus installation:
120
+
121
+ ```typescript
122
+ import * as fs from 'fs';
123
+ import * as path from 'path';
124
+ import { execSync } from 'child_process';
125
+
126
+ // Create cache directory
127
+ fs.mkdirSync(config.cachePath, { recursive: true });
128
+
129
+ // Create package.json
130
+ const packageJson = {
131
+ name: isPublic ? 'specweave-docs-public' : 'specweave-docs-internal',
132
+ version: '1.0.0',
133
+ private: true,
134
+ scripts: {
135
+ start: `docusaurus start --port ${config.port}`,
136
+ build: 'docusaurus build',
137
+ clear: 'docusaurus clear'
138
+ },
139
+ dependencies: {
140
+ '@docusaurus/core': '^3.9.2',
141
+ '@docusaurus/preset-classic': '^3.9.2',
142
+ '@docusaurus/theme-mermaid': '^3.9.2',
143
+ '@mdx-js/react': '^3.0.0',
144
+ 'clsx': '^2.0.0',
145
+ 'prism-react-renderer': '^2.3.0',
146
+ 'react': '^19.0.0',
147
+ 'react-dom': '^19.0.0'
148
+ },
149
+ engines: {
150
+ node: '>=20.0'
151
+ }
152
+ };
153
+
154
+ fs.writeFileSync(
155
+ path.join(config.cachePath, 'package.json'),
156
+ JSON.stringify(packageJson, null, 2)
157
+ );
158
+
159
+ // Calculate relative path from cache to docs
160
+ // For internal: ../../docs/internal
161
+ // For public: ../../docs/public
162
+ const relativePath = isPublic ? '../../docs/public' : '../../docs/internal';
163
+
164
+ // Create Docusaurus config
165
+ const docusaurusConfig = `import {themes as prismThemes} from 'prism-react-renderer';
166
+ import type {Config} from '@docusaurus/types';
167
+ import type * as Preset from '@docusaurus/preset-classic';
168
+
169
+ const config: Config = {
170
+ title: '${config.title}',
171
+ tagline: 'SpecWeave Living Documentation',
172
+ favicon: 'img/favicon.ico',
173
+ future: { v4: true },
174
+ url: 'http://localhost:${config.port}',
175
+ baseUrl: '/',
176
+ onBrokenLinks: 'warn',
177
+ onBrokenMarkdownLinks: 'warn',
178
+ i18n: { defaultLocale: 'en', locales: ['en'] },
179
+ markdown: { mermaid: true, format: 'md' },
180
+ themes: ['@docusaurus/theme-mermaid'],
181
+ presets: [
182
+ [
183
+ 'classic',
184
+ {
185
+ docs: {
186
+ path: '${relativePath}',
187
+ routeBasePath: '/',
188
+ sidebarPath: './sidebars.ts',
189
+ showLastUpdateTime: true,
190
+ sidebarCollapsible: true,
191
+ sidebarCollapsed: true,
192
+ },
193
+ blog: false,
194
+ theme: { customCss: './src/css/custom.css' },
195
+ } satisfies Preset.Options,
196
+ ],
197
+ ],
198
+ themeConfig: {
199
+ colorMode: {
200
+ defaultMode: 'dark',
201
+ disableSwitch: false,
202
+ respectPrefersColorScheme: true,
203
+ },
204
+ navbar: {
205
+ title: '${config.navbarTitle}',
206
+ items: [
207
+ {to: '/', label: 'Home', position: 'left'},
208
+ {type: 'search', position: 'right'},
209
+ ],
210
+ },
211
+ footer: {
212
+ style: 'dark',
213
+ copyright: 'SpecWeave Living Documentation',
214
+ },
215
+ prism: {
216
+ theme: prismThemes.github,
217
+ darkTheme: prismThemes.dracula,
218
+ additionalLanguages: ['bash', 'typescript', 'yaml', 'json'],
219
+ },
220
+ mermaid: { theme: {light: 'neutral', dark: 'dark'} },
221
+ } satisfies Preset.ThemeConfig,
222
+ };
223
+
224
+ export default config;
225
+ `;
226
+
227
+ fs.writeFileSync(path.join(config.cachePath, 'docusaurus.config.ts'), docusaurusConfig);
228
+
229
+ // Create auto-generated sidebar
230
+ const sidebarsConfig = `import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
231
+
232
+ const sidebars: SidebarsConfig = {
233
+ docs: [
234
+ {
235
+ type: 'autogenerated',
236
+ dirName: '.',
237
+ },
238
+ ],
239
+ };
240
+
241
+ export default sidebars;
242
+ `;
243
+
244
+ fs.writeFileSync(path.join(config.cachePath, 'sidebars.ts'), sidebarsConfig);
245
+
246
+ // Create minimal CSS
247
+ fs.mkdirSync(path.join(config.cachePath, 'src', 'css'), { recursive: true });
248
+ const customCss = `:root {
249
+ --ifm-color-primary: ${isPublic ? '#059669' : '#2563eb'};
250
+ --ifm-code-font-size: 95%;
251
+ }
252
+ [data-theme='dark'] {
253
+ --ifm-color-primary: ${isPublic ? '#34d399' : '#60a5fa'};
254
+ }
255
+ `;
256
+
257
+ fs.writeFileSync(path.join(config.cachePath, 'src', 'css', 'custom.css'), customCss);
258
+
259
+ // Create static folder with placeholder favicon
260
+ fs.mkdirSync(path.join(config.cachePath, 'static', 'img'), { recursive: true });
261
+ fs.writeFileSync(
262
+ path.join(config.cachePath, 'static', 'img', 'favicon.ico'),
263
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">📚</text></svg>'
264
+ );
265
+
266
+ // Install dependencies using PUBLIC npm registry
267
+ execSync('npm install --registry=https://registry.npmjs.org --legacy-peer-deps', {
268
+ cwd: config.cachePath,
269
+ stdio: 'inherit'
270
+ });
271
+ ```
272
+
273
+ ### Step 4: Start the Server
274
+
275
+ ```bash
276
+ cd ${config.cachePath} && npm start
277
+ ```
278
+
279
+ This will:
280
+ - Start Docusaurus on **http://localhost:${config.port}**
281
+ - Enable hot reload (edit markdown, see changes instantly)
282
+ - Render Mermaid diagrams
283
+ - Auto-generate sidebar from folder structure
284
+
285
+ ### Output to User
286
+
287
+ After starting, display:
288
+
289
+ ```
290
+ 📚 Documentation View Server Started!
291
+
292
+ Mode: ${isPublic ? 'PUBLIC' : 'INTERNAL'} docs
293
+ URL: http://localhost:${config.port}
294
+ Content: ${config.docsPath}/
295
+
296
+ Features:
297
+ • Hot reload - edit markdown, see changes instantly
298
+ • Mermaid diagrams - architecture diagrams render beautifully
299
+ • Auto sidebar - generated from folder structure
300
+ • Dark/light mode - toggle in navbar
301
+
302
+ Press Ctrl+C to stop the server.
303
+ ```
304
+
305
+ ## What You Get
306
+
307
+ - **Hot reload** - Edit markdown, see changes instantly
308
+ - **Auto sidebar** - Generated from folder structure
309
+ - **Mermaid diagrams** - Architecture diagrams render beautifully
310
+ - **Dark/light mode** - Toggle in navbar
311
+ - **Local search** - Instant search across all docs
312
+ - **Color coding** - Internal docs use blue theme, public docs use green theme
313
+
314
+ ## Examples
315
+
316
+ ### View Internal Docs (Default)
317
+
318
+ ```bash
319
+ /specweave-docs:view
320
+
321
+ # Output:
322
+ 📚 Starting Internal Documentation server...
323
+ 🔍 Running pre-flight validation...
324
+ ✅ Validation passed! Starting server...
325
+
326
+ 📚 Documentation View Server Started!
327
+ Mode: INTERNAL docs
328
+ URL: http://localhost:3015
329
+ Content: .specweave/docs/internal/
330
+ ```
331
+
332
+ ### View Public Docs
333
+
334
+ ```bash
335
+ /specweave-docs:view --public
336
+
337
+ # Output:
338
+ 📚 Starting Public Documentation server...
339
+ 🔍 Running pre-flight validation...
340
+ ✅ Validation passed! Starting server...
341
+
342
+ 📚 Documentation View Server Started!
343
+ Mode: PUBLIC docs
344
+ URL: http://localhost:3016
345
+ Content: .specweave/docs/public/
346
+ ```
347
+
348
+ ### View Both Simultaneously
349
+
350
+ Run in separate terminals:
351
+ ```bash
352
+ # Terminal 1: Internal docs
353
+ /specweave-docs:view
354
+
355
+ # Terminal 2: Public docs
356
+ /specweave-docs:view --public
357
+
358
+ # Now both servers are running!
359
+ # Internal: http://localhost:3015
360
+ # Public: http://localhost:3016
361
+ ```
362
+
363
+ ## Troubleshooting
364
+
365
+ ### Port already in use
366
+ ```bash
367
+ # For internal docs (port 3015)
368
+ lsof -i :3015 && kill -9 $(lsof -t -i :3015)
369
+
370
+ # For public docs (port 3016)
371
+ lsof -i :3016 && kill -9 $(lsof -t -i :3016)
372
+ ```
373
+
374
+ ### Reinstall from scratch
375
+ ```bash
376
+ # For internal docs
377
+ rm -rf .specweave/cache/docs-site && /specweave-docs:view
378
+
379
+ # For public docs
380
+ rm -rf .specweave/cache/docs-site-public && /specweave-docs:view --public
381
+ ```
382
+
383
+ ### npm registry issues
384
+ The setup uses `--registry=https://registry.npmjs.org` to bypass private registry configurations.
385
+
386
+ ## See Also
387
+
388
+ - `/specweave-docs:build` - Build static site for deployment
389
+ - `/specweave-docs:organize` - Generate themed indexes for large folders
390
+ - `/specweave-docs:health` - Documentation health report
391
+ - `/specweave-docs:validate` - Validate documentation without starting server
@@ -1,18 +1,19 @@
1
1
  ---
2
2
  name: preview
3
- description: Documentation preview expert for Docusaurus integration. Launches interactive preview server for SpecWeave living documentation with hot reload, auto-generated sidebar, and Mermaid diagrams. Works in ANY SpecWeave project with auto-setup. Activates for preview docs, view documentation, Docusaurus server, docs UI, documentation website, local docs server, hot reload docs, static site build.
3
+ description: Documentation view expert for Docusaurus integration. Launches interactive server for SpecWeave living documentation with hot reload, auto-generated sidebar, and Mermaid diagrams. Works in ANY SpecWeave project with auto-setup. Supports both internal (port 3015) and public (port 3016) docs. Activates for preview docs, view documentation, Docusaurus server, docs UI, documentation website, local docs server, hot reload docs, static site build.
4
4
  ---
5
5
 
6
- # Documentation Preview Skill
6
+ # Documentation View Skill
7
7
 
8
- Expert in launching and managing Docusaurus documentation preview for SpecWeave projects.
8
+ Expert in launching and managing Docusaurus documentation server for SpecWeave projects.
9
9
 
10
10
  ## What I Do
11
11
 
12
- I help you preview your SpecWeave living documentation with Docusaurus:
12
+ I help you view your SpecWeave living documentation with Docusaurus:
13
13
 
14
14
  ### Key Features
15
15
  - **Zero-config setup** - Works in any SpecWeave project automatically
16
+ - **Internal & Public docs** - Internal on port 3015, public on port 3016
16
17
  - **Cached installation** - Docusaurus cached in `.specweave/cache/docs-site/` (gitignored)
17
18
  - **Hot reload** - Edit markdown, see changes instantly
18
19
  - **Mermaid diagrams** - Architecture diagrams render beautifully
@@ -22,9 +23,9 @@ I help you preview your SpecWeave living documentation with Docusaurus:
22
23
  ## How It Works
23
24
 
24
25
  1. **First run (~30 seconds)**:
25
- - Creates Docusaurus in `.specweave/cache/docs-site/`
26
+ - Creates Docusaurus in `.specweave/cache/docs-site/` (internal) or `.specweave/cache/docs-site-public/` (public)
26
27
  - Installs dependencies from public npm registry
27
- - Configures to read from `.specweave/docs/internal/`
28
+ - Configures to read from `.specweave/docs/internal/` or `.specweave/docs/public/`
28
29
 
29
30
  2. **Subsequent runs (instant)**:
30
31
  - Uses cached installation
@@ -32,16 +33,29 @@ I help you preview your SpecWeave living documentation with Docusaurus:
32
33
 
33
34
  ## Available Commands
34
35
 
35
- ### Preview Documentation
36
+ ### View Internal Documentation (Default)
36
37
  ```bash
37
- /specweave-docs:preview
38
+ /specweave-docs:view
38
39
  ```
39
40
 
40
41
  **What it does:**
41
42
  1. Checks if `.specweave/docs/internal/` exists
42
- 2. Sets up Docusaurus in cache (if first run)
43
- 3. Starts dev server on **http://localhost:3015**
44
- 4. Enables hot reload
43
+ 2. Runs pre-flight validation (auto-fixes common issues)
44
+ 3. Sets up Docusaurus in cache (if first run)
45
+ 4. Starts dev server on **http://localhost:3015**
46
+ 5. Enables hot reload
47
+
48
+ ### View Public Documentation
49
+ ```bash
50
+ /specweave-docs:view --public
51
+ ```
52
+
53
+ **What it does:**
54
+ 1. Checks if `.specweave/docs/public/` exists
55
+ 2. Runs pre-flight validation (auto-fixes common issues)
56
+ 3. Sets up Docusaurus in cache (if first run)
57
+ 4. Starts dev server on **http://localhost:3016**
58
+ 5. Enables hot reload
45
59
 
46
60
  ### Build Static Site
47
61
  ```bash
@@ -56,32 +70,56 @@ I help you preview your SpecWeave living documentation with Docusaurus:
56
70
  ## When to Use This Skill
57
71
 
58
72
  ### Activate for:
59
- - "Preview my documentation"
73
+ - "View my documentation"
74
+ - "Preview my docs"
60
75
  - "Show me my docs in a browser"
61
76
  - "Launch Docusaurus"
62
77
  - "View my living documentation"
63
- - "Start docs preview"
78
+ - "Start docs server"
64
79
  - "I want to see my internal docs"
80
+ - "View public docs"
65
81
 
66
82
  ### Workflow
67
83
 
68
84
  ```
69
85
  User: "I want to preview my docs"
70
- You: "I'll launch the documentation preview server."
71
- [Run: /specweave-docs:preview]
86
+ You: "I'll launch the documentation view server."
87
+ [Run: /specweave-docs:view]
88
+ ```
89
+
90
+ ```
91
+ User: "Show me my public documentation"
92
+ You: "I'll launch the public documentation server."
93
+ [Run: /specweave-docs:view --public]
72
94
  ```
73
95
 
96
+ ## Port Reference
97
+
98
+ | Docs Type | Port | Path |
99
+ |-----------|------|------|
100
+ | Internal (default) | 3015 | `.specweave/docs/internal/` |
101
+ | Public | 3016 | `.specweave/docs/public/` |
102
+
74
103
  ## Troubleshooting
75
104
 
76
- ### Port 3015 already in use
105
+ ### Port 3015 or 3016 already in use
77
106
  ```bash
107
+ # For internal docs
78
108
  lsof -i :3015 && kill -9 $(lsof -t -i :3015)
109
+
110
+ # For public docs
111
+ lsof -i :3016 && kill -9 $(lsof -t -i :3016)
79
112
  ```
80
113
 
81
114
  ### Reinstall from scratch
82
115
  ```bash
116
+ # For internal docs
83
117
  rm -rf .specweave/cache/docs-site
84
- # Then run /specweave-docs:preview again
118
+ # Then run /specweave-docs:view again
119
+
120
+ # For public docs
121
+ rm -rf .specweave/cache/docs-site-public
122
+ # Then run /specweave-docs:view --public again
85
123
  ```
86
124
 
87
125
  ### npm registry issues
@@ -92,3 +130,4 @@ The setup explicitly uses `--registry=https://registry.npmjs.org` to bypass priv
92
130
  - `/specweave-docs:build` - Build static site for deployment
93
131
  - `/specweave-docs:organize` - Organize large folders with themed indexes
94
132
  - `/specweave-docs:health` - Documentation health report
133
+ - `/specweave-docs:validate` - Validate documentation before viewing
@@ -32,16 +32,17 @@
32
32
  ```
33
33
  1. NEVER pollute project root with .md files
34
34
  2. Increment IDs unique (0001-9999)
35
- 3. ONLY 3 files in increment root: spec.md, plan.md, tasks.md
35
+ 3. ONLY 4 files in increment root: metadata.json, spec.md, plan.md, tasks.md
36
36
  4. All reports/scripts/logs → increment subfolders
37
- 5. Read context-manifest.yaml first (70%+ token savings)
37
+ 5. metadata.json MUST exist BEFORE spec.md can be created
38
38
  6. tasks.md + spec.md = SOURCE OF TRUTH (update after every task!)
39
39
  ```
40
40
 
41
41
  **File Organization**:
42
42
  ```
43
43
  .specweave/increments/0001-feature/
44
- ├── spec.md, plan.md, tasks.md # ONLY these in root
44
+ ├── metadata.json # REQUIRED - create FIRST
45
+ ├── spec.md, plan.md, tasks.md # Core increment docs
45
46
  ├── reports/ # SESSION-*.md, analysis, etc.
46
47
  ├── scripts/ # Helper scripts
47
48
  └── logs/ # Execution logs
@@ -410,26 +411,21 @@ TASK COMPLETED
410
411
 
411
412
  ## Context Loading {#context-loading}
412
413
 
413
- ### Why Context Manifests Matter
414
+ ### Efficient Context Management
414
415
 
415
416
  ```
416
- Without manifest: Load all docs (50k tokens) → Crash risk
417
- With manifest: Load relevant files (5k tokens) → 90% savings
417
+ Read only what's needed for the current task:
418
+ - Active increment: spec.md, tasks.md (always)
419
+ - Supporting docs: only when referenced in tasks
420
+ - Living docs: load per-US when implementing
418
421
  ```
419
422
 
420
- ### Using context-manifest.yaml
423
+ ### Token-Efficient Approach
421
424
 
422
- ```yaml
423
- # .specweave/increments/0001-feature/context-manifest.yaml
424
- spec_sections:
425
- - .specweave/docs/internal/strategy/prd.md
426
- - .specweave/docs/internal/architecture/hld.md
427
- documentation:
428
- - .specweave/docs/internal/specs/default/relevant-spec.md
429
- max_context_tokens: 10000
430
- ```
431
-
432
- **Rule**: Read context-manifest.yaml FIRST. Only load files listed there.
425
+ 1. Start with increment's `tasks.md` - contains current task list
426
+ 2. Reference `spec.md` for acceptance criteria
427
+ 3. Load living docs only when needed for context
428
+ 4. Avoid loading entire documentation trees
433
429
 
434
430
  ---
435
431
 
@@ -439,10 +435,10 @@ max_context_tokens: 10000
439
435
  .specweave/
440
436
  ├── increments/ # Feature increments (0001-9999)
441
437
  │ └── 0001-feature/
438
+ │ ├── metadata.json # Increment metadata - REQUIRED
442
439
  │ ├── spec.md # WHAT & WHY (user stories, ACs)
443
- │ ├── plan.md # HOW (architecture, APIs)
444
- ├── tasks.md # Task checklist with test plans
445
- │ └── context-manifest.yaml # Files to load
440
+ │ ├── plan.md # HOW (architecture, APIs) - optional
441
+ └── tasks.md # Task checklist with test plans
446
442
  ├── docs/internal/
447
443
  │ ├── strategy/ # PRD, business requirements
448
444
  │ ├── specs/ # Living docs (extracted user stories)
@@ -521,10 +517,10 @@ AI: [Creates .specweave/increments/0001-auth/spec.md, plan.md, tasks.md]
521
517
 
522
518
  ### Creating Increment
523
519
  1. `mkdir -p .specweave/increments/0001-feature`
524
- 2. Create `spec.md` (WHAT/WHY, user stories, ACs)
525
- 3. Create `plan.md` (HOW, architecture, APIs)
520
+ 2. Create `metadata.json` (increment metadata) - **MUST be FIRST**
521
+ 3. Create `spec.md` (WHAT/WHY, user stories, ACs)
526
522
  4. Create `tasks.md` (task checklist with tests)
527
- 5. Create `context-manifest.yaml` (selective loading)
523
+ 5. Optional: Create `plan.md` (HOW, architecture) for complex features
528
524
 
529
525
  ### Completing Tasks
530
526
  1. Implement the task
@@ -599,12 +595,12 @@ Or run: `/specweave:sync-tasks`
599
595
 
600
596
  **Symptoms**: Tool crashes 10-50s after start
601
597
 
602
- **Causes**: Loading too many files, no context manifest
598
+ **Causes**: Loading too many files at once
603
599
 
604
600
  **Fix**:
605
- 1. Create `context-manifest.yaml` in increment folder
606
- 2. List only files needed for current task
607
- 3. Never load entire `.specweave/docs/` folder
601
+ 1. Load only the active increment's spec.md and tasks.md
602
+ 2. Reference living docs only when needed for specific tasks
603
+ 3. Never load entire `.specweave/docs/` folder at once
608
604
 
609
605
  ### Skills/Agents Not Activating
610
606
 
@@ -67,10 +67,10 @@ Edit("spec.md", "- [ ] **AC-US1-01**", "- [x] **AC-US1-01**");
67
67
  .specweave/
68
68
  ├── increments/ # Feature increments (####-name/)
69
69
  │ └── 0001-feature/
70
+ │ ├── metadata.json # Increment metadata - REQUIRED
70
71
  │ ├── spec.md # WHAT & WHY
71
- │ ├── plan.md # HOW
72
- ├── tasks.md # Checklist with embedded tests
73
- │ └── context-manifest.yaml # Selective loading
72
+ │ ├── plan.md # HOW (optional)
73
+ └── tasks.md # Checklist with embedded tests
74
74
  ├── docs/internal/
75
75
  │ ├── strategy/ # Business specs
76
76
  │ ├── specs/ # Living docs (post-completion)
@@ -96,12 +96,16 @@ Edit("spec.md", "- [ ] **AC-US1-01**", "- [x] **AC-US1-01**");
96
96
 
97
97
  ---
98
98
 
99
- ## Context Loading (Token Savings)
99
+ ## Increment Files
100
100
 
101
- **ALWAYS read `context-manifest.yaml` first!** Load only files listed there.
102
- - Full specs: 50k tokens
103
- - Manifest files: 5k tokens
104
- - **Savings: 90%**
101
+ **Required files** for every increment:
102
+ 1. `metadata.json` - Increment metadata (status, type, dates) - MUST create FIRST
103
+ 2. `spec.md` - User stories, acceptance criteria
104
+ 3. `tasks.md` - Implementation tasks with embedded tests
105
+
106
+ **Optional**:
107
+ - `plan.md` - Technical design (for complex features only)
108
+ - `reports/` - Completion reports, analyses
105
109
 
106
110
  ---
107
111