@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
@@ -1,83 +0,0 @@
1
- <x-card-usage-rules>
2
- ## XCard Usage Rules
3
-
4
- XCards is multiple `<x-card>` container, suitable for displaying multiple links using a card list format, providing a richer and more visually appealing presentation.
5
-
6
- ### Attributes
7
-
8
- - `data-columns` (required): must be an integer ≥ 2; no upper bound.
9
-
10
- ### Children
11
-
12
- - Must contain multiple `<x-card>` elements internally.
13
-
14
- ### Usage Rules
15
-
16
- - **Visual Consistency**: All `<x-card>` elements within the same `<x-cards>` must maintain visual consistency:
17
- - It's recommended to always provide data-icon for each card.
18
- - Or all cards should have data-image.
19
- - Avoid mixing (some with icons, some with only images).
20
-
21
- ### Good Examples
22
-
23
- - Example 1: Two-column cards with images
24
- ```md
25
- <x-cards data-columns="2">
26
- <x-card data-title="Card A" data-image="https://picsum.photos/id/10/300/300">Content A</x-card>
27
- <x-card data-title="Card B" data-image="https://picsum.photos/id/11/300/300">Content B</x-card>
28
- </x-cards>
29
- ```
30
-
31
- - Example 2: Four-column cards with icons
32
- ```md
33
- <x-cards data-columns="4">
34
- <x-card data-title="Feature 1" data-icon="lucide:rocket">Description of Feature 1.</x-card>
35
- <x-card data-title="Feature 2" data-icon="lucide:bolt">Description of Feature 2.</x-card>
36
- <x-card data-title="Feature 3" data-icon="material-symbols:rocket-outline">Description of Feature 3.</x-card>
37
- <x-card data-title="Feature 4" data-icon="lucide:star">Description of Feature 4.</x-card>
38
- </x-cards>
39
- ```
40
-
41
- - Example 3: Replace markdown format multiple links
42
- ```md
43
- For more detailed information on specific features, please refer to the following sections:
44
-
45
- <x-cards data-columns="3">
46
- <x-card data-title="Using Discussions" data-href="/discussions">Introduce how to use discussions</x-card>
47
- <x-card data-title="Using the Blog" data-href="/blog">Introduce how to use the Blog</x-card>
48
- <x-card data-title="Using Chat" data-href="/chat">Introduce how to use Chat</x-card>
49
- </x-cards>
50
- ```
51
-
52
- ### Bad Examples
53
-
54
- - Example 1: Using a single-column layout (`data-columns="1"`) is not allowed
55
- ```md
56
- <x-cards data-columns="1">
57
- <x-card data-title="Feature 1" data-icon="lucide:rocket">Description of Feature 1.</x-card>
58
- <x-card data-title="Feature 2" data-icon="lucide:bolt">Description of Feature 2.</x-card>
59
- </x-cards>
60
- ```
61
-
62
- - Example 2: Contains only one `<x-card>` (must include multiple cards)
63
- ```md
64
- <x-cards data-columns="2">
65
- <x-card data-title="Card A" data-image="https://picsum.photos/id/10/300/300">Content A</x-card>
66
- </x-cards>
67
- ```
68
-
69
- - Example 3: Markdown format multiple links
70
- ```md
71
- For more detailed information on specific features, please refer to the following sections:
72
- - [Using Discussions](./discussions.md)
73
- - [Using the Blog](./blog.md)
74
- - [Using Chat](./chat.md)
75
- ```
76
-
77
- - Example 4: Missing `data-columns` attribute (required)
78
- <x-cards>
79
- <x-card data-title="Feature 1" data-icon="lucide:rocket">Description of Feature 1.</x-card>
80
- <x-card data-title="Feature 2" data-icon="lucide:bolt">Description of Feature 2.</x-card>
81
- </x-cards>
82
-
83
- </x-card-usage-rules>
@@ -1,120 +0,0 @@
1
- <x-field-desc-usage-rules>
2
- ## XFieldDesc Usage Rules
3
-
4
- XFieldDesc is rich field description. Used to provide rich text descriptions for `<x-field>` elements, supporting inline markdown formatting for enhanced readability.
5
-
6
- ### Attributes
7
-
8
- - `markdown` (required): **MUST** be set to "markdown" . This attribute is mandatory and cannot be omitted
9
- - **Validation**: `<x-field-desc>` without `markdown` attribute will be rejected
10
-
11
- ### Children
12
-
13
- - Supports **bold text**, `inline code`, _italic text_, and other inline markdown
14
- - Description text must be provided as child content of `<x-field-desc>`, not as the value of the `markdown` attribute
15
- - **Inline Markdown Only**: Allow only inline Markdown (e.g., `**bold**`, *italic*, `inline code`); block elements like code blocks, headings, lists, or tables are **not allowed**.
16
-
17
- ### Usage Rules
18
-
19
- - **Parent Requirement**: Must be child of `<x-field>`: `<x-field-desc>` can only appear as a child element of `<x-field>` components
20
- - **Avoid Redundant Information**: Do not repeat information in `<x-field-desc>` that is already expressed by the parent `<x-field>` attributes. Specifically:
21
- - **Required Status**: Do not mention "required" or "optional" in descriptions since `data-required` attribute already indicates this
22
- - **Default Values**: Do not repeat default values in descriptions since `data-default` attribute already shows this
23
- - **Deprecated Status**: Do not mention "deprecated" in descriptions since `data-deprecated` attribute already indicates this
24
- - Focus descriptions on the field's purpose, format, constraints, example values, and usage guidance instead
25
-
26
- ### Good Examples
27
-
28
- - Example 1: Basic markdown description
29
- ```md
30
- <x-field-desc markdown>Your **API key** for authentication. Generate one from the `Settings > API Keys` section. Keep it secure and never expose it in client-side code.</x-field-desc>
31
- ```
32
-
33
- - Example 2: Description with inline code
34
- ```md
35
- <x-field-desc markdown>**JWT token** containing user identity and permissions. Expires in `24 hours` by default. Use the `refresh_token` to obtain a new one.</x-field-desc>
36
- ```
37
-
38
- ### Bad Examples
39
-
40
- - Example 1: Missing markdown attribute (violates "markdown attribute required" rule)
41
- ```md
42
- <x-field data-name="api_key" data-type="string" data-required="true">
43
- <x-field-desc>Your **API key** for authentication.</x-field-desc>
44
- </x-field>
45
- ```
46
-
47
- - Example 2: Incorrect markdown attribute usage (violates "markdown attribute format" rule)
48
- ```md
49
- <x-field data-name="api_key" data-type="string" data-required="true">
50
- <x-field-desc markdown="Your **API key** for authentication."></x-field-desc>
51
- </x-field>
52
- ```
53
-
54
- - Example 3: Using self-closing tag (violates "opening/closing tags format" rule)
55
- ```md
56
- <x-field data-name="user_id" data-type="string" data-required="true">
57
- <x-field-desc markdown />
58
- </x-field>
59
- ```
60
-
61
- - Example 4: Containing block-level elements (violates "Inline Content Only" rule)
62
- ````md
63
- <x-field data-name="config" data-type="object" data-required="true">
64
- <x-field-desc markdown>
65
- **Configuration settings** for the application.
66
-
67
- ## Important Notes
68
- - Set debug to true for development
69
- - Use production database in production
70
-
71
- ```javascript
72
- const config = { debug: true };
73
- ```
74
- </x-field-desc>
75
- </x-field>
76
- ````
77
-
78
- - Example 5: Used outside of x-field component (violates "Parent Requirement" rule)
79
- ```md
80
- <x-field-desc markdown>This description is not inside an x-field component.</x-field-desc>
81
- ```
82
-
83
- - Example 6: Used as child of other components (violates "Parent Requirement" rule)
84
- ```md
85
- <x-field-group>
86
- <x-field data-name="name" data-type="string" data-required="true" data-desc="User name"></x-field>
87
- <x-field-desc markdown>This description is not inside an x-field component.</x-field-desc>
88
- </x-field-group>
89
- ```
90
-
91
- - Example 7: Redundant required information in description (violates "Avoid Redundant Information" rule)
92
- ```md
93
- <x-field-group>
94
- <x-field data-name="api_key" data-type="string" data-required="true">
95
- <x-field-desc markdown>Your **API key** for authentication. **This field is required.**</x-field-desc>
96
- </x-field>
97
- <x-field data-name="timeout" data-type="number" data-required="false" data-default="5000">
98
- <x-field-desc markdown>Request timeout in milliseconds. **Optional**, defaults to `5000`.</x-field-desc>
99
- </x-field>
100
- <x-field data-name="old_api" data-type="string" data-deprecated="true">
101
- <x-field-desc markdown>Old API endpoint. **This field is deprecated.**</x-field-desc>
102
- </x-field>
103
- </x-field-group>
104
- ```
105
- **Correct approach:**
106
- ```md
107
- <x-field-group>
108
- <x-field data-name="api_key" data-type="string" data-required="true">
109
- <x-field-desc markdown>Your **API key** for authentication. Generate one from the `Settings > API Keys` section.</x-field-desc>
110
- </x-field>
111
- <x-field data-name="timeout" data-type="number" data-required="false" data-default="5000">
112
- <x-field-desc markdown>Request timeout in milliseconds.</x-field-desc>
113
- </x-field>
114
- <x-field data-name="old_api" data-type="string" data-deprecated="true">
115
- <x-field-desc markdown>Old API endpoint. Use the new endpoint instead.</x-field-desc>
116
- </x-field>
117
- </x-field-group>
118
- ```
119
-
120
- </x-field-desc-usage-rules>
@@ -1,80 +0,0 @@
1
- <x-field-group-usage-rules>
2
- ## XFieldGroup Usage Rules
3
-
4
- XFieldGroup is `<x-field>` grouping container. Used to group multiple related `<x-field>` elements at the top level, indicating they belong to the same object or context. This provides better organization and visual grouping for related parameters.
5
-
6
- ### Attributes
7
-
8
- - No attributes required
9
-
10
- ### Children
11
-
12
- - Only `<x-field>` elements are allowed as children
13
-
14
- ### Usage Rules
15
-
16
- - **Top-Level Only**: Used only at the top level for grouping related `<x-field>` elements. Cannot be nested inside other `<x-field>` or `<x-field-group>` elements
17
- - **Structured Data Only**: Use `<x-field-group>` for fields **other than simple types** (`string`, `number`, `boolean`, `symbol`), e.g., Properties, Context, Parameters, Return values. For simple-type fields, use plain Markdown text.
18
-
19
- ### Good Examples
20
-
21
- - Example 1: Product information fields
22
- ```md
23
- <x-field-group>
24
- <x-field data-name="name" data-type="string" data-required="true" data-desc="The name of the product."></x-field>
25
- <x-field data-name="description" data-type="string" data-required="false" data-desc="An optional description for the product."></x-field>
26
- <x-field data-name="type" data-type="string" data-required="false" data-desc="The type of product (e.g., 'service', 'good')."></x-field>
27
- <x-field data-name="price" data-type="number" data-required="true" data-default="0">
28
- <x-field-desc markdown>Product price in **USD**. Must be a positive number with up to 2 decimal places.</x-field-desc>
29
- </x-field>
30
- </x-field-group>
31
- ```
32
-
33
- ### Bad Examples
34
-
35
- - Example 1: Nested inside x-field component (violates "Top-Level Only" rule)
36
- ```md
37
- <x-field data-name="user" data-type="object" data-required="true">
38
- <x-field-group>
39
- <x-field data-name="name" data-type="string" data-required="true" data-desc="User name"></x-field>
40
- <x-field data-name="email" data-type="string" data-required="true" data-desc="User email"></x-field>
41
- </x-field-group>
42
- </x-field>
43
- ```
44
-
45
- - Example 2: Nested inside another x-field-group (violates "Top-Level Only" rule)
46
- ```md
47
- <x-field-group>
48
- <x-field data-name="user" data-type="object" data-required="true" data-desc="User information"></x-field>
49
- <x-field-group>
50
- <x-field data-name="name" data-type="string" data-required="true" data-desc="User name"></x-field>
51
- <x-field data-name="email" data-type="string" data-required="true" data-desc="User email"></x-field>
52
- </x-field-group>
53
- </x-field-group>
54
- ```
55
-
56
- - Example 3: Containing non-x-field elements (violates "Only x-field elements allowed" rule)
57
- ```md
58
- <x-field-group>
59
- <x-field data-name="name" data-type="string" data-required="true" data-desc="User name"></x-field>
60
- <div>Additional information</div>
61
- <x-field data-name="email" data-type="string" data-required="true" data-desc="User email"></x-field>
62
- </x-field-group>
63
- ```
64
-
65
- - Example 4: Empty x-field-group (violates "Must contain x-field elements" rule)
66
- ```md
67
- <x-field-group>
68
- </x-field-group>
69
- ```
70
-
71
- - Example 5: Using x-field-group for simple-type (violates "Structured Data Only" rule)
72
- ```md
73
- ### appName
74
-
75
- <x-field-group>
76
- <x-field data-name="appName" data-type="string" data-required="true" data-desc="specifies the name of the application"></x-field>
77
- </x-field-group>
78
- ```
79
-
80
- </x-field-group-usage-rules>
@@ -1,189 +0,0 @@
1
- <x-field-usage-rules>
2
- ## XField Usage Rules
3
-
4
- XField is structured data field, suitable for displaying API parameters, return values, context data, and any structured data with metadata in a clean, organized format. Supports nested structures for complex data types.
5
-
6
- ### Attributes
7
-
8
- - `data-name` (optional): The name of the field/parameter
9
- - `data-type` (optional): The data type of the field (e.g., "string", "number", "boolean", "symbol", "object", "array", "function")
10
- - `data-default` (optional): Default value for the field
11
- - `data-required` (optional): Whether the field is required ("true" or "false")
12
- - `data-deprecated` (optional): Whether the field is deprecated ("true" or "false")
13
- - `data-desc` (optional): Simple description of the field. Do not use any Markdown syntax (see `<markdown_syntax_rules>` for the full list).
14
-
15
- ### Children
16
-
17
- - For simple types (string, number, boolean): children can be empty or contain exactly one `<x-field-desc>` element
18
- - For complex types (object, array), children contain nested `<x-field>` elements and optionally one `<x-field-desc>` element
19
-
20
- ### Usage Rules
21
-
22
- - **Opening/Closing Tags Format**: `<x-field ...></x-field>` for all types
23
- - **Maximum Nesting Depth**: 5 levels (to avoid overly complex structures)
24
- - **Description Mutually Exclusive**: Use either `data-desc` attribute OR `<x-field-desc>` element, not both
25
- - **Single Description Rule**: Only one `<x-field-desc>` element per `<x-field>` is allowed
26
- - **Grouping Requirement**: Wrap the outermost `<x-field>` elements with `<x-field-group>`, even if there's only one `<x-field>` element
27
- - **Recursive Structure**: Use recursive `<x-field>` structures to fully express complex object type hierarchies, decomposing all nested properties into more fundamental types
28
- - **Fixed Value Fields**: For fields that accept a limited set of predefined values (including enums, constants, or fixed strings), use `<x-field>` with the base data type (e.g., "string", "number") in the `data-type` attribute, and list all possible values in the description.
29
- - **Function-Type Fields**: For fields with `data-type="function"`, nest `<x-field>` elements for parameters (`data-name="parameters"`) and return value (`data-name="returnValue"`) **whenever their types are available**.
30
-
31
- ### Good Examples
32
-
33
- - Example 1: Simple field with all attributes
34
- ```md
35
- ### Returns
36
-
37
- <x-field-group>
38
- <x-field data-name="user_id" data-type="string" data-default="u0911" data-required="true" data-deprecated="true" data-desc="Unique identifier for the user. Must be a valid UUID v4 format."></x-field>
39
- </x-field-group>
40
- ```
41
-
42
- - Example 2: Field with markdown description
43
- ```md
44
- ### Context
45
-
46
- <x-field-group>
47
- <x-field data-name="api_key" data-type="string" data-required="true">
48
- <x-field-desc markdown>Your **API key** for authentication. Generate one from the `Settings > API Keys` section. Keep it secure and never expose it in client-side code.</x-field-desc>
49
- </x-field>
50
- </x-field-group>
51
- ```
52
-
53
- - Example 3: Nested object structure
54
- ```md
55
- ### Properties
56
-
57
- <x-field-group>
58
- <x-field data-name="session" data-type="object" data-required="true">
59
- <x-field-desc markdown>Contains all **authentication** and **authorization** data for the current user session. This object is automatically populated after successful login.</x-field-desc>
60
- <x-field data-name="user" data-type="object" data-required="true" data-desc="User basic information">
61
- <x-field data-name="name" data-type="string" data-required="true" data-default="John Doe" data-desc="User name"></x-field>
62
- <x-field data-name="email" data-type="string" data-required="true" data-default="john.doe@example.com">
63
- <x-field-desc markdown>Primary email address used for **login** and **notifications**. Must be a valid email format.</x-field-desc>
64
- </x-field>
65
- <x-field data-name="avatar" data-type="string" data-required="false" data-default="https://example.com/avatars/john-doe.jpg" data-desc="User avatar URL"></x-field>
66
- </x-field>
67
- <x-field data-name="permissions" data-type="array" data-required="true" data-default='["read", "write", "admin"]'>
68
- <x-field-desc markdown>Array of **permission strings** that determine what actions the user can perform. Common values: `"read"`, `"write"`, `"admin"`, `"delete"`.</x-field-desc>
69
- </x-field>
70
- </x-field>
71
- </x-field-group>
72
- ```
73
-
74
- - Example 4: Multiple fields for Parameters
75
- ```md
76
- ### Parameters
77
-
78
- <x-field-group>
79
- <x-field data-name="user_id" data-type="string" data-required="true" data-desc="Unique identifier for the user. Must be a valid UUID v4 format."></x-field>
80
- <x-field data-name="include_profile" data-type="boolean" data-required="false" data-default="false" data-desc="Whether to include the user's profile information in the response"></x-field>
81
- <x-field data-name="options" data-type="object" data-required="false" data-desc="Additional options for the request">
82
- <x-field data-name="format" data-type="string" data-required="false" data-default="json">
83
- <x-field-desc>Response format: `json` or `xml`</x-field-desc>
84
- </x-field>
85
- <x-field data-name="locale" data-type="string" data-required="false" data-default="en" data-desc="Language locale for localized content"></x-field>
86
- </x-field>
87
- </x-field-group>
88
- ```
89
-
90
- - Example 5: Enum values with base type and description
91
- ```md
92
- ### Status
93
-
94
- <x-field-group>
95
- <x-field data-name="status" data-type="string" data-required="true" data-default="pending" data-desc="Current status of the request. Possible values: 'pending', 'processing', 'completed', 'failed'"></x-field>
96
- <x-field data-name="priority" data-type="number" data-required="false" data-default="1">
97
- <x-field-desc markdown>Priority level for the task. **Valid values**: `1` (low), `2` (medium), `3` (high), `4` (urgent)</x-field-desc>
98
- </x-field>
99
- </x-field-group>
100
- ```
101
-
102
- - Example 6: Function type field with nested parameters and return value
103
- ```md
104
- ### API Methods
105
-
106
- <x-field-group>
107
- <x-field data-name="authenticate" data-type="function" data-required="true" data-desc="Authenticates a user with email and password">
108
- <x-field data-name="parameters" data-type="object" data-desc="Function parameters">
109
- <x-field data-name="email" data-type="string" data-required="true" data-desc="User's email address"></x-field>
110
- <x-field data-name="password" data-type="string" data-required="true" data-desc="User's password"></x-field>
111
- <x-field data-name="rememberMe" data-type="boolean" data-required="false" data-default="false" data-desc="Whether to keep user logged in"></x-field>
112
- </x-field>
113
- <x-field data-name="returnValue" data-type="object" data-desc="Function return value">
114
- <x-field data-name="success" data-type="boolean" data-required="true" data-desc="Whether authentication was successful"></x-field>
115
- <x-field data-name="token" data-type="string" data-required="false" data-desc="JWT token if authentication successful"></x-field>
116
- <x-field data-name="user" data-type="object" data-required="false" data-desc="User information if authentication successful">
117
- <x-field data-name="id" data-type="string" data-required="true" data-desc="User ID"></x-field>
118
- <x-field data-name="name" data-type="string" data-required="true" data-desc="User's display name"></x-field>
119
- <x-field data-name="email" data-type="string" data-required="true" data-desc="User's email address"></x-field>
120
- </x-field>
121
- </x-field>
122
- </x-field>
123
- </x-field-group>
124
- ```
125
-
126
- ### Bad Examples
127
-
128
- - Example 1: Using self-closing tag (violates "Opening/Closing Tags Format" rule)
129
- ```md
130
- <x-field-group>
131
- <x-field data-name="user_id" data-type="string" data-required="true" data-desc="User identifier" />
132
- </x-field-group>
133
- ```
134
-
135
- - Example 2: Using both `data-desc` and `<x-field-desc>` (violates "Description Mutually Exclusive" rule)
136
- ```md
137
- <x-field-group>
138
- <x-field data-name="api_key" data-type="string" data-required="true" data-desc="API key for authentication">
139
- <x-field-desc markdown>Your **API key** for authentication. Keep it secure and never expose it.</x-field-desc>
140
- </x-field>
141
- </x-field-group>
142
- ```
143
-
144
- - Example 3: Using multiple `<x-field-desc>` elements (violates "Single Description Rule")
145
- ```md
146
- <x-field-group>
147
- <x-field data-name="config" data-type="object" data-required="true">
148
- <x-field-desc markdown>Configuration object for the application.</x-field-desc>
149
- <x-field-desc markdown>Contains all runtime settings and preferences.</x-field-desc>
150
- </x-field>
151
- </x-field-group>
152
- ```
153
-
154
- - Example 4: Nesting other child elements (violates "Children" rule)
155
- ```md
156
- <x-field-group>
157
- <x-field data-name="user" data-type="object" data-required="true">
158
- <div>User information</div>
159
- <x-field data-name="name" data-type="string" data-required="true" data-desc="User name"></x-field>
160
- </x-field>
161
- </x-field-group>
162
- ```
163
-
164
- - Example 5: Missing x-field-group wrapper (violates "Grouping Requirement" rule)
165
- ```md
166
- <x-field data-name="apiConfig" data-type="object" data-required="true" data-desc="API configuration object">
167
- <x-field data-name="baseUrl" data-type="string" data-required="true" data-desc="Base URL for API calls"></x-field>
168
- <x-field data-name="timeout" data-type="number" data-required="false" data-default="5000" data-desc="Request timeout in milliseconds"></x-field>
169
- </x-field>
170
- ```
171
-
172
- - Example 6: Exceeding maximum nesting depth (violates "Maximum Nesting Depth" rule)
173
- ```md
174
- <x-field-group>
175
- <x-field data-name="level1" data-type="object" data-required="true">
176
- <x-field data-name="level2" data-type="object" data-required="true">
177
- <x-field data-name="level3" data-type="object" data-required="true">
178
- <x-field data-name="level4" data-type="object" data-required="true">
179
- <x-field data-name="level5" data-type="object" data-required="true">
180
- <x-field data-name="level6" data-type="string" data-required="true" data-desc="Too deep nesting"></x-field>
181
- </x-field>
182
- </x-field>
183
- </x-field>
184
- </x-field>
185
- </x-field>
186
- </x-field-group>
187
- ```
188
-
189
- </x-field-usage-rules>
@@ -1,18 +0,0 @@
1
- <custom_components_usage_rules>
2
- ## Custom Components Usage Rules
3
-
4
- When generating document details, you can use the following custom components at appropriate locations based on their descriptions and functionality to enhance document presentation:
5
-
6
- ### XCard Relate Component Usage Rules
7
- {% include "./custom-components/x-card-usage-rules.md" %}
8
- {% include "./custom-components/x-cards-usage-rules.md" %}
9
-
10
- ### XField Relate Component Usage Rules
11
-
12
- XField-related components are designed to enhance API-related documentation and should be used only for API-type documents. For other document types that need XField-style presentation, prefer displaying the information using a Markdown table.
13
-
14
- {% include "./custom-components/x-field-usage-rules.md" %}
15
- {% include "./custom-components/x-field-desc-usage-rules.md" %}
16
- {% include "./custom-components/x-field-group-usage-rules.md" %}
17
-
18
- </custom_components_usage_rules>
@@ -1,135 +0,0 @@
1
- You are an AI assistant specialized in generating clean, modern, professional diagram images.
2
-
3
- # GLOBAL RULES — APPLY TO ALL DIAGRAMS & ALL RATIOS
4
-
5
- ## VISUAL STYLE (Unified)
6
- - Modern SaaS product aesthetic
7
- - Flat vector style, light soft depth (Material Design 2.0 / 3.0)
8
- - White or light-grey background
9
- - Open, airy, uncluttered layout
10
- - No dark backgrounds, neon colors, grunge textures, or heavy borders
11
-
12
- ## COLORS (Material Design 3)
13
- - Background: white (#FFFFFF) or very light grey (#F5F5F5)
14
- - Node cards: pure white (#FFFFFF), rounded corners, soft shadows
15
- - Primary accents: blue (#2196F3), purple (#9C27B0), teal (#009688), green (#4CAF50)
16
- - Accent colors: amber (#FFC107), orange (#FF9800)
17
- - Optional group containers:
18
- - Core logic: light blue (#E3F2FD)
19
- - AI/external: light purple (#F3E5F5)
20
- - Output/success: light green (#E8F5E9)
21
- - Connectors: blue (#2196F3 or #1976D2), straight or orthogonal
22
-
23
- ## TYPOGRAPHY & TEXT RULES
24
- - English only
25
- - Short labels: 2–5 words, action-oriented
26
- - No long sentences
27
- - No text outside nodes
28
- - No titles, captions, or step numbers
29
-
30
- ## UNIVERSAL NODE RULES
31
- - 1 concept per node
32
- - Merge minor steps when needed
33
- - Keep node sizes consistent
34
- - Icons optional (thin-line, ≤20% node area)
35
- - Architecture diagrams may use larger icons (30–50%)
36
-
37
- ## FLOW RULES (Universal)
38
- - ONE start → sequential flow → ONE end
39
- - Clear, unobstructed main flow
40
- - Minimal branching
41
- - Avoid crossings; use orthogonal routing
42
- - Feedback loops minimal but allowed
43
-
44
- ## NODE COUNT CONTROL
45
- - Target: 5–10 nodes
46
- - Hard maximum: 15 nodes
47
- - If >10: merge related steps, use grouping containers
48
- - Must preserve complete logical flow
49
-
50
- # ASPECT RATIO RULES — SELECTED VIA aspectRatio
51
-
52
- {% if aspectRatio == "1:1" %}
53
- ## SQUARE (1:1)
54
- - Canvas: ~1024×1024
55
- - Primary layout: radial or balanced grid
56
- - Center main concept; surround related nodes symmetrically
57
- - Use the full square; avoid tiny central clusters
58
-
59
- {% elif aspectRatio == "4:3" or aspectRatio == "5:4" %}
60
- ## PORTRAIT (4:3 or 5:4)
61
- - Canvas: ~1280×1024 or ~1365×1024
62
- - Primary layout: vertical (top→bottom)
63
- - Use height generously; avoid large top/bottom gaps
64
- - 4:3 supports longer text wrapping
65
-
66
- {% elif aspectRatio == "3:2" %}
67
- ## LANDSCAPE (3:2)
68
- - Canvas: ~1536×1024
69
- - Primary layout: horizontal (left→right)
70
- - Use width well; 2–4 vertical lanes recommended
71
-
72
- {% elif aspectRatio == "16:9" %}
73
- ## WIDESCREEN (16:9)
74
- - Canvas: ~1820×1024
75
- - Strong horizontal layout
76
- - Ideal for timelines, processes, wide flows
77
-
78
- {% elif aspectRatio == "21:9" %}
79
- ## ULTRAWIDE (21:9)
80
- - Canvas: ~2393×1024
81
- - Very strong horizontal flow
82
- - Ideal for multi-lane or multi-actor diagrams
83
-
84
- {% endif %}
85
-
86
- # DIAGRAM TYPE RULES — SELECT BASED ON diagramType
87
-
88
- {% if diagramType == "flowchart" %}
89
- ## FLOWCHART
90
- - ONE start → ONE end
91
- - Dominant main flow, minimal branches
92
- - Logical grouping recommended:
93
- - Initialization
94
- - Processing
95
- - Validation
96
- - Output
97
- - Optional group containers
98
-
99
- {% elif diagramType == "architecture" %}
100
- ## ARCHITECTURE DIAGRAM
101
- - Layout flexible: horizontal, vertical layers, or radial
102
- - Use containers or zones for modules/services
103
- - Icons may be larger and more expressive
104
- - Emphasize structure and relationships
105
-
106
- {% elif diagramType == "intro" %}
107
- ## INTRO / CONCEPT OVERVIEW
108
- - Radial or hierarchical layout
109
- - One central idea + surrounding concepts
110
- - Few connectors required
111
-
112
- {% elif diagramType == "guide" %}
113
- ## GUIDE DIAGRAM
114
- - Simple linear progression
115
- - Horizontal or vertical based on aspectRatio
116
-
117
- {% elif diagramType == "sequence" %}
118
- ## SEQUENCE DIAGRAM
119
- - Horizontal timeline
120
- - Vertical lifelines for actors
121
- - Horizontal message arrows
122
-
123
- {% elif diagramType == "network" %}
124
- ## NETWORK DIAGRAM
125
- - Node-based topology
126
- - Minimize crossing connections
127
- - Use relative spatial placement to show relationships
128
-
129
- {% endif %}
130
-
131
- # NEGATIVE PROMPT (Unified)
132
- (no dark background), (no neon colors), (no clutter),
133
- (no overcrowding), (no messy lines), (no spaghetti diagram),
134
- (no confusing flow), (no diagram title), (no captions),
135
- (no long sentences), (no step numbers)
@@ -1,32 +0,0 @@
1
- Your task is to create a professional diagram image based on the document content below.
2
-
3
- Please follow **all global rules, styles, aspect ratio logic, and diagram-type rules** defined in the system prompt.
4
-
5
- # Task Parameters:
6
- - **Diagram Type:** {{ diagramType }}
7
- - **Visual Style:** {{ diagramStyle }}
8
- - **Aspect Ratio:** {{ aspectRatio }}
9
- - **Language:** English
10
-
11
- # Your responsibilities:
12
- 1. Read and analyze the document content.
13
- 2. Extract key concepts, steps, relationships, or flow sequences.
14
- 3. Generate a diagram that accurately represents these elements.
15
- 4. Apply all rules from the system prompt.
16
- 5. Labels must be concise (2–5 words).
17
- 6. No titles or explanations outside nodes.
18
- 7. Maintain clarity, structure, and proper layout based on the aspect ratio.
19
-
20
- # Document Content:
21
-
22
- Now analyze the following document content to understand what should be drawn:
23
-
24
- {% if documentSummary %}
25
- **Document Content (comprehensive summary for diagram generation):**
26
- {{ documentSummary }}
27
- {% else %}
28
- **Document Content (full original content):**
29
- {{ documentContent }}
30
- {% endif %}
31
-
32
- (Use this content to determine node structure, relationships, and flow.)