novelws 1.2.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 (320) hide show
  1. package/CHANGELOG.md +161 -0
  2. package/LICENSE +22 -0
  3. package/README.md +372 -0
  4. package/dist/cli.d.ts +3 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +50 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/commands/check.d.ts +6 -0
  9. package/dist/commands/check.d.ts.map +1 -0
  10. package/dist/commands/check.js +32 -0
  11. package/dist/commands/check.js.map +1 -0
  12. package/dist/commands/init.d.ts +6 -0
  13. package/dist/commands/init.d.ts.map +1 -0
  14. package/dist/commands/init.js +160 -0
  15. package/dist/commands/init.js.map +1 -0
  16. package/dist/commands/plugin.d.ts +6 -0
  17. package/dist/commands/plugin.d.ts.map +1 -0
  18. package/dist/commands/plugin.js +135 -0
  19. package/dist/commands/plugin.js.map +1 -0
  20. package/dist/commands/upgrade.d.ts +6 -0
  21. package/dist/commands/upgrade.d.ts.map +1 -0
  22. package/dist/commands/upgrade.js +92 -0
  23. package/dist/commands/upgrade.js.map +1 -0
  24. package/dist/core/config.d.ts +72 -0
  25. package/dist/core/config.d.ts.map +1 -0
  26. package/dist/core/config.js +136 -0
  27. package/dist/core/config.js.map +1 -0
  28. package/dist/core/errors.d.ts +59 -0
  29. package/dist/core/errors.d.ts.map +1 -0
  30. package/dist/core/errors.js +125 -0
  31. package/dist/core/errors.js.map +1 -0
  32. package/dist/core/platform.d.ts +27 -0
  33. package/dist/core/platform.d.ts.map +1 -0
  34. package/dist/core/platform.js +75 -0
  35. package/dist/core/platform.js.map +1 -0
  36. package/dist/core/template.d.ts +35 -0
  37. package/dist/core/template.d.ts.map +1 -0
  38. package/dist/core/template.js +94 -0
  39. package/dist/core/template.js.map +1 -0
  40. package/dist/plugins/identifier.d.ts +13 -0
  41. package/dist/plugins/identifier.d.ts.map +1 -0
  42. package/dist/plugins/identifier.js +72 -0
  43. package/dist/plugins/identifier.js.map +1 -0
  44. package/dist/plugins/installers/base.d.ts +27 -0
  45. package/dist/plugins/installers/base.d.ts.map +1 -0
  46. package/dist/plugins/installers/base.js +30 -0
  47. package/dist/plugins/installers/base.js.map +1 -0
  48. package/dist/plugins/installers/github.d.ts +22 -0
  49. package/dist/plugins/installers/github.d.ts.map +1 -0
  50. package/dist/plugins/installers/github.js +133 -0
  51. package/dist/plugins/installers/github.js.map +1 -0
  52. package/dist/plugins/installers/local.d.ts +16 -0
  53. package/dist/plugins/installers/local.d.ts.map +1 -0
  54. package/dist/plugins/installers/local.js +69 -0
  55. package/dist/plugins/installers/local.js.map +1 -0
  56. package/dist/plugins/installers/npm.d.ts +20 -0
  57. package/dist/plugins/installers/npm.d.ts.map +1 -0
  58. package/dist/plugins/installers/npm.js +99 -0
  59. package/dist/plugins/installers/npm.js.map +1 -0
  60. package/dist/plugins/manager.d.ts +77 -0
  61. package/dist/plugins/manager.d.ts.map +1 -0
  62. package/dist/plugins/manager.js +349 -0
  63. package/dist/plugins/manager.js.map +1 -0
  64. package/dist/plugins/registry.d.ts +48 -0
  65. package/dist/plugins/registry.d.ts.map +1 -0
  66. package/dist/plugins/registry.js +111 -0
  67. package/dist/plugins/registry.js.map +1 -0
  68. package/dist/plugins/types.d.ts +66 -0
  69. package/dist/plugins/types.d.ts.map +1 -0
  70. package/dist/plugins/types.js +2 -0
  71. package/dist/plugins/types.js.map +1 -0
  72. package/dist/plugins/validator.d.ts +19 -0
  73. package/dist/plugins/validator.d.ts.map +1 -0
  74. package/dist/plugins/validator.js +164 -0
  75. package/dist/plugins/validator.js.map +1 -0
  76. package/dist/utils/logger.d.ts +13 -0
  77. package/dist/utils/logger.d.ts.map +1 -0
  78. package/dist/utils/logger.js +48 -0
  79. package/dist/utils/logger.js.map +1 -0
  80. package/dist/utils/project.d.ts +24 -0
  81. package/dist/utils/project.d.ts.map +1 -0
  82. package/dist/utils/project.js +61 -0
  83. package/dist/utils/project.js.map +1 -0
  84. package/dist/version.d.ts +3 -0
  85. package/dist/version.d.ts.map +1 -0
  86. package/dist/version.js +21 -0
  87. package/dist/version.js.map +1 -0
  88. package/package.json +76 -0
  89. package/plugins/authentic-voice/README.md +31 -0
  90. package/plugins/authentic-voice/commands/authentic-voice.md +73 -0
  91. package/plugins/authentic-voice/commands/authenticity-audit.md +37 -0
  92. package/plugins/authentic-voice/config.yaml +30 -0
  93. package/plugins/authentic-voice/experts/authentic-editor.md +27 -0
  94. package/plugins/export/README.md +319 -0
  95. package/plugins/export/commands/export.md +460 -0
  96. package/plugins/export/commands/generate-cover.md +256 -0
  97. package/plugins/export/commands/metadata.md +309 -0
  98. package/plugins/export/config.yaml +47 -0
  99. package/plugins/export/experts/publishing-expert.md +171 -0
  100. package/plugins/export/templates/epub/chapter-template.html +13 -0
  101. package/plugins/export/templates/epub/cover-template.html +14 -0
  102. package/plugins/export/templates/epub/stylesheet.css +200 -0
  103. package/plugins/export/templates/pdf/ebook-style.css +137 -0
  104. package/plugins/export/templates/pdf/print-style.css +179 -0
  105. package/plugins/export/templates/platforms/jinjiang-format.md +101 -0
  106. package/plugins/export/templates/platforms/qidian-format.md +108 -0
  107. package/plugins/export/templates/platforms/tomato-format.md +95 -0
  108. package/plugins/translate/README.md +265 -0
  109. package/plugins/translate/commands/glossary.md +731 -0
  110. package/plugins/translate/commands/translate-preview.md +543 -0
  111. package/plugins/translate/commands/translate.md +649 -0
  112. package/plugins/translate/config.yaml +43 -0
  113. package/plugins/translate/experts/literary-translator.md +605 -0
  114. package/templates/commands/analyze.md +1485 -0
  115. package/templates/commands/checklist.md +434 -0
  116. package/templates/commands/clarify.md +257 -0
  117. package/templates/commands/constitution.md +257 -0
  118. package/templates/commands/expert.md +136 -0
  119. package/templates/commands/plan.md +749 -0
  120. package/templates/commands/recap.md +613 -0
  121. package/templates/commands/relations.md +96 -0
  122. package/templates/commands/revise.md +341 -0
  123. package/templates/commands/specify.md +682 -0
  124. package/templates/commands/tasks.md +142 -0
  125. package/templates/commands/timeline.md +73 -0
  126. package/templates/commands/track-init.md +137 -0
  127. package/templates/commands/track.md +463 -0
  128. package/templates/commands/write.md +1264 -0
  129. package/templates/config/keyword-mappings.json +106 -0
  130. package/templates/knowledge/audit-config.json +26 -0
  131. package/templates/knowledge/character-profiles.md +152 -0
  132. package/templates/knowledge/character-voices.md +137 -0
  133. package/templates/knowledge/locations.md +184 -0
  134. package/templates/knowledge/world-setting.md +121 -0
  135. package/templates/knowledge-base/README.md +285 -0
  136. package/templates/knowledge-base/character-archetypes/01-hero.md +233 -0
  137. package/templates/knowledge-base/character-archetypes/02-mentor.md +177 -0
  138. package/templates/knowledge-base/character-archetypes/03-shadow.md +221 -0
  139. package/templates/knowledge-base/character-archetypes/04-ally.md +178 -0
  140. package/templates/knowledge-base/character-archetypes/05-shapeshifter.md +177 -0
  141. package/templates/knowledge-base/character-archetypes/06-trickster.md +181 -0
  142. package/templates/knowledge-base/character-archetypes/07-threshold-guardian.md +177 -0
  143. package/templates/knowledge-base/character-archetypes/08-herald.md +180 -0
  144. package/templates/knowledge-base/character-archetypes/09-father.md +249 -0
  145. package/templates/knowledge-base/character-archetypes/10-mother.md +202 -0
  146. package/templates/knowledge-base/character-archetypes/11-child.md +183 -0
  147. package/templates/knowledge-base/character-archetypes/12-sage.md +202 -0
  148. package/templates/knowledge-base/character-archetypes/README.md +60 -0
  149. package/templates/knowledge-base/character-archetypes/application-guide.md +222 -0
  150. package/templates/knowledge-base/character-archetypes/archetype-combinations.md +242 -0
  151. package/templates/knowledge-base/character-archetypes/config.yaml +28 -0
  152. package/templates/knowledge-base/character-archetypes/examples-analysis.md +223 -0
  153. package/templates/knowledge-base/craft/character-arc.md +1153 -0
  154. package/templates/knowledge-base/craft/dialogue.md +1170 -0
  155. package/templates/knowledge-base/craft/pacing.md +1200 -0
  156. package/templates/knowledge-base/craft/scene-structure.md +1136 -0
  157. package/templates/knowledge-base/craft/show-not-tell.md +1012 -0
  158. package/templates/knowledge-base/emotional-beats/01-first-meeting.md +145 -0
  159. package/templates/knowledge-base/emotional-beats/02-bonding-moment.md +226 -0
  160. package/templates/knowledge-base/emotional-beats/03-declaration.md +284 -0
  161. package/templates/knowledge-base/emotional-beats/04-triumph.md +240 -0
  162. package/templates/knowledge-base/emotional-beats/05-reunion.md +396 -0
  163. package/templates/knowledge-base/emotional-beats/06-forgiveness.md +204 -0
  164. package/templates/knowledge-base/emotional-beats/07-betrayal.md +204 -0
  165. package/templates/knowledge-base/emotional-beats/08-loss.md +214 -0
  166. package/templates/knowledge-base/emotional-beats/09-rejection.md +254 -0
  167. package/templates/knowledge-base/emotional-beats/10-failure.md +244 -0
  168. package/templates/knowledge-base/emotional-beats/11-misunderstanding.md +205 -0
  169. package/templates/knowledge-base/emotional-beats/12-farewell.md +283 -0
  170. package/templates/knowledge-base/emotional-beats/13-revelation.md +242 -0
  171. package/templates/knowledge-base/emotional-beats/14-point-of-no-return.md +215 -0
  172. package/templates/knowledge-base/emotional-beats/15-dark-night.md +244 -0
  173. package/templates/knowledge-base/emotional-beats/16-sacrifice.md +246 -0
  174. package/templates/knowledge-base/emotional-beats/17-awakening.md +246 -0
  175. package/templates/knowledge-base/emotional-beats/18-confrontation.md +217 -0
  176. package/templates/knowledge-base/emotional-beats/19-bittersweet-goodbye.md +368 -0
  177. package/templates/knowledge-base/emotional-beats/20-moral-dilemma.md +248 -0
  178. package/templates/knowledge-base/emotional-beats/21-temptation.md +240 -0
  179. package/templates/knowledge-base/emotional-beats/22-redemption.md +210 -0
  180. package/templates/knowledge-base/emotional-beats/README.md +104 -0
  181. package/templates/knowledge-base/emotional-beats/beat-sequences.md +276 -0
  182. package/templates/knowledge-base/emotional-beats/config.yaml +30 -0
  183. package/templates/knowledge-base/emotional-beats/pacing-guide.md +390 -0
  184. package/templates/knowledge-base/genres/historical.md +1127 -0
  185. package/templates/knowledge-base/genres/mystery.md +1123 -0
  186. package/templates/knowledge-base/genres/revenge.md +846 -0
  187. package/templates/knowledge-base/genres/romance.md +948 -0
  188. package/templates/knowledge-base/genres/sci-fi.md +156 -0
  189. package/templates/knowledge-base/genres/thriller.md +166 -0
  190. package/templates/knowledge-base/genres/wuxia.md +143 -0
  191. package/templates/knowledge-base/references/README.md +96 -0
  192. package/templates/knowledge-base/references/china-1920s/culture.md +423 -0
  193. package/templates/knowledge-base/references/china-1920s/daily-life.md +616 -0
  194. package/templates/knowledge-base/references/china-1920s/overview.md +298 -0
  195. package/templates/knowledge-base/references/china-1920s/society.md +703 -0
  196. package/templates/knowledge-base/references/china-1920s/warlords.md +427 -0
  197. package/templates/knowledge-base/references/cultivation-world/daily-life.md +108 -0
  198. package/templates/knowledge-base/references/cultivation-world/overview.md +64 -0
  199. package/templates/knowledge-base/references/cultivation-world/power-system.md +108 -0
  200. package/templates/knowledge-base/references/cultivation-world/sects.md +104 -0
  201. package/templates/knowledge-base/references/cultivation-world/world-setting.md +108 -0
  202. package/templates/knowledge-base/references/modern-workplace/corporate.md +115 -0
  203. package/templates/knowledge-base/references/modern-workplace/daily-life.md +129 -0
  204. package/templates/knowledge-base/references/modern-workplace/overview.md +73 -0
  205. package/templates/knowledge-base/references/modern-workplace/relationships.md +107 -0
  206. package/templates/knowledge-base/references/modern-workplace/tech-industry.md +131 -0
  207. package/templates/knowledge-base/references/tang-dynasty/culture.md +135 -0
  208. package/templates/knowledge-base/references/tang-dynasty/daily-life.md +139 -0
  209. package/templates/knowledge-base/references/tang-dynasty/overview.md +76 -0
  210. package/templates/knowledge-base/references/tang-dynasty/politics.md +121 -0
  211. package/templates/knowledge-base/references/tang-dynasty/society.md +126 -0
  212. package/templates/knowledge-base/requirements/README.md +240 -0
  213. package/templates/knowledge-base/requirements/anti-ai-v3.md +46 -0
  214. package/templates/knowledge-base/requirements/anti-ai-v4.md +430 -0
  215. package/templates/knowledge-base/requirements/fast-paced.md +552 -0
  216. package/templates/knowledge-base/requirements/no-poison.md +60 -0
  217. package/templates/knowledge-base/requirements/romance-angst.md +102 -0
  218. package/templates/knowledge-base/requirements/romance-sweet.md +63 -0
  219. package/templates/knowledge-base/requirements/serious-literature.md +45 -0
  220. package/templates/knowledge-base/requirements/strong-emotion.md +60 -0
  221. package/templates/knowledge-base/styles/README.md +302 -0
  222. package/templates/knowledge-base/styles/ancient-style.md +579 -0
  223. package/templates/knowledge-base/styles/literary.md +439 -0
  224. package/templates/knowledge-base/styles/minimal.md +472 -0
  225. package/templates/knowledge-base/styles/natural-voice.md +930 -0
  226. package/templates/knowledge-base/styles/web-novel.md +525 -0
  227. package/templates/memory/constitution.md +140 -0
  228. package/templates/memory/personal-voice.md +113 -0
  229. package/templates/scripts/README.md +187 -0
  230. package/templates/scripts/bash/analyze-story.sh +170 -0
  231. package/templates/scripts/bash/check-consistency.sh +463 -0
  232. package/templates/scripts/bash/check-plot.sh +374 -0
  233. package/templates/scripts/bash/check-timeline.sh +346 -0
  234. package/templates/scripts/bash/check-world.sh +395 -0
  235. package/templates/scripts/bash/check-writing-state.sh +854 -0
  236. package/templates/scripts/bash/clarify-story.sh +117 -0
  237. package/templates/scripts/bash/common.sh +151 -0
  238. package/templates/scripts/bash/constitution.sh +114 -0
  239. package/templates/scripts/bash/generate-tasks.sh +65 -0
  240. package/templates/scripts/bash/init-tracking.sh +183 -0
  241. package/templates/scripts/bash/manage-relations.sh +174 -0
  242. package/templates/scripts/bash/plan-story.sh +100 -0
  243. package/templates/scripts/bash/specify-story.sh +93 -0
  244. package/templates/scripts/bash/tasks-story.sh +96 -0
  245. package/templates/scripts/bash/test-word-count.sh +182 -0
  246. package/templates/scripts/bash/tests/bench-preload-cache.sh +100 -0
  247. package/templates/scripts/bash/tests/run-all-benchmarks.sh +16 -0
  248. package/templates/scripts/bash/tests/test-cache-semantics.sh +199 -0
  249. package/templates/scripts/bash/tests/test-cross-platform.sh +35 -0
  250. package/templates/scripts/bash/tests/test-edge-cases-bash.sh +60 -0
  251. package/templates/scripts/bash/tests/test-phase1-bash.sh +28 -0
  252. package/templates/scripts/bash/tests/test-preload-cache.sh +123 -0
  253. package/templates/scripts/bash/tests/test-regex-precompile.sh +89 -0
  254. package/templates/scripts/bash/tests/test-regression-bash.sh +42 -0
  255. package/templates/scripts/bash/tests/test-task6-verification.sh +200 -0
  256. package/templates/scripts/bash/text-audit.sh +144 -0
  257. package/templates/scripts/bash/track-progress.sh +194 -0
  258. package/templates/scripts/powershell/analyze-story.ps1 +171 -0
  259. package/templates/scripts/powershell/check-analyze-stage.ps1 +110 -0
  260. package/templates/scripts/powershell/check-consistency.ps1 +138 -0
  261. package/templates/scripts/powershell/check-plot.ps1 +139 -0
  262. package/templates/scripts/powershell/check-timeline.ps1 +112 -0
  263. package/templates/scripts/powershell/check-writing-state.ps1 +490 -0
  264. package/templates/scripts/powershell/check-writing-state.ps1.backup +135 -0
  265. package/templates/scripts/powershell/clarify-story.ps1 +107 -0
  266. package/templates/scripts/powershell/common.ps1 +36 -0
  267. package/templates/scripts/powershell/constitution.ps1 +142 -0
  268. package/templates/scripts/powershell/generate-tasks.ps1 +75 -0
  269. package/templates/scripts/powershell/init-tracking.ps1 +98 -0
  270. package/templates/scripts/powershell/manage-relations.ps1 +134 -0
  271. package/templates/scripts/powershell/plan-story.ps1 +96 -0
  272. package/templates/scripts/powershell/specify-story.ps1 +82 -0
  273. package/templates/scripts/powershell/tests/bench-ps-cache.ps1 +80 -0
  274. package/templates/scripts/powershell/tests/test-cross-platform.ps1 +27 -0
  275. package/templates/scripts/powershell/tests/test-edge-cases-ps.ps1 +29 -0
  276. package/templates/scripts/powershell/tests/test-phase1-ps.ps1 +28 -0
  277. package/templates/scripts/powershell/tests/test-ps-cache.ps1 +73 -0
  278. package/templates/scripts/powershell/tests/test-regression-ps.ps1 +40 -0
  279. package/templates/scripts/powershell/text-audit.ps1 +100 -0
  280. package/templates/scripts/powershell/track-progress.ps1 +105 -0
  281. package/templates/skills/genre-knowledge/fantasy/SKILL.md +355 -0
  282. package/templates/skills/genre-knowledge/mystery/SKILL.md +337 -0
  283. package/templates/skills/genre-knowledge/romance/SKILL.md +228 -0
  284. package/templates/skills/genre-knowledge/sci-fi/SKILL.md +65 -0
  285. package/templates/skills/genre-knowledge/thriller/SKILL.md +95 -0
  286. package/templates/skills/quality-assurance/consistency-checker/SKILL.md +341 -0
  287. package/templates/skills/quality-assurance/continuity-tracker/SKILL.md +157 -0
  288. package/templates/skills/quality-assurance/forgotten-elements/SKILL.md +147 -0
  289. package/templates/skills/quality-assurance/getting-started/SKILL.md +224 -0
  290. package/templates/skills/quality-assurance/pacing-monitor/SKILL.md +143 -0
  291. package/templates/skills/quality-assurance/pov-validator/SKILL.md +135 -0
  292. package/templates/skills/quality-assurance/pre-write-checklist/SKILL.md +583 -0
  293. package/templates/skills/quality-assurance/requirement-detector/CONFLICT_RESOLUTION.md +119 -0
  294. package/templates/skills/quality-assurance/requirement-detector/EXAMPLES.md +146 -0
  295. package/templates/skills/quality-assurance/requirement-detector/KEYWORDS.md +160 -0
  296. package/templates/skills/quality-assurance/requirement-detector/SKILL.md +149 -0
  297. package/templates/skills/quality-assurance/setting-detector/SKILL.md +611 -0
  298. package/templates/skills/quality-assurance/style-detector/CONFLICT_RESOLUTION.md +126 -0
  299. package/templates/skills/quality-assurance/style-detector/EXAMPLES.md +206 -0
  300. package/templates/skills/quality-assurance/style-detector/KEYWORDS.md +207 -0
  301. package/templates/skills/quality-assurance/style-detector/SKILL.md +126 -0
  302. package/templates/skills/quality-assurance/workflow-guide/SKILL.md +381 -0
  303. package/templates/skills/writing-techniques/character-arc/SKILL.md +267 -0
  304. package/templates/skills/writing-techniques/dialogue-techniques/SKILL.md +366 -0
  305. package/templates/skills/writing-techniques/multi-thread-narrative/SKILL.md +553 -0
  306. package/templates/skills/writing-techniques/multi-thread-narrative/experts/thread-analyst.md +226 -0
  307. package/templates/skills/writing-techniques/pacing-control/SKILL.md +377 -0
  308. package/templates/skills/writing-techniques/reader-expectation/SKILL.md +578 -0
  309. package/templates/skills/writing-techniques/reader-expectation/experts/expectation-analyst.md +209 -0
  310. package/templates/skills/writing-techniques/revision-polish/SKILL.md +496 -0
  311. package/templates/skills/writing-techniques/revision-polish/experts/revision-editor.md +221 -0
  312. package/templates/skills/writing-techniques/scene-structure/SKILL.md +361 -0
  313. package/templates/skills/writing-techniques/style-learning/SKILL.md +436 -0
  314. package/templates/specification-example.md +146 -0
  315. package/templates/tracking/character-state.json +78 -0
  316. package/templates/tracking/plot-tracker.json +62 -0
  317. package/templates/tracking/relationships.json +70 -0
  318. package/templates/tracking/timeline.json +49 -0
  319. package/templates/tracking/tracking-log.md +110 -0
  320. package/templates/tracking/validation-rules.json +128 -0
@@ -0,0 +1,731 @@
1
+ ---
2
+ title: 术语表管理 - /glossary
3
+ description: 管理翻译术语表,确保角色名、地名、专有名词翻译统一
4
+ ---
5
+
6
+ # 术语表管理
7
+
8
+ ## 使用方法
9
+
10
+ ### 初始化
11
+
12
+ ```bash
13
+ /glossary init
14
+ ```
15
+
16
+ 在 `.specify/translation/` 创建空的 `glossary.json`,并自动扫描 `spec/knowledge/` 提取角色名和地名。
17
+
18
+ ### 添加术语
19
+
20
+ ```bash
21
+ /glossary add "类别:中文|英文|日文"
22
+ ```
23
+
24
+ **示例:**
25
+ ```bash
26
+ /glossary add "角色:李明|Li Ming|リ・ミン"
27
+ /glossary add "地名:青云宗|Azure Cloud Sect"
28
+ /glossary add "功法:青云剑法|Azure Cloud Sword Art"
29
+ ```
30
+
31
+ **支持的类别:**
32
+ - `角色` (characters) - 人物名称
33
+ - `地名` (places) - 地点、门派、城市
34
+ - `功法` (skills) - 武功、法术、技能
35
+ - `道具` (items) - 物品、装备、宝物
36
+ - `组织` (organizations) - 门派、帮会、势力
37
+ - `概念` (concepts) - 修炼体系、世界观概念
38
+ - `称呼` (titles) - 师父、长老等称呼
39
+
40
+ ### 批量导入
41
+
42
+ ```bash
43
+ /glossary import glossary.csv
44
+ ```
45
+
46
+ **CSV 格式:**
47
+ ```csv
48
+ 类别,中文,英文,日文,备注
49
+ 角色,李明,Li Ming,リ・ミン,主角
50
+ 地名,青云宗,Azure Cloud Sect,青雲宗,主角门派
51
+ 功法,青云剑法,Azure Cloud Sword Art,青雲剣法,主角剑法
52
+ ```
53
+
54
+ ### 查看术语
55
+
56
+ ```bash
57
+ /glossary list # 查看全部
58
+ /glossary list --category 角色 # 按类别筛选
59
+ /glossary list --search 青云 # 搜索
60
+ ```
61
+
62
+ ### 编辑术语
63
+
64
+ ```bash
65
+ /glossary edit "李明" --en "Lee Ming"
66
+ /glossary edit "青云宗" --ja "青雲宗"
67
+ ```
68
+
69
+ ### 删除术语
70
+
71
+ ```bash
72
+ /glossary remove "李明"
73
+ ```
74
+
75
+ ### 自动提取
76
+
77
+ ```bash
78
+ /glossary extract
79
+ ```
80
+
81
+ 扫描已写章节,AI 自动识别专有名词:
82
+ - 列出未在术语表中的名词
83
+ - 提供翻译建议
84
+ - 用户确认后添加
85
+
86
+ ### 导出
87
+
88
+ ```bash
89
+ /glossary export --format csv # 导出为 CSV
90
+ /glossary export --format markdown # 导出为 Markdown
91
+ ```
92
+
93
+ ---
94
+
95
+ ## 术语表格式
96
+
97
+ 术语表存储在 `.specify/translation/glossary.json`:
98
+
99
+ ```json
100
+ {
101
+ "version": "1.0",
102
+ "story": "my-novel",
103
+ "last_updated": "2025-02-09",
104
+ "languages": ["zh", "en", "ja"],
105
+ "categories": {
106
+ "characters": [
107
+ {
108
+ "id": "char_001",
109
+ "zh": "李明",
110
+ "en": "Li Ming",
111
+ "ja": "リ・ミン",
112
+ "pinyin": "Lǐ Míng",
113
+ "notes": "主角,青云宗弟子",
114
+ "first_appearance": "chapter-01",
115
+ "aliases": {
116
+ "zh": ["小明", "明哥"],
117
+ "en": ["Ming", "Brother Ming"],
118
+ "ja": ["ミンくん"]
119
+ }
120
+ }
121
+ ],
122
+ "places": [
123
+ {
124
+ "id": "place_001",
125
+ "zh": "青云宗",
126
+ "en": "Azure Cloud Sect",
127
+ "ja": "青雲宗",
128
+ "notes": "主角所属门派"
129
+ }
130
+ ],
131
+ "skills": [],
132
+ "items": [],
133
+ "organizations": [],
134
+ "concepts": [],
135
+ "titles": []
136
+ }
137
+ }
138
+ ```
139
+
140
+ ---
141
+
142
+ ## 术语冲突检测
143
+
144
+ 自动检测以下冲突:
145
+
146
+ ### 1. 相同中文、不同英文(不一致)
147
+
148
+ ```
149
+ ⚠️ 检测到术语不一致:
150
+ "青云宗" 有两个英文译名:
151
+ - Azure Cloud Sect (chapter-01)
152
+ - Green Cloud Sect (chapter-05)
153
+
154
+ 建议:统一为 "Azure Cloud Sect"
155
+ ```
156
+
157
+ ### 2. 不同中文、相同英文(混淆)
158
+
159
+ ```
160
+ ⚠️ 检测到术语冲突:
161
+ "李明" 和 "黎明" 的英文都是 "Li Ming"
162
+
163
+ 建议:区分为:
164
+ - 李明 → Li Ming
165
+ - 黎明 → Lí Míng 或 Li Ming (dawn)
166
+ ```
167
+
168
+ ### 3. 拼音相似的角色名(容易混淆)
169
+
170
+ ```
171
+ ⚠️ 检测到拼音相似:
172
+ - 李明 (Lǐ Míng) → Li Ming
173
+ - 李敏 (Lǐ Mǐn) → Li Min
174
+
175
+ 建议:保持当前译名,读者可区分
176
+ ```
177
+
178
+ ---
179
+
180
+ ## 执行流程
181
+
182
+ ### /glossary init
183
+
184
+ 当用户调用 `/glossary init` 时:
185
+
186
+ **Step 1: 检查是否已存在**
187
+ ```
188
+ 如果 .specify/translation/glossary.json 已存在:
189
+ 提示:"术语表已存在,是否覆盖?(y/n)"
190
+ 用户确认 → 继续
191
+ 用户拒绝 → 退出
192
+ ```
193
+
194
+ **Step 2: 创建目录**
195
+ ```bash
196
+ mkdir -p .specify/translation
197
+ ```
198
+
199
+ **Step 3: 扫描知识库**
200
+ ```
201
+ 读取 spec/knowledge/ 下的文件:
202
+ - characters.md → 提取角色名
203
+ - world.md → 提取地名、组织
204
+ - magic-system.md → 提取概念、功法
205
+ ```
206
+
207
+ **Step 4: 生成初始术语表**
208
+ ```json
209
+ {
210
+ "version": "1.0",
211
+ "story": "[从 spec/metadata.yaml 读取]",
212
+ "last_updated": "2025-02-09",
213
+ "languages": ["zh", "en", "ja"],
214
+ "categories": {
215
+ "characters": [
216
+ // 从 characters.md 提取的角色
217
+ ],
218
+ "places": [
219
+ // 从 world.md 提取的地名
220
+ ],
221
+ // 其他类别为空数组
222
+ }
223
+ }
224
+ ```
225
+
226
+ **Step 5: 提示用户**
227
+ ```
228
+ ✅ 术语表初始化成功!
229
+
230
+ 自动提取:
231
+ - 角色:5 个
232
+ - 地名:3 个
233
+
234
+ 术语表位置:.specify/translation/glossary.json
235
+
236
+ 下一步:
237
+ 1. 检查自动提取的术语是否正确
238
+ 2. 为每个术语添加英文/日文译名
239
+ 3. 使用 /glossary add 添加更多术语
240
+
241
+ 示例:
242
+ /glossary add "角色:李明|Li Ming|リ・ミン"
243
+ ```
244
+
245
+ ---
246
+
247
+ ### /glossary add
248
+
249
+ 当用户调用 `/glossary add "类别:中文|英文|日文"` 时:
250
+
251
+ **Step 1: 解析参数**
252
+ ```
253
+ 输入:"角色:李明|Li Ming|リ・ミン"
254
+
255
+ 解析:
256
+ category = "角色" → "characters"
257
+ zh = "李明"
258
+ en = "Li Ming"
259
+ ja = "リ・ミン" (可选)
260
+ ```
261
+
262
+ **Step 2: 验证类别**
263
+ ```
264
+ 支持的类别:
265
+ 角色 → characters
266
+ 地名 → places
267
+ 功法 → skills
268
+ 道具 → items
269
+ 组织 → organizations
270
+ 概念 → concepts
271
+ 称呼 → titles
272
+
273
+ 如果类别不支持 → 提示错误
274
+ ```
275
+
276
+ **Step 3: 检查冲突**
277
+ ```
278
+ 检查是否已存在相同中文术语:
279
+ 如果存在 → 提示:"李明 已存在,是否覆盖?(y/n)"
280
+ 用户确认 → 继续
281
+ 用户拒绝 → 退出
282
+
283
+ 检查是否有相同英文译名:
284
+ 如果存在 → 警告:"Li Ming 已用于其他术语,可能混淆"
285
+ ```
286
+
287
+ **Step 4: 生成 ID**
288
+ ```
289
+ 根据类别生成唯一 ID:
290
+ characters → char_001, char_002, ...
291
+ places → place_001, place_002, ...
292
+ ```
293
+
294
+ **Step 5: 添加到术语表**
295
+ ```json
296
+ {
297
+ "id": "char_001",
298
+ "zh": "李明",
299
+ "en": "Li Ming",
300
+ "ja": "リ・ミン",
301
+ "pinyin": "Lǐ Míng", // 自动生成
302
+ "notes": "",
303
+ "first_appearance": "",
304
+ "aliases": {
305
+ "zh": [],
306
+ "en": [],
307
+ "ja": []
308
+ }
309
+ }
310
+ ```
311
+
312
+ **Step 6: 保存并提示**
313
+ ```
314
+ ✅ 术语添加成功!
315
+
316
+ 类别:角色
317
+ 中文:李明
318
+ 英文:Li Ming
319
+ 日文:リ・ミン
320
+
321
+ 当前术语总数:6 个
322
+ ```
323
+
324
+ ---
325
+
326
+ ### /glossary list
327
+
328
+ 当用户调用 `/glossary list` 时:
329
+
330
+ **Step 1: 读取术语表**
331
+ ```
332
+ 读取 .specify/translation/glossary.json
333
+ 如果不存在 → 提示:"术语表未初始化,请先运行 /glossary init"
334
+ ```
335
+
336
+ **Step 2: 过滤(如果有参数)**
337
+ ```
338
+ --category 角色 → 只显示 characters
339
+ --search 青云 → 搜索包含"青云"的术语
340
+ ```
341
+
342
+ **Step 3: 格式化输出**
343
+ ```
344
+ 术语表(共 15 个术语)
345
+
346
+ 【角色】(5 个)
347
+ ┌────────┬──────────────┬──────────────┬──────────┐
348
+ │ 中文 │ 英文 │ 日文 │ 备注 │
349
+ ├────────┼──────────────┼──────────────┼──────────┤
350
+ │ 李明 │ Li Ming │ リ・ミン │ 主角 │
351
+ │ 苏婉儿 │ Su Wan'er │ 蘇婉児 │ 女主角 │
352
+ │ ... │ ... │ ... │ ... │
353
+ └────────┴──────────────┴──────────────┴──────────┘
354
+
355
+ 【地名】(3 个)
356
+ ┌────────┬──────────────────┬──────────┬──────────┐
357
+ │ 中文 │ 英文 │ 日文 │ 备注 │
358
+ ├────────┼──────────────────┼──────────┼──────────┤
359
+ │ 青云宗 │ Azure Cloud Sect │ 青雲宗 │ 主角门派 │
360
+ │ ... │ ... │ ... │ ... │
361
+ └────────┴──────────────────┴──────────┴──────────┘
362
+
363
+ 【功法】(2 个)
364
+ ...
365
+
366
+ 使用 /glossary list --category 角色 查看特定类别
367
+ 使用 /glossary list --search 青云 搜索术语
368
+ ```
369
+
370
+ ---
371
+
372
+ ### /glossary extract
373
+
374
+ 当用户调用 `/glossary extract` 时:
375
+
376
+ **Step 1: 扫描章节**
377
+ ```
378
+ 读取 stories/[story-name]/content/ 下的所有章节
379
+ ```
380
+
381
+ **Step 2: AI 识别专有名词**
382
+ ```
383
+ 提示词:
384
+ 你是专有名词识别专家。请分析以下小说文本,识别所有专有名词。
385
+
386
+ 专有名词包括:
387
+ - 人物名称(主角、配角、路人)
388
+ - 地名(城市、门派、地点)
389
+ - 功法/技能名称
390
+ - 道具/物品名称
391
+ - 组织名称
392
+ - 修炼体系/世界观概念
393
+ - 特殊称呼
394
+
395
+ 文本:
396
+ [章节内容]
397
+
398
+ 请列出所有专有名词,格式:
399
+ 类别 | 名词 | 出现次数 | 首次出现章节
400
+ ```
401
+
402
+ **Step 3: 过滤已存在的术语**
403
+ ```
404
+ 对比 glossary.json,过滤掉已存在的术语
405
+ ```
406
+
407
+ **Step 4: 提供翻译建议**
408
+ ```
409
+ 对每个新术语,AI 提供翻译建议:
410
+
411
+ 提示词:
412
+ 请为以下中文专有名词提供英文和日文翻译建议。
413
+
414
+ 类别:角色
415
+ 名词:李明
416
+ 上下文:[首次出现的段落]
417
+
418
+ 翻译要求:
419
+ - 人名:拼音翻译(Li Ming)
420
+ - 地名:意译为主(Azure Cloud Sect)
421
+ - 功法:意译(Azure Cloud Sword Art)
422
+ - 概念:意译(spiritual energy)
423
+
424
+ 请提供:
425
+ 1. 英文译名(推荐)
426
+ 2. 日文译名(推荐)
427
+ 3. 翻译理由
428
+ ```
429
+
430
+ **Step 5: 展示结果并确认**
431
+ ```
432
+ 🔍 扫描完成!发现 12 个新专有名词:
433
+
434
+ 【角色】(5 个)
435
+ 1. 李明 → Li Ming | リ・ミン
436
+ 首次出现:chapter-01
437
+ 出现次数:145 次
438
+
439
+ 2. 苏婉儿 → Su Wan'er | 蘇婉児
440
+ 首次出现:chapter-03
441
+ 出现次数:89 次
442
+
443
+ 【地名】(3 个)
444
+ 3. 天都城 → Celestial Capital | 天都城
445
+ 首次出现:chapter-02
446
+ 出现次数:67 次
447
+
448
+ ...
449
+
450
+ 是否添加这些术语到术语表?
451
+ [a] 全部添加
452
+ [s] 选择性添加
453
+ [n] 不添加
454
+
455
+ 用户选择 → 执行相应操作
456
+ ```
457
+
458
+ ---
459
+
460
+ ### /glossary import
461
+
462
+ 当用户调用 `/glossary import glossary.csv` 时:
463
+
464
+ **Step 1: 读取 CSV 文件**
465
+ ```csv
466
+ 类别,中文,英文,日文,备注
467
+ 角色,李明,Li Ming,リ・ミン,主角
468
+ 地名,青云宗,Azure Cloud Sect,青雲宗,主角门派
469
+ ```
470
+
471
+ **Step 2: 解析每一行**
472
+ ```
473
+ 跳过标题行
474
+ 对每一行:
475
+ 解析类别、中文、英文、日文、备注
476
+ 验证格式
477
+ 检查冲突
478
+ ```
479
+
480
+ **Step 3: 批量添加**
481
+ ```
482
+ 成功:15 个
483
+ 失败:2 个(冲突或格式错误)
484
+
485
+ 失败详情:
486
+ 第 3 行:"李明" 已存在
487
+ 第 7 行:类别 "武器" 不支持(应为 "道具")
488
+ ```
489
+
490
+ ---
491
+
492
+ ### /glossary edit
493
+
494
+ 当用户调用 `/glossary edit "李明" --en "Lee Ming"` 时:
495
+
496
+ **Step 1: 查找术语**
497
+ ```
498
+ 在 glossary.json 中搜索 zh="李明"
499
+ 如果不存在 → 提示:"术语 '李明' 不存在"
500
+ ```
501
+
502
+ **Step 2: 更新字段**
503
+ ```
504
+ 支持的字段:
505
+ --en <英文>
506
+ --ja <日文>
507
+ --notes <备注>
508
+ --pinyin <拼音>
509
+ ```
510
+
511
+ **Step 3: 保存并提示**
512
+ ```
513
+ ✅ 术语更新成功!
514
+
515
+ 李明
516
+ 英文:Li Ming → Lee Ming
517
+ ```
518
+
519
+ ---
520
+
521
+ ### /glossary remove
522
+
523
+ 当用户调用 `/glossary remove "李明"` 时:
524
+
525
+ **Step 1: 查找术语**
526
+ ```
527
+ 在 glossary.json 中搜索 zh="李明"
528
+ 如果不存在 → 提示:"术语 '李明' 不存在"
529
+ ```
530
+
531
+ **Step 2: 确认删除**
532
+ ```
533
+ ⚠️ 确认删除术语?
534
+
535
+ 中文:李明
536
+ 英文:Li Ming
537
+ 类别:角色
538
+ 出现次数:145 次(如果已翻译)
539
+
540
+ 删除后,已翻译的内容不会自动更新。
541
+ 确认删除?(y/n)
542
+ ```
543
+
544
+ **Step 3: 删除并保存**
545
+ ```
546
+ ✅ 术语已删除
547
+
548
+ 当前术语总数:14 个
549
+ ```
550
+
551
+ ---
552
+
553
+ ### /glossary export
554
+
555
+ 当用户调用 `/glossary export --format csv` 时:
556
+
557
+ **CSV 格式:**
558
+ ```csv
559
+ 类别,中文,英文,日文,拼音,备注,首次出现
560
+ 角色,李明,Li Ming,リ・ミン,Lǐ Míng,主角,chapter-01
561
+ 地名,青云宗,Azure Cloud Sect,青雲宗,,主角门派,chapter-01
562
+ ```
563
+
564
+ **Markdown 格式:**
565
+ ```markdown
566
+ # 术语表
567
+
568
+ ## 角色 (5 个)
569
+
570
+ | 中文 | 英文 | 日文 | 拼音 | 备注 |
571
+ |------|------|------|------|------|
572
+ | 李明 | Li Ming | リ・ミン | Lǐ Míng | 主角 |
573
+ | ... | ... | ... | ... | ... |
574
+
575
+ ## 地名 (3 个)
576
+
577
+ | 中文 | 英文 | 日文 | 备注 |
578
+ |------|------|------|------|
579
+ | 青云宗 | Azure Cloud Sect | 青雲宗 | 主角门派 |
580
+ | ... | ... | ... | ... |
581
+ ```
582
+
583
+ ---
584
+
585
+ ## 术语冲突检测详解
586
+
587
+ ### 检测时机
588
+
589
+ - 添加新术语时(/glossary add)
590
+ - 批量导入时(/glossary import)
591
+ - 自动提取时(/glossary extract)
592
+ - 手动触发(/glossary check)
593
+
594
+ ### 检测规则
595
+
596
+ **规则 1:相同中文、不同译名**
597
+ ```
598
+ 术语 A:李明 → Li Ming
599
+ 术语 B:李明 → Lee Ming
600
+
601
+ 结果:❌ 冲突(同一术语有多个译名)
602
+ ```
603
+
604
+ **规则 2:不同中文、相同译名**
605
+ ```
606
+ 术语 A:李明 → Li Ming
607
+ 术语 B:黎明 → Li Ming
608
+
609
+ 结果:⚠️ 警告(不同术语共享译名,可能混淆)
610
+ ```
611
+
612
+ **规则 3:拼音相似**
613
+ ```
614
+ 术语 A:李明 (Lǐ Míng) → Li Ming
615
+ 术语 B:李敏 (Lǐ Mǐn) → Li Min
616
+
617
+ 结果:ℹ️ 提示(拼音相似,注意区分)
618
+ ```
619
+
620
+ **规则 4:别名冲突**
621
+ ```
622
+ 术语 A:李明,别名 ["小明"]
623
+ 术语 B:王小明,别名 ["小明"]
624
+
625
+ 结果:⚠️ 警告(别名冲突)
626
+ ```
627
+
628
+ ---
629
+
630
+ ## 最佳实践
631
+
632
+ ### 1. 初始化时机
633
+
634
+ **推荐:** 在开始写作前初始化术语表
635
+
636
+ ```bash
637
+ # 创建项目后立即初始化
638
+ /glossary init
639
+
640
+ # 添加主要角色和地名
641
+ /glossary add "角色:李明|Li Ming"
642
+ /glossary add "地名:青云宗|Azure Cloud Sect"
643
+ ```
644
+
645
+ ### 2. 术语命名规范
646
+
647
+ **人名:**
648
+ - 中文 → 拼音(Li Ming)
649
+ - 保持声调区分(Lǐ vs Lí)
650
+ - 复姓连写(Sima Zhao)
651
+
652
+ **地名:**
653
+ - 意译为主(Azure Cloud Sect)
654
+ - 保留文化特色(Celestial Capital)
655
+ - 避免过度直译(不要 Blue Cloud Sect)
656
+
657
+ **功法/技能:**
658
+ - 意译(Azure Cloud Sword Art)
659
+ - 保持意境(不要 Blue Cloud Sword Method)
660
+
661
+ **概念:**
662
+ - 通用译法(spiritual energy)
663
+ - 首次出现时注释
664
+
665
+ **称呼:**
666
+ - 保留拼音(Shifu, Shixiong)
667
+ - 或使用通用翻译(Master, Senior Brother)
668
+
669
+ ### 3. 维护频率
670
+
671
+ - **写作中:** 发现新专有名词立即添加
672
+ - **写作后:** 运行 /glossary extract 检查遗漏
673
+ - **翻译前:** 确保所有术语已添加
674
+ - **定期:** 检查冲突和不一致
675
+
676
+ ### 4. 备份
677
+
678
+ ```bash
679
+ # 定期导出备份
680
+ /glossary export --format csv > glossary-backup-2025-02-09.csv
681
+ ```
682
+
683
+ ---
684
+
685
+ ## 常见问题
686
+
687
+ ### Q: 术语表可以多人协作吗?
688
+
689
+ A: 可以。术语表是 JSON 文件,可以通过 Git 协作。建议:
690
+ - 一人负责维护术语表
691
+ - 其他人提交术语建议
692
+ - 定期合并更新
693
+
694
+ ### Q: 如何处理一词多义?
695
+
696
+ A: 使用备注字段区分:
697
+ ```bash
698
+ /glossary add "概念:道|Dao|道" --notes "修炼之道"
699
+ /glossary add "地名:道|Road|道" --notes "道路"
700
+ ```
701
+
702
+ ### Q: 术语表可以导入到其他项目吗?
703
+
704
+ A: 可以。导出为 CSV 后,在新项目中导入:
705
+ ```bash
706
+ /glossary export --format csv > terms.csv
707
+ # 在新项目中
708
+ /glossary import terms.csv
709
+ ```
710
+
711
+ ### Q: 如何处理角色别名?
712
+
713
+ A: 在添加术语后手动编辑 JSON,添加 aliases 字段:
714
+ ```json
715
+ {
716
+ "zh": "李明",
717
+ "en": "Li Ming",
718
+ "aliases": {
719
+ "zh": ["小明", "明哥"],
720
+ "en": ["Ming", "Brother Ming"]
721
+ }
722
+ }
723
+ ```
724
+
725
+ ---
726
+
727
+ ## 相关命令
728
+
729
+ - `/translate` - 使用术语表翻译
730
+ - `/translate-preview` - 预览术语应用效果
731
+ - `/analyze` - 检查术语一致性