@aigne/doc-smith 0.9.8-alpha.0 → 0.9.8-alpha.10

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 (266) hide show
  1. package/CLAUDE.md +43 -0
  2. package/README.md +138 -240
  3. package/agents/bash-executor/bash-executor.mjs +341 -0
  4. package/agents/document-checker/content-checker.mjs +158 -0
  5. package/agents/document-checker/structure-checker.mjs +307 -0
  6. package/agents/document-checker/validate-content.mjs +786 -0
  7. package/agents/document-checker/validate-structure.mjs +479 -0
  8. package/agents/localize/generate-summary.mjs +163 -0
  9. package/agents/localize/index.yaml +15 -38
  10. package/agents/localize/load-glossary.mjs +52 -0
  11. package/agents/localize/prepare-doc-content.mjs +138 -0
  12. package/agents/localize/prepare-translation.mjs +243 -0
  13. package/agents/localize/save-translation.mjs +149 -0
  14. package/agents/localize/translate-document.yaml +6 -7
  15. package/agents/localize/translate-to-languages.yaml +11 -0
  16. package/agents/publish/check-docs.mjs +42 -0
  17. package/agents/publish/index.yaml +4 -18
  18. package/agents/publish/init-config.mjs +123 -0
  19. package/agents/publish/publish-docs.mjs +61 -39
  20. package/agents/utils/save-document.mjs +225 -0
  21. package/aigne.yaml +15 -146
  22. package/biome.json +73 -0
  23. package/doc-smith/SKILL.md +220 -0
  24. package/doc-smith/references/changeset-guide.md +170 -0
  25. package/doc-smith/references/document-content-guide.md +150 -0
  26. package/doc-smith/references/document-structure-schema.md +138 -0
  27. package/doc-smith/references/patch-guide.md +96 -0
  28. package/doc-smith/references/structure-confirmation-guide.md +133 -0
  29. package/doc-smith/references/structure-planning-guide.md +149 -0
  30. package/doc-smith/references/update-workflow.md +108 -0
  31. package/doc-smith/references/user-intent-guide.md +175 -0
  32. package/doc-smith/references/workspace-initialization.md +326 -0
  33. package/doc-smith.yaml +47 -0
  34. package/feature-design/localize-agent.md +219 -0
  35. package/feature-design/multilang-folder-structure.md +853 -0
  36. package/feature-design/save-document-agent.md +652 -0
  37. package/feature-design/workspace.md +697 -0
  38. package/package.json +10 -57
  39. package/prompts/doc-smith.md +57 -0
  40. package/prompts/translate/translate-document.md +0 -139
  41. package/scripts/README.md +90 -0
  42. package/scripts/install.sh +86 -0
  43. package/scripts/uninstall.sh +52 -0
  44. package/utils/agent-constants.mjs +76 -0
  45. package/utils/{auth-utils.mjs → auth.mjs} +2 -6
  46. package/{agents/utils/update-branding.mjs → utils/branding.mjs} +3 -4
  47. package/utils/config.mjs +239 -0
  48. package/utils/constants.mjs +38 -0
  49. package/utils/deploy.mjs +3 -3
  50. package/utils/docs-converter.mjs +197 -0
  51. package/utils/docs.mjs +241 -0
  52. package/utils/document-paths.mjs +175 -0
  53. package/utils/files.mjs +76 -0
  54. package/utils/git.mjs +54 -0
  55. package/utils/{blocklet.mjs → http.mjs} +18 -0
  56. package/utils/project.mjs +76 -0
  57. package/utils/{upload-files.mjs → upload.mjs} +3 -3
  58. package/CHANGELOG.md +0 -994
  59. package/LICENSE +0 -93
  60. package/agents/chat/chat-system.md +0 -38
  61. package/agents/chat/index.mjs +0 -59
  62. package/agents/chat/skills/generate-document.yaml +0 -15
  63. package/agents/chat/skills/list-documents.mjs +0 -15
  64. package/agents/chat/skills/update-document.yaml +0 -24
  65. package/agents/clear/choose-contents.mjs +0 -192
  66. package/agents/clear/clear-auth-tokens.mjs +0 -88
  67. package/agents/clear/clear-deployment-config.mjs +0 -49
  68. package/agents/clear/clear-document-config.mjs +0 -36
  69. package/agents/clear/clear-document-structure.mjs +0 -102
  70. package/agents/clear/clear-generated-docs.mjs +0 -142
  71. package/agents/clear/clear-media-description.mjs +0 -129
  72. package/agents/clear/index.yaml +0 -26
  73. package/agents/create/analyze-diagram-type-llm.yaml +0 -160
  74. package/agents/create/analyze-diagram-type.mjs +0 -297
  75. package/agents/create/check-document-structure.yaml +0 -30
  76. package/agents/create/check-need-generate-structure.mjs +0 -105
  77. package/agents/create/document-structure-tools/add-document.mjs +0 -85
  78. package/agents/create/document-structure-tools/delete-document.mjs +0 -116
  79. package/agents/create/document-structure-tools/move-document.mjs +0 -109
  80. package/agents/create/document-structure-tools/update-document.mjs +0 -84
  81. package/agents/create/generate-diagram-image.yaml +0 -60
  82. package/agents/create/generate-structure.yaml +0 -117
  83. package/agents/create/index.yaml +0 -49
  84. package/agents/create/refine-document-structure.yaml +0 -12
  85. package/agents/create/replace-d2-with-image.mjs +0 -625
  86. package/agents/create/update-document-structure.yaml +0 -54
  87. package/agents/create/user-add-document/add-documents-to-structure.mjs +0 -90
  88. package/agents/create/user-add-document/find-documents-to-add-links.yaml +0 -47
  89. package/agents/create/user-add-document/index.yaml +0 -46
  90. package/agents/create/user-add-document/prepare-documents-to-translate.mjs +0 -22
  91. package/agents/create/user-add-document/print-add-document-summary.mjs +0 -63
  92. package/agents/create/user-add-document/review-documents-with-new-links.mjs +0 -110
  93. package/agents/create/user-remove-document/find-documents-with-invalid-links.mjs +0 -78
  94. package/agents/create/user-remove-document/index.yaml +0 -40
  95. package/agents/create/user-remove-document/prepare-documents-to-translate.mjs +0 -22
  96. package/agents/create/user-remove-document/print-remove-document-summary.mjs +0 -53
  97. package/agents/create/user-remove-document/remove-documents-from-structure.mjs +0 -99
  98. package/agents/create/user-remove-document/review-documents-with-invalid-links.mjs +0 -115
  99. package/agents/create/user-review-document-structure.mjs +0 -140
  100. package/agents/create/utils/init-current-content.mjs +0 -34
  101. package/agents/create/utils/merge-document-structures.mjs +0 -30
  102. package/agents/evaluate/code-snippet.mjs +0 -97
  103. package/agents/evaluate/document-structure.yaml +0 -67
  104. package/agents/evaluate/document.yaml +0 -82
  105. package/agents/evaluate/generate-report.mjs +0 -85
  106. package/agents/evaluate/index.yaml +0 -46
  107. package/agents/history/index.yaml +0 -6
  108. package/agents/history/view.mjs +0 -78
  109. package/agents/init/check.mjs +0 -16
  110. package/agents/init/index.mjs +0 -275
  111. package/agents/init/validate.mjs +0 -16
  112. package/agents/localize/choose-language.mjs +0 -107
  113. package/agents/localize/record-translation-history.mjs +0 -23
  114. package/agents/localize/translate-multilingual.yaml +0 -51
  115. package/agents/media/batch-generate-media-description.yaml +0 -46
  116. package/agents/media/generate-media-description.yaml +0 -50
  117. package/agents/media/load-media-description.mjs +0 -256
  118. package/agents/prefs/index.mjs +0 -203
  119. package/agents/publish/translate-meta.mjs +0 -103
  120. package/agents/schema/document-structure-item.yaml +0 -26
  121. package/agents/schema/document-structure-refine-item.yaml +0 -23
  122. package/agents/schema/document-structure.yaml +0 -29
  123. package/agents/update/batch-generate-document.yaml +0 -27
  124. package/agents/update/batch-update-document.yaml +0 -7
  125. package/agents/update/check-diagram-flag.mjs +0 -116
  126. package/agents/update/check-document.mjs +0 -162
  127. package/agents/update/check-generate-diagram.mjs +0 -106
  128. package/agents/update/check-sync-image-flag.mjs +0 -55
  129. package/agents/update/check-update-is-single.mjs +0 -53
  130. package/agents/update/document-tools/update-document-content.mjs +0 -303
  131. package/agents/update/generate-diagram.yaml +0 -63
  132. package/agents/update/generate-document.yaml +0 -70
  133. package/agents/update/handle-document-update.yaml +0 -103
  134. package/agents/update/index.yaml +0 -79
  135. package/agents/update/pre-check-generate-diagram.yaml +0 -44
  136. package/agents/update/save-and-translate-document.mjs +0 -76
  137. package/agents/update/sync-images-and-exit.mjs +0 -148
  138. package/agents/update/update-document-detail.yaml +0 -71
  139. package/agents/update/update-single/update-single-document-detail.mjs +0 -280
  140. package/agents/update/update-single-document.yaml +0 -7
  141. package/agents/update/user-review-document.mjs +0 -272
  142. package/agents/utils/action-success.mjs +0 -16
  143. package/agents/utils/analyze-document-feedback-intent.yaml +0 -32
  144. package/agents/utils/analyze-feedback-intent.mjs +0 -136
  145. package/agents/utils/analyze-structure-feedback-intent.yaml +0 -29
  146. package/agents/utils/check-detail-result.mjs +0 -38
  147. package/agents/utils/check-feedback-refiner.mjs +0 -81
  148. package/agents/utils/choose-docs.mjs +0 -293
  149. package/agents/utils/document-icon-generate.yaml +0 -52
  150. package/agents/utils/document-title-streamline.yaml +0 -48
  151. package/agents/utils/ensure-document-icons.mjs +0 -129
  152. package/agents/utils/exit.mjs +0 -6
  153. package/agents/utils/feedback-refiner.yaml +0 -50
  154. package/agents/utils/find-item-by-path.mjs +0 -114
  155. package/agents/utils/find-user-preferences-by-path.mjs +0 -37
  156. package/agents/utils/format-document-structure.mjs +0 -35
  157. package/agents/utils/generate-document-or-skip.mjs +0 -41
  158. package/agents/utils/handle-diagram-operations.mjs +0 -263
  159. package/agents/utils/load-all-document-content.mjs +0 -30
  160. package/agents/utils/load-document-all-content.mjs +0 -84
  161. package/agents/utils/load-sources.mjs +0 -405
  162. package/agents/utils/map-reasoning-effort-level.mjs +0 -15
  163. package/agents/utils/post-generate.mjs +0 -144
  164. package/agents/utils/read-current-document-content.mjs +0 -46
  165. package/agents/utils/save-doc-translation.mjs +0 -61
  166. package/agents/utils/save-doc.mjs +0 -88
  167. package/agents/utils/save-output.mjs +0 -26
  168. package/agents/utils/save-sidebar.mjs +0 -51
  169. package/agents/utils/skip-if-content-exists.mjs +0 -27
  170. package/agents/utils/streamline-document-titles-if-needed.mjs +0 -88
  171. package/agents/utils/transform-detail-data-sources.mjs +0 -45
  172. package/assets/report-template/report.html +0 -198
  173. package/docs-mcp/analyze-content-relevance.yaml +0 -50
  174. package/docs-mcp/analyze-docs-relevance.yaml +0 -59
  175. package/docs-mcp/docs-search.yaml +0 -42
  176. package/docs-mcp/get-docs-detail.mjs +0 -41
  177. package/docs-mcp/get-docs-structure.mjs +0 -16
  178. package/docs-mcp/read-doc-content.mjs +0 -119
  179. package/prompts/common/document/content-rules-core.md +0 -20
  180. package/prompts/common/document/markdown-syntax-rules.md +0 -65
  181. package/prompts/common/document/media-file-list-usage-rules.md +0 -18
  182. package/prompts/common/document/openapi-usage-rules.md +0 -189
  183. package/prompts/common/document/role-and-personality.md +0 -16
  184. package/prompts/common/document/user-preferences.md +0 -9
  185. package/prompts/common/document-structure/conflict-resolution-guidance.md +0 -16
  186. package/prompts/common/document-structure/document-icon-generate.md +0 -116
  187. package/prompts/common/document-structure/document-structure-rules.md +0 -43
  188. package/prompts/common/document-structure/document-title-streamline.md +0 -86
  189. package/prompts/common/document-structure/glossary.md +0 -7
  190. package/prompts/common/document-structure/intj-traits.md +0 -5
  191. package/prompts/common/document-structure/openapi-usage-rules.md +0 -28
  192. package/prompts/common/document-structure/output-constraints.md +0 -18
  193. package/prompts/common/document-structure/user-locale-rules.md +0 -10
  194. package/prompts/common/document-structure/user-preferences.md +0 -9
  195. package/prompts/detail/custom/admonition-usage-rules.md +0 -94
  196. package/prompts/detail/custom/code-block-usage-rules.md +0 -163
  197. package/prompts/detail/custom/custom-components/x-card-usage-rules.md +0 -63
  198. package/prompts/detail/custom/custom-components/x-cards-usage-rules.md +0 -83
  199. package/prompts/detail/custom/custom-components/x-field-desc-usage-rules.md +0 -120
  200. package/prompts/detail/custom/custom-components/x-field-group-usage-rules.md +0 -80
  201. package/prompts/detail/custom/custom-components/x-field-usage-rules.md +0 -189
  202. package/prompts/detail/custom/custom-components-usage-rules.md +0 -18
  203. package/prompts/detail/diagram/generate-image-system.md +0 -135
  204. package/prompts/detail/diagram/generate-image-user.md +0 -32
  205. package/prompts/detail/diagram/guide.md +0 -29
  206. package/prompts/detail/diagram/official-examples.md +0 -712
  207. package/prompts/detail/diagram/pre-check.md +0 -23
  208. package/prompts/detail/diagram/role-and-personality.md +0 -2
  209. package/prompts/detail/diagram/rules.md +0 -46
  210. package/prompts/detail/diagram/system-prompt.md +0 -1139
  211. package/prompts/detail/diagram/user-prompt.md +0 -43
  212. package/prompts/detail/generate/detail-example.md +0 -457
  213. package/prompts/detail/generate/document-rules.md +0 -45
  214. package/prompts/detail/generate/system-prompt.md +0 -61
  215. package/prompts/detail/generate/user-prompt.md +0 -99
  216. package/prompts/detail/jsx/rules.md +0 -6
  217. package/prompts/detail/update/system-prompt.md +0 -121
  218. package/prompts/detail/update/user-prompt.md +0 -41
  219. package/prompts/evaluate/document-structure.md +0 -93
  220. package/prompts/evaluate/document.md +0 -149
  221. package/prompts/media/media-description/system-prompt.md +0 -43
  222. package/prompts/media/media-description/user-prompt.md +0 -17
  223. package/prompts/structure/check-document-structure.md +0 -93
  224. package/prompts/structure/document-rules.md +0 -21
  225. package/prompts/structure/find-documents-to-add-links.md +0 -52
  226. package/prompts/structure/generate/system-prompt.md +0 -13
  227. package/prompts/structure/generate/user-prompt.md +0 -137
  228. package/prompts/structure/review/structure-review-system.md +0 -81
  229. package/prompts/structure/structure-example.md +0 -89
  230. package/prompts/structure/structure-getting-started.md +0 -10
  231. package/prompts/structure/update/system-prompt.md +0 -93
  232. package/prompts/structure/update/user-prompt.md +0 -43
  233. package/prompts/translate/admonition.md +0 -20
  234. package/prompts/translate/code-block.md +0 -33
  235. package/prompts/utils/analyze-document-feedback-intent.md +0 -54
  236. package/prompts/utils/analyze-structure-feedback-intent.md +0 -43
  237. package/prompts/utils/feedback-refiner.md +0 -105
  238. package/types/document-schema.mjs +0 -55
  239. package/types/document-structure-schema.mjs +0 -261
  240. package/utils/check-document-has-diagram.mjs +0 -95
  241. package/utils/conflict-detector.mjs +0 -149
  242. package/utils/constants/index.mjs +0 -620
  243. package/utils/constants/linter.mjs +0 -102
  244. package/utils/d2-utils.mjs +0 -198
  245. package/utils/debug.mjs +0 -3
  246. package/utils/delete-diagram-images.mjs +0 -99
  247. package/utils/docs-finder-utils.mjs +0 -623
  248. package/utils/evaluate/report-utils.mjs +0 -132
  249. package/utils/extract-api.mjs +0 -32
  250. package/utils/file-utils.mjs +0 -960
  251. package/utils/history-utils.mjs +0 -203
  252. package/utils/icon-map.mjs +0 -26
  253. package/utils/image-compress.mjs +0 -75
  254. package/utils/kroki-utils.mjs +0 -173
  255. package/utils/linter/index.mjs +0 -50
  256. package/utils/load-config.mjs +0 -107
  257. package/utils/markdown/index.mjs +0 -26
  258. package/utils/markdown-checker.mjs +0 -694
  259. package/utils/mermaid-validator.mjs +0 -140
  260. package/utils/mermaid-worker-pool.mjs +0 -250
  261. package/utils/mermaid-worker.mjs +0 -233
  262. package/utils/openapi/index.mjs +0 -28
  263. package/utils/preferences-utils.mjs +0 -175
  264. package/utils/request.mjs +0 -10
  265. package/utils/sync-diagram-to-translations.mjs +0 -262
  266. package/utils/utils.mjs +0 -1354
package/CLAUDE.md ADDED
@@ -0,0 +1,43 @@
1
+ # 项目自定义要求
2
+
3
+ ## 项目概述
4
+
5
+ 本项目用于维护和管理 Claude Code Agent Skills。
6
+
7
+ ## 核心规则
8
+
9
+ 1. **项目结构**
10
+ - 每个文件夹是一个独立的 Skill
11
+ - 每个 Skill 必须包含 `SKILL.md` 文件作为主文档
12
+
13
+ 2. **语言要求**
14
+ - 所有 Skill 的提示词必须使用中文编写
15
+
16
+ 3. **开发规范**
17
+ - 创建或修改 Skill 时,必须使用 `/skill-creator` 获取最佳实践和开发指导
18
+ - 遵循 skill-creator 中定义的所有规范和要求
19
+
20
+ ## 工作流程
21
+
22
+ ### 创建新 Skill
23
+
24
+ ```bash
25
+ # 1. 使用 skill-creator 获取指导
26
+ /skill-creator
27
+
28
+ # 2. 按照 skill-creator 的指导创建 Skill 文件夹和内容
29
+ ```
30
+
31
+ ### 修改现有 Skill
32
+
33
+ ```bash
34
+ # 1. 如需要,使用 skill-creator 获取更新指导
35
+ /skill-creator
36
+
37
+ # 2. 编辑 Skill 文件
38
+ ```
39
+
40
+ ## 重要提醒
41
+
42
+ - 具体的 Skill 开发规范、文件结构、内容要求等,请通过 `/skill-creator` 动态获取
43
+ - skill-creator 会提供最新的最佳实践和详细指导
package/README.md CHANGED
@@ -1,302 +1,200 @@
1
- [![GitHub stars](https://img.shields.io/github/stars/AIGNE-io/aigne-doc-smith?style=flat-square)](https://github.com/AIGNE-io/aigne-doc-smith/stargazers)
2
- [![NPM Version](https://img.shields.io/npm/v/@aigne/doc-smith?style=flat-square)](https://www.npmjs.com/package/@aigne/doc-smith)
3
- [![NPM Downloads](https://img.shields.io/npm/dm/@aigne/doc-smith?style=flat-square)](https://www.npmjs.com/package/@aigne/doc-smith)
4
- [![Open Issues](https://img.shields.io/github/issues-raw/AIGNE-io/aigne-doc-smith?style=flat-square)](https://github.com/AIGNE-io/aigne-doc-smith/issues)
5
- [![License](https://img.shields.io/github/license/AIGNE-io/aigne-doc-smith?style=flat-square)](https://github.com/AIGNE-io/aigne-doc-smith/blob/main/LICENSE)
6
- [![codecov](https://codecov.io/gh/AIGNE-io/aigne-doc-smith/graph/badge.svg?token=95TQO2NKYC)](https://codecov.io/gh/AIGNE-io/aigne-doc-smith)
1
+ # DocSmith Skill
7
2
 
8
- # AIGNE DocSmith
3
+ 从工作区数据源生成全面的结构化文档的 Claude Code Skill。
9
4
 
10
- > 🚀 **AI-powered documentation that understands your code**
5
+ ## 功能特性
11
6
 
12
- AIGNE DocSmith is a powerful, AI-driven documentation tool built on the [AIGNE Framework](https://www.aigne.io/en/framework). It automatically analyzes your codebase to generate comprehensive, structured, and multi-language documentation that stays in sync with your code.
7
+ DocSmith 可以帮助你:
8
+ - 📚 从代码仓库、文本文件和媒体资源生成全面的文档
9
+ - 🏗️ 构建有组织的文档结构和文档站点
10
+ - 📝 分析工作区内容并生成结构化的文档
11
+ - 🔄 将代码/项目内容转换为可读的文档
13
12
 
14
- ## 🎯 Why DocSmith?
13
+ 支持生成:
14
+ - 技术文档
15
+ - 用户指南
16
+ - API 参考
17
+ - 教程和示例
18
+ - 产品文档
15
19
 
16
- - **🧠 Intelligent Analysis**: Understands your code's structure, patterns, and intent.
17
- - **📚 Comprehensive Coverage**: Generates everything from API references to user guides.
18
- - **🌍 Global Ready**: Supports 12 languages with professional-grade translation.
19
- - **🔄 Always Current**: Automatically detects changes and updates documentation accordingly.
20
- - **⚡ Zero Config**: Works out of the box with smart defaults and auto-detection.
20
+ ### 用户意图分析
21
21
 
22
- ## AIGNE Ecosystem
22
+ DocSmith 会自动分析工作区内容,推断:
23
+ - **目标用户** - 文档的主要受众(开发者、运维人员、最终用户等)
24
+ - **使用场景** - 用户查阅文档的情境(首次接触、开发集成、问题排查等)
25
+ - **文档侧重点** - 文档类型(使用指南、API 参考、快速上手、架构说明等)
23
26
 
24
- DocSmith is part of the [AIGNE](https://www.aigne.io) ecosystem, a comprehensive AI application development platform.
27
+ 推断结果会展示给用户确认,支持多轮调整直到满意。
25
28
 
26
- ![AIGNE Ecosystem Architecture](https://docsmith.aigne.io/image-bin/uploads/def424c20bbdb3c77483894fe0e22819.png)
29
+ ### 结构确认机制
27
30
 
28
- As shown in the diagram, DocSmith integrates seamlessly with other [AIGNE](https://www.aigne.io) components, leveraging the platform's AI capabilities and infrastructure.
31
+ 在生成文档前,DocSmith 会展示规划的文档结构:
32
+ - 文档总数和层次关系
33
+ - 每个文档的标题、描述和来源文件
34
+ - 清晰的 emoji 标识便于快速浏览
29
35
 
30
- ## ✨ Features
36
+ 用户可以:
37
+ - 删除/添加文档
38
+ - 调整层次结构(合并、拆分、调整父子关系)
39
+ - 修改内容范围
31
40
 
32
- ### 🤖 AI-Powered Generation
41
+ 只有在用户确认结构后,才会开始生成实际内容。
33
42
 
34
- - **Smart Structure Planning**: Analyzes your codebase to create a logical and comprehensive documentation structure.
35
- - **Intelligent Content Creation**: Generates detailed, contextual content that explains both the "what" and the "why."
36
- - **Adaptive Writing Styles**: Supports multiple documentation styles, including Technical, User-Friendly, and Developer-Focused.
43
+ ## 项目结构
37
44
 
38
- ### 🌍 Multi-Language Support
39
-
40
- - **12 Language Support**: English, Chinese (Simplified & Traditional), Japanese, Korean, Spanish, French, German, Portuguese, Russian, Italian, and Arabic.
41
- - **Professional Translation**: Provides context-aware translations that maintain technical accuracy.
42
- - **Glossary Integration**: Ensures consistent terminology across all languages.
43
-
44
- ### 🔗 Seamless Integration
45
-
46
- - **AIGNE Hub Integration**: Use the [AIGNE Hub](https://www.aigne.io/en/hub) without API keys and switch between Google Gemini, OpenAI GPT, Claude, and more.
47
- - **Multiple LLM Support**: Bring your own API keys for OpenAI, Anthropic, Google, and other providers.
48
- - **One-Click Publishing**: Publish your docs and generate shareable links for your team. Publish to [docsmith.aigne.io](https://docsmith.aigne.io/app/) or your own [Discuss Kit](https://www.web3kit.rocks/discuss-kit) instance.
49
-
50
- ### 🔄 Smart Updates
51
-
52
- - **Change Detection**: Automatically identifies code changes and updates the relevant documentation.
53
- - **Targeted Regeneration**: Updates specific sections with custom feedback and requirements.
54
- - **Version Awareness**: Maintains a history of your documentation and tracks changes over time.
55
-
56
- ## 🚀 Quick Start
57
-
58
- ### Prerequisites
59
-
60
- - Node.js 20+ and npm/pnpm
61
- - No API keys required (uses the AIGNE Hub by default).
62
-
63
- ### 📦 Installation
64
-
65
- Install the AIGNE CLI globally:
66
-
67
- ```bash
68
- npm install -g @aigne/cli
69
- ```
70
-
71
- Verify the installation:
72
-
73
- ```bash
74
- aigne doc --help
75
45
  ```
76
-
77
- ### 🎉 Generate Your First Documentation
78
-
79
- Navigate to your project directory and run:
80
-
81
- ```bash
82
- # One command to generate your documentation
83
- aigne doc create
46
+ doc-smith-skill/
47
+ ├── CLAUDE.md # Claude Code 项目说明
48
+ ├── doc-smith/ # Skill 主目录
49
+ │ ├── SKILL.md # Skill 主文档(中文)
50
+ │ └── references/ # 参考文档
51
+ │ ├── document-structure-schema.md # 文档结构 Schema
52
+ │ ├── structure-confirmation-guide.md # 结构确认指南
53
+ │ ├── structure-planning-guide.md # 结构规划指南
54
+ │ └── user-intent-guide.md # 用户意图指南
55
+ ├── scripts/ # 安装/卸载脚本
56
+ │ ├── install.sh # 安装脚本
57
+ │ ├── uninstall.sh # 卸载脚本
58
+ │ └── README.md # 脚本使用说明
59
+ └── README.md # 本文件
84
60
  ```
85
61
 
86
- DocSmith will:
87
-
88
- 1. 🔍 Auto-detect your project's structure and tech stack.
89
- 2. 🎯 Guide you through an interactive setup (first time only).
90
- 3. 📝 Generate comprehensive documentation.
91
- 4. 🌍 Optionally translate it into multiple languages.
92
- 5. 🚀 Publish it to your preferred platform.
93
-
94
- ## 🔧 Advanced Configuration
95
-
96
- ### LLM Providers
62
+ ## 快速开始
97
63
 
98
- DocSmith supports multiple AI providers:
64
+ ### 1. 安装 Skill
99
65
 
100
- **🎯 AIGNE Hub (Recommended)**
101
-
102
- - ✅ No API keys required.
103
- - ✅ Easy model switching.
104
- - ✅ Built-in rate limiting and optimization.
66
+ 运行安装脚本将 doc-smith 安装到全局 skills 目录:
105
67
 
106
68
  ```bash
107
- # Switch models effortlessly
108
- aigne doc create --model google:gemini-2.5-pro
109
- aigne doc create --model anthropic:claude-sonnet-4-5
110
- aigne doc create --model openai:gpt-4o
69
+ ./scripts/install.sh -y
111
70
  ```
112
71
 
113
- **🔑 Custom API Keys**
114
- Configure your own API keys for direct provider access:
115
-
116
- - OpenAI GPT models
117
- - Anthropic Claude models
118
- - Google Gemini models
119
- - and more...
72
+ ### 2. 使用 Skill
120
73
 
121
- ## 📖 Usage Guide
74
+ #### Workspace 模式 (推荐)
122
75
 
123
- ### Core Commands
76
+ DocSmith 现在使用独立 workspace 目录,不会污染源仓库。
124
77
 
125
- #### 📝 Generate Documentation
78
+ **创建并使用 workspace:**
126
79
 
127
80
  ```bash
128
- # Smart generation with auto-configuration
129
- aigne doc create
81
+ # 1. 创建空目录作为 workspace
82
+ mkdir my-docs-workspace
83
+ cd my-docs-workspace
130
84
 
131
- # Force a complete regeneration of the documentation
132
- aigne doc create --forceRegenerate
133
-
134
- # Generate with custom feedback
135
- aigne doc create --feedback "Add more API examples and troubleshooting sections"
85
+ # 2. 打开 Claude Code 并执行 doc-smith
86
+ # 输入: 使用 doc-smith 生成文档
136
87
  ```
137
88
 
138
- #### 🔄 Update Existing Documents
89
+ **初始化流程:**
90
+ DocSmith 会引导你完成初始化:
91
+ 1. 询问输出语言(如:zh、en)
92
+ 2. 询问源仓库 Git URL(可选,如果源代码在本地可不提供)
93
+ 3. 自动创建目录结构
94
+ 4. 自动添加源仓库为 git submodule(如果提供了 URL)
95
+ 5. 生成 config.yaml 配置文件
96
+ 6. 初始化 git 仓库并提交
97
+
98
+ **后续操作:**
99
+ DocSmith 会:
100
+ 1. 分析源仓库内容
101
+ 2. 推断用户意图
102
+ 3. 规划文档结构
103
+ 4. 生成结构化的 Markdown 文档
104
+ 5. 询问是否提交到 Git
105
+
106
+ ### 3. Workspace 目录结构
139
107
 
140
- ```bash
141
- # Interactively select and update a document
142
- aigne doc update
143
-
144
- # Update specific document with feedback
145
- aigne doc update --docs overview.md --feedback "Add comprehensive FAQ section"
146
108
  ```
147
-
148
- #### 🌍 Multi-Language Translation
149
-
150
- ```bash
151
- # Interactive translation with smart language selection
152
- aigne doc localize
153
-
154
- # Translate specific documents into multiple languages
155
- aigne doc localize --langs zh --langs ja --docs examples.md --docs overview.md
156
-
157
- # Translate with a custom glossary for consistent terminology
158
- aigne doc localize --glossary @path/to/glossary.md --feedback "Use technical terminology consistently"
109
+ my-docs-workspace/ # 独立 workspace 目录
110
+ ├── config.yaml # workspace 配置文件
111
+ ├── sources/ # 源仓库 (git submodule)
112
+ │ └── my-project/
113
+ ├── intent/
114
+ │ └── user-intent.md # 用户意图描述
115
+ ├── planning/
116
+ │ └── document-structure.yaml # 文档结构计划
117
+ ├── docs/ # 生成的文档
118
+ │ ├── overview.md
119
+ │ ├── getting-started.md
120
+ │ └── api/
121
+ │ └── authentication.md
122
+ └── cache/ # 临时数据 (不纳入 git)
159
123
  ```
160
124
 
161
- #### 🚀 Publishing & Deployment
162
-
163
- ```bash
164
- # Interactive publishing with platform selection
165
- aigne doc publish
166
-
167
- # Publish to a custom Discuss Kit instance
168
- aigne doc publish --appUrl https://your-discuss-kit-instance.com
169
- ```
125
+ ### 4. 版本管理
170
126
 
171
- #### ⚙️ Configuration Management
127
+ Workspace 是一个独立的 Git 仓库,支持完整的版本管理:
172
128
 
173
129
  ```bash
174
- # Interactive configuration setup
175
- aigne doc init
130
+ # 查看历史
131
+ git log
176
132
 
177
- # View the current configuration
178
- aigne doc prefs
179
- ```
133
+ # 查看变更
134
+ git diff
180
135
 
181
- ### Configuration Options
136
+ # 回滚版本
137
+ git revert <commit-hash>
182
138
 
183
- DocSmith automatically detects your project's structure, but you can customize it to your needs:
184
-
185
- - **📝 Documentation Styles**: Technical, User-Friendly, Developer-Focused, Academic
186
- - **🎯 Target Audiences**: Developers, End Users, System Administrators, Business Users
187
- - **🌍 Languages**: Choose from 12 supported languages.
188
- - **📁 Source Paths**: Customize which files and directories to analyze.
189
- - **📤 Output Settings**: Configure the documentation structure and formatting.
190
-
191
- ## 🌐 Supported Languages
192
-
193
- DocSmith provides professional-grade translations for 12 languages:
194
-
195
- | Language | Code | Support Level |
196
- | --------- | ------- | ------------- |
197
- | English | `en` | ✅ Native |
198
- | 简体中文 | `zh-CN` | ✅ Full |
199
- | 繁體中文 | `zh-TW` | ✅ Full |
200
- | 日本語 | `ja` | ✅ Full |
201
- | 한국어 | `ko` | ✅ Full |
202
- | Español | `es` | ✅ Full |
203
- | Français | `fr` | ✅ Full |
204
- | Deutsch | `de` | ✅ Full |
205
- | Português | `pt-BR` | ✅ Full |
206
- | Русский | `ru` | ✅ Full |
207
- | Italiano | `it` | ✅ Full |
208
- | العربية | `ar` | ✅ Full |
209
-
210
- ## 🤝 Contributing
211
-
212
- We welcome contributions from the community! Here's how you can help:
139
+ # 推送到远程仓库(可选)
140
+ git remote add origin <your-repo-url>
141
+ git push -u origin main
142
+ ```
213
143
 
214
- ### 🐛 Reporting Issues
144
+ ## 文档说明
215
145
 
216
- - 🔍 [Search existing issues](https://github.com/AIGNE-io/aigne-doc-smith/issues) first.
217
- - 📝 Use our issue templates for bug reports and feature requests.
218
- - 🚨 Include clear reproduction steps and details about your environment.
146
+ - **SKILL.md** - Skill 完整使用指南,包含工作流程、最佳实践等
147
+ - **references/**
148
+ - **document-structure-schema.md** - 文档结构 YAML 的完整 Schema 说明
149
+ - **structure-planning-guide.md** - 文档结构规划指南
150
+ - **structure-confirmation-guide.md** - 结构确认流程指南
151
+ - **user-intent-guide.md** - 用户意图理解指南
219
152
 
220
- ### 💡 Feature Requests
153
+ 所有文档均已翻译为中文,方便理解和编辑。
221
154
 
222
- - 🌟 Share your ideas in [GitHub Discussions](https://github.com/AIGNE-io/aigne-doc-smith/discussions).
223
- - 📋 Check our [roadmap](https://github.com/AIGNE-io/aigne-doc-smith/projects) for planned features.
224
- - 🗳️ Vote on existing feature requests.
155
+ ## 卸载
225
156
 
226
- ### 🔧 Development Setup
157
+ 如需移除 skill:
227
158
 
228
159
  ```bash
229
- # Clone the repository
230
- git clone https://github.com/AIGNE-io/aigne-doc-smith.git
231
- cd aigne-doc-smith
232
-
233
- # Install dependencies
234
- pnpm install
235
-
236
- # Run tests
237
- pnpm test
238
-
239
- # Run the linter
240
- pnpm run lint
241
-
242
- # Automatically fix lint errors
243
- pnpm run lint:fix
160
+ ./scripts/uninstall.sh
244
161
  ```
245
162
 
246
- ### 📜 Code of Conduct
247
-
248
- Please follow our community guidelines and maintain respectful, constructive communication.
249
-
250
- ## 💼 Enterprise & Production Use
251
-
252
- ### 🏢 Enterprise Features
253
-
254
- - **Team Collaboration**: Multi-user workflows with role-based access.
255
- - **Custom Branding**: White-label your documentation with your brand's identity.
256
- - **API Integration**: Use REST APIs for automated documentation pipelines.
257
- - **Analytics**: Track documentation usage and effectiveness.
163
+ ## 手动安装
258
164
 
259
- ### 🔒 Security & Compliance
165
+ 如果脚本无法使用,可以手动安装:
260
166
 
261
- - **Private Cloud**: Deploy on your own infrastructure.
262
- - **SSO Integration**: Connect with your existing identity providers.
263
- - **Audit Logs**: Complete activity tracking and compliance reporting.
264
- - **Data Privacy**: Your code never leaves your environment in private deployments.
265
-
266
- ### 📞 Support & Services
267
-
268
- - **Priority Support**: Get direct access to our engineering team.
269
- - **Custom Training**: We offer team onboarding and best practices workshops.
270
- - **Professional Services**: We provide custom integrations and deployment assistance.
271
-
272
- [Contact us](https://www.aigne.io/contact) for enterprise licensing and deployment options.
273
-
274
- ## 📊 Community & Resources
275
-
276
- ### 📚 Documentation & Tutorials
167
+ ```bash
168
+ mkdir -p ~/.claude/skills
169
+ cp -r doc-smith ~/.claude/skills/
170
+ ```
277
171
 
278
- - 📖 [Documentation](https://docsmith.aigne.io/docs/)
172
+ ## 开发和自定义
279
173
 
280
- ### 💬 Community Support
174
+ 如果你想修改或扩展 doc-smith skill:
281
175
 
282
- - 🐦 [Twitter](https://twitter.com/arcblock_io) - For updates and announcements.
283
- - 🎮 [Community](https://community.arcblock.io/discussions/boards/aigne) - For real-time community chat.
176
+ 1. 编辑 `doc-smith/SKILL.md` 中的说明文档
177
+ 2. 修改 `doc-smith/references/` 中的参考文档
178
+ 3. 运行 `./scripts/install.sh -y` 重新安装
284
179
 
285
- ### 🏆 Showcase
180
+ ## 注意事项
286
181
 
287
- See DocSmith in action with these real-world examples:
182
+ - 确保 Claude Code 已正确安装
183
+ - 确保 Git 已安装(用于 submodule 和版本管理)
184
+ - Workspace 需要在空目录中初始化
185
+ - 生成的文档在独立的 workspace 目录中,不会污染源仓库
288
186
 
289
- - [Docs Repository](https://docsmith.aigne.io/app) - Generated with DocSmith.
187
+ ## 迁移说明
290
188
 
291
- ## 📄 License
189
+ 如果你之前使用过旧版本(`.aigne/doc-smith/` 目录结构),建议:
190
+ 1. 创建新的 workspace 目录
191
+ 2. 重新生成文档
192
+ 3. 旧版本数据可以手动迁移到新的 workspace 目录结构中
292
193
 
293
- This project is licensed under the **Elastic License 2.0**. See the [LICENSE](LICENSE) file for details.
194
+ ## 支持
294
195
 
295
- ### What does this mean?
196
+ 如有问题或建议,请在项目中提出 issue。
296
197
 
297
- - ✅ **Free for most use cases**: Including personal projects, internal use, and most commercial applications.
298
- - ✅ **Open source**: The full source code is available for review and contributions.
299
- - ✅ **Commercial friendly**: Use it in your business applications and services.
300
- - ❌ **Restrictions**: You cannot offer DocSmith as a competing hosted service.
198
+ ## 许可
301
199
 
302
- [Learn more about the Elastic License 2.0](https://www.elastic.co/licensing/elastic-license)
200
+ [根据你的需求添加许可信息]