@h2nguyen/arc42-node-mcp-server 2.0.0 → 2.1.0

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 (222) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +81 -5
  3. package/dist/templates/formats/asciidoc/index.d.ts +178 -0
  4. package/dist/templates/formats/asciidoc/index.d.ts.map +1 -0
  5. package/dist/templates/formats/asciidoc/index.js +225 -0
  6. package/dist/templates/formats/asciidoc/index.js.map +1 -0
  7. package/dist/templates/formats/index.d.ts +108 -0
  8. package/dist/templates/formats/index.d.ts.map +1 -0
  9. package/dist/templates/formats/index.js +149 -0
  10. package/dist/templates/formats/index.js.map +1 -0
  11. package/dist/templates/formats/markdown/index.d.ts +172 -0
  12. package/dist/templates/formats/markdown/index.d.ts.map +1 -0
  13. package/dist/templates/formats/markdown/index.js +211 -0
  14. package/dist/templates/formats/markdown/index.js.map +1 -0
  15. package/dist/templates/formats/output-format-factory.d.ts +125 -0
  16. package/dist/templates/formats/output-format-factory.d.ts.map +1 -0
  17. package/dist/templates/formats/output-format-factory.js +166 -0
  18. package/dist/templates/formats/output-format-factory.js.map +1 -0
  19. package/dist/templates/formats/output-format-registry.d.ts +114 -0
  20. package/dist/templates/formats/output-format-registry.d.ts.map +1 -0
  21. package/dist/templates/formats/output-format-registry.js +147 -0
  22. package/dist/templates/formats/output-format-registry.js.map +1 -0
  23. package/dist/templates/formats/output-format-strategy.d.ts +195 -0
  24. package/dist/templates/formats/output-format-strategy.d.ts.map +1 -0
  25. package/dist/templates/formats/output-format-strategy.js +69 -0
  26. package/dist/templates/formats/output-format-strategy.js.map +1 -0
  27. package/dist/templates/index.d.ts +9 -8
  28. package/dist/templates/index.d.ts.map +1 -1
  29. package/dist/templates/index.js +21 -10
  30. package/dist/templates/index.js.map +1 -1
  31. package/dist/templates/locales/cz/index.d.ts +25 -3
  32. package/dist/templates/locales/cz/index.d.ts.map +1 -1
  33. package/dist/templates/locales/cz/index.js +34 -18
  34. package/dist/templates/locales/cz/index.js.map +1 -1
  35. package/dist/templates/locales/cz/templates-asciidoc.d.ts +22 -0
  36. package/dist/templates/locales/cz/templates-asciidoc.d.ts.map +1 -0
  37. package/dist/templates/locales/cz/templates-asciidoc.js +764 -0
  38. package/dist/templates/locales/cz/templates-asciidoc.js.map +1 -0
  39. package/dist/templates/locales/cz/{templates.d.ts → templates-markdown.d.ts} +1 -1
  40. package/dist/templates/locales/cz/templates-markdown.d.ts.map +1 -0
  41. package/dist/templates/locales/cz/{templates.js → templates-markdown.js} +1 -1
  42. package/dist/templates/locales/cz/templates-markdown.js.map +1 -0
  43. package/dist/templates/locales/de/index.d.ts +14 -4
  44. package/dist/templates/locales/de/index.d.ts.map +1 -1
  45. package/dist/templates/locales/de/index.js +22 -25
  46. package/dist/templates/locales/de/index.js.map +1 -1
  47. package/dist/templates/locales/de/templates-asciidoc.d.ts +22 -0
  48. package/dist/templates/locales/de/templates-asciidoc.d.ts.map +1 -0
  49. package/dist/templates/locales/de/templates-asciidoc.js +814 -0
  50. package/dist/templates/locales/de/templates-asciidoc.js.map +1 -0
  51. package/dist/templates/locales/de/{templates.d.ts → templates-markdown.d.ts} +1 -1
  52. package/dist/templates/locales/de/templates-markdown.d.ts.map +1 -0
  53. package/dist/templates/locales/de/{templates.js → templates-markdown.js} +1 -1
  54. package/dist/templates/locales/de/templates-markdown.js.map +1 -0
  55. package/dist/templates/locales/en/index.d.ts +14 -4
  56. package/dist/templates/locales/en/index.d.ts.map +1 -1
  57. package/dist/templates/locales/en/index.js +22 -25
  58. package/dist/templates/locales/en/index.js.map +1 -1
  59. package/dist/templates/locales/en/templates-asciidoc.d.ts +22 -0
  60. package/dist/templates/locales/en/templates-asciidoc.d.ts.map +1 -0
  61. package/dist/templates/locales/en/templates-asciidoc.js +764 -0
  62. package/dist/templates/locales/en/templates-asciidoc.js.map +1 -0
  63. package/dist/templates/locales/en/{templates.d.ts → templates-markdown.d.ts} +1 -1
  64. package/dist/templates/locales/en/templates-markdown.d.ts.map +1 -0
  65. package/dist/templates/locales/en/{templates.js → templates-markdown.js} +1 -1
  66. package/dist/templates/locales/en/templates-markdown.js.map +1 -0
  67. package/dist/templates/locales/es/index.d.ts +15 -10
  68. package/dist/templates/locales/es/index.d.ts.map +1 -1
  69. package/dist/templates/locales/es/index.js +23 -31
  70. package/dist/templates/locales/es/index.js.map +1 -1
  71. package/dist/templates/locales/es/templates-asciidoc.d.ts +22 -0
  72. package/dist/templates/locales/es/templates-asciidoc.d.ts.map +1 -0
  73. package/dist/templates/locales/es/templates-asciidoc.js +764 -0
  74. package/dist/templates/locales/es/templates-asciidoc.js.map +1 -0
  75. package/dist/templates/locales/es/{templates.d.ts → templates-markdown.d.ts} +1 -1
  76. package/dist/templates/locales/es/templates-markdown.d.ts.map +1 -0
  77. package/dist/templates/locales/es/{templates.js → templates-markdown.js} +1 -1
  78. package/dist/templates/locales/es/templates-markdown.js.map +1 -0
  79. package/dist/templates/locales/fr/index.d.ts +14 -9
  80. package/dist/templates/locales/fr/index.d.ts.map +1 -1
  81. package/dist/templates/locales/fr/index.js +22 -30
  82. package/dist/templates/locales/fr/index.js.map +1 -1
  83. package/dist/templates/locales/fr/templates-asciidoc.d.ts +22 -0
  84. package/dist/templates/locales/fr/templates-asciidoc.d.ts.map +1 -0
  85. package/dist/templates/locales/fr/templates-asciidoc.js +764 -0
  86. package/dist/templates/locales/fr/templates-asciidoc.js.map +1 -0
  87. package/dist/templates/locales/fr/{templates.d.ts → templates-markdown.d.ts} +1 -1
  88. package/dist/templates/locales/fr/templates-markdown.d.ts.map +1 -0
  89. package/dist/templates/locales/fr/{templates.js → templates-markdown.js} +1 -1
  90. package/dist/templates/locales/fr/templates-markdown.js.map +1 -0
  91. package/dist/templates/locales/it/index.d.ts +14 -9
  92. package/dist/templates/locales/it/index.d.ts.map +1 -1
  93. package/dist/templates/locales/it/index.js +22 -30
  94. package/dist/templates/locales/it/index.js.map +1 -1
  95. package/dist/templates/locales/it/templates-asciidoc.d.ts +22 -0
  96. package/dist/templates/locales/it/templates-asciidoc.d.ts.map +1 -0
  97. package/dist/templates/locales/it/templates-asciidoc.js +764 -0
  98. package/dist/templates/locales/it/templates-asciidoc.js.map +1 -0
  99. package/dist/templates/locales/it/{templates.d.ts → templates-markdown.d.ts} +1 -1
  100. package/dist/templates/locales/it/templates-markdown.d.ts.map +1 -0
  101. package/dist/templates/locales/it/{templates.js → templates-markdown.js} +1 -1
  102. package/dist/templates/locales/it/templates-markdown.js.map +1 -0
  103. package/dist/templates/locales/language-strategy-factory.d.ts +120 -0
  104. package/dist/templates/locales/language-strategy-factory.d.ts.map +1 -0
  105. package/dist/templates/locales/language-strategy-factory.js +127 -0
  106. package/dist/templates/locales/language-strategy-factory.js.map +1 -0
  107. package/dist/templates/locales/language-strategy.d.ts +16 -12
  108. package/dist/templates/locales/language-strategy.d.ts.map +1 -1
  109. package/dist/templates/locales/language-strategy.js.map +1 -1
  110. package/dist/templates/locales/nl/index.d.ts +14 -9
  111. package/dist/templates/locales/nl/index.d.ts.map +1 -1
  112. package/dist/templates/locales/nl/index.js +22 -30
  113. package/dist/templates/locales/nl/index.js.map +1 -1
  114. package/dist/templates/locales/nl/templates-asciidoc.d.ts +22 -0
  115. package/dist/templates/locales/nl/templates-asciidoc.d.ts.map +1 -0
  116. package/dist/templates/locales/nl/templates-asciidoc.js +764 -0
  117. package/dist/templates/locales/nl/templates-asciidoc.js.map +1 -0
  118. package/dist/templates/locales/nl/{templates.d.ts → templates-markdown.d.ts} +1 -1
  119. package/dist/templates/locales/nl/templates-markdown.d.ts.map +1 -0
  120. package/dist/templates/locales/nl/{templates.js → templates-markdown.js} +1 -1
  121. package/dist/templates/locales/nl/templates-markdown.js.map +1 -0
  122. package/dist/templates/locales/pt/index.d.ts +14 -9
  123. package/dist/templates/locales/pt/index.d.ts.map +1 -1
  124. package/dist/templates/locales/pt/index.js +22 -30
  125. package/dist/templates/locales/pt/index.js.map +1 -1
  126. package/dist/templates/locales/pt/templates-asciidoc.d.ts +22 -0
  127. package/dist/templates/locales/pt/templates-asciidoc.d.ts.map +1 -0
  128. package/dist/templates/locales/pt/templates-asciidoc.js +764 -0
  129. package/dist/templates/locales/pt/templates-asciidoc.js.map +1 -0
  130. package/dist/templates/locales/pt/{templates.d.ts → templates-markdown.d.ts} +1 -1
  131. package/dist/templates/locales/pt/templates-markdown.d.ts.map +1 -0
  132. package/dist/templates/locales/pt/{templates.js → templates-markdown.js} +1 -1
  133. package/dist/templates/locales/pt/templates-markdown.js.map +1 -0
  134. package/dist/templates/locales/ru/index.d.ts +19 -3
  135. package/dist/templates/locales/ru/index.d.ts.map +1 -1
  136. package/dist/templates/locales/ru/index.js +28 -24
  137. package/dist/templates/locales/ru/index.js.map +1 -1
  138. package/dist/templates/locales/ru/templates-asciidoc.d.ts +22 -0
  139. package/dist/templates/locales/ru/templates-asciidoc.d.ts.map +1 -0
  140. package/dist/templates/locales/ru/templates-asciidoc.js +996 -0
  141. package/dist/templates/locales/ru/templates-asciidoc.js.map +1 -0
  142. package/dist/templates/locales/ru/{templates.d.ts → templates-markdown.d.ts} +1 -1
  143. package/dist/templates/locales/ru/templates-markdown.d.ts.map +1 -0
  144. package/dist/templates/locales/ru/{templates.js → templates-markdown.js} +1 -1
  145. package/dist/templates/locales/ru/templates-markdown.js.map +1 -0
  146. package/dist/templates/locales/template-provider.d.ts +22 -10
  147. package/dist/templates/locales/template-provider.d.ts.map +1 -1
  148. package/dist/templates/locales/template-provider.js +53 -14
  149. package/dist/templates/locales/template-provider.js.map +1 -1
  150. package/dist/templates/locales/ukr/index.d.ts +25 -3
  151. package/dist/templates/locales/ukr/index.d.ts.map +1 -1
  152. package/dist/templates/locales/ukr/index.js +34 -18
  153. package/dist/templates/locales/ukr/index.js.map +1 -1
  154. package/dist/templates/locales/ukr/templates-asciidoc.d.ts +22 -0
  155. package/dist/templates/locales/ukr/templates-asciidoc.d.ts.map +1 -0
  156. package/dist/templates/locales/ukr/templates-asciidoc.js +764 -0
  157. package/dist/templates/locales/ukr/templates-asciidoc.js.map +1 -0
  158. package/dist/templates/locales/ukr/{templates.d.ts → templates-markdown.d.ts} +1 -1
  159. package/dist/templates/locales/ukr/templates-markdown.d.ts.map +1 -0
  160. package/dist/templates/locales/ukr/{templates.js → templates-markdown.js} +1 -1
  161. package/dist/templates/locales/ukr/templates-markdown.js.map +1 -0
  162. package/dist/templates/locales/zh/index.d.ts +25 -3
  163. package/dist/templates/locales/zh/index.d.ts.map +1 -1
  164. package/dist/templates/locales/zh/index.js +34 -18
  165. package/dist/templates/locales/zh/index.js.map +1 -1
  166. package/dist/templates/locales/zh/templates-asciidoc.d.ts +22 -0
  167. package/dist/templates/locales/zh/templates-asciidoc.d.ts.map +1 -0
  168. package/dist/templates/locales/zh/templates-asciidoc.js +764 -0
  169. package/dist/templates/locales/zh/templates-asciidoc.js.map +1 -0
  170. package/dist/templates/locales/zh/{templates.d.ts → templates-markdown.d.ts} +1 -1
  171. package/dist/templates/locales/zh/templates-markdown.d.ts.map +1 -0
  172. package/dist/templates/locales/zh/{templates.js → templates-markdown.js} +1 -1
  173. package/dist/templates/locales/zh/templates-markdown.js.map +1 -0
  174. package/dist/tools/arc42-init.d.ts +2 -1
  175. package/dist/tools/arc42-init.d.ts.map +1 -1
  176. package/dist/tools/arc42-init.js +154 -24
  177. package/dist/tools/arc42-init.js.map +1 -1
  178. package/dist/tools/arc42-status.d.ts.map +1 -1
  179. package/dist/tools/arc42-status.js +66 -10
  180. package/dist/tools/arc42-status.js.map +1 -1
  181. package/dist/tools/arc42-workflow-guide.d.ts +1 -0
  182. package/dist/tools/arc42-workflow-guide.d.ts.map +1 -1
  183. package/dist/tools/arc42-workflow-guide.js +16 -14
  184. package/dist/tools/arc42-workflow-guide.js.map +1 -1
  185. package/dist/tools/generate-template.d.ts +1 -0
  186. package/dist/tools/generate-template.d.ts.map +1 -1
  187. package/dist/tools/generate-template.js +16 -5
  188. package/dist/tools/generate-template.js.map +1 -1
  189. package/dist/tools/get-section.d.ts.map +1 -1
  190. package/dist/tools/get-section.js +28 -7
  191. package/dist/tools/get-section.js.map +1 -1
  192. package/dist/tools/update-section.d.ts +1 -1
  193. package/dist/tools/update-section.d.ts.map +1 -1
  194. package/dist/tools/update-section.js +71 -8
  195. package/dist/tools/update-section.js.map +1 -1
  196. package/dist/types.d.ts +2 -0
  197. package/dist/types.d.ts.map +1 -1
  198. package/dist/types.js +1 -0
  199. package/dist/types.js.map +1 -1
  200. package/package.json +1 -1
  201. package/dist/templates/locales/cz/templates.d.ts.map +0 -1
  202. package/dist/templates/locales/cz/templates.js.map +0 -1
  203. package/dist/templates/locales/de/templates.d.ts.map +0 -1
  204. package/dist/templates/locales/de/templates.js.map +0 -1
  205. package/dist/templates/locales/en/templates.d.ts.map +0 -1
  206. package/dist/templates/locales/en/templates.js.map +0 -1
  207. package/dist/templates/locales/es/templates.d.ts.map +0 -1
  208. package/dist/templates/locales/es/templates.js.map +0 -1
  209. package/dist/templates/locales/fr/templates.d.ts.map +0 -1
  210. package/dist/templates/locales/fr/templates.js.map +0 -1
  211. package/dist/templates/locales/it/templates.d.ts.map +0 -1
  212. package/dist/templates/locales/it/templates.js.map +0 -1
  213. package/dist/templates/locales/nl/templates.d.ts.map +0 -1
  214. package/dist/templates/locales/nl/templates.js.map +0 -1
  215. package/dist/templates/locales/pt/templates.d.ts.map +0 -1
  216. package/dist/templates/locales/pt/templates.js.map +0 -1
  217. package/dist/templates/locales/ru/templates.d.ts.map +0 -1
  218. package/dist/templates/locales/ru/templates.js.map +0 -1
  219. package/dist/templates/locales/ukr/templates.d.ts.map +0 -1
  220. package/dist/templates/locales/ukr/templates.js.map +0 -1
  221. package/dist/templates/locales/zh/templates.d.ts.map +0 -1
  222. package/dist/templates/locales/zh/templates.js.map +0 -1
@@ -0,0 +1,764 @@
1
+ /**
2
+ * Chinese Templates - AsciiDoc Format
3
+ *
4
+ * Contains all arc42 section templates in Chinese using AsciiDoc syntax.
5
+ * Based on the official arc42 templates from vendor/arc42-template.
6
+ *
7
+ * @module templates/locales/zh/templates-asciidoc
8
+ */
9
+ /**
10
+ * Get the Chinese AsciiDoc template for a specific section
11
+ */
12
+ export function getTemplate(section) {
13
+ const templates = {
14
+ '01_introduction_and_goals': getIntroductionAndGoalsTemplate,
15
+ '02_architecture_constraints': getArchitectureConstraintsTemplate,
16
+ '03_context_and_scope': getContextAndScopeTemplate,
17
+ '04_solution_strategy': getSolutionStrategyTemplate,
18
+ '05_building_block_view': getBuildingBlockViewTemplate,
19
+ '06_runtime_view': getRuntimeViewTemplate,
20
+ '07_deployment_view': getDeploymentViewTemplate,
21
+ '08_concepts': getConceptsTemplate,
22
+ '09_architecture_decisions': getArchitectureDecisionsTemplate,
23
+ '10_quality_requirements': getQualityRequirementsTemplate,
24
+ '11_technical_risks': getTechnicalRisksTemplate,
25
+ '12_glossary': getGlossaryTemplate
26
+ };
27
+ return templates[section]();
28
+ }
29
+ function getIntroductionAndGoalsTemplate() {
30
+ return `= 1. 引言与目标
31
+
32
+ == 需求概述
33
+
34
+ *目的*:描述软件架构师和开发团队必须考虑的相关需求和驱动因素。
35
+
36
+ === 关键需求
37
+
38
+ // 列出前 3-5 个功能需求
39
+
40
+ [options="header",cols="1,3,1"]
41
+ |===
42
+ |编号 |需求 |优先级
43
+ |REQ-1 |[简要描述] |高
44
+ |REQ-2 |[简要描述] |中
45
+ |===
46
+
47
+ === 特性
48
+
49
+ // 系统的基本特性
50
+
51
+ * 特性 1:[描述]
52
+ * 特性 2:[描述]
53
+
54
+ == 质量目标
55
+
56
+ *目的*:定义对干系人最重要的前 3-5 个质量目标。
57
+
58
+ // 基于 ISO 25010,优先考虑以下质量属性:
59
+ // 性能、安全性、可靠性、可维护性、可用性等。
60
+
61
+ [options="header",cols="1,2,3"]
62
+ |===
63
+ |优先级 |质量目标 |动机
64
+ |1 |[例如:性能] |[为什么这很关键]
65
+ |2 |[例如:安全性] |[为什么这很关键]
66
+ |3 |[例如:可维护性] |[为什么这很关键]
67
+ |===
68
+
69
+ == 干系人
70
+
71
+ *目的*:识别所有应该了解架构的人员。
72
+
73
+ [options="header",cols="2,2,3"]
74
+ |===
75
+ |角色/姓名 |联系方式 |期望
76
+ |产品负责人 |[姓名/邮箱] |[他们对架构的期望]
77
+ |开发团队 |[团队名称] |[他们需要了解什么]
78
+ |运维团队 |[团队/人员] |[部署和运维关注点]
79
+ |最终用户 |[类型] |[用户体验期望]
80
+ |===
81
+
82
+ .更多信息
83
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-1/[引言与目标]。
84
+ `;
85
+ }
86
+ function getArchitectureConstraintsTemplate() {
87
+ return `= 2. 架构约束
88
+
89
+ *目的*:记录任何约束架构师在设计和实现决策自由度的需求。
90
+
91
+ == 技术约束
92
+
93
+ [options="header",cols="1,3"]
94
+ |===
95
+ |约束 |说明
96
+ |[例如:必须运行在 Linux 上] |[为什么存在此约束]
97
+ |[例如:最低 Java 17] |[组织要求]
98
+ |===
99
+
100
+ == 组织约束
101
+
102
+ [options="header",cols="1,3"]
103
+ |===
104
+ |约束 |说明
105
+ |[例如:团队规模:5 名开发人员] |[对架构的影响]
106
+ |[例如:时间线:6 个月] |[交付约束]
107
+ |===
108
+
109
+ == 约定
110
+
111
+ [options="header",cols="1,3"]
112
+ |===
113
+ |约定 |说明
114
+ |[例如:代码风格:Google Java Style] |[风格指南链接]
115
+ |[例如:文档:arc42] |[文档要求]
116
+ |===
117
+
118
+ .更多信息
119
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-2/[架构约束]。
120
+ `;
121
+ }
122
+ function getContextAndScopeTemplate() {
123
+ return `= 3. 上下文和边界
124
+
125
+ *目的*:将您的系统(即边界范围)与其所有通信方(周边系统和用户,即您系统的上下文)界定清晰。
126
+
127
+ == 业务上下文
128
+
129
+ *目的*:指定所有通信方(用户、IT 系统等)并解释特定领域的输入和输出。
130
+
131
+ // 在此处添加上下文图(PlantUML、Mermaid 或图片)
132
+
133
+ [plantuml, business-context, svg]
134
+ ----
135
+ @startuml
136
+ !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
137
+
138
+ Person(user, "用户", "系统用户")
139
+ System(system, "您的系统", "描述")
140
+ System_Ext(external, "外部系统", "描述")
141
+
142
+ Rel(user, system, "使用")
143
+ Rel(system, external, "调用")
144
+ @enduml
145
+ ----
146
+
147
+ [options="header",cols="1,2,2"]
148
+ |===
149
+ |通信方 |输入 |输出
150
+ |[用户/系统名称] |[他们发送的内容] |[他们接收的内容]
151
+ |===
152
+
153
+ == 技术上下文
154
+
155
+ *目的*:指定系统与其上下文之间的技术信道和协议。
156
+
157
+ // 带有协议的技术基础设施
158
+
159
+ [options="header",cols="1,1,2"]
160
+ |===
161
+ |通信方 |信道 |协议
162
+ |[系统名称] |[例如:REST API] |[例如:HTTPS、JSON]
163
+ |[系统名称] |[例如:消息队列] |[例如:AMQP]
164
+ |===
165
+
166
+ .更多信息
167
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-3/[上下文和边界]。
168
+ `;
169
+ }
170
+ function getSolutionStrategyTemplate() {
171
+ return `= 4. 解决方案策略
172
+
173
+ *目的*:塑造系统架构的基本决策和解决方案策略的简短总结。
174
+
175
+ == 技术决策
176
+
177
+ [options="header",cols="1,2,2"]
178
+ |===
179
+ |决策 |选择 |理由
180
+ |编程语言 |[例如:TypeScript] |[为什么选择这个]
181
+ |框架 |[例如:NestJS] |[为什么选择这个]
182
+ |数据库 |[例如:PostgreSQL] |[为什么选择这个]
183
+ |===
184
+
185
+ == 顶层分解
186
+
187
+ 描述高层结构:
188
+
189
+ * [例如:分层架构]
190
+ * [例如:微服务]
191
+ * [例如:事件驱动]
192
+
193
+ == 质量实现策略
194
+
195
+ [options="header",cols="1,2"]
196
+ |===
197
+ |质量目标 |实现策略
198
+ |[性能] |[例如:缓存、异步处理]
199
+ |[安全性] |[例如:OAuth2、静态加密]
200
+ |[可维护性] |[例如:整洁架构、全面测试]
201
+ |===
202
+
203
+ .更多信息
204
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-4/[解决方案策略]。
205
+ `;
206
+ }
207
+ function getBuildingBlockViewTemplate() {
208
+ return `= 5. 构建块视图
209
+
210
+ *目的*:系统静态分解为构建块及其依赖关系。
211
+
212
+ == 级别 1:整体系统
213
+
214
+ *目的*:白盒描述显示整体系统的内部结构。
215
+
216
+ === 白盒描述
217
+
218
+ // 在此处添加组件图
219
+
220
+ [plantuml, building-blocks-l1, svg]
221
+ ----
222
+ @startuml
223
+ !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
224
+
225
+ Container(web, "Web 应用", "React", "用户界面")
226
+ Container(api, "API 服务器", "Node.js", "业务逻辑")
227
+ ContainerDb(db, "数据库", "PostgreSQL", "数据存储")
228
+
229
+ Rel(web, api, "调用", "REST/JSON")
230
+ Rel(api, db, "读取/写入", "SQL")
231
+ @enduml
232
+ ----
233
+
234
+ === 包含的构建块
235
+
236
+ [options="header",cols="1,3"]
237
+ |===
238
+ |构建块 |描述
239
+ |[组件 A] |[职责和目的]
240
+ |[组件 B] |[职责和目的]
241
+ |===
242
+
243
+ == 级别 2:[子系统名称]
244
+
245
+ *目的*:将主要组件分解为更小的构建块。
246
+
247
+ === 白盒 [组件 A]
248
+
249
+ // 描述组件 A 的内部结构
250
+
251
+ [options="header",cols="1,3"]
252
+ |===
253
+ |构建块 |描述
254
+ |[子组件 A.1] |[职责]
255
+ |[子组件 A.2] |[职责]
256
+ |===
257
+
258
+ .更多信息
259
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-5/[构建块视图]。
260
+ `;
261
+ }
262
+ function getRuntimeViewTemplate() {
263
+ return `= 6. 运行时视图
264
+
265
+ *目的*:记录构建块在运行时的行为和交互。
266
+
267
+ == 场景 1:[例如:用户登录]
268
+
269
+ // 描述关键场景的运行时行为
270
+
271
+ [plantuml, runtime-login, svg]
272
+ ----
273
+ @startuml
274
+ actor 用户
275
+ participant "Web 应用" as Web
276
+ participant "API 服务器" as API
277
+ participant "认证服务" as Auth
278
+ database "用户数据库" as DB
279
+
280
+ 用户 -> Web: 输入凭证
281
+ Web -> API: POST /auth/login
282
+ API -> Auth: 验证凭证
283
+ Auth -> DB: 查询用户
284
+ DB --> Auth: 用户数据
285
+ Auth --> API: JWT 令牌
286
+ API --> Web: 成功 + 令牌
287
+ Web --> 用户: 仪表板
288
+ @enduml
289
+ ----
290
+
291
+ === 描述
292
+
293
+ . 用户在 Web 应用中输入凭证
294
+ . Web 应用向 API 服务器发送登录请求
295
+ . API 通过认证服务验证凭证
296
+ . 成功后返回 JWT 令牌
297
+
298
+ == 场景 2:[例如:数据处理]
299
+
300
+ // 记录另一个重要的运行时场景
301
+
302
+ === 描述
303
+
304
+ [描述步骤和交互]
305
+
306
+ .更多信息
307
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-6/[运行时视图]。
308
+ `;
309
+ }
310
+ function getDeploymentViewTemplate() {
311
+ return `= 7. 部署视图
312
+
313
+ *目的*:技术基础设施,包括环境、计算机、处理器、拓扑结构。
314
+
315
+ == 基础设施级别 1
316
+
317
+ *目的*:部署基础设施概览。
318
+
319
+ [plantuml, deployment-l1, svg]
320
+ ----
321
+ @startuml
322
+ !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Deployment.puml
323
+
324
+ Deployment_Node(cloud, "云服务提供商", "AWS/Azure/GCP") {
325
+ Deployment_Node(web_tier, "Web 层") {
326
+ Container(web, "Web 服务器", "nginx", "静态文件 + 反向代理")
327
+ }
328
+ Deployment_Node(app_tier, "应用层") {
329
+ Container(api, "API 服务器", "Node.js", "业务逻辑")
330
+ }
331
+ Deployment_Node(data_tier, "数据层") {
332
+ ContainerDb(db, "数据库", "PostgreSQL", "主存储")
333
+ }
334
+ }
335
+ @enduml
336
+ ----
337
+
338
+ === 动机
339
+
340
+ [为什么选择这种部署架构]
341
+
342
+ === 质量和性能特征
343
+
344
+ [此部署如何支持质量目标]
345
+
346
+ == 基础设施级别 2
347
+
348
+ *目的*:特定部署节点的详细视图。
349
+
350
+ === [节点名称]
351
+
352
+ [options="header",cols="1,3"]
353
+ |===
354
+ |方面 |描述
355
+ |硬件 |[例如:4 vCPU,16GB RAM]
356
+ |软件 |[例如:Ubuntu 22.04,Docker 24.x]
357
+ |网络 |[例如:VPC,安全组]
358
+ |===
359
+
360
+ .更多信息
361
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-7/[部署视图]。
362
+ `;
363
+ }
364
+ function getConceptsTemplate() {
365
+ return `= 8. 跨领域概念
366
+
367
+ *目的*:与多个构建块相关的整体规则和解决方案思路。
368
+
369
+ == 领域模型
370
+
371
+ // 核心领域概念及其关系
372
+
373
+ [plantuml, domain-model, svg]
374
+ ----
375
+ @startuml
376
+ class 用户 {
377
+ +id: UUID
378
+ +email: String
379
+ +name: String
380
+ }
381
+ class 订单 {
382
+ +id: UUID
383
+ +status: OrderStatus
384
+ +createdAt: DateTime
385
+ }
386
+ 用户 "1" -- "*" 订单 : 下单
387
+ @enduml
388
+ ----
389
+
390
+ == 安全概念
391
+
392
+ === 认证
393
+
394
+ [描述认证方法:JWT、OAuth2 等]
395
+
396
+ === 授权
397
+
398
+ [描述授权方法:RBAC、ABAC 等]
399
+
400
+ == 错误处理
401
+
402
+ [描述系统如何处理错误]
403
+
404
+ * [例如:全局错误处理器]
405
+ * [例如:结构化错误响应]
406
+ * [例如:错误日志策略]
407
+
408
+ == 日志和监控
409
+
410
+ [options="header",cols="1,2"]
411
+ |===
412
+ |方面 |方法
413
+ |日志 |[例如:结构化 JSON 日志,ELK 栈]
414
+ |指标 |[例如:Prometheus,Grafana]
415
+ |追踪 |[例如:OpenTelemetry,Jaeger]
416
+ |===
417
+
418
+ == 测试策略
419
+
420
+ [options="header",cols="1,2,1"]
421
+ |===
422
+ |类型 |范围 |覆盖率目标
423
+ |单元测试 |单个函数/类 |80%
424
+ |集成测试 |组件交互 |关键路径
425
+ |端到端测试 |完整用户流程 |关键流程
426
+ |===
427
+
428
+ .更多信息
429
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-8/[跨领域概念]。
430
+ `;
431
+ }
432
+ function getArchitectureDecisionsTemplate() {
433
+ return `= 9. 架构决策
434
+
435
+ *目的*:记录重要的、高成本的、大规模的或有风险的架构决策。
436
+
437
+ == ADR-001:[决策标题]
438
+
439
+ === 状态
440
+
441
+ [提议 | 已接受 | 已弃用 | 已取代]
442
+
443
+ === 上下文
444
+
445
+ [描述促使做出此决策的问题]
446
+
447
+ === 决策
448
+
449
+ [描述做出的决策]
450
+
451
+ === 后果
452
+
453
+ *正面:*
454
+
455
+ * [好处 1]
456
+ * [好处 2]
457
+
458
+ *负面:*
459
+
460
+ * [缺点 1]
461
+ * [缺点 2]
462
+
463
+ === 考虑的替代方案
464
+
465
+ [options="header",cols="1,2,2"]
466
+ |===
467
+ |替代方案 |优点 |缺点
468
+ |[选项 A] |[好处] |[缺点]
469
+ |[选项 B] |[好处] |[缺点]
470
+ |===
471
+
472
+ '''
473
+
474
+ == ADR-002:[决策标题]
475
+
476
+ // 对于其他决策使用相同的模板
477
+
478
+ .更多信息
479
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-9/[架构决策]。
480
+ `;
481
+ }
482
+ function getQualityRequirementsTemplate() {
483
+ return `= 10. 质量需求
484
+
485
+ *目的*:具体的质量需求及用于评估的场景。
486
+
487
+ == 质量树
488
+
489
+ // 质量目标及其细化的可视化表示
490
+
491
+ [plantuml, quality-tree, svg]
492
+ ----
493
+ @startmindmap
494
+ * 质量
495
+ ** 性能
496
+ *** 响应时间
497
+ *** 吞吐量
498
+ ** 安全性
499
+ *** 认证
500
+ *** 授权
501
+ ** 可维护性
502
+ *** 模块化
503
+ *** 可测试性
504
+ @endmindmap
505
+ ----
506
+
507
+ == 质量场景
508
+
509
+ === 性能场景
510
+
511
+ [options="header",cols="1,2,1,1"]
512
+ |===
513
+ |编号 |场景 |预期响应 |优先级
514
+ |PERF-1 |用户在正常负载下请求仪表板 |< 200ms |高
515
+ |PERF-2 |系统处理 1000 个并发用户 |无降级 |中
516
+ |===
517
+
518
+ === 安全场景
519
+
520
+ [options="header",cols="1,2,1,1"]
521
+ |===
522
+ |编号 |场景 |预期行为 |优先级
523
+ |SEC-1 |无效登录尝试 |5 次尝试后锁定账户 |高
524
+ |SEC-2 |未授权的 API 访问 |返回 401,记录审计日志 |高
525
+ |===
526
+
527
+ === 可维护性场景
528
+
529
+ [options="header",cols="1,2,1,1"]
530
+ |===
531
+ |编号 |场景 |预期工作量 |优先级
532
+ |MAINT-1 |添加新实体类型 |< 2 天开发 |中
533
+ |MAINT-2 |更新依赖版本 |< 4 小时(包括测试) |中
534
+ |===
535
+
536
+ .更多信息
537
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-10/[质量需求]。
538
+ `;
539
+ }
540
+ function getTechnicalRisksTemplate() {
541
+ return `= 11. 风险和技术债务
542
+
543
+ *目的*:识别和跟踪已知的技术风险和累积的技术债务。
544
+
545
+ == 技术风险
546
+
547
+ [options="header",cols="1,2,1,2"]
548
+ |===
549
+ |风险 |描述 |概率 |缓解措施
550
+ |[例如:第三方 API 故障] |[我们依赖的外部服务] |中 |[熔断器、降级方案]
551
+ |[例如:数据丢失] |[数据库损坏] |低 |[备份、复制]
552
+ |===
553
+
554
+ == 技术债务
555
+
556
+ [options="header",cols="1,2,1,1"]
557
+ |===
558
+ |项目 |描述 |影响 |优先级
559
+ |[例如:遗留认证] |[旧认证系统需要替换] |高 |中
560
+ |[例如:缺少测试] |[模块 X 的覆盖率低于目标] |中 |低
561
+ |===
562
+
563
+ == 风险监控
564
+
565
+ [描述如何监控和审查风险]
566
+
567
+ * [例如:每周风险审查会议]
568
+ * [例如:自动监控告警]
569
+
570
+ .更多信息
571
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-11/[风险和技术债务]。
572
+ `;
573
+ }
574
+ function getGlossaryTemplate() {
575
+ return `= 12. 术语表
576
+
577
+ *目的*:定义架构文档中使用的重要领域和技术术语。
578
+
579
+ == 领域术语
580
+
581
+ [options="header",cols="1,3"]
582
+ |===
583
+ |术语 |定义
584
+ |[领域术语 1] |[清晰、简洁的定义]
585
+ |[领域术语 2] |[清晰、简洁的定义]
586
+ |===
587
+
588
+ == 技术术语
589
+
590
+ [options="header",cols="1,3"]
591
+ |===
592
+ |术语 |定义
593
+ |[技术术语 1] |[清晰、简洁的定义]
594
+ |[技术术语 2] |[清晰、简洁的定义]
595
+ |===
596
+
597
+ == 缩写
598
+
599
+ [options="header",cols="1,3"]
600
+ |===
601
+ |缩写 |含义
602
+ |API |应用程序编程接口
603
+ |JWT |JSON Web 令牌
604
+ |REST |表述性状态转移
605
+ |===
606
+
607
+ .更多信息
608
+ 参见 arc42 文档中的 link:https://docs.arc42.org/section-12/[术语表]。
609
+ `;
610
+ }
611
+ /**
612
+ * Get the Chinese workflow guide in AsciiDoc format
613
+ */
614
+ export function getWorkflowGuide() {
615
+ return `= arc42 架构文档工作流指南
616
+
617
+ == 概述
618
+
619
+ 本指南帮助您使用 arc42 模板记录软件架构。arc42 模板是一个实用的、经过验证的软件和系统架构文档模板。
620
+
621
+ == 支持的语言
622
+
623
+ 此 arc42 MCP 服务器支持多种语言的文档:
624
+
625
+ [options="header",cols="1,2,2"]
626
+ |===
627
+ |代码 |语言 |原名
628
+ |EN |英语 |English
629
+ |DE |德语 |Deutsch
630
+ |CZ |捷克语 |Čeština
631
+ |ES |西班牙语 |Español
632
+ |FR |法语 |Français
633
+ |IT |意大利语 |Italiano
634
+ |NL |荷兰语 |Nederlands
635
+ |PT |葡萄牙语 |Português
636
+ |RU |俄语 |Русский
637
+ |UKR |乌克兰语 |Українська
638
+ |ZH |中文 |中文
639
+ |===
640
+
641
+ == 入门指南
642
+
643
+ === 步骤 1:初始化工作空间
644
+
645
+ 使用 \`arc42-init\` 工具创建文档工作空间:
646
+
647
+ [source]
648
+ ----
649
+ arc42-init(projectName: "我的项目", language: "ZH")
650
+ ----
651
+
652
+ 您可以使用 ISO 语言代码指定不同的语言。
653
+
654
+ === 步骤 2:检查状态
655
+
656
+ 使用 \`arc42-status\` 查看文档的当前状态:
657
+
658
+ [source]
659
+ ----
660
+ arc42-status()
661
+ ----
662
+
663
+ === 步骤 3:生成章节模板
664
+
665
+ 使用 \`generate-template\` 获取每个章节的详细模板:
666
+
667
+ [source]
668
+ ----
669
+ generate-template(section: "01_introduction_and_goals", language: "ZH")
670
+ ----
671
+
672
+ == arc42 的 12 个章节
673
+
674
+ . *引言与目标* - 从这里开始!定义您正在构建什么以及为什么。
675
+ . *架构约束* - 您不能做什么?
676
+ . *上下文和边界* - 什么在范围内,什么在范围外?
677
+ . *解决方案策略* - 解决问题的高层方法。
678
+ . *构建块视图* - 系统的静态结构。
679
+ . *运行时视图* - 动态行为和场景。
680
+ . *部署视图* - 如何部署和运维?
681
+ . *跨领域概念* - 系统中使用的模式。
682
+ . *架构决策* - 重要决策及其理由。
683
+ . *质量需求* - 具体的质量场景。
684
+ . *风险和技术债务* - 可能出什么问题?
685
+ . *术语表* - 定义您的术语。
686
+
687
+ == 最佳实践
688
+
689
+ . *从第 1 章开始* - 理解目标是基础
690
+ . *保持简洁* - arc42 是务实的,不是官僚的
691
+ . *使用图表* - 一图胜千言
692
+ . *记录决策* - 未来的您会感谢现在的您
693
+ . *迭代* - 架构文档永远不会"完成"
694
+
695
+ == 可用工具
696
+
697
+ * \`arc42-init\` - 初始化文档工作空间
698
+ * \`arc42-status\` - 检查文档状态
699
+ * \`generate-template\` - 生成章节模板
700
+ * \`update-section\` - 更新章节内容
701
+ * \`get-section\` - 读取章节内容
702
+ * \`arc42-workflow-guide\` - 显示本指南
703
+
704
+ == 资源
705
+
706
+ * link:https://arc42.org/[arc42 网站]
707
+ * link:https://docs.arc42.org/[arc42 文档]
708
+ * link:https://arc42.org/examples[arc42 示例]
709
+ `;
710
+ }
711
+ /**
712
+ * Get the Chinese README content in AsciiDoc format
713
+ */
714
+ export function getReadmeContent(projectName) {
715
+ const name = projectName || '项目';
716
+ return `= ${name} - 架构文档
717
+
718
+ 本目录包含 ${name} 的架构文档,遵循 arc42 模板。
719
+
720
+ == 结构
721
+
722
+ * \`sections/\` - 单独的章节 AsciiDoc 文件(12 个章节)
723
+ * \`images/\` - 图表和图片
724
+ * \`arc42-documentation.adoc\` - 主合并文档
725
+ * \`config.yaml\` - 配置
726
+
727
+ == arc42 的 12 个章节
728
+
729
+ . *引言与目标* - 需求、质量目标、干系人
730
+ . *架构约束* - 技术和组织约束
731
+ . *上下文和边界* - 业务和技术上下文
732
+ . *解决方案策略* - 基本决策和策略
733
+ . *构建块视图* - 静态分解
734
+ . *运行时视图* - 动态行为
735
+ . *部署视图* - 基础设施和部署
736
+ . *跨领域概念* - 整体规则和方法
737
+ . *架构决策* - 重要决策(ADR)
738
+ . *质量需求* - 质量树和场景
739
+ . *风险和技术债务* - 已知问题和风险
740
+ . *术语表* - 重要术语
741
+
742
+ == 入门指南
743
+
744
+ . 从第 1 章开始:引言与目标
745
+ . 迭代地完成各章节
746
+ . 使用图表来说明概念
747
+ . 关注决策,而非实现细节
748
+
749
+ == 生成文档
750
+
751
+ 使用 MCP 工具:
752
+
753
+ * 检查状态:\`arc42-status\`
754
+ * 生成模板:\`generate-template\`
755
+ * 更新章节:\`update-section\`
756
+
757
+ == 资源
758
+
759
+ * link:https://arc42.org/[arc42 网站]
760
+ * link:https://docs.arc42.org/[arc42 文档]
761
+ * link:https://arc42.org/examples[arc42 示例]
762
+ `;
763
+ }
764
+ //# sourceMappingURL=templates-asciidoc.js.map