specweave 0.30.12 → 0.30.14

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 (127) hide show
  1. package/.claude-plugin/marketplace.json +0 -11
  2. package/CLAUDE.md +1 -1
  3. package/bin/fix-marketplace-errors.sh +1 -1
  4. package/dist/src/cli/commands/init.d.ts.map +1 -1
  5. package/dist/src/cli/commands/init.js +13 -0
  6. package/dist/src/cli/commands/init.js.map +1 -1
  7. package/dist/src/cli/helpers/ado-area-selector.d.ts.map +1 -1
  8. package/dist/src/cli/helpers/ado-area-selector.js +13 -0
  9. package/dist/src/cli/helpers/ado-area-selector.js.map +1 -1
  10. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  11. package/dist/src/cli/helpers/issue-tracker/index.js +7 -2
  12. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  13. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts +7 -0
  14. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
  15. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +33 -2
  16. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
  17. package/dist/src/cli/workers/clone-worker.js +19 -3
  18. package/dist/src/cli/workers/clone-worker.js.map +1 -1
  19. package/dist/src/core/living-docs/board-matcher.d.ts +120 -0
  20. package/dist/src/core/living-docs/board-matcher.d.ts.map +1 -0
  21. package/dist/src/core/living-docs/board-matcher.js +466 -0
  22. package/dist/src/core/living-docs/board-matcher.js.map +1 -0
  23. package/dist/src/core/living-docs/foundation-builder.js +1 -1
  24. package/dist/src/core/living-docs/foundation-builder.js.map +1 -1
  25. package/dist/src/core/living-docs/living-docs-sync.d.ts +19 -8
  26. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  27. package/dist/src/core/living-docs/living-docs-sync.js +148 -52
  28. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  29. package/dist/src/core/living-docs/suggestions-generator.js +1 -1
  30. package/dist/src/core/living-docs/suggestions-generator.js.map +1 -1
  31. package/dist/src/core/living-docs/umbrella-detector.d.ts +4 -0
  32. package/dist/src/core/living-docs/umbrella-detector.d.ts.map +1 -1
  33. package/dist/src/core/living-docs/umbrella-detector.js +20 -1
  34. package/dist/src/core/living-docs/umbrella-detector.js.map +1 -1
  35. package/dist/src/core/living-docs/workitem-matcher.js +5 -5
  36. package/dist/src/core/living-docs/workitem-matcher.js.map +1 -1
  37. package/dist/src/importers/item-converter.d.ts +4 -0
  38. package/dist/src/importers/item-converter.d.ts.map +1 -1
  39. package/dist/src/importers/item-converter.js +4 -0
  40. package/dist/src/importers/item-converter.js.map +1 -1
  41. package/dist/src/init/repo/types.d.ts +1 -1
  42. package/dist/src/living-docs/enterprise-analyzer.d.ts.map +1 -1
  43. package/dist/src/living-docs/enterprise-analyzer.js +70 -19
  44. package/dist/src/living-docs/enterprise-analyzer.js.map +1 -1
  45. package/dist/src/living-docs/epic-id-allocator.d.ts +4 -0
  46. package/dist/src/living-docs/epic-id-allocator.d.ts.map +1 -1
  47. package/dist/src/living-docs/epic-id-allocator.js +4 -0
  48. package/dist/src/living-docs/epic-id-allocator.js.map +1 -1
  49. package/dist/src/living-docs/fs-id-allocator.d.ts +4 -0
  50. package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -1
  51. package/dist/src/living-docs/fs-id-allocator.js +4 -0
  52. package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
  53. package/dist/src/living-docs/smart-doc-organizer.d.ts +114 -0
  54. package/dist/src/living-docs/smart-doc-organizer.d.ts.map +1 -0
  55. package/dist/src/living-docs/smart-doc-organizer.js +535 -0
  56. package/dist/src/living-docs/smart-doc-organizer.js.map +1 -0
  57. package/package.json +13 -13
  58. package/plugins/PLUGINS-INDEX.md +2 -3
  59. package/plugins/specweave/commands/specweave-judge.md +265 -0
  60. package/plugins/specweave/commands/specweave-organize-docs.md +185 -0
  61. package/plugins/specweave/hooks/hooks.json +3 -3
  62. package/plugins/specweave/hooks/universal/hook-wrapper.cmd +26 -0
  63. package/plugins/specweave/hooks/universal/hook-wrapper.sh +67 -0
  64. package/plugins/specweave-ado/commands/{specweave-ado-close-workitem.md → close.md} +9 -5
  65. package/plugins/specweave-ado/commands/{specweave-ado-create-workitem.md → create.md} +9 -5
  66. package/plugins/specweave-ado/commands/pull.md +459 -0
  67. package/plugins/specweave-ado/commands/push.md +361 -0
  68. package/plugins/specweave-ado/commands/{specweave-ado-status.md → status.md} +12 -0
  69. package/plugins/specweave-ado/commands/{specweave-ado-sync.md → sync.md} +64 -3
  70. package/plugins/specweave-ado/hooks/README.md +1 -1
  71. package/plugins/specweave-docs/commands/build.md +158 -0
  72. package/plugins/specweave-docs/commands/{docs-generate.md → generate.md} +10 -5
  73. package/plugins/specweave-docs/commands/health.md +268 -0
  74. package/plugins/specweave-docs/commands/{docs-init.md → init.md} +11 -6
  75. package/plugins/specweave-docs/commands/organize.md +184 -0
  76. package/plugins/specweave-docs/commands/preview.md +138 -0
  77. package/plugins/specweave-docs/skills/preview/SKILL.md +105 -0
  78. package/plugins/specweave-github/agents/user-story-updater/AGENT.md +1 -1
  79. package/plugins/specweave-github/commands/{specweave-github-close-issue.md → close.md} +2 -2
  80. package/plugins/specweave-github/commands/{specweave-github-create-issue.md → create.md} +2 -2
  81. package/plugins/specweave-github/commands/pull.md +142 -0
  82. package/plugins/specweave-github/commands/push.md +154 -0
  83. package/plugins/specweave-github/commands/{specweave-github-sync.md → sync.md} +19 -5
  84. package/plugins/specweave-github/commands/{specweave-github-update-user-story.md → update-user-story.md} +1 -1
  85. package/plugins/specweave-github/hooks/README.md +1 -1
  86. package/plugins/specweave-jira/commands/pull.md +164 -0
  87. package/plugins/specweave-jira/commands/push.md +170 -0
  88. package/plugins/specweave-jira/commands/{specweave-jira-sync.md → sync.md} +18 -3
  89. package/plugins/specweave-jira/hooks/README.md +1 -1
  90. package/plugins/specweave-kafka/README.md +20 -0
  91. package/plugins/specweave-kafka/benchmarks/kafka-throughput.benchmark.ts +551 -0
  92. package/plugins/specweave-kafka/examples/README.md +191 -0
  93. package/plugins/specweave-kafka/examples/avro-schema-registry/.env.example +8 -0
  94. package/plugins/specweave-kafka/examples/avro-schema-registry/README.md +69 -0
  95. package/plugins/specweave-kafka/examples/avro-schema-registry/consumer.js +37 -0
  96. package/plugins/specweave-kafka/examples/avro-schema-registry/package.json +14 -0
  97. package/plugins/specweave-kafka/examples/avro-schema-registry/producer.js +57 -0
  98. package/plugins/specweave-kafka/examples/exactly-once-semantics/.env.example +5 -0
  99. package/plugins/specweave-kafka/examples/exactly-once-semantics/README.md +30 -0
  100. package/plugins/specweave-kafka/examples/exactly-once-semantics/eos-pipeline.js +79 -0
  101. package/plugins/specweave-kafka/examples/exactly-once-semantics/package.json +11 -0
  102. package/plugins/specweave-kafka/examples/kafka-streams-app/.env.example +4 -0
  103. package/plugins/specweave-kafka/examples/kafka-streams-app/README.md +30 -0
  104. package/plugins/specweave-kafka/examples/kafka-streams-app/package.json +11 -0
  105. package/plugins/specweave-kafka/examples/kafka-streams-app/windowed-aggregation.js +66 -0
  106. package/plugins/specweave-kafka/examples/n8n-workflow/README.md +54 -0
  107. package/plugins/specweave-kafka/examples/n8n-workflow/docker-compose.yml +19 -0
  108. package/plugins/specweave-kafka/examples/n8n-workflow/kafka-to-slack.json +50 -0
  109. package/plugins/specweave-kafka/examples/simple-producer-consumer/.env.example +15 -0
  110. package/plugins/specweave-kafka/examples/simple-producer-consumer/README.md +183 -0
  111. package/plugins/specweave-kafka/examples/simple-producer-consumer/consumer.js +60 -0
  112. package/plugins/specweave-kafka/examples/simple-producer-consumer/docker-compose.yml +30 -0
  113. package/plugins/specweave-kafka/examples/simple-producer-consumer/package.json +18 -0
  114. package/plugins/specweave-kafka/examples/simple-producer-consumer/producer.js +52 -0
  115. package/plugins/specweave-release/commands/specweave-release-npm.md +26 -239
  116. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +0 -21
  117. package/plugins/specweave-docs-preview/commands/build.md +0 -489
  118. package/plugins/specweave-docs-preview/commands/preview.md +0 -355
  119. package/plugins/specweave-docs-preview/skills/docs-preview/SKILL.md +0 -386
  120. /package/plugins/specweave-ado/commands/{specweave-ado-clone-repos.md → clone.md} +0 -0
  121. /package/plugins/specweave-ado/commands/{specweave-ado-import-areas.md → import-areas.md} +0 -0
  122. /package/plugins/specweave-ado/commands/{specweave-ado-import-projects.md → import-projects.md} +0 -0
  123. /package/plugins/specweave-github/commands/{specweave-github-cleanup-duplicates.md → cleanup-duplicates.md} +0 -0
  124. /package/plugins/specweave-github/commands/{specweave-github-reconcile.md → reconcile.md} +0 -0
  125. /package/plugins/specweave-github/commands/{specweave-github-status.md → status.md} +0 -0
  126. /package/plugins/specweave-jira/commands/{specweave-jira-import-boards.md → import-boards.md} +0 -0
  127. /package/plugins/specweave-jira/commands/{specweave-jira-import-projects.md → import-projects-full.md} +0 -0
@@ -0,0 +1,268 @@
1
+ ---
2
+ name: specweave-docs:health
3
+ description: Documentation health report - analyzes docs for freshness, coverage, naming violations, duplicates, and provides recommendations.
4
+ ---
5
+
6
+ # Documentation Health Report
7
+
8
+ Analyze your documentation for health issues including freshness, coverage, naming violations, duplicates, and spec-code mismatches.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ # Full health report
14
+ /specweave-docs:health
15
+
16
+ # Include archived documents
17
+ /specweave-docs:health --include-archived
18
+
19
+ # Output as JSON
20
+ /specweave-docs:health --format json
21
+
22
+ # Save report to file
23
+ /specweave-docs:health --output health-report.md
24
+ ```
25
+
26
+ ## Your Task
27
+
28
+ Execute the enterprise documentation analyzer:
29
+
30
+ ```typescript
31
+ import { EnterpriseDocAnalyzer, generateEnterpriseReport } from '../../src/living-docs/enterprise-analyzer.js';
32
+ import * as fs from 'fs';
33
+ import * as path from 'path';
34
+
35
+ const projectPath = process.cwd();
36
+
37
+ // Create analyzer
38
+ const analyzer = new EnterpriseDocAnalyzer({
39
+ projectPath,
40
+ includeArchived: false, // Set true to include archived docs
41
+ });
42
+
43
+ // Run analysis
44
+ console.log('\nAnalyzing Documentation Health...\n');
45
+ const report = await analyzer.analyze();
46
+
47
+ // Generate markdown report
48
+ const markdownReport = generateEnterpriseReport(report);
49
+
50
+ // Display summary
51
+ console.log(`
52
+ DOCUMENTATION HEALTH REPORT
53
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
54
+
55
+ Overall Score: ${report.healthScore.overall}% (Grade: ${report.healthScore.grade})
56
+
57
+ Metrics:
58
+ Freshness: ${report.healthScore.freshness}%
59
+ Coverage: ${report.healthScore.coverage}%
60
+ Accuracy: ${report.healthScore.accuracy}%
61
+
62
+ Categories: ${report.categories.length}
63
+ Total Documents: ${report.totalDocuments}
64
+
65
+ Issues Found:
66
+ Spec-Code Mismatches: ${report.mismatches.length}
67
+ Naming Violations: ${report.namingViolations.length}
68
+ Duplicates: ${report.duplicates.length}
69
+ Discrepancies: ${report.discrepancies.length}
70
+
71
+ Recommendations: ${report.recommendations.length}
72
+ `);
73
+
74
+ // Show recommendations
75
+ if (report.recommendations.length > 0) {
76
+ console.log('RECOMMENDATIONS');
77
+ console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
78
+ for (const rec of report.recommendations) {
79
+ console.log(`• ${rec}`);
80
+ }
81
+ }
82
+
83
+ // Optionally save full report
84
+ const outputPath = path.join(projectPath, '.specweave/docs/ENTERPRISE-HEALTH.md');
85
+ fs.writeFileSync(outputPath, markdownReport);
86
+ console.log(`\nFull report saved to: ${outputPath}`);
87
+ ```
88
+
89
+ ## Health Metrics
90
+
91
+ ### Overall Score (0-100%)
92
+
93
+ Weighted combination of:
94
+ - **Freshness** (20%): Documents updated in last 30 days
95
+ - **Coverage** (30%): Documents with acceptance criteria
96
+ - **Accuracy** (50%): ACs without spec-code mismatches + naming compliance
97
+
98
+ ### Grade Scale
99
+
100
+ | Grade | Score Range | Meaning |
101
+ |-------|-------------|---------|
102
+ | A | 90-100% | Excellent documentation health |
103
+ | B | 80-89% | Good, minor improvements needed |
104
+ | C | 70-79% | Acceptable, several issues |
105
+ | D | 60-69% | Below standard, action required |
106
+ | F | <60% | Critical issues, immediate attention |
107
+
108
+ ## Issue Types
109
+
110
+ ### Spec-Code Mismatches
111
+
112
+ | Type | Description |
113
+ |------|-------------|
114
+ | `ghost_completion` | AC marked complete but no code evidence found |
115
+ | `partial_implementation` | Very little code evidence (<10 lines) |
116
+ | `undocumented_code` | Code exists without corresponding spec |
117
+ | `spec_drift` | Spec and code have diverged |
118
+
119
+ ### Naming Violations
120
+
121
+ | Type | Severity | Example |
122
+ |------|----------|---------|
123
+ | `all_caps` | Warning | `CIRCUIT-BREAKER.md` |
124
+ | `mixed_case` | Warning | `CircuitBreaker.md` |
125
+ | `date_suffix` | Info | `feature-2025-11-24.md` |
126
+ | `no_extension` | Error | `readme` (missing .md) |
127
+
128
+ ### Duplicates
129
+
130
+ | Type | Description |
131
+ |------|-------------|
132
+ | `exact` | Identical content |
133
+ | `near_duplicate` | Very similar content (>90%) |
134
+ | `same_title` | Same normalized title |
135
+
136
+ ### Discrepancies
137
+
138
+ | Type | Description |
139
+ |------|-------------|
140
+ | `broken_link` | Link to non-existent file |
141
+ | `orphaned_reference` | Reference to deleted increment |
142
+ | `outdated_version` | Old version numbers (v0.x) |
143
+ | `conflicting_info` | Contradictory information |
144
+
145
+ ## Report Sections
146
+
147
+ ### 1. Health Score Summary
148
+
149
+ ```
150
+ | Metric | Score | Grade |
151
+ |--------|-------|-------|
152
+ | Overall | 85% | B |
153
+ | Freshness | 72% | - |
154
+ | Coverage | 65% | - |
155
+ | Accuracy | 92% | - |
156
+ ```
157
+
158
+ ### 2. Documentation Categories
159
+
160
+ ```
161
+ | Category | Documents | Last Updated |
162
+ |----------|-----------|--------------|
163
+ | Feature Specs | 45 | 12/3/2025 |
164
+ | Architecture | 148 | 12/3/2025 |
165
+ | ADRs | 147 | 12/3/2025 |
166
+ ```
167
+
168
+ ### 3. Spec-Code Mismatches
169
+
170
+ ```
171
+ | AC ID | Type | Confidence | File |
172
+ |-------|------|------------|------|
173
+ | AC-US1-01 | ghost_completion | 70% | spec-0045.md |
174
+ ```
175
+
176
+ ### 4. Naming Violations
177
+
178
+ ```
179
+ | File | Type | Severity | Expected |
180
+ |------|------|----------|----------|
181
+ | CIRCUIT-BREAKER.md | all_caps | Warning | lowercase-kebab.md |
182
+ ```
183
+
184
+ ### 5. Recommendations
185
+
186
+ Actionable suggestions based on analysis:
187
+ - Update stale documentation
188
+ - Add acceptance criteria
189
+ - Fix naming conventions
190
+ - Consolidate duplicates
191
+ - Run `/specweave-docs:organize` for large folders
192
+
193
+ ## Output Example
194
+
195
+ ```
196
+ DOCUMENTATION HEALTH REPORT
197
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
198
+
199
+ Overall Score: 78% (Grade: C)
200
+
201
+ Metrics:
202
+ Freshness: 65%
203
+ Coverage: 42%
204
+ Accuracy: 89%
205
+
206
+ Categories: 6
207
+ Total Documents: 708
208
+
209
+ Issues Found:
210
+ Spec-Code Mismatches: 12
211
+ Naming Violations: 8
212
+ Duplicates: 3
213
+ Discrepancies: 15
214
+
215
+ Recommendations: 5
216
+
217
+ RECOMMENDATIONS
218
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
219
+
220
+ • Documentation freshness is low. Consider reviewing docs over 30 days old.
221
+ • Documentation coverage is limited. Add acceptance criteria to more documents.
222
+ • 8 files use ALL CAPS naming. Rename to lowercase-kebab-case.
223
+ • 3 sets of duplicate documents detected. Consider consolidating.
224
+ • "ADRs" has 147 files. Run /specweave-docs:organize to generate themed indexes.
225
+
226
+ Full report saved to: .specweave/docs/ENTERPRISE-HEALTH.md
227
+ ```
228
+
229
+ ## Integrations
230
+
231
+ ### CI/CD Health Check
232
+
233
+ ```yaml
234
+ # .github/workflows/docs-health.yml
235
+ name: Documentation Health
236
+
237
+ on:
238
+ push:
239
+ paths:
240
+ - '.specweave/docs/**'
241
+
242
+ jobs:
243
+ health-check:
244
+ runs-on: ubuntu-latest
245
+ steps:
246
+ - uses: actions/checkout@v3
247
+ - name: Check Documentation Health
248
+ run: |
249
+ npx specweave docs:health --format json > health.json
250
+ SCORE=$(jq '.healthScore.overall' health.json)
251
+ if [ $SCORE -lt 70 ]; then
252
+ echo "Documentation health below threshold: $SCORE%"
253
+ exit 1
254
+ fi
255
+ ```
256
+
257
+ ### Scheduled Reports
258
+
259
+ ```bash
260
+ # Run weekly health check
261
+ 0 9 * * 1 cd /project && npx specweave docs:health --output weekly-health.md
262
+ ```
263
+
264
+ ## See Also
265
+
266
+ - `/specweave-docs:organize` - Organize large folders with themed indexes
267
+ - `/specweave-docs:preview` - Preview documentation with Docusaurus
268
+ - `/specweave-docs:generate` - Generate docs from code
@@ -1,11 +1,16 @@
1
- # Docs Init - Initialize Documentation Site
1
+ ---
2
+ name: specweave-docs:init
3
+ description: Initialize Docusaurus documentation site with spec-driven structure, living docs integration, and SpecWeave-optimized configuration.
4
+ ---
5
+
6
+ # Initialize Documentation Site
2
7
 
3
8
  Initialize a Docusaurus documentation site with spec-driven documentation structure, living docs integration, and SpecWeave-optimized configuration.
4
9
 
5
10
  ## Usage
6
11
 
7
12
  ```
8
- /specweave-docs:docs-init [options]
13
+ /specweave-docs:init [options]
9
14
  ```
10
15
 
11
16
  ## What I Do
@@ -298,14 +303,14 @@ themeConfig: {
298
303
 
299
304
  ### Custom Output Directory
300
305
  ```bash
301
- /specweave-docs:docs-init --output ./documentation
306
+ /specweave-docs:init --output ./documentation
302
307
  ```
303
308
 
304
309
  ## Related Commands
305
310
 
306
- - `/specweave-docs:docs-generate` - Generate docs from code/specs
307
- - `/specweave-docs-preview:preview` - Launch documentation preview server
308
- - `/specweave-docs-preview:build` - Build static documentation site
311
+ - `/specweave-docs:generate` - Generate docs from code/specs
312
+ - `/specweave-docs:preview` - Launch documentation preview server
313
+ - `/specweave-docs:build` - Build static documentation site
309
314
 
310
315
  ## Requirements
311
316
 
@@ -0,0 +1,184 @@
1
+ ---
2
+ name: specweave-docs:organize
3
+ description: Smart documentation organization - generates themed navigation indexes for large folders. Works seamlessly with Docusaurus preview.
4
+ ---
5
+
6
+ # Smart Documentation Organizer
7
+
8
+ Automatically organize large documentation folders by detecting themes and generating navigable category indexes.
9
+
10
+ ## Why Organize?
11
+
12
+ When folders grow beyond 30+ files, navigation becomes painful:
13
+ - ADRs (147 files) - hard to find sync vs hooks vs testing decisions
14
+ - Specs - many features across different domains
15
+ - Guides - mixed topics without clear structure
16
+
17
+ **Solution**: Generate themed category indexes WITHOUT moving files (preserves URLs).
18
+
19
+ ## Usage
20
+
21
+ ```bash
22
+ # Analyze and organize all internal docs
23
+ /specweave-docs:organize
24
+
25
+ # Analyze specific folder only
26
+ /specweave-docs:organize --folder architecture/adr
27
+
28
+ # Preview without generating files
29
+ /specweave-docs:organize --dry-run
30
+
31
+ # Force regeneration even if under threshold
32
+ /specweave-docs:organize --force
33
+
34
+ # Set custom threshold (default: 30)
35
+ /specweave-docs:organize --threshold 20
36
+ ```
37
+
38
+ ## Your Task
39
+
40
+ Execute the smart documentation organizer:
41
+
42
+ ```typescript
43
+ import { SmartDocOrganizer, organizeDocumentation } from '../../src/living-docs/smart-doc-organizer.js';
44
+ import * as path from 'path';
45
+
46
+ const projectPath = process.cwd();
47
+
48
+ // Option 1: Quick organize all internal docs
49
+ const result = await organizeDocumentation(projectPath, {
50
+ dryRun: false, // Set true to preview
51
+ thresholdForOrganization: 30,
52
+ });
53
+
54
+ console.log(result.summary);
55
+
56
+ // Option 2: Analyze specific folder
57
+ const organizer = new SmartDocOrganizer({
58
+ projectPath,
59
+ thresholdForOrganization: 30,
60
+ generateIndexes: true,
61
+ dryRun: false,
62
+ });
63
+
64
+ const adrPath = path.join(projectPath, '.specweave/docs/internal/architecture/adr');
65
+ const plan = await organizer.analyzeFolder(adrPath);
66
+
67
+ console.log(`
68
+ DOCUMENTATION ANALYSIS
69
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
70
+
71
+ Folder: ${plan.folder}
72
+ Total Files: ${plan.totalFiles}
73
+ Needs Organization: ${plan.needsOrganization ? 'Yes' : 'No'}
74
+
75
+ Theme Categories:
76
+ ${plan.themeCategories
77
+ .filter(c => c.count >= 3)
78
+ .map(c => ` ${c.theme.icon} ${c.theme.name}: ${c.count} files`)
79
+ .join('\n')}
80
+
81
+ Uncategorized: ${plan.uncategorized.length} files
82
+ `);
83
+
84
+ // Generate indexes if needed
85
+ if (plan.needsOrganization) {
86
+ const generatedFiles = await organizer.generateCategoryIndexes(plan);
87
+ console.log(`\nGenerated ${generatedFiles.length} index files`);
88
+ }
89
+ ```
90
+
91
+ ## What Gets Generated
92
+
93
+ ### 1. Category Index (`_categories.md`)
94
+
95
+ Main navigation hub with:
96
+ - Links to all theme categories
97
+ - Quick stats (total docs, categorized count)
98
+ - Recently updated documents
99
+
100
+ ### 2. Theme Indexes (`_index-{theme}.md`)
101
+
102
+ Per-theme navigation with:
103
+ - All files in that category
104
+ - Sub-grouping for large themes (15+ files)
105
+ - Sorted alphabetically
106
+
107
+ ## Theme Detection
108
+
109
+ The organizer automatically detects these themes:
110
+
111
+ | Icon | Theme | Keywords |
112
+ |------|-------|----------|
113
+ | 🔄 | Synchronization | sync, integration, bidirectional |
114
+ | 🐙 | GitHub | github, issue, actions |
115
+ | 🪝 | Hooks | hook, event, trigger |
116
+ | 🔌 | External Tools | jira, ado, area-path |
117
+ | 🧪 | Testing | test, fixture, coverage |
118
+ | 🏗️ | Brownfield | brownfield, migration, legacy |
119
+ | ⚡ | Performance | cache, pagination, batch |
120
+ | 🔒 | Security | permission, auth, token |
121
+ | 📦 | Increments | increment, status, lifecycle |
122
+ | ⚙️ | Configuration | config, env, setup |
123
+ | 📚 | Documentation | doc, spec, naming |
124
+
125
+ ## Output Example
126
+
127
+ ```
128
+ DOCUMENTATION ANALYSIS
129
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
130
+
131
+ Folder: architecture/adr
132
+ Total Files: 147
133
+ Needs Organization: Yes
134
+
135
+ Theme Categories:
136
+ 🔄 Synchronization & Integration: 23 files
137
+ 🐙 GitHub Integration: 18 files
138
+ 🪝 Hooks & Events: 15 files
139
+ 🧪 Testing & Quality: 12 files
140
+ 🔌 External Tools (ADO, JIRA): 11 files
141
+ 📦 Increment Lifecycle: 10 files
142
+ ⚡ Performance & Optimization: 9 files
143
+ ⚙️ Configuration & Setup: 8 files
144
+
145
+ Uncategorized: 14 files
146
+
147
+ Generated 9 index files:
148
+ - _categories.md
149
+ - _index-sync.md
150
+ - _index-github.md
151
+ - _index-hooks.md
152
+ - _index-testing.md
153
+ - _index-external-tools.md
154
+ - _index-increments.md
155
+ - _index-performance.md
156
+ - _index-config.md
157
+ ```
158
+
159
+ ## Docusaurus Integration
160
+
161
+ After running this command, use:
162
+
163
+ ```bash
164
+ /specweave-docs:preview
165
+ ```
166
+
167
+ The generated indexes will appear in the sidebar:
168
+ - **Browse by Category** - main hub
169
+ - **Synchronization & Integration** - themed section
170
+ - **GitHub Integration** - themed section
171
+ - etc.
172
+
173
+ ## Best Practices
174
+
175
+ 1. **Run periodically** - As docs grow, re-run to update indexes
176
+ 2. **Review uncategorized** - Files without themes may need better naming
177
+ 3. **Check Docusaurus** - Preview after organizing to verify navigation
178
+ 4. **Don't move files** - Indexes are virtual, original URLs preserved
179
+
180
+ ## See Also
181
+
182
+ - `/specweave-docs:preview` - Preview documentation with Docusaurus
183
+ - `/specweave-docs:build` - Build static documentation site
184
+ - `/specweave-docs:health` - Documentation health report
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: specweave-docs:preview
3
+ description: Launch Docusaurus documentation server. Supports both public (port 3016) and internal (port 3015) documentation sites.
4
+ ---
5
+
6
+ # Documentation Preview Command
7
+
8
+ Launch Docusaurus development server with hot reload, Mermaid diagrams, and auto-generated sidebar.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ # Preview INTERNAL docs (SpecWeave living documentation) - DEFAULT
14
+ /specweave-docs:preview
15
+
16
+ # Preview PUBLIC docs (end-user documentation)
17
+ /specweave-docs:preview --public
18
+ ```
19
+
20
+ ## Two Documentation Sites
21
+
22
+ | Site | Port | Content | NPM Script |
23
+ |------|------|---------|------------|
24
+ | **Internal** | 3015 | `.specweave/docs/internal/` | `docs:internal` |
25
+ | **Public** | 3016 | `docs-site/docs/` | `docs:dev` |
26
+
27
+ ## Your Task
28
+
29
+ Execute the appropriate npm script based on user flags:
30
+
31
+ ```bash
32
+ # Check if user wants public docs
33
+ PUBLIC_FLAG="${1:-}"
34
+
35
+ cd /path/to/project
36
+
37
+ if [ "$PUBLIC_FLAG" = "--public" ]; then
38
+ echo "Launching PUBLIC documentation on port 3016..."
39
+ echo "Content: docs-site/docs/"
40
+ echo ""
41
+ npm run docs:dev
42
+ else
43
+ echo "Launching INTERNAL documentation on port 3015..."
44
+ echo "Content: .specweave/docs/internal/"
45
+ echo ""
46
+ npm run docs:internal
47
+ fi
48
+ ```
49
+
50
+ ### Alternative: Run directly with npx
51
+
52
+ If in a fresh project without the docs-site setup:
53
+
54
+ ```bash
55
+ # For internal docs
56
+ cd docs-site && npm run start:internal
57
+
58
+ # For public docs
59
+ cd docs-site && npm run start
60
+ ```
61
+
62
+ ## What You Get
63
+
64
+ - **Hot reload** - Edit markdown, see changes instantly
65
+ - **Auto sidebar** - Generated from folder structure
66
+ - **Mermaid diagrams** - Architecture diagrams render beautifully
67
+ - **Dark/light mode** - Toggle in navbar
68
+ - **Local search** - Instant search across all docs
69
+ - **Mobile responsive** - Works on any device
70
+
71
+ ## First-Time Setup
72
+
73
+ If `docs-site/node_modules` doesn't exist:
74
+
75
+ ```bash
76
+ npm run docs:install
77
+ ```
78
+
79
+ This installs Docusaurus dependencies (~200MB, ~30 seconds).
80
+
81
+ ## Ports
82
+
83
+ | Script | Port | URL |
84
+ |--------|------|-----|
85
+ | `docs:dev` | 3016 | http://localhost:3016 |
86
+ | `docs:internal` | 3015 | http://localhost:3015 |
87
+
88
+ ## Internal Docs Structure
89
+
90
+ ```
91
+ .specweave/docs/internal/
92
+ ├── strategy/ → Product strategy
93
+ ├── specs/ → Feature specifications (708 files!)
94
+ │ └── specweave/
95
+ │ ├── FS-001/ → Feature folders
96
+ │ ├── FS-002/
97
+ │ └── ...
98
+ ├── architecture/ → ADRs, HLDs, diagrams
99
+ ├── delivery/ → Release plans, guides
100
+ ├── operations/ → Runbooks, NFRs
101
+ └── governance/ → Standards, conventions
102
+ ```
103
+
104
+ ## Configuration Files
105
+
106
+ | File | Purpose |
107
+ |------|---------|
108
+ | `docusaurus.config.ts` | Public docs config |
109
+ | `docusaurus.config.internal.ts` | Internal docs config |
110
+ | `sidebars.ts` | Public docs sidebar |
111
+ | `sidebars.internal.ts` | Internal docs sidebar |
112
+
113
+ ## Troubleshooting
114
+
115
+ ### Port already in use
116
+ ```bash
117
+ # Find process using port
118
+ lsof -i :3015
119
+
120
+ # Kill it
121
+ kill -9 <PID>
122
+ ```
123
+
124
+ ### Missing dependencies
125
+ ```bash
126
+ npm run docs:install
127
+ ```
128
+
129
+ ### Build errors
130
+ ```bash
131
+ cd docs-site && npm run clear && npm run start:internal
132
+ ```
133
+
134
+ ## See Also
135
+
136
+ - `/specweave-docs:build` - Build static site for deployment
137
+ - `/specweave-docs:organize` - Generate themed indexes for large folders
138
+ - `/specweave-docs:health` - Documentation health report