specweave 0.22.14 → 0.23.1

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 (211) hide show
  1. package/CLAUDE.md +178 -1
  2. package/dist/src/cli/commands/import-external.d.ts +22 -0
  3. package/dist/src/cli/commands/import-external.d.ts.map +1 -0
  4. package/dist/src/cli/commands/import-external.js +282 -0
  5. package/dist/src/cli/commands/import-external.js.map +1 -0
  6. package/dist/src/cli/commands/init.d.ts.map +1 -1
  7. package/dist/src/cli/commands/init.js +46 -0
  8. package/dist/src/cli/commands/init.js.map +1 -1
  9. package/dist/src/cli/helpers/github-repo-selector.d.ts +59 -0
  10. package/dist/src/cli/helpers/github-repo-selector.d.ts.map +1 -0
  11. package/dist/src/cli/helpers/github-repo-selector.js +265 -0
  12. package/dist/src/cli/helpers/github-repo-selector.js.map +1 -0
  13. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  14. package/dist/src/cli/helpers/issue-tracker/index.js +5 -17
  15. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  16. package/dist/src/config/types.d.ts +16 -16
  17. package/dist/src/core/increment/ac-status-manager.d.ts.map +1 -1
  18. package/dist/src/core/increment/ac-status-manager.js +4 -2
  19. package/dist/src/core/increment/ac-status-manager.js.map +1 -1
  20. package/dist/src/core/increment/completion-validator.d.ts +30 -1
  21. package/dist/src/core/increment/completion-validator.d.ts.map +1 -1
  22. package/dist/src/core/increment/completion-validator.js +151 -3
  23. package/dist/src/core/increment/completion-validator.js.map +1 -1
  24. package/dist/src/core/increment/increment-archiver.d.ts +25 -0
  25. package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
  26. package/dist/src/core/increment/increment-archiver.js +130 -3
  27. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  28. package/dist/src/core/living-docs/feature-archiver.d.ts +37 -0
  29. package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -1
  30. package/dist/src/core/living-docs/feature-archiver.js +262 -18
  31. package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
  32. package/dist/src/core/living-docs/feature-id-manager.d.ts +17 -0
  33. package/dist/src/core/living-docs/feature-id-manager.d.ts.map +1 -1
  34. package/dist/src/core/living-docs/feature-id-manager.js +25 -0
  35. package/dist/src/core/living-docs/feature-id-manager.js.map +1 -1
  36. package/dist/src/core/living-docs/living-docs-sync.d.ts +14 -0
  37. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  38. package/dist/src/core/living-docs/living-docs-sync.js +46 -0
  39. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  40. package/dist/src/core/repo-structure/repo-id-generator.d.ts +20 -0
  41. package/dist/src/core/repo-structure/repo-id-generator.d.ts.map +1 -1
  42. package/dist/src/core/repo-structure/repo-id-generator.js +44 -0
  43. package/dist/src/core/repo-structure/repo-id-generator.js.map +1 -1
  44. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  45. package/dist/src/core/repo-structure/repo-structure-manager.js +5 -2
  46. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  47. package/dist/src/core/sync/sync-event-logger.d.ts +15 -1
  48. package/dist/src/core/sync/sync-event-logger.d.ts.map +1 -1
  49. package/dist/src/core/sync/sync-event-logger.js +39 -1
  50. package/dist/src/core/sync/sync-event-logger.js.map +1 -1
  51. package/dist/src/core/types/sync-config-validator.d.ts +57 -0
  52. package/dist/src/core/types/sync-config-validator.d.ts.map +1 -0
  53. package/dist/src/core/types/sync-config-validator.js +116 -0
  54. package/dist/src/core/types/sync-config-validator.js.map +1 -0
  55. package/dist/src/importers/duplicate-detector.d.ts +107 -0
  56. package/dist/src/importers/duplicate-detector.d.ts.map +1 -0
  57. package/dist/src/importers/duplicate-detector.js +189 -0
  58. package/dist/src/importers/duplicate-detector.js.map +1 -0
  59. package/dist/src/importers/import-coordinator.d.ts +15 -0
  60. package/dist/src/importers/import-coordinator.d.ts.map +1 -1
  61. package/dist/src/importers/import-coordinator.js +43 -1
  62. package/dist/src/importers/import-coordinator.js.map +1 -1
  63. package/dist/src/importers/item-converter.d.ts +5 -0
  64. package/dist/src/importers/item-converter.d.ts.map +1 -1
  65. package/dist/src/importers/item-converter.js +27 -2
  66. package/dist/src/importers/item-converter.js.map +1 -1
  67. package/dist/src/importers/rate-limiter.d.ts +128 -0
  68. package/dist/src/importers/rate-limiter.d.ts.map +1 -0
  69. package/dist/src/importers/rate-limiter.js +200 -0
  70. package/dist/src/importers/rate-limiter.js.map +1 -0
  71. package/dist/src/init/compliance/types.d.ts +2 -2
  72. package/dist/src/integrations/ado/ado-client.d.ts +6 -0
  73. package/dist/src/integrations/ado/ado-client.d.ts.map +1 -1
  74. package/dist/src/integrations/ado/ado-client.js +23 -0
  75. package/dist/src/integrations/ado/ado-client.js.map +1 -1
  76. package/dist/src/integrations/jira/jira-client.d.ts +6 -0
  77. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  78. package/dist/src/integrations/jira/jira-client.js +38 -0
  79. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  80. package/dist/src/sync/external-item-sync-service.d.ts +150 -0
  81. package/dist/src/sync/external-item-sync-service.d.ts.map +1 -0
  82. package/dist/src/sync/external-item-sync-service.js +241 -0
  83. package/dist/src/sync/external-item-sync-service.js.map +1 -0
  84. package/dist/src/sync/format-preservation-sync.d.ts +90 -0
  85. package/dist/src/sync/format-preservation-sync.d.ts.map +1 -0
  86. package/dist/src/sync/format-preservation-sync.js +173 -0
  87. package/dist/src/sync/format-preservation-sync.js.map +1 -0
  88. package/dist/src/sync/index.d.ts +8 -0
  89. package/dist/src/sync/index.d.ts.map +1 -0
  90. package/dist/src/sync/index.js +6 -0
  91. package/dist/src/sync/index.js.map +1 -0
  92. package/dist/src/sync/sync-coordinator.d.ts +49 -0
  93. package/dist/src/sync/sync-coordinator.d.ts.map +1 -0
  94. package/dist/src/sync/sync-coordinator.js +248 -0
  95. package/dist/src/sync/sync-coordinator.js.map +1 -0
  96. package/dist/src/sync/sync-metadata.d.ts +75 -0
  97. package/dist/src/sync/sync-metadata.d.ts.map +1 -0
  98. package/dist/src/sync/sync-metadata.js +100 -0
  99. package/dist/src/sync/sync-metadata.js.map +1 -0
  100. package/dist/src/types/living-docs-us-file.d.ts +63 -0
  101. package/dist/src/types/living-docs-us-file.d.ts.map +1 -0
  102. package/dist/src/types/living-docs-us-file.js +27 -0
  103. package/dist/src/types/living-docs-us-file.js.map +1 -0
  104. package/dist/src/validators/format-preservation-validator.d.ts +127 -0
  105. package/dist/src/validators/format-preservation-validator.d.ts.map +1 -0
  106. package/dist/src/validators/format-preservation-validator.js +187 -0
  107. package/dist/src/validators/format-preservation-validator.js.map +1 -0
  108. package/package.json +3 -2
  109. package/plugins/specweave/.claude-plugin/plugin.json +20 -0
  110. package/plugins/specweave/commands/specweave-archive-features.md +11 -1
  111. package/plugins/specweave/commands/specweave-archive.md +51 -15
  112. package/plugins/specweave/commands/specweave-import-docs.md +88 -278
  113. package/plugins/specweave/commands/specweave-import-external.md +407 -0
  114. package/plugins/specweave/hooks/post-edit-spec.sh +94 -0
  115. package/plugins/specweave/hooks/post-increment-completion.sh +0 -0
  116. package/plugins/specweave/hooks/post-spec-update.sh +0 -0
  117. package/plugins/specweave/hooks/post-task-completion.sh +13 -3
  118. package/plugins/specweave/hooks/post-write-spec.sh +91 -0
  119. package/plugins/specweave/lib/hooks/auto-transition.js +1 -1
  120. package/plugins/specweave/lib/hooks/auto-transition.js.bak +50 -0
  121. package/plugins/specweave/lib/hooks/auto-transition.ts +1 -1
  122. package/plugins/specweave/lib/hooks/auto-transition.ts.bak +84 -0
  123. package/plugins/specweave/lib/hooks/git-diff-analyzer.d.js.bak +0 -0
  124. package/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.bak +89 -0
  125. package/plugins/specweave/lib/hooks/git-diff-analyzer.js.bak +142 -0
  126. package/plugins/specweave/lib/hooks/git-diff-analyzer.ts.bak +269 -0
  127. package/plugins/specweave/lib/hooks/invoke-translator-skill.d.js.bak +0 -0
  128. package/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.bak +60 -0
  129. package/plugins/specweave/lib/hooks/invoke-translator-skill.js +1 -1
  130. package/plugins/specweave/lib/hooks/invoke-translator-skill.js.bak +155 -0
  131. package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +1 -1
  132. package/plugins/specweave/lib/hooks/invoke-translator-skill.ts.bak +264 -0
  133. package/plugins/specweave/lib/hooks/prepare-reflection-context.d.js.bak +0 -0
  134. package/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.bak +42 -0
  135. package/plugins/specweave/lib/hooks/prepare-reflection-context.js.bak +110 -0
  136. package/plugins/specweave/lib/hooks/prepare-reflection-context.ts.bak +178 -0
  137. package/plugins/specweave/lib/hooks/reflection-config-loader.d.js.bak +0 -0
  138. package/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.bak +45 -0
  139. package/plugins/specweave/lib/hooks/reflection-config-loader.js.bak +92 -0
  140. package/plugins/specweave/lib/hooks/reflection-config-loader.ts.bak +156 -0
  141. package/plugins/specweave/lib/hooks/reflection-parser.d.js.bak +0 -0
  142. package/plugins/specweave/lib/hooks/reflection-parser.d.ts.bak +33 -0
  143. package/plugins/specweave/lib/hooks/reflection-parser.js.bak +301 -0
  144. package/plugins/specweave/lib/hooks/reflection-parser.ts.bak +484 -0
  145. package/plugins/specweave/lib/hooks/reflection-prompt-builder.d.js.bak +0 -0
  146. package/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.bak +56 -0
  147. package/plugins/specweave/lib/hooks/reflection-prompt-builder.js.bak +182 -0
  148. package/plugins/specweave/lib/hooks/reflection-prompt-builder.ts.bak +306 -0
  149. package/plugins/specweave/lib/hooks/reflection-storage.d.js.bak +0 -0
  150. package/plugins/specweave/lib/hooks/reflection-storage.d.ts.bak +64 -0
  151. package/plugins/specweave/lib/hooks/reflection-storage.js.bak +231 -0
  152. package/plugins/specweave/lib/hooks/reflection-storage.ts.bak +369 -0
  153. package/plugins/specweave/lib/hooks/run-self-reflection.d.js.bak +0 -0
  154. package/plugins/specweave/lib/hooks/run-self-reflection.d.ts.bak +43 -0
  155. package/plugins/specweave/lib/hooks/run-self-reflection.js.bak +132 -0
  156. package/plugins/specweave/lib/hooks/run-self-reflection.ts.bak +258 -0
  157. package/plugins/specweave/lib/hooks/sync-cache.js.bak +294 -0
  158. package/plugins/specweave/lib/hooks/sync-living-docs.d.js.bak +1 -0
  159. package/plugins/specweave/lib/hooks/sync-living-docs.d.ts.bak +27 -0
  160. package/plugins/specweave/lib/hooks/sync-living-docs.js +35 -1
  161. package/plugins/specweave/lib/hooks/sync-living-docs.js.bak +339 -0
  162. package/plugins/specweave/lib/hooks/sync-us-tasks.js +179 -3
  163. package/plugins/specweave/lib/hooks/sync-us-tasks.js.bak +476 -0
  164. package/plugins/specweave/lib/hooks/translate-file.d.js.bak +0 -0
  165. package/plugins/specweave/lib/hooks/translate-file.d.ts.bak +59 -0
  166. package/plugins/specweave/lib/hooks/translate-file.js +1 -1
  167. package/plugins/specweave/lib/hooks/translate-file.js.bak +289 -0
  168. package/plugins/specweave/lib/hooks/translate-file.ts +1 -1
  169. package/plugins/specweave/lib/hooks/translate-file.ts.bak +428 -0
  170. package/plugins/specweave/lib/hooks/translate-living-docs.d.js.bak +0 -0
  171. package/plugins/specweave/lib/hooks/translate-living-docs.d.ts.bak +13 -0
  172. package/plugins/specweave/lib/hooks/translate-living-docs.js.bak +119 -0
  173. package/plugins/specweave/lib/hooks/translate-living-docs.ts.bak +224 -0
  174. package/plugins/specweave/lib/hooks/update-ac-status.js +1 -1
  175. package/plugins/specweave/lib/hooks/update-ac-status.js.bak +51 -0
  176. package/plugins/specweave/lib/hooks/update-ac-status.ts +1 -1
  177. package/plugins/specweave/lib/hooks/update-ac-status.ts.bak +103 -0
  178. package/plugins/specweave/lib/hooks/update-tasks-md.d.js.bak +1 -0
  179. package/plugins/specweave/lib/hooks/update-tasks-md.d.ts.bak +29 -0
  180. package/plugins/specweave/lib/hooks/update-tasks-md.js.bak +296 -0
  181. package/plugins/specweave/lib/hooks/update-tasks-md.ts.bak +489 -0
  182. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.d.ts +115 -0
  183. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js +345 -0
  184. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js.map +1 -0
  185. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.d.ts +106 -0
  186. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js +220 -0
  187. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js.map +1 -0
  188. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +60 -0
  189. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +192 -0
  190. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -0
  191. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.d.ts +52 -0
  192. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +276 -0
  193. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -0
  194. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.d.ts +163 -0
  195. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +541 -0
  196. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -0
  197. package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +157 -0
  198. package/plugins/specweave/lib/vendor/core/types/increment-metadata.js +191 -0
  199. package/plugins/specweave/lib/vendor/core/types/increment-metadata.js.map +1 -0
  200. package/plugins/specweave/lib/vendor/generators/spec/task-parser.d.ts +95 -0
  201. package/plugins/specweave/lib/vendor/generators/spec/task-parser.js +301 -0
  202. package/plugins/specweave/lib/vendor/generators/spec/task-parser.js.map +1 -0
  203. package/plugins/specweave/lib/vendor/utils/logger.d.ts +48 -0
  204. package/plugins/specweave/lib/vendor/utils/logger.js +53 -0
  205. package/plugins/specweave/lib/vendor/utils/logger.js.map +1 -0
  206. package/plugins/specweave/lib/vendor/utils/translation.d.ts +187 -0
  207. package/plugins/specweave/lib/vendor/utils/translation.js +414 -0
  208. package/plugins/specweave/lib/vendor/utils/translation.js.map +1 -0
  209. package/plugins/specweave-github/commands/specweave-github-update-user-story.md +1 -1
  210. package/plugins/specweave-github/skills/github-issue-standard/SKILL.md +1 -1
  211. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +531 -0
@@ -1,326 +1,136 @@
1
1
  ---
2
2
  name: specweave:import-docs
3
- description: Intelligently import ANY documentation (Notion, Confluence, Evernote, Google Docs, markdown) with AI-powered content analysis and automatic living docs integration.
3
+ description: Import brownfield documentation from Notion exports, Confluence, GitHub Wiki, or any markdown folder. Automatically classifies files as specs, modules, team docs, or legacy.
4
4
  ---
5
5
 
6
- # Import Documentation (AI-Powered)
6
+ # Import Brownfield Documentation
7
7
 
8
- **One command. Any source. Intelligent classification.**
9
-
10
- Import documentation from **anywhere** - Notion, Confluence, Evernote, Google Docs, or plain markdown. SpecWeave uses AI to understand content, classify documents, and merge intelligently into living docs.
11
-
12
- ## Philosophy
13
-
14
- **You shouldn't need to tell SpecWeave where docs came from.** Just point it at a folder of markdown files, and SpecWeave figures out:
15
- - What type of document it is (spec, architecture, guide)
16
- - Where it should go in living docs
17
- - How to merge with existing content
18
- - What needs manual review
8
+ Import existing documentation from Notion exports, Confluence, GitHub Wiki, or any markdown folder.
19
9
 
20
10
  ## What This Does
21
11
 
22
- ### 1. **Smart Source Detection** (Zero Config)
23
- SpecWeave auto-detects export format:
24
- - Notion export? Detects `.csv` metadata, nested folders
25
- - Confluence? Detects `index.html`, attachment structure
26
- - Evernote? Detects `.enex` format (converts to markdown)
27
- - Google Docs? Detects HTML export structure
28
- - Plain markdown? Works with any folder
29
-
30
- **You don't specify `--source`** - SpecWeave figures it out.
31
-
32
- ### 2. **AI-Powered Content Classification**
33
- LLM analyzes ACTUAL content (not just keywords):
34
- - **Feature Specs** - User stories, acceptance criteria, business requirements
35
- - **Architecture** - Technical design, system diagrams, ADRs
36
- - **API Docs** - Endpoints, request/response formats, authentication
37
- - **User Guides** - How-tos, tutorials, onboarding
38
- - **Team Process** - Conventions, workflows, PR guidelines
39
- - **Legacy** - Needs review (ambiguous content)
40
-
41
- **Confidence Scoring**: 90%+ = Auto-classify, <90% = Flag for review
42
-
43
- ### 3. **Intelligent Merging** (Not Overwriting)
44
- When docs already exist:
45
- - **Specs**: Merge user stories (preserve existing, add new)
46
- - **Architecture**: Create versioned files (design-v1.md, design-v2.md)
47
- - **Guides**: Detect duplicates, suggest consolidation
48
- - **Legacy**: Never overwrite (safe copy to legacy/)
49
-
50
- ### 4. **Living Docs Integration**
51
- Automatically updates:
52
- - Feature registry with imported specs
53
- - Architecture index with design docs
54
- - Cross-reference links between documents
55
- - Traceability metadata (source, import date)
56
-
57
- ### 5. **Migration Report**
58
- Shows what happened:
59
- - Classification decisions with confidence scores
60
- - Merge conflicts detected
61
- - Files that need manual review
62
- - Suggested next steps
12
+ 1. **Analyzes markdown files** in source directory (recursively)
13
+ 2. **Classifies files** based on content:
14
+ - **Specs** - Contains "user story", "acceptance criteria", "feature"
15
+ - **Modules** - Contains "module", "component", "architecture"
16
+ - **Team** - Contains "onboarding", "convention", "workflow"
17
+ - **Legacy** - Everything else (no strong match)
18
+ 3. **Copies files** to appropriate destinations
19
+ 4. **Creates migration report** with classification details
20
+ 5. **Updates config** with import history
63
21
 
64
22
  ## Usage
65
23
 
66
- **Simplest form** (SpecWeave does everything):
67
24
  ```bash
68
- /specweave:import-docs /path/to/docs
25
+ /specweave:import-docs <source-path> [options]
69
26
  ```
70
27
 
71
- That's it! No flags, no config, no source type. Just point and import.
72
-
73
- ### Options (All Optional)
28
+ ### Options
74
29
 
75
- - `--project=<id>` - Target project (default: active project from config)
76
- - `--dry-run` - Preview without making changes
77
- - `--confidence=<threshold>` - Min confidence for auto-classification (default: 90)
78
- - `--merge-strategy=<smart|skip|overwrite>` - How to handle conflicts (default: smart)
30
+ - `--source=<type>` - Source type: `notion`, `confluence`, `wiki`, `custom` (required)
31
+ - `--project=<id>` - Target project ID (default: active project)
32
+ - `--preserve-structure` - Preserve original folder structure
33
+ - `--dry-run` - Preview classification without importing
79
34
 
80
35
  ## Examples
81
36
 
82
- ### Example 1: Simplest Import (Zero Config)
37
+ ### Example 1: Notion Export
83
38
 
84
39
  ```bash
85
- # Just downloaded Notion export to /tmp/notion-export/
86
- # No need to specify it's from Notion!
87
-
88
- /specweave:import-docs /tmp/notion-export
89
-
90
- # Output:
91
- # 🔍 Analyzing /tmp/notion-export...
92
- # Detected source: Notion export (found Database.csv)
93
- # Found 47 markdown files
94
- #
95
- # 🤖 AI Classification (using Claude)...
96
- # Analyzed 47 files
97
- #
98
- # 📊 Classification Results:
99
- # Feature Specs: 12 files (avg confidence: 95%)
100
- # • Product Requirements.md → FS-048
101
- # • User Stories.md → FS-049
102
- # ...
103
- #
104
- # Architecture: 18 files (avg confidence: 92%)
105
- # • System Design.md → architecture/design/
106
- # • API Architecture.md → architecture/api/
107
- # ...
108
- #
109
- # User Guides: 5 files (avg confidence: 88%)
110
- # • Getting Started.md → guides/
111
- # ...
112
- #
113
- # Needs Review: 12 files (confidence <90%)
114
- # • Meeting Notes.md → legacy/ (68% confidence)
115
- # ...
116
- #
117
- # 🔗 Living Docs Integration...
118
- # ✓ Created 12 feature specs (FS-048 through FS-059)
119
- # ✓ Updated architecture index
120
- # ✓ Created 23 cross-reference links
121
- #
122
- # ✅ Import complete! 35/47 files auto-classified (74%)
123
- # 💡 Review 12 files in legacy/ for manual classification
40
+ # Export Notion workspace to /tmp/notion-export/
41
+ # Then import:
42
+
43
+ /specweave:import-docs /tmp/notion-export/ --source=notion
44
+
45
+ # Result:
46
+ # 📊 Analysis Results:
47
+ # Total files: 47
48
+ # - Specs: 12 files → specs/
49
+ # - Modules: 18 files → modules/
50
+ # - Team docs: 5 files → team/
51
+ # - Legacy: 12 files → legacy/notion/
52
+ # ✅ Import complete!
124
53
  ```
125
54
 
126
- ### Example 2: Dry Run (Preview)
55
+ ### Example 2: Confluence Export
127
56
 
128
57
  ```bash
129
- # Preview what would happen WITHOUT making changes
130
- /specweave:import-docs /path/to/docs --dry-run
131
-
132
- # Output shows:
133
- # - Source detection results
134
- # - AI classification decisions
135
- # - Where files would go
136
- # - Merge conflicts that would occur
137
- # - NO actual changes made
138
- ```
139
-
140
- ### Example 3: Confluence Export (Auto-Detected)
58
+ /specweave:import-docs /path/to/confluence/ --source=confluence --project=web-app
141
59
 
142
- ```bash
143
- # Exported Confluence space to /path/to/confluence/
144
- # SpecWeave auto-detects it's Confluence!
145
-
146
- /specweave:import-docs /path/to/confluence
147
-
148
- # Output:
149
- # 🔍 Analyzing /path/to/confluence...
150
- # ✓ Detected source: Confluence export (found index.html)
151
- # ✓ Converting HTML to markdown (38 files)...
152
- # ✓ Found 38 markdown files
153
- #
154
- # [Rest of AI classification...]
60
+ # Imports to: projects/web-app/specs/, modules/, team/, legacy/confluence/
155
61
  ```
156
62
 
157
- ### Example 4: Evernote Export (Auto-Converts)
63
+ ### Example 3: Dry Run (Preview)
158
64
 
159
65
  ```bash
160
- # Exported Evernote notebook to /tmp/evernote.enex
161
- # SpecWeave auto-detects and converts!
162
-
163
- /specweave:import-docs /tmp/evernote.enex
164
-
165
- # Output:
166
- # 🔍 Analyzing /tmp/evernote.enex...
167
- # ✓ Detected source: Evernote export (.enex format)
168
- # ✓ Converting ENEX to markdown (142 notes)...
169
- # ✓ Extracted 142 markdown files
170
- #
171
- # [Rest of AI classification...]
172
- ```
66
+ /specweave:import-docs /tmp/docs/ --source=custom --dry-run
173
67
 
174
- ### Example 5: Intelligent Merging
175
-
176
- ```bash
177
- # You already have FS-048 in living docs
178
- # SpecWeave merges intelligently (doesn't overwrite!)
179
-
180
- /specweave:import-docs /tmp/updated-requirements
181
-
182
- # Output:
183
- # 🔍 Analyzing /tmp/updated-requirements...
184
- # ✓ Detected source: Plain markdown folder
185
- #
186
- # 🤖 AI Classification...
187
- # ✓ Feature Requirements.md → FS-048 (ALREADY EXISTS)
188
- #
189
- # 🔀 Intelligent Merging...
190
- # FS-048: User Authentication
191
- # Existing: 3 user stories (US-001, US-002, US-003)
192
- # Imported: 5 user stories (US-001, US-002, US-004, US-005, US-006)
193
- #
194
- # Merge strategy:
195
- # ✓ US-001: Keep existing (no changes)
196
- # ✓ US-002: Merge (updated acceptance criteria)
197
- # ✓ US-003: Keep existing (not in import)
198
- # ✓ US-004: Add new (from import)
199
- # ✓ US-005: Add new (from import)
200
- # ✓ US-006: Add new (from import)
201
- #
202
- # Result: 6 user stories total (3 preserved, 1 merged, 3 new)
203
- #
204
- # ✅ Smart merge complete! No data lost.
68
+ # Shows classification without importing files
69
+ # Use this to preview results before actual import
205
70
  ```
206
71
 
207
- ### Example 6: Lower Confidence Threshold
72
+ ### Example 4: Preserve Structure
208
73
 
209
74
  ```bash
210
- # Accept files with 75%+ confidence (vs default 90%)
211
- # More aggressive auto-classification
75
+ /specweave:import-docs /path/to/wiki/ --source=wiki --preserve-structure
212
76
 
213
- /specweave:import-docs /tmp/messy-docs --confidence=75
214
-
215
- # Output:
216
- # [More files auto-classified, fewer in "Needs Review"]
77
+ # Preserves original folder structure:
78
+ # legacy/wiki/engineering/backend/auth.md
79
+ # legacy/wiki/engineering/frontend/components.md
217
80
  ```
218
81
 
219
- ## Supported Sources (All Auto-Detected)
220
-
221
- SpecWeave automatically detects the source format. You never need to specify `--source`.
82
+ ## Supported Sources
222
83
 
223
84
  ### Notion
224
- **Auto-Detection**: Finds `Database.csv` or Notion-specific folder structure
225
- **Export Steps**:
226
- 1. Notion Settings → Export → Export all workspace content
227
- 2. Choose "Markdown & CSV"
228
- 3. Extract ZIP to folder
229
- 4. Run: `/specweave:import-docs /path/to/export`
85
+ - **Export Format**: Markdown & CSV
86
+ - **Steps**:
87
+ 1. In Notion: Settings → Export → Export all workspace content
88
+ 2. Choose "Markdown & CSV" format
89
+ 3. Download ZIP file
90
+ 4. Extract to folder (e.g., `/tmp/notion-export/`)
91
+ 5. Run import command
230
92
 
231
93
  ### Confluence
232
- **Auto-Detection**: Finds `index.html` or Confluence metadata
233
- **Export Steps**:
94
+ - **Export Format**: HTML or Markdown
95
+ - **Steps**:
234
96
  1. Space tools → Content Tools → Export
235
97
  2. Choose HTML or Markdown
236
- 3. Extract files
237
- 4. Run: `/specweave:import-docs /path/to/export`
238
-
239
- ### Evernote
240
- **Auto-Detection**: Finds `.enex` file format
241
- **Export Steps**:
242
- 1. Evernote → File → Export → Export as ENEX
243
- 2. Save .enex file
244
- 3. Run: `/specweave:import-docs /path/to/export.enex`
245
-
246
- **Note**: SpecWeave auto-converts ENEX to markdown
247
-
248
- ### Google Docs
249
- **Auto-Detection**: Finds HTML export structure
250
- **Export Steps**:
251
- 1. File → Download → Web Page (.html)
252
- 2. Extract ZIP
253
- 3. Run: `/specweave:import-docs /path/to/export`
98
+ 3. Extract exported files
99
+ 4. Run import command
254
100
 
255
101
  ### GitHub Wiki
256
- **Auto-Detection**: Finds `.git` folder with wiki structure
257
- **Export Steps**:
258
- 1. Clone: `git clone https://github.com/user/repo.wiki.git`
259
- 2. Run: `/specweave:import-docs ./repo.wiki`
260
-
261
- ### Plain Markdown
262
- **Auto-Detection**: Finds `.md` or `.markdown` files
263
- **No export needed** - just point at any folder
264
-
265
- ## AI Classification (How It Works)
266
-
267
- SpecWeave uses Claude to analyze **actual content**, not just keywords.
268
-
269
- ### What Claude Analyzes
270
-
271
- For each file, Claude examines:
272
- 1. **Document Structure**: Headings, lists, tables, code blocks
273
- 2. **Content Patterns**: User stories, acceptance criteria, technical terms
274
- 3. **Writing Style**: Business vs technical language
275
- 4. **Relationships**: References to other documents
276
- 5. **Intent**: What problem is this document solving?
277
-
278
- ### Classification Categories
279
-
280
- **Feature Specs** (90%+ confidence required)
281
- - **Indicators**: User stories, acceptance criteria, business requirements
282
- - **Example Content**: "As a user, I want...", "Given-When-Then", "AC-001"
283
- - **Living Docs Destination**: `.specweave/docs/internal/specs/`
284
-
285
- **Architecture Docs** (90%+ confidence)
286
- - **Indicators**: System design, technical decisions, diagrams
287
- - **Example Content**: "Architecture", "Component diagram", "Database schema"
288
- - **Living Docs Destination**: `.specweave/docs/internal/architecture/`
289
-
290
- **API Documentation** (90%+ confidence)
291
- - **Indicators**: Endpoints, request/response, authentication
292
- - **Example Content**: "POST /api/users", "Authorization: Bearer", "HTTP 200"
293
- - **Living Docs Destination**: `.specweave/docs/internal/architecture/api/`
294
-
295
- **User Guides** (90%+ confidence)
296
- - **Indicators**: Step-by-step instructions, tutorials, screenshots
297
- - **Example Content**: "Getting Started", "How to...", "Step 1:"
298
- - **Living Docs Destination**: `.specweave/docs/public/guides/`
299
-
300
- **Team Process** (90%+ confidence)
301
- - **Indicators**: Conventions, workflows, team agreements
302
- - **Example Content**: "PR process", "Code review checklist", "Onboarding"
303
- - **Living Docs Destination**: `.specweave/docs/internal/team/`
304
-
305
- **ADRs** (95%+ confidence - strict!)
306
- - **Indicators**: "Architecture Decision Record", "ADR-XXXX", "Status: Accepted"
307
- - **Example Content**: "## Context", "## Decision", "## Consequences"
308
- - **Living Docs Destination**: `.specweave/docs/internal/architecture/adr/`
309
-
310
- **Needs Manual Review** (<90% confidence)
311
- - **Indicators**: Ambiguous content, mixed types, meeting notes
312
- - **Example Content**: Anything Claude isn't confident about
313
- - **Living Docs Destination**: `.specweave/docs/internal/legacy/needs-review/`
314
-
315
- ### Confidence Scoring
316
-
317
- Claude provides a confidence score (0-100%) for each classification:
318
-
319
- - **95-100%**: Extremely confident (rare, only for very clear docs like ADRs)
320
- - **90-94%**: High confidence (default threshold for auto-classification)
321
- - **80-89%**: Medium confidence (flagged for review, not auto-classified)
322
- - **70-79%**: Low confidence (definitely needs review)
323
- - **<70%**: Very uncertain (goes to legacy/)
102
+ - **Export Format**: Git repository
103
+ - **Steps**:
104
+ 1. Clone wiki: `git clone https://github.com/user/repo.wiki.git`
105
+ 2. Run import command on cloned directory
106
+
107
+ ### Custom (Any Markdown)
108
+ - Any folder containing `.md` or `.markdown` files
109
+ - Recursive search through subdirectories
110
+
111
+ ## Classification Algorithm
112
+
113
+ Files are classified using keyword analysis:
114
+
115
+ ### Specs (70%+ confidence)
116
+ - Keywords: "user story", "acceptance criteria", "feature", "requirement"
117
+ - Patterns: "As a [user], I want [goal]", "Given-When-Then"
118
+ - Example: Feature specs, PRDs, user stories
119
+
120
+ ### Modules (70%+ confidence)
121
+ - Keywords: "module", "component", "service", "architecture"
122
+ - Patterns: API docs, technical design, integration points
123
+ - Example: Auth module, payment processing, ML pipeline
124
+
125
+ ### Team (70%+ confidence)
126
+ - Keywords: "onboarding", "convention", "workflow", "pr process"
127
+ - Patterns: Team processes, coding standards, deployment guides
128
+ - Example: Onboarding guide, code review checklist
129
+
130
+ ### Legacy (<70% confidence)
131
+ - No strong match to above categories
132
+ - Uncertain classification
133
+ - Requires manual review
324
134
 
325
135
  ## Destination Folders
326
136