specweave 0.30.11 → 0.30.13

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 (134) hide show
  1. package/dist/src/cli/commands/init.d.ts.map +1 -1
  2. package/dist/src/cli/commands/init.js +25 -2
  3. package/dist/src/cli/commands/init.js.map +1 -1
  4. package/dist/src/cli/helpers/ado-area-selector.d.ts.map +1 -1
  5. package/dist/src/cli/helpers/ado-area-selector.js +13 -0
  6. package/dist/src/cli/helpers/ado-area-selector.js.map +1 -1
  7. package/dist/src/cli/helpers/init/living-docs-preflight.d.ts +5 -1
  8. package/dist/src/cli/helpers/init/living-docs-preflight.d.ts.map +1 -1
  9. package/dist/src/cli/helpers/init/living-docs-preflight.js +80 -28
  10. package/dist/src/cli/helpers/init/living-docs-preflight.js.map +1 -1
  11. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  12. package/dist/src/cli/helpers/issue-tracker/index.js +7 -2
  13. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  14. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts +7 -0
  15. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
  16. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +33 -2
  17. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
  18. package/dist/src/cli/workers/brownfield-worker.d.ts +13 -0
  19. package/dist/src/cli/workers/brownfield-worker.d.ts.map +1 -1
  20. package/dist/src/cli/workers/brownfield-worker.js +154 -0
  21. package/dist/src/cli/workers/brownfield-worker.js.map +1 -1
  22. package/dist/src/cli/workers/clone-worker.js +19 -3
  23. package/dist/src/cli/workers/clone-worker.js.map +1 -1
  24. package/dist/src/cli/workers/living-docs-worker.js +272 -11
  25. package/dist/src/cli/workers/living-docs-worker.js.map +1 -1
  26. package/dist/src/core/background/brownfield-launcher.d.ts +2 -1
  27. package/dist/src/core/background/brownfield-launcher.d.ts.map +1 -1
  28. package/dist/src/core/background/brownfield-launcher.js.map +1 -1
  29. package/dist/src/core/background/types.d.ts +10 -2
  30. package/dist/src/core/background/types.d.ts.map +1 -1
  31. package/dist/src/core/discrepancy/brownfield-types.d.ts +3 -1
  32. package/dist/src/core/discrepancy/brownfield-types.d.ts.map +1 -1
  33. package/dist/src/core/living-docs/board-matcher.d.ts +120 -0
  34. package/dist/src/core/living-docs/board-matcher.d.ts.map +1 -0
  35. package/dist/src/core/living-docs/board-matcher.js +466 -0
  36. package/dist/src/core/living-docs/board-matcher.js.map +1 -0
  37. package/dist/src/core/living-docs/feature-archiver.d.ts +39 -0
  38. package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -1
  39. package/dist/src/core/living-docs/feature-archiver.js +197 -0
  40. package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
  41. package/dist/src/core/living-docs/foundation-builder.js +1 -1
  42. package/dist/src/core/living-docs/foundation-builder.js.map +1 -1
  43. package/dist/src/core/living-docs/living-docs-sync.d.ts +19 -8
  44. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  45. package/dist/src/core/living-docs/living-docs-sync.js +148 -52
  46. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  47. package/dist/src/core/living-docs/suggestions-generator.js +1 -1
  48. package/dist/src/core/living-docs/suggestions-generator.js.map +1 -1
  49. package/dist/src/core/living-docs/umbrella-detector.d.ts +4 -0
  50. package/dist/src/core/living-docs/umbrella-detector.d.ts.map +1 -1
  51. package/dist/src/core/living-docs/umbrella-detector.js +20 -1
  52. package/dist/src/core/living-docs/umbrella-detector.js.map +1 -1
  53. package/dist/src/core/living-docs/workitem-matcher.js +5 -5
  54. package/dist/src/core/living-docs/workitem-matcher.js.map +1 -1
  55. package/dist/src/core/llm/availability-messages.d.ts +33 -0
  56. package/dist/src/core/llm/availability-messages.d.ts.map +1 -0
  57. package/dist/src/core/llm/availability-messages.js +170 -0
  58. package/dist/src/core/llm/availability-messages.js.map +1 -0
  59. package/dist/src/core/llm/index.d.ts +34 -0
  60. package/dist/src/core/llm/index.d.ts.map +1 -0
  61. package/dist/src/core/llm/index.js +35 -0
  62. package/dist/src/core/llm/index.js.map +1 -0
  63. package/dist/src/core/llm/provider-factory.d.ts +48 -0
  64. package/dist/src/core/llm/provider-factory.d.ts.map +1 -0
  65. package/dist/src/core/llm/provider-factory.js +274 -0
  66. package/dist/src/core/llm/provider-factory.js.map +1 -0
  67. package/dist/src/core/llm/providers/anthropic-provider.d.ts +66 -0
  68. package/dist/src/core/llm/providers/anthropic-provider.d.ts.map +1 -0
  69. package/dist/src/core/llm/providers/anthropic-provider.js +195 -0
  70. package/dist/src/core/llm/providers/anthropic-provider.js.map +1 -0
  71. package/dist/src/core/llm/providers/azure-openai-provider.d.ts +47 -0
  72. package/dist/src/core/llm/providers/azure-openai-provider.d.ts.map +1 -0
  73. package/dist/src/core/llm/providers/azure-openai-provider.js +116 -0
  74. package/dist/src/core/llm/providers/azure-openai-provider.js.map +1 -0
  75. package/dist/src/core/llm/providers/bedrock-provider.d.ts +44 -0
  76. package/dist/src/core/llm/providers/bedrock-provider.d.ts.map +1 -0
  77. package/dist/src/core/llm/providers/bedrock-provider.js +149 -0
  78. package/dist/src/core/llm/providers/bedrock-provider.js.map +1 -0
  79. package/dist/src/core/llm/providers/claude-code-provider.d.ts +115 -0
  80. package/dist/src/core/llm/providers/claude-code-provider.d.ts.map +1 -0
  81. package/dist/src/core/llm/providers/claude-code-provider.js +379 -0
  82. package/dist/src/core/llm/providers/claude-code-provider.js.map +1 -0
  83. package/dist/src/core/llm/providers/ollama-provider.d.ts +40 -0
  84. package/dist/src/core/llm/providers/ollama-provider.d.ts.map +1 -0
  85. package/dist/src/core/llm/providers/ollama-provider.js +116 -0
  86. package/dist/src/core/llm/providers/ollama-provider.js.map +1 -0
  87. package/dist/src/core/llm/providers/openai-provider.d.ts +44 -0
  88. package/dist/src/core/llm/providers/openai-provider.d.ts.map +1 -0
  89. package/dist/src/core/llm/providers/openai-provider.js +119 -0
  90. package/dist/src/core/llm/providers/openai-provider.js.map +1 -0
  91. package/dist/src/core/llm/providers/vertex-ai-provider.d.ts +46 -0
  92. package/dist/src/core/llm/providers/vertex-ai-provider.d.ts.map +1 -0
  93. package/dist/src/core/llm/providers/vertex-ai-provider.js +123 -0
  94. package/dist/src/core/llm/providers/vertex-ai-provider.js.map +1 -0
  95. package/dist/src/core/llm/types.d.ts +181 -0
  96. package/dist/src/core/llm/types.d.ts.map +1 -0
  97. package/dist/src/core/llm/types.js +56 -0
  98. package/dist/src/core/llm/types.js.map +1 -0
  99. package/dist/src/importers/item-converter.d.ts +4 -0
  100. package/dist/src/importers/item-converter.d.ts.map +1 -1
  101. package/dist/src/importers/item-converter.js +73 -12
  102. package/dist/src/importers/item-converter.js.map +1 -1
  103. package/dist/src/init/repo/types.d.ts +1 -1
  104. package/dist/src/living-docs/enterprise-analyzer.d.ts +160 -0
  105. package/dist/src/living-docs/enterprise-analyzer.d.ts.map +1 -0
  106. package/dist/src/living-docs/enterprise-analyzer.js +887 -0
  107. package/dist/src/living-docs/enterprise-analyzer.js.map +1 -0
  108. package/dist/src/living-docs/epic-id-allocator.d.ts +4 -0
  109. package/dist/src/living-docs/epic-id-allocator.d.ts.map +1 -1
  110. package/dist/src/living-docs/epic-id-allocator.js +4 -0
  111. package/dist/src/living-docs/epic-id-allocator.js.map +1 -1
  112. package/dist/src/living-docs/fs-id-allocator.d.ts +9 -0
  113. package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -1
  114. package/dist/src/living-docs/fs-id-allocator.js +16 -5
  115. package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
  116. package/dist/src/living-docs/smart-doc-organizer.d.ts +114 -0
  117. package/dist/src/living-docs/smart-doc-organizer.d.ts.map +1 -0
  118. package/dist/src/living-docs/smart-doc-organizer.js +535 -0
  119. package/dist/src/living-docs/smart-doc-organizer.js.map +1 -0
  120. package/package.json +1 -1
  121. package/plugins/specweave/commands/specweave-archive.md +69 -2
  122. package/plugins/specweave/commands/specweave-judge.md +265 -0
  123. package/plugins/specweave/commands/specweave-organize-docs.md +185 -0
  124. package/plugins/specweave/hooks/hooks.json +3 -3
  125. package/plugins/specweave/hooks/universal/hook-wrapper.cmd +26 -0
  126. package/plugins/specweave/hooks/universal/hook-wrapper.sh +67 -0
  127. package/plugins/specweave-docs/commands/build.md +158 -0
  128. package/plugins/specweave-docs/commands/{docs-generate.md → generate.md} +7 -2
  129. package/plugins/specweave-docs/commands/health.md +268 -0
  130. package/plugins/specweave-docs/commands/{docs-init.md → init.md} +7 -2
  131. package/plugins/specweave-docs/commands/organize.md +184 -0
  132. package/plugins/specweave-docs/commands/preview.md +138 -0
  133. package/plugins/specweave-docs/skills/preview/SKILL.md +105 -0
  134. package/plugins/specweave-release/commands/specweave-release-npm.md +22 -235
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: specweave-docs:build
3
+ description: Build static documentation site for deployment. Supports both public and internal docs. Outputs production-ready HTML/CSS/JS.
4
+ ---
5
+
6
+ # Documentation Build Command
7
+
8
+ Build production-ready static documentation site for deployment to any static host.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ # Build INTERNAL docs (SpecWeave living documentation) - DEFAULT
14
+ /specweave-docs:build
15
+
16
+ # Build PUBLIC docs (end-user documentation)
17
+ /specweave-docs:build --public
18
+ ```
19
+
20
+ ## Two Build Targets
21
+
22
+ | Site | Output Directory | NPM Script |
23
+ |------|------------------|------------|
24
+ | **Internal** | `docs-site/build-internal/` | `docs:internal:build` |
25
+ | **Public** | `docs-site/build/` | `docs:build` |
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 "Building PUBLIC documentation..."
39
+ echo "Output: docs-site/build/"
40
+ echo ""
41
+ npm run docs:build
42
+ echo ""
43
+ echo "Build complete! Output: docs-site/build/"
44
+ else
45
+ echo "Building INTERNAL documentation..."
46
+ echo "Output: docs-site/build-internal/"
47
+ echo ""
48
+ npm run docs:internal:build
49
+ echo ""
50
+ echo "Build complete! Output: docs-site/build-internal/"
51
+ fi
52
+ ```
53
+
54
+ ## Output Structure
55
+
56
+ ```
57
+ docs-site/build-internal/
58
+ ├── index.html <- Landing page
59
+ ├── strategy/
60
+ ├── specs/
61
+ ├── architecture/
62
+ │ └── adr/
63
+ ├── delivery/
64
+ ├── operations/
65
+ ├── governance/
66
+ ├── assets/
67
+ │ ├── css/styles.[hash].css
68
+ │ └── js/runtime.[hash].js
69
+ └── sitemap.xml
70
+ ```
71
+
72
+ ## Deployment Options
73
+
74
+ ### 1. Preview Locally
75
+
76
+ ```bash
77
+ # Internal docs
78
+ cd docs-site && npm run serve:internal
79
+
80
+ # Public docs
81
+ cd docs-site && npm run serve
82
+ ```
83
+
84
+ ### 2. Netlify
85
+
86
+ ```bash
87
+ cd docs-site
88
+ npx netlify deploy --dir=build-internal --prod
89
+ ```
90
+
91
+ ### 3. Vercel
92
+
93
+ ```bash
94
+ cd docs-site
95
+ npx vercel --prod
96
+ ```
97
+
98
+ ### 4. GitHub Pages
99
+
100
+ ```bash
101
+ # Copy build to docs folder (GitHub Pages expects /docs)
102
+ cp -r docs-site/build-internal/* docs/
103
+ git add docs/
104
+ git commit -m "docs: update documentation site"
105
+ git push
106
+ ```
107
+
108
+ ### 5. Static Server
109
+
110
+ ```bash
111
+ npx serve docs-site/build-internal/
112
+ ```
113
+
114
+ ## Build vs Preview
115
+
116
+ | Aspect | Preview | Build |
117
+ |--------|---------|-------|
118
+ | **Purpose** | Development | Production |
119
+ | **Speed** | Instant | 10-30 seconds |
120
+ | **Output** | Dev server | Static files |
121
+ | **Hot Reload** | Yes | No |
122
+ | **Optimization** | No | Yes (minified) |
123
+ | **Use Case** | Writing docs | Deployment |
124
+
125
+ ## First-Time Setup
126
+
127
+ If dependencies not installed:
128
+
129
+ ```bash
130
+ npm run docs:install
131
+ ```
132
+
133
+ ## Troubleshooting
134
+
135
+ ### Build fails with broken links
136
+ ```bash
137
+ # Preview first to find errors
138
+ npm run docs:internal
139
+ # Fix broken links, then build
140
+ npm run docs:internal:build
141
+ ```
142
+
143
+ ### Out of memory
144
+ ```bash
145
+ # Increase Node memory
146
+ NODE_OPTIONS="--max-old-space-size=4096" npm run docs:internal:build
147
+ ```
148
+
149
+ ### Cache issues
150
+ ```bash
151
+ cd docs-site && npm run clear && npm run build:internal
152
+ ```
153
+
154
+ ## See Also
155
+
156
+ - `/specweave-docs:preview` - Preview docs locally with hot reload
157
+ - `/specweave-docs:organize` - Organize large folders with themed indexes
158
+ - `/specweave-docs:health` - Documentation health report
@@ -1,11 +1,16 @@
1
- # Docs Generate - Generate Documentation from Code
1
+ ---
2
+ name: specweave-docs:generate
3
+ description: Generate documentation from TypeScript/JavaScript code, OpenAPI specs, GraphQL schemas, and SpecWeave specifications.
4
+ ---
5
+
6
+ # Generate Documentation from Code
2
7
 
3
8
  Generate documentation automatically from TypeScript/JavaScript code, OpenAPI specs, GraphQL schemas, and SpecWeave specifications. Creates comprehensive API docs, type references, and usage examples.
4
9
 
5
10
  ## Usage
6
11
 
7
12
  ```
8
- /specweave-docs:docs-generate <source-type> <path> [options]
13
+ /specweave-docs:generate <source-type> <path> [options]
9
14
  ```
10
15
 
11
16
  ## Source Types
@@ -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
@@ -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