@aigne/doc-smith 0.9.8-alpha.2 → 0.9.8-alpha.4

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 (256) hide show
  1. package/CLAUDE.md +43 -0
  2. package/README.md +94 -250
  3. package/aigne.yaml +2 -149
  4. package/doc-smith/SKILL.md +117 -0
  5. package/doc-smith/references/changeset_schema.md +118 -0
  6. package/doc-smith/references/document_structure_schema.md +139 -0
  7. package/doc-smith/references/document_update_guide.md +193 -0
  8. package/doc-smith/references/structure_confirmation_guide.md +133 -0
  9. package/doc-smith/references/structure_planning_guide.md +146 -0
  10. package/doc-smith/references/user_intent_guide.md +172 -0
  11. package/doc-smith.yaml +114 -0
  12. package/main-system-prompt.md +56 -0
  13. package/package.json +3 -69
  14. package/scripts/README.md +90 -0
  15. package/scripts/install.sh +86 -0
  16. package/scripts/uninstall.sh +52 -0
  17. package/CHANGELOG.md +0 -994
  18. package/LICENSE +0 -93
  19. package/agentic-agents/common/base-info.md +0 -53
  20. package/agentic-agents/common/planner.md +0 -168
  21. package/agentic-agents/common/worker.md +0 -93
  22. package/agentic-agents/create/index.yaml +0 -118
  23. package/agentic-agents/create/objective.md +0 -44
  24. package/agentic-agents/create/set-custom-prompt.mjs +0 -27
  25. package/agentic-agents/detail/index.yaml +0 -95
  26. package/agentic-agents/detail/objective.md +0 -9
  27. package/agentic-agents/detail/set-custom-prompt.mjs +0 -88
  28. package/agentic-agents/predict-resources/index.yaml +0 -44
  29. package/agentic-agents/predict-resources/instructions.md +0 -61
  30. package/agentic-agents/structure/design-rules.md +0 -39
  31. package/agentic-agents/structure/index.yaml +0 -86
  32. package/agentic-agents/structure/objective.md +0 -14
  33. package/agentic-agents/structure/review-criteria.md +0 -55
  34. package/agentic-agents/structure/set-custom-prompt.mjs +0 -78
  35. package/agentic-agents/utils/init-workspace-cache.mjs +0 -171
  36. package/agentic-agents/utils/load-base-sources.mjs +0 -20
  37. package/agentic-agents/workspace-cache-sharing-design.md +0 -671
  38. package/agents/chat/chat-system.md +0 -38
  39. package/agents/chat/index.mjs +0 -59
  40. package/agents/chat/skills/generate-document.yaml +0 -15
  41. package/agents/chat/skills/list-documents.mjs +0 -15
  42. package/agents/chat/skills/update-document.yaml +0 -24
  43. package/agents/clear/choose-contents.mjs +0 -192
  44. package/agents/clear/clear-auth-tokens.mjs +0 -88
  45. package/agents/clear/clear-deployment-config.mjs +0 -49
  46. package/agents/clear/clear-document-config.mjs +0 -36
  47. package/agents/clear/clear-document-structure.mjs +0 -102
  48. package/agents/clear/clear-generated-docs.mjs +0 -142
  49. package/agents/clear/clear-media-description.mjs +0 -129
  50. package/agents/clear/index.yaml +0 -26
  51. package/agents/create/analyze-diagram-type-llm.yaml +0 -160
  52. package/agents/create/analyze-diagram-type.mjs +0 -297
  53. package/agents/create/check-document-structure.yaml +0 -30
  54. package/agents/create/check-need-generate-structure.mjs +0 -105
  55. package/agents/create/document-structure-tools/add-document.mjs +0 -85
  56. package/agents/create/document-structure-tools/delete-document.mjs +0 -116
  57. package/agents/create/document-structure-tools/move-document.mjs +0 -109
  58. package/agents/create/document-structure-tools/update-document.mjs +0 -84
  59. package/agents/create/generate-diagram-image.yaml +0 -60
  60. package/agents/create/generate-structure.yaml +0 -117
  61. package/agents/create/index.yaml +0 -49
  62. package/agents/create/refine-document-structure.yaml +0 -12
  63. package/agents/create/replace-d2-with-image.mjs +0 -625
  64. package/agents/create/update-document-structure.yaml +0 -54
  65. package/agents/create/user-add-document/add-documents-to-structure.mjs +0 -90
  66. package/agents/create/user-add-document/find-documents-to-add-links.yaml +0 -47
  67. package/agents/create/user-add-document/index.yaml +0 -46
  68. package/agents/create/user-add-document/prepare-documents-to-translate.mjs +0 -22
  69. package/agents/create/user-add-document/print-add-document-summary.mjs +0 -63
  70. package/agents/create/user-add-document/review-documents-with-new-links.mjs +0 -110
  71. package/agents/create/user-remove-document/find-documents-with-invalid-links.mjs +0 -78
  72. package/agents/create/user-remove-document/index.yaml +0 -40
  73. package/agents/create/user-remove-document/prepare-documents-to-translate.mjs +0 -22
  74. package/agents/create/user-remove-document/print-remove-document-summary.mjs +0 -53
  75. package/agents/create/user-remove-document/remove-documents-from-structure.mjs +0 -99
  76. package/agents/create/user-remove-document/review-documents-with-invalid-links.mjs +0 -115
  77. package/agents/create/user-review-document-structure.mjs +0 -140
  78. package/agents/create/utils/init-current-content.mjs +0 -34
  79. package/agents/create/utils/merge-document-structures.mjs +0 -30
  80. package/agents/evaluate/code-snippet.mjs +0 -97
  81. package/agents/evaluate/document-structure.yaml +0 -67
  82. package/agents/evaluate/document.yaml +0 -82
  83. package/agents/evaluate/generate-report.mjs +0 -85
  84. package/agents/evaluate/index.yaml +0 -46
  85. package/agents/history/index.yaml +0 -6
  86. package/agents/history/view.mjs +0 -78
  87. package/agents/init/check.mjs +0 -16
  88. package/agents/init/index.mjs +0 -275
  89. package/agents/init/validate.mjs +0 -16
  90. package/agents/localize/choose-language.mjs +0 -107
  91. package/agents/localize/index.yaml +0 -58
  92. package/agents/localize/record-translation-history.mjs +0 -23
  93. package/agents/localize/translate-document.yaml +0 -24
  94. package/agents/localize/translate-multilingual.yaml +0 -51
  95. package/agents/media/batch-generate-media-description.yaml +0 -46
  96. package/agents/media/generate-media-description.yaml +0 -50
  97. package/agents/media/load-media-description.mjs +0 -256
  98. package/agents/prefs/index.mjs +0 -203
  99. package/agents/publish/index.yaml +0 -26
  100. package/agents/publish/publish-docs.mjs +0 -356
  101. package/agents/publish/translate-meta.mjs +0 -103
  102. package/agents/schema/document-structure-item.yaml +0 -26
  103. package/agents/schema/document-structure-refine-item.yaml +0 -23
  104. package/agents/schema/document-structure.yaml +0 -29
  105. package/agents/update/batch-generate-document.yaml +0 -27
  106. package/agents/update/batch-update-document.yaml +0 -7
  107. package/agents/update/check-diagram-flag.mjs +0 -116
  108. package/agents/update/check-document.mjs +0 -162
  109. package/agents/update/check-generate-diagram.mjs +0 -106
  110. package/agents/update/check-sync-image-flag.mjs +0 -55
  111. package/agents/update/check-update-is-single.mjs +0 -53
  112. package/agents/update/document-tools/update-document-content.mjs +0 -303
  113. package/agents/update/generate-diagram.yaml +0 -63
  114. package/agents/update/generate-document.yaml +0 -70
  115. package/agents/update/handle-document-update.yaml +0 -103
  116. package/agents/update/index.yaml +0 -79
  117. package/agents/update/pre-check-generate-diagram.yaml +0 -44
  118. package/agents/update/save-and-translate-document.mjs +0 -76
  119. package/agents/update/sync-images-and-exit.mjs +0 -148
  120. package/agents/update/update-document-detail.yaml +0 -71
  121. package/agents/update/update-single/update-single-document-detail.mjs +0 -280
  122. package/agents/update/update-single-document.yaml +0 -7
  123. package/agents/update/user-review-document.mjs +0 -272
  124. package/agents/utils/action-success.mjs +0 -16
  125. package/agents/utils/analyze-document-feedback-intent.yaml +0 -32
  126. package/agents/utils/analyze-feedback-intent.mjs +0 -136
  127. package/agents/utils/analyze-structure-feedback-intent.yaml +0 -29
  128. package/agents/utils/check-detail-result.mjs +0 -38
  129. package/agents/utils/check-feedback-refiner.mjs +0 -81
  130. package/agents/utils/choose-docs.mjs +0 -293
  131. package/agents/utils/document-icon-generate.yaml +0 -52
  132. package/agents/utils/document-title-streamline.yaml +0 -48
  133. package/agents/utils/ensure-document-icons.mjs +0 -129
  134. package/agents/utils/exit.mjs +0 -6
  135. package/agents/utils/feedback-refiner.yaml +0 -50
  136. package/agents/utils/find-item-by-path.mjs +0 -114
  137. package/agents/utils/find-user-preferences-by-path.mjs +0 -37
  138. package/agents/utils/format-document-structure.mjs +0 -35
  139. package/agents/utils/generate-document-or-skip.mjs +0 -41
  140. package/agents/utils/handle-diagram-operations.mjs +0 -263
  141. package/agents/utils/load-all-document-content.mjs +0 -30
  142. package/agents/utils/load-document-all-content.mjs +0 -84
  143. package/agents/utils/load-sources.mjs +0 -405
  144. package/agents/utils/map-reasoning-effort-level.mjs +0 -15
  145. package/agents/utils/post-generate.mjs +0 -144
  146. package/agents/utils/read-current-document-content.mjs +0 -46
  147. package/agents/utils/save-doc-translation.mjs +0 -61
  148. package/agents/utils/save-doc.mjs +0 -88
  149. package/agents/utils/save-output.mjs +0 -26
  150. package/agents/utils/save-sidebar.mjs +0 -51
  151. package/agents/utils/skip-if-content-exists.mjs +0 -27
  152. package/agents/utils/streamline-document-titles-if-needed.mjs +0 -88
  153. package/agents/utils/transform-detail-data-sources.mjs +0 -45
  154. package/agents/utils/update-branding.mjs +0 -84
  155. package/assets/report-template/report.html +0 -198
  156. package/docs-mcp/analyze-content-relevance.yaml +0 -50
  157. package/docs-mcp/analyze-docs-relevance.yaml +0 -59
  158. package/docs-mcp/docs-search.yaml +0 -42
  159. package/docs-mcp/get-docs-detail.mjs +0 -41
  160. package/docs-mcp/get-docs-structure.mjs +0 -16
  161. package/docs-mcp/read-doc-content.mjs +0 -119
  162. package/prompts/common/document/content-rules-core.md +0 -20
  163. package/prompts/common/document/markdown-syntax-rules.md +0 -65
  164. package/prompts/common/document/media-file-list-usage-rules.md +0 -18
  165. package/prompts/common/document/openapi-usage-rules.md +0 -189
  166. package/prompts/common/document/role-and-personality.md +0 -16
  167. package/prompts/common/document/user-preferences.md +0 -9
  168. package/prompts/common/document-structure/conflict-resolution-guidance.md +0 -16
  169. package/prompts/common/document-structure/document-icon-generate.md +0 -116
  170. package/prompts/common/document-structure/document-structure-rules.md +0 -43
  171. package/prompts/common/document-structure/document-title-streamline.md +0 -86
  172. package/prompts/common/document-structure/glossary.md +0 -7
  173. package/prompts/common/document-structure/intj-traits.md +0 -5
  174. package/prompts/common/document-structure/openapi-usage-rules.md +0 -28
  175. package/prompts/common/document-structure/output-constraints.md +0 -18
  176. package/prompts/common/document-structure/user-locale-rules.md +0 -10
  177. package/prompts/common/document-structure/user-preferences.md +0 -9
  178. package/prompts/detail/custom/admonition-usage-rules.md +0 -94
  179. package/prompts/detail/custom/code-block-usage-rules.md +0 -163
  180. package/prompts/detail/custom/custom-components/x-card-usage-rules.md +0 -63
  181. package/prompts/detail/custom/custom-components/x-cards-usage-rules.md +0 -83
  182. package/prompts/detail/custom/custom-components/x-field-desc-usage-rules.md +0 -120
  183. package/prompts/detail/custom/custom-components/x-field-group-usage-rules.md +0 -80
  184. package/prompts/detail/custom/custom-components/x-field-usage-rules.md +0 -189
  185. package/prompts/detail/custom/custom-components-usage-rules.md +0 -18
  186. package/prompts/detail/diagram/generate-image-system.md +0 -135
  187. package/prompts/detail/diagram/generate-image-user.md +0 -32
  188. package/prompts/detail/diagram/guide.md +0 -29
  189. package/prompts/detail/diagram/official-examples.md +0 -712
  190. package/prompts/detail/diagram/pre-check.md +0 -23
  191. package/prompts/detail/diagram/role-and-personality.md +0 -2
  192. package/prompts/detail/diagram/rules.md +0 -46
  193. package/prompts/detail/diagram/system-prompt.md +0 -1139
  194. package/prompts/detail/diagram/user-prompt.md +0 -43
  195. package/prompts/detail/generate/detail-example.md +0 -457
  196. package/prompts/detail/generate/document-rules.md +0 -45
  197. package/prompts/detail/generate/system-prompt.md +0 -61
  198. package/prompts/detail/generate/user-prompt.md +0 -99
  199. package/prompts/detail/jsx/rules.md +0 -6
  200. package/prompts/detail/update/system-prompt.md +0 -121
  201. package/prompts/detail/update/user-prompt.md +0 -41
  202. package/prompts/evaluate/document-structure.md +0 -93
  203. package/prompts/evaluate/document.md +0 -149
  204. package/prompts/media/media-description/system-prompt.md +0 -43
  205. package/prompts/media/media-description/user-prompt.md +0 -17
  206. package/prompts/structure/check-document-structure.md +0 -93
  207. package/prompts/structure/document-rules.md +0 -21
  208. package/prompts/structure/find-documents-to-add-links.md +0 -52
  209. package/prompts/structure/generate/system-prompt.md +0 -13
  210. package/prompts/structure/generate/user-prompt.md +0 -137
  211. package/prompts/structure/review/structure-review-system.md +0 -81
  212. package/prompts/structure/structure-example.md +0 -89
  213. package/prompts/structure/structure-getting-started.md +0 -10
  214. package/prompts/structure/update/system-prompt.md +0 -93
  215. package/prompts/structure/update/user-prompt.md +0 -43
  216. package/prompts/translate/admonition.md +0 -20
  217. package/prompts/translate/code-block.md +0 -33
  218. package/prompts/translate/glossary.md +0 -6
  219. package/prompts/translate/translate-document.md +0 -305
  220. package/prompts/utils/analyze-document-feedback-intent.md +0 -54
  221. package/prompts/utils/analyze-structure-feedback-intent.md +0 -43
  222. package/prompts/utils/feedback-refiner.md +0 -105
  223. package/types/document-schema.mjs +0 -55
  224. package/types/document-structure-schema.mjs +0 -261
  225. package/utils/auth-utils.mjs +0 -275
  226. package/utils/blocklet.mjs +0 -104
  227. package/utils/check-document-has-diagram.mjs +0 -95
  228. package/utils/conflict-detector.mjs +0 -149
  229. package/utils/constants/index.mjs +0 -620
  230. package/utils/constants/linter.mjs +0 -102
  231. package/utils/d2-utils.mjs +0 -198
  232. package/utils/debug.mjs +0 -3
  233. package/utils/delete-diagram-images.mjs +0 -99
  234. package/utils/deploy.mjs +0 -86
  235. package/utils/docs-finder-utils.mjs +0 -623
  236. package/utils/evaluate/report-utils.mjs +0 -132
  237. package/utils/extract-api.mjs +0 -32
  238. package/utils/file-utils.mjs +0 -960
  239. package/utils/history-utils.mjs +0 -203
  240. package/utils/icon-map.mjs +0 -26
  241. package/utils/image-compress.mjs +0 -75
  242. package/utils/kroki-utils.mjs +0 -173
  243. package/utils/linter/index.mjs +0 -50
  244. package/utils/load-config.mjs +0 -107
  245. package/utils/markdown/index.mjs +0 -26
  246. package/utils/markdown-checker.mjs +0 -694
  247. package/utils/mermaid-validator.mjs +0 -140
  248. package/utils/mermaid-worker-pool.mjs +0 -250
  249. package/utils/mermaid-worker.mjs +0 -233
  250. package/utils/openapi/index.mjs +0 -28
  251. package/utils/preferences-utils.mjs +0 -175
  252. package/utils/request.mjs +0 -10
  253. package/utils/store/index.mjs +0 -45
  254. package/utils/sync-diagram-to-translations.mjs +0 -262
  255. package/utils/upload-files.mjs +0 -231
  256. package/utils/utils.mjs +0 -1354
package/LICENSE DELETED
@@ -1,93 +0,0 @@
1
- Elastic License 2.0
2
-
3
- URL: https://www.elastic.co/licensing/elastic-license
4
-
5
- ## Acceptance
6
-
7
- By using the software, you agree to all of the terms and conditions below.
8
-
9
- ## Copyright License
10
-
11
- The licensor grants you a non-exclusive, royalty-free, worldwide,
12
- non-sublicensable, non-transferable license to use, copy, distribute, make
13
- available, and prepare derivative works of the software, in each case subject to
14
- the limitations and conditions below.
15
-
16
- ## Limitations
17
-
18
- You may not provide the software to third parties as a hosted or managed
19
- service, where the service provides users with access to any substantial set of
20
- the features or functionality of the software.
21
-
22
- You may not move, change, disable, or circumvent the license key functionality
23
- in the software, and you may not remove or obscure any functionality in the
24
- software that is protected by the license key.
25
-
26
- You may not alter, remove, or obscure any licensing, copyright, or other notices
27
- of the licensor in the software. Any use of the licensor’s trademarks is subject
28
- to applicable law.
29
-
30
- ## Patents
31
-
32
- The licensor grants you a license, under any patent claims the licensor can
33
- license, or becomes able to license, to make, have made, use, sell, offer for
34
- sale, import and have imported the software, in each case subject to the
35
- limitations and conditions in this license. This license does not cover any
36
- patent claims that you cause to be infringed by modifications or additions to
37
- the software. If you or your company make any written claim that the software
38
- infringes or contributes to infringement of any patent, your patent license for
39
- the software granted under these terms ends immediately. If your company makes
40
- such a claim, your patent license ends immediately for work on behalf of your
41
- company.
42
-
43
- ## Notices
44
-
45
- You must ensure that anyone who gets a copy of any part of the software from you
46
- also gets a copy of these terms.
47
-
48
- If you modify the software, you must include in any modified copies of the
49
- software prominent notices stating that you have modified the software.
50
-
51
- ## No Other Rights
52
-
53
- These terms do not imply any licenses other than those expressly granted in
54
- these terms.
55
-
56
- ## Termination
57
-
58
- If you use the software in violation of these terms, such use is not licensed,
59
- and your licenses will automatically terminate. If the licensor provides you
60
- with a notice of your violation, and you cease all violation of this license no
61
- later than 30 days after you receive that notice, your licenses will be
62
- reinstated retroactively. However, if you violate these terms after such
63
- reinstatement, any additional violation of these terms will cause your licenses
64
- to terminate automatically and permanently.
65
-
66
- ## No Liability
67
-
68
- *As far as the law allows, the software comes as is, without any warranty or
69
- condition, and the licensor will not be liable to you for any damages arising
70
- out of these terms or the use or nature of the software, under any kind of
71
- legal claim.*
72
-
73
- ## Definitions
74
-
75
- The **licensor** is the entity offering these terms, and the **software** is the
76
- software the licensor makes available under these terms, including any portion
77
- of it.
78
-
79
- **you** refers to the individual or entity agreeing to these terms.
80
-
81
- **your company** is any legal entity, sole proprietorship, or other kind of
82
- organization that you work for, plus all organizations that have control over,
83
- are under the control of, or are under common control with that
84
- organization. **control** means ownership of substantially all the assets of an
85
- entity, or the power to direct its management and policies by vote, contract, or
86
- otherwise. Control can be direct or indirect.
87
-
88
- **your licenses** are all the licenses granted to you for the software under
89
- these terms.
90
-
91
- **use** means anything you do with the software requiring one of your licenses.
92
-
93
- **trademark** means trademarks, service marks, and similar rights.
@@ -1,53 +0,0 @@
1
- ### DocSmith 基本信息
2
- DocSmith 是一个基于用户提供的数据源,生成文档结构、文档内容的工具。
3
-
4
- #### 输入
5
- 用户提供的任意数据源:
6
- - 代码仓库
7
- - 任意格式的文本内容
8
- - 媒体资源,图片、视频等。
9
-
10
- #### 功能
11
- 提供以下功能:
12
- - 自动分析 workspace 中的数据源
13
- - 规划生成文档结构
14
- - 基于文档结构为所有节点生成文档详情
15
- - 合理使用数据源中的媒体资源
16
-
17
- #### 输出
18
- DocSmith 的所有输出都在 /modules/doc-smith 中,包含以下输出:
19
- - 文档结构
20
- - 文档内容
21
-
22
- ##### 文档结构:/modules/doc-smith/output/document_structure.yaml
23
- 规划需要生成的文档列表、层级关系、每篇文档计划展示的内容。
24
- 数据格式:
25
- ```yaml
26
- project:
27
- title: "xxx" // 项目名称
28
- description: "xxx" // 项目描述
29
- documents: // 文档列表
30
- - title: "xxx" // 文档标题
31
- description: "xxx" // 文档描述
32
- path: "xxx" // 文档路径,示例: /overview.md 、/getting-started.md
33
- sourcePaths: // 文件路径数组(不是目录) - 不带 'workspace:' 前缀的相对路径
34
- -xxx
35
- icon: "lucide:xxx" // 为一级文档生成 icon ,Must be a valid **Lucide icon name** in the format: `lucide:icon-name`
36
- - title: "xxx"
37
- description: "xxx"
38
- path: "xxx"
39
- sourcePaths:
40
- -xxx
41
- children: // 子级文档,可嵌套
42
- - title: "xxx"
43
- description: "xxx"
44
- sourcePaths:
45
- -xxx
46
- path: "xxx"
47
- ```
48
-
49
- ##### 文档详情:/modules/doc-smith/docs/xxx.md
50
- 文档详情以 markdown 的格式输出在 /modules/doc-smith/docs 目录中,根据文档的 `path` 生成文件名。
51
-
52
- 文档详情要求:
53
- - 在开头和结尾引导阅读关联文档,并提供关联文档链接
@@ -1,168 +0,0 @@
1
- Your responsibility is to decide the next tasks based on the current execution state.
2
-
3
- ## Responsibilities
4
-
5
- You are the Planner in the Orchestrator. The entire Orchestrator completes tasks through collaboration of three roles:
6
-
7
- 1. **Planner (you)** analyzes the current state and outputs "nextTasks" (one or more tasks)
8
- 2. **Worker** executes the tasks and updates the execution state
9
- 3. **Loop back to step 1**, Planner plans the next tasks based on the new state
10
- 4. **Repeat steps 1-3** until Planner determines the objective is complete
11
- 5. **Planner** sets `finished: true`
12
- 6. **Completer** generates the final report and returns it to the user
13
-
14
- ## Environment
15
-
16
- {{ $afs.description }}
17
-
18
- ```yaml alt="The modules available in the AFS"
19
- {{ $afs.modules | yaml.stringify }}
20
- ```
21
-
22
- The workspace directory is located at: `/modules/workspace/`
23
- The DocSmith directory is located at: `/modules/doc-smith/`
24
-
25
- ## Workspace Directory Structure Cache
26
-
27
- To reduce redundant `afs_list` calls, the following is a cached overview of the workspace directory structure:
28
-
29
- ```yaml alt="The cached directory structure of the workspace"
30
- {{ $afs.list(workspace, { maxChildren: 50, maxDepth: 10, format: 'tree' }) | yaml.stringify }}
31
- ```
32
-
33
- To reduce redundant `afs_list` calls, the following is a cached overview of the doc-smith directory structure:
34
- ```yaml alt="The cached directory structure of the doc-smith"
35
- {{ $afs.list(doc_smith_workspace, { maxChildren: 50, maxDepth: 10, format: 'tree' }) | yaml.stringify }}
36
- ```
37
-
38
- **Important Notes**:
39
- - Refer to the above directory structure first to avoid redundant `afs_list` calls
40
- - If you need deeper levels or filtered directories, you can still use the `afs_list` tool
41
- - If you need to read the contents of multiple files, use multiple afs_read calls at once to read them in batch.
42
-
43
- ## Interaction History
44
-
45
- ```yaml alt="The history of interactions provide context for planning"
46
- {{ $afs.histories | yaml.stringify }}
47
- ```
48
-
49
- ## User's Objective
50
-
51
- ```txt alt="The user's next objective you need to plan for"
52
- {{ objective }}
53
- ```
54
-
55
- ## Current Execution State
56
-
57
- ```yaml alt="The latest execution state"
58
- {{ executionState | yaml.stringify }}
59
- ```
60
-
61
- ## Current Data State
62
-
63
- ```yaml alt="The latest document structure"
64
- {{ $afs.read(document_structure_path) | yaml.stringify }}
65
- ```
66
-
67
- ## How to Plan the Next Tasks
68
-
69
- ### 1. Determine if Tasks Are Needed
70
-
71
- First, assess whether the objective requires any tasks at all. Ask yourself:
72
-
73
- **Does this objective require tasks?**
74
-
75
- Consider if completing the objective needs:
76
- - **Information gathering**: Does it need to explore directories, read files, or fetch data?
77
- - **Analysis or processing**: Does it need to analyze code, process data, or perform computations?
78
- - **State dependency**: Does it depend on information not yet in the execution state?
79
-
80
- **Set `finished: true` immediately when:**
81
- - The objective requires no exploration, analysis, or information gathering
82
- - The current execution state already contains everything needed to respond
83
- - The objective is purely conversational without requiring any action
84
-
85
- **Plan tasks when:**
86
- - The objective requires gathering information from the file system, code, or documentation
87
- - The objective requires analysis, processing, or computation to be performed
88
- - Additional information must be collected before a complete response can be given
89
-
90
- ### 2. Analyze Information Requirements
91
-
92
- If tasks are needed, think about the current state and objective:
93
- - What information is needed to complete the objective?
94
- - Where can this information be obtained from? (directory structure, config files, source code, documentation, etc.)
95
- - What information has already been collected? What is still missing?
96
- - Is deeper exploration needed, or is it ready to generate a summary?
97
-
98
- ### 3. Decision Principles
99
-
100
- - **Plan one or more tasks per iteration**: You can output multiple tasks when they are independent
101
- - **Only decide, don't execute**: You only output task descriptions, actual execution is done by the Worker
102
- - **Trust the iterative process**: You will be called again after tasks complete, allowing you to adjust the plan dynamically
103
- - **Avoid duplicate work**: Review the execution history to understand what has been completed
104
- - **Goal-oriented descriptions**: Task descriptions should state "what to do", not "how to do it"
105
-
106
- ### 4. Parallel vs Sequential Execution
107
-
108
- You can specify whether tasks should run in parallel or sequentially using \`parallelTasks\`.
109
-
110
- **IMPORTANT: When tasks run in parallel, they CANNOT see each other's results.** Each parallel task receives the same execution state snapshot from before this batch started.
111
-
112
- **Set \`parallelTasks: true\` ONLY when ALL conditions are met:**
113
- - Tasks operate on **completely independent** data sources or resources
114
- - Task results are **not needed by other tasks** in the same batch
115
- - Tasks have **no ordering requirements** between them
116
- - You are **100% certain** there are no dependencies
117
-
118
- **Set \`parallelTasks: false\` (default) when ANY of these apply:**
119
- - Any task needs results from another task in the same batch
120
- - Tasks must be executed in a specific order
121
- - Tasks operate on shared resources that could conflict
122
- - You are **uncertain** whether tasks are truly independent
123
-
124
- **When in doubt, use sequential execution.** It's safer to be slower than to produce incorrect results.
125
-
126
- ### 5. Decision Making at Different Stages
127
-
128
- Flexibly decide the next step based on current progress:
129
-
130
- **Exploration Stage**:
131
- - Plan exploration tasks, specifying which directories or files to examine
132
- - If exploring multiple independent sources, consider parallel execution
133
-
134
- **Processing Stage**:
135
- - Process gathered information
136
- - Use sequential execution when processing depends on previous results
137
-
138
- **Summary Stage**:
139
- - When sufficient information is collected, plan to generate a summary or report task
140
-
141
- **Completion Stage**:
142
- - Set `finished: true` when:
143
- - The objective doesn't require any tasks (simple greetings, already answered questions)
144
- - All necessary tasks are completed
145
- - The objective is fully achieved
146
- - This will trigger the Completer to integrate all information and generate the final report
147
-
148
- ### Supplementary rules
149
- {{ customPlannerPrompt }}
150
-
151
- ## Domain Knowledge
152
- {{ domainKnowledge }}
153
-
154
- ## Output Format
155
-
156
- ```yaml
157
- nextTasks: # List of tasks to execute (omit if finished)
158
- - "task description 1"
159
- - "task description 2"
160
- parallelTasks: false # true if tasks can run in parallel, false for sequential (default: false)
161
- finished: false # true if objective is achieved and no more tasks needed
162
- ```
163
-
164
- **Notes:**
165
- - Task descriptions should be **goal-oriented**, not specifying concrete operations
166
- - Let the worker autonomously decide how to complete each task
167
- - Default to sequential execution (\`parallelTasks: false\`) unless you're certain tasks are independent
168
- - When \`finished: true\`, omit \`nextTasks\`
@@ -1,93 +0,0 @@
1
- You are a task execution agent. Your job is to execute the specific task assigned to you - nothing more, nothing less.
2
-
3
- ## Environment
4
-
5
- {{ $afs.description }}
6
-
7
- When you need to execute multiple AFS operations, you can perform them in batches, such as reading the contents of several required files at the same time.
8
-
9
- ```yaml alt="The modules available in the AFS"
10
- {{ $afs.modules | yaml.stringify }}
11
- ```
12
-
13
- The workspace directory is located at: `/modules/workspace/`
14
- The DocSmith directory is located at: `/modules/doc-smith/`
15
-
16
- ## Workspace Directory Structure Cache
17
-
18
- To reduce redundant `afs_list` calls, the following is a cached overview of the workspace directory structure (up to 3 levels deep):
19
-
20
- ```yaml alt="The cached directory structure of the workspace"
21
- {{ $afs.list(workspace, { maxChildren: 50, maxDepth: 10 }) | yaml.stringify }}
22
- ```
23
-
24
- ```yaml alt="The cached directory structure of the Doc Smith workspace"
25
- {{ $afs.list(doc_smith_workspace, { maxChildren: 50, maxDepth: 10 }) | yaml.stringify }}
26
- ```
27
-
28
- **Important Notes**:
29
- - Refer to the above directory structure first to avoid redundant `afs_list` calls
30
- - If you need deeper levels or filtered directories, you can still use the `afs_list` tool
31
- - If you need to read the contents of multiple files, use multiple afs_read calls at once to read them in batch.
32
-
33
- ## Prefetched File Contents for Reference
34
-
35
- ```yaml alt="The prefetched file contents that may help planning"
36
- {{ $afs.search("/", task, {preset: "predict-resources"}) | yaml.stringify }}
37
- ```
38
-
39
- **Important Notes**:
40
- - Refer to the above prefetched file contents first to avoid redundant `afs_read` calls
41
- - The files above have been intelligently predicted based on your task and are most likely to be relevant
42
- - If you need to read additional files not listed above, you can still use the `afs_read` tool
43
-
44
- ## User's Objective
45
-
46
- ```txt alt="The user's objective provide for context only"
47
- {{ objective }}
48
- ```
49
-
50
- **CRITICAL CONSTRAINT**: The objective above is provided ONLY for context. You must NOT attempt to:
51
- - Solve the entire objective
52
- - Plan additional steps beyond your current task
53
- - Make decisions about what should happen next
54
- - Execute any tasks other than the one explicitly assigned to you below
55
-
56
- ## Latest Execution State
57
-
58
- ```yaml alt="The latest execution state for your reference"
59
- {{ executionState | yaml.stringify }}
60
- ```
61
-
62
- ## Your Current Task
63
-
64
- ```txt alt="The specific task you need to execute now"
65
- {{ task }}
66
- ```
67
-
68
- ## Important Instructions
69
- - Focus EXCLUSIVELY on completing the current task described above
70
- - The task is self-contained - execute it completely and accurately
71
- - Do NOT perform additional tasks beyond what is specified
72
- - Do NOT try to determine what should happen after this task
73
- - Use the available tools and skills to accomplish this specific task
74
- - Return a clear result that the planner can use to decide the next step
75
-
76
- ### Efficient Information Retrieval Strategy
77
- When your task requires checking directories or reading files:
78
- 1. Check prefetched information first: Review the "Workspace Directory Structure Cache" and "Prefetched File Contents" sections above
79
- 2. Only use tools when necessary: If the required information is already provided, use it directly without making redundant `afs_list` or `afs_read` calls
80
- 3. Batch operations when needed: If you need additional information not already provided, make multiple tool calls at once for efficiency
81
-
82
- ## Current Data State
83
-
84
- ```yaml alt="The latest document structure"
85
- {{ $afs.read(document_structure_path) | yaml.stringify }}
86
- ```
87
-
88
- ## Domain Knowledge
89
- {{ domainKnowledge }}
90
-
91
-
92
- ## Output Format
93
- Return your task execution result as a structured response. The output schema will guide you on the required fields.
@@ -1,118 +0,0 @@
1
- type: team
2
- name: DocSmith
3
- alias:
4
- - run
5
- description: DocSmith entry point for documentation generation, editing, and translation
6
- input_schema:
7
- type: object
8
- properties:
9
- message:
10
- type: string
11
- description: User feedback describing what documentation tasks to perform (natural language)
12
- changeset:
13
- type: string
14
- description: 通过 Changeset 描述一批希望执行的变更
15
- required: []
16
- default_input:
17
- workspace: /modules/workspace
18
- doc_smith_workspace: /modules/doc-smith
19
- document_structure_path: /modules/doc-smith/output/document_structure.yaml
20
-
21
- skills:
22
- - url: ../../agents/init/index.mjs
23
- default_input:
24
- skipIfExists: true
25
- # - ../utils/init-workspace-cache.mjs
26
- - ../utils/load-base-sources.mjs
27
- - ./set-custom-prompt.mjs
28
- - type: "@aigne/agent-library/orchestrator"
29
- objective:
30
- url: objective.md
31
-
32
- planner:
33
- type: ai
34
- model: anthropic/claude-opus-4-5
35
- instructions:
36
- url: ../common/planner.md
37
- input_schema:
38
- type: object
39
- properties:
40
- workspace:
41
- type: string
42
- description: The workspace path
43
- doc_smith_workspace:
44
- type: string
45
- description: The Doc Smith workspace path
46
- document_structure_path:
47
- type: string
48
- description: The document structure path
49
- customPlannerPrompt:
50
- type: string
51
- description: The custom planner prompt
52
- domainKnowledge:
53
- type: string
54
- description: The domain knowledge
55
-
56
- worker:
57
- type: ai
58
- model: gemini-3-pro-preview
59
- instructions:
60
- url: ../common/worker.md
61
- input_schema:
62
- type: object
63
- properties:
64
- workspace:
65
- type: string
66
- description: The workspace path
67
- doc_smith_workspace:
68
- type: string
69
- description: The Doc Smith workspace path
70
- domainKnowledge:
71
- type: string
72
- description: The domain knowledge
73
- document_structure_path:
74
- type: string
75
- description: The document structure path
76
- # skills:
77
- # - ../structure/index.yaml
78
- # - ../detail/index.yaml
79
-
80
- # completer:
81
- # type: function
82
- # process: |
83
- # let message = 'All tasks have been completed.';
84
- # return { message };
85
-
86
- state_management:
87
- max_iterations: 50
88
- max_tokens: 200000
89
- keep_recent: 30
90
-
91
- # shareAfs: true
92
- afs:
93
- # storage:
94
- # url: .afs
95
- modules:
96
- - module: local-fs
97
- options:
98
- name: doc-smith
99
- localPath: .aigne/doc-smith
100
- description: The Doc Smith workspace for storing intermediate and output files
101
- - module: local-fs
102
- options:
103
- name: workspace
104
- localPath: .
105
- description: The target repository containing source code and documentation. Read-only, cannot be modified.
106
- ignore:
107
- - ".git"
108
- - ".aigne"
109
- context:
110
- search:
111
- presets:
112
- predict-resources:
113
- select:
114
- agent: "../predict-resources/index.yaml"
115
- # drivers:
116
- # - driver: i18n
117
- # options:
118
- # defaultSourceLanguage: zh
@@ -1,44 +0,0 @@
1
- {% if structureContent %}
2
- 文档已在 `/modules/doc-smith`目录下生成:
3
- 1. 检查文档结构中的每篇都已生成了详情,如果有缺失,请为缺失的文档生成详情
4
- 2. 根据我的反馈修改文档
5
- {% else %}
6
- 请为当前仓库生成文档:
7
- 1. 生成文档结构
8
- 2. 为文档结构中的每篇文档生成详情
9
- {% endif %}
10
-
11
- 我对文档的要求:
12
- 文档使用 {{locale }} 语言。
13
-
14
- {% if rules %}
15
- {{ rules }}
16
- {% endif %}
17
-
18
-
19
- {% if message %}
20
- 我的反馈意见:
21
- {{ message }}
22
- {% endif %}
23
-
24
- {% if changeset %}
25
- 请分析我反馈的 ChangeSet ,规划任务实施修改:
26
- ```txt
27
- {{ changeset }}
28
- ```
29
- {% endif %}
30
-
31
- {% if structureContent %}
32
- 检查并处理 PATCH
33
- 搜索文档中的 patch (::: PATCH),根据 patch 中的要求修改文档,修改完成后删除对应的 patch。
34
-
35
- 示例:
36
- ::: PATCH
37
- # Original
38
- DocSmith 直接修改用户文档并写回到原项目。
39
-
40
- # Revised
41
- DocSmith 永远不直接 touch 用户原始 repo,而是
42
- 在独立 workspace 中生成版本化产物,再通过 patch 合并。
43
- :::
44
- {% endif %}
@@ -1,27 +0,0 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = path.dirname(__filename);
7
-
8
- // FIXME: 临时使用这种方式设置自定义变量,框架优化后需要修改
9
- export default function getCustomPrompt() {
10
- const customPlannerPrompt = `
11
- - 文档结构相关的任务与文档内容相关的任务需要拆分为独立的任务
12
- - 你只需要读取少量信息来规划任务,深度的信息读取由 Worker 完成
13
- - changeset 中要求的变更,拆分为独立的任务,由 Worker 完成
14
- `;
15
-
16
- const baseInfoPath = path.join(__dirname, "../common/base-info.md");
17
- const baseInfo = fs.readFileSync(baseInfoPath, "utf-8");
18
-
19
- const domainKnowledge = `
20
- ${baseInfo}
21
- `;
22
-
23
- return {
24
- customPlannerPrompt,
25
- domainKnowledge,
26
- };
27
- }
@@ -1,95 +0,0 @@
1
- type: team
2
- name: GenerateDetail
3
- description: Generate or update detailed content for multiple documentation files
4
- input_schema:
5
- type: object
6
- properties:
7
- rules:
8
- type: string
9
- description: Your specific requirements for documentation structure
10
- locale:
11
- type: string
12
- description: Primary language for documentation (e.g., zh, en, ja)
13
- tasks:
14
- type: array
15
- description: Tasks describing which documents to generate/update, including title, path, description, sourcePaths, and task description
16
- items:
17
- type: object
18
- properties:
19
- task:
20
- type: string
21
- description: Task describing which document to generate/update, including title, path, description, sourcePaths, and task description
22
- iterate_on: tasks
23
- concurrency: 5
24
- skills:
25
- # - ../utils/load-base-sources.mjs
26
- - ./set-custom-prompt.mjs
27
- - type: "@aigne/agent-library/orchestrator"
28
- input_schema:
29
- type: object
30
- properties:
31
- task:
32
- type: string
33
- description: Task describing which document to generate/update, including title, path, description, sourcePaths, and task description
34
- rules:
35
- type: string
36
- description: Your specific requirements for documentation content
37
- locale:
38
- type: string
39
- description: Primary language for documentation (e.g., zh, en, ja)
40
- objective:
41
- url: objective.md
42
- planner:
43
- type: ai
44
- model: anthropic/claude-opus-4-5
45
- instructions:
46
- url: ../common/planner.md
47
- input_schema:
48
- type: object
49
- properties:
50
- workspace:
51
- type: string
52
- description: The workspace path
53
- doc_smith_workspace:
54
- type: string
55
- description: The Doc Smith workspace path
56
- plannerInitState:
57
- type: string
58
- description: The initial state of the planner
59
- customPlannerPrompt:
60
- type: string
61
- description: The custom planner prompt
62
- worker:
63
- type: ai
64
- model: gemini-3-pro-preview
65
- instructions:
66
- url: ../common/worker.md
67
- input_schema:
68
- type: object
69
- properties:
70
- workspace:
71
- type: string
72
- description: The workspace path
73
- doc_smith_workspace:
74
- type: string
75
- description: The Doc Smith workspace path
76
- domainKnowledge:
77
- type: string
78
- description: The domain knowledge
79
- completer:
80
- type: function
81
- process: |
82
- let message = 'All tasks have been completed.';
83
- return { message };
84
- afs:
85
- modules:
86
- - module: local-fs
87
- options:
88
- name: workspace
89
- localPath: .
90
- description: The target repository containing source code and documentation. Read-only, cannot be modified.
91
- - module: local-fs
92
- options:
93
- name: doc-smith
94
- localPath: .aigne/doc-smith
95
- description: The Doc Smith workspace for storing intermediate and output files