novelws 4.0.0 → 5.0.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 (357) hide show
  1. package/CHANGELOG.md +100 -623
  2. package/README.md +79 -594
  3. package/dist/cli.js +1 -3
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +12 -99
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/upgrade.d.ts.map +1 -1
  9. package/dist/commands/upgrade.js +17 -108
  10. package/dist/commands/upgrade.js.map +1 -1
  11. package/dist/core/config.d.ts +1 -37
  12. package/dist/core/config.d.ts.map +1 -1
  13. package/dist/core/config.js +6 -45
  14. package/dist/core/config.js.map +1 -1
  15. package/dist/core/errors.d.ts +0 -31
  16. package/dist/core/errors.d.ts.map +1 -1
  17. package/dist/core/errors.js +0 -58
  18. package/dist/core/errors.js.map +1 -1
  19. package/dist/utils/diagnostics.d.ts +2 -16
  20. package/dist/utils/diagnostics.d.ts.map +1 -1
  21. package/dist/utils/diagnostics.js +5 -72
  22. package/dist/utils/diagnostics.js.map +1 -1
  23. package/dist/utils/project.d.ts +1 -1
  24. package/dist/utils/project.d.ts.map +1 -1
  25. package/dist/utils/project.js +3 -3
  26. package/dist/utils/project.js.map +1 -1
  27. package/package.json +1 -2
  28. package/templates/commands/analyze.md +65 -265
  29. package/templates/commands/expand.md +70 -0
  30. package/templates/commands/plan.md +47 -452
  31. package/templates/commands/specify.md +43 -869
  32. package/templates/commands/write.md +49 -643
  33. package/templates/dot-claude/CLAUDE.md +38 -202
  34. package/templates/resources/anti-ai.md +16 -0
  35. package/templates/resources/style-reference.md +19 -0
  36. package/templates/tracking/character-state.json +1 -76
  37. package/templates/tracking/plot-tracker.json +3 -60
  38. package/templates/tracking/relationships.json +1 -68
  39. package/templates/tracking/timeline.json +1 -47
  40. package/dist/commands/plugin.d.ts +0 -6
  41. package/dist/commands/plugin.d.ts.map +0 -1
  42. package/dist/commands/plugin.js +0 -135
  43. package/dist/commands/plugin.js.map +0 -1
  44. package/dist/plugins/identifier.d.ts +0 -13
  45. package/dist/plugins/identifier.d.ts.map +0 -1
  46. package/dist/plugins/identifier.js +0 -72
  47. package/dist/plugins/identifier.js.map +0 -1
  48. package/dist/plugins/installers/base.d.ts +0 -27
  49. package/dist/plugins/installers/base.d.ts.map +0 -1
  50. package/dist/plugins/installers/base.js +0 -30
  51. package/dist/plugins/installers/base.js.map +0 -1
  52. package/dist/plugins/installers/github.d.ts +0 -22
  53. package/dist/plugins/installers/github.d.ts.map +0 -1
  54. package/dist/plugins/installers/github.js +0 -133
  55. package/dist/plugins/installers/github.js.map +0 -1
  56. package/dist/plugins/installers/local.d.ts +0 -16
  57. package/dist/plugins/installers/local.d.ts.map +0 -1
  58. package/dist/plugins/installers/local.js +0 -69
  59. package/dist/plugins/installers/local.js.map +0 -1
  60. package/dist/plugins/installers/npm.d.ts +0 -20
  61. package/dist/plugins/installers/npm.d.ts.map +0 -1
  62. package/dist/plugins/installers/npm.js +0 -99
  63. package/dist/plugins/installers/npm.js.map +0 -1
  64. package/dist/plugins/manager.d.ts +0 -77
  65. package/dist/plugins/manager.d.ts.map +0 -1
  66. package/dist/plugins/manager.js +0 -349
  67. package/dist/plugins/manager.js.map +0 -1
  68. package/dist/plugins/registry.d.ts +0 -48
  69. package/dist/plugins/registry.d.ts.map +0 -1
  70. package/dist/plugins/registry.js +0 -111
  71. package/dist/plugins/registry.js.map +0 -1
  72. package/dist/plugins/types.d.ts +0 -66
  73. package/dist/plugins/types.d.ts.map +0 -1
  74. package/dist/plugins/types.js +0 -2
  75. package/dist/plugins/types.js.map +0 -1
  76. package/dist/plugins/validator.d.ts +0 -19
  77. package/dist/plugins/validator.d.ts.map +0 -1
  78. package/dist/plugins/validator.js +0 -164
  79. package/dist/plugins/validator.js.map +0 -1
  80. package/dist/utils/logger.d.ts +0 -13
  81. package/dist/utils/logger.d.ts.map +0 -1
  82. package/dist/utils/logger.js +0 -48
  83. package/dist/utils/logger.js.map +0 -1
  84. package/plugins/authentic-voice/README.md +0 -31
  85. package/plugins/authentic-voice/commands/authentic-voice.md +0 -73
  86. package/plugins/authentic-voice/commands/authenticity-audit.md +0 -37
  87. package/plugins/authentic-voice/config.yaml +0 -30
  88. package/plugins/authentic-voice/experts/authentic-editor.md +0 -27
  89. package/plugins/export/README.md +0 -319
  90. package/plugins/export/commands/export.md +0 -460
  91. package/plugins/export/commands/generate-cover.md +0 -256
  92. package/plugins/export/commands/metadata.md +0 -309
  93. package/plugins/export/config.yaml +0 -47
  94. package/plugins/export/experts/publishing-expert.md +0 -171
  95. package/plugins/export/templates/epub/chapter-template.html +0 -13
  96. package/plugins/export/templates/epub/cover-template.html +0 -14
  97. package/plugins/export/templates/epub/stylesheet.css +0 -200
  98. package/plugins/export/templates/pdf/ebook-style.css +0 -137
  99. package/plugins/export/templates/pdf/print-style.css +0 -179
  100. package/plugins/export/templates/platforms/jinjiang-format.md +0 -101
  101. package/plugins/export/templates/platforms/qidian-format.md +0 -108
  102. package/plugins/export/templates/platforms/tomato-format.md +0 -95
  103. package/plugins/translate/README.md +0 -265
  104. package/plugins/translate/commands/glossary.md +0 -731
  105. package/plugins/translate/commands/translate-preview.md +0 -543
  106. package/plugins/translate/commands/translate.md +0 -649
  107. package/plugins/translate/config.yaml +0 -43
  108. package/plugins/translate/experts/literary-translator.md +0 -605
  109. package/templates/commands/character.md +0 -287
  110. package/templates/commands/checklist.md +0 -744
  111. package/templates/commands/clarify.md +0 -269
  112. package/templates/commands/constitution.md +0 -269
  113. package/templates/commands/expert.md +0 -188
  114. package/templates/commands/facts.md +0 -552
  115. package/templates/commands/guide.md +0 -900
  116. package/templates/commands/help-me.md +0 -221
  117. package/templates/commands/recap.md +0 -748
  118. package/templates/commands/relations.md +0 -385
  119. package/templates/commands/revise.md +0 -450
  120. package/templates/commands/search.md +0 -531
  121. package/templates/commands/tasks.md +0 -396
  122. package/templates/commands/timeline.md +0 -309
  123. package/templates/commands/track-init.md +0 -149
  124. package/templates/commands/track.md +0 -704
  125. package/templates/commands/volume-summary.md +0 -471
  126. package/templates/knowledge/audit-config.json +0 -26
  127. package/templates/knowledge/character-profiles.md +0 -152
  128. package/templates/knowledge/character-voices.md +0 -137
  129. package/templates/knowledge/locations.md +0 -184
  130. package/templates/knowledge/world-setting.md +0 -121
  131. package/templates/resources/character-archetypes/01-hero.md +0 -233
  132. package/templates/resources/character-archetypes/02-mentor.md +0 -177
  133. package/templates/resources/character-archetypes/03-shadow.md +0 -221
  134. package/templates/resources/character-archetypes/04-ally.md +0 -178
  135. package/templates/resources/character-archetypes/05-shapeshifter.md +0 -177
  136. package/templates/resources/character-archetypes/06-trickster.md +0 -181
  137. package/templates/resources/character-archetypes/07-threshold-guardian.md +0 -177
  138. package/templates/resources/character-archetypes/08-herald.md +0 -180
  139. package/templates/resources/character-archetypes/09-father.md +0 -249
  140. package/templates/resources/character-archetypes/10-mother.md +0 -202
  141. package/templates/resources/character-archetypes/11-child.md +0 -183
  142. package/templates/resources/character-archetypes/12-sage.md +0 -202
  143. package/templates/resources/character-archetypes/README.md +0 -60
  144. package/templates/resources/character-archetypes/application-guide.md +0 -222
  145. package/templates/resources/character-archetypes/archetype-combinations.md +0 -242
  146. package/templates/resources/character-archetypes/config.yaml +0 -28
  147. package/templates/resources/character-archetypes/examples-analysis.md +0 -223
  148. package/templates/resources/config/keyword-mappings.json +0 -226
  149. package/templates/resources/config/specification-example.md +0 -146
  150. package/templates/resources/craft/character-arc.md +0 -1153
  151. package/templates/resources/craft/dialogue.md +0 -1170
  152. package/templates/resources/craft/hook-design.md +0 -345
  153. package/templates/resources/craft/pacing.md +0 -1200
  154. package/templates/resources/craft/power-system.md +0 -254
  155. package/templates/resources/craft/scene-structure.md +0 -1136
  156. package/templates/resources/craft/show-not-tell.md +0 -1012
  157. package/templates/resources/craft/story-structures.md +0 -134
  158. package/templates/resources/craft/tension-management.md +0 -168
  159. package/templates/resources/emotional-beats/01-first-meeting.md +0 -145
  160. package/templates/resources/emotional-beats/02-bonding-moment.md +0 -226
  161. package/templates/resources/emotional-beats/03-declaration.md +0 -284
  162. package/templates/resources/emotional-beats/04-triumph.md +0 -240
  163. package/templates/resources/emotional-beats/05-reunion.md +0 -396
  164. package/templates/resources/emotional-beats/06-forgiveness.md +0 -204
  165. package/templates/resources/emotional-beats/07-betrayal.md +0 -204
  166. package/templates/resources/emotional-beats/08-loss.md +0 -214
  167. package/templates/resources/emotional-beats/09-rejection.md +0 -254
  168. package/templates/resources/emotional-beats/10-failure.md +0 -244
  169. package/templates/resources/emotional-beats/11-misunderstanding.md +0 -205
  170. package/templates/resources/emotional-beats/12-farewell.md +0 -283
  171. package/templates/resources/emotional-beats/13-revelation.md +0 -242
  172. package/templates/resources/emotional-beats/14-point-of-no-return.md +0 -215
  173. package/templates/resources/emotional-beats/15-dark-night.md +0 -244
  174. package/templates/resources/emotional-beats/16-sacrifice.md +0 -246
  175. package/templates/resources/emotional-beats/17-awakening.md +0 -246
  176. package/templates/resources/emotional-beats/18-confrontation.md +0 -217
  177. package/templates/resources/emotional-beats/19-bittersweet-goodbye.md +0 -368
  178. package/templates/resources/emotional-beats/20-moral-dilemma.md +0 -248
  179. package/templates/resources/emotional-beats/21-temptation.md +0 -240
  180. package/templates/resources/emotional-beats/22-redemption.md +0 -210
  181. package/templates/resources/emotional-beats/README.md +0 -104
  182. package/templates/resources/emotional-beats/beat-sequences.md +0 -276
  183. package/templates/resources/emotional-beats/config.yaml +0 -30
  184. package/templates/resources/emotional-beats/pacing-guide.md +0 -390
  185. package/templates/resources/genres/game-lit.md +0 -174
  186. package/templates/resources/genres/historical.md +0 -1127
  187. package/templates/resources/genres/horror.md +0 -211
  188. package/templates/resources/genres/military.md +0 -209
  189. package/templates/resources/genres/mystery.md +0 -1123
  190. package/templates/resources/genres/rebirth.md +0 -177
  191. package/templates/resources/genres/revenge.md +0 -846
  192. package/templates/resources/genres/romance.md +0 -948
  193. package/templates/resources/genres/sci-fi.md +0 -156
  194. package/templates/resources/genres/sports.md +0 -216
  195. package/templates/resources/genres/thriller.md +0 -166
  196. package/templates/resources/genres/urban.md +0 -170
  197. package/templates/resources/genres/workplace.md +0 -214
  198. package/templates/resources/genres/wuxia.md +0 -143
  199. package/templates/resources/genres/xuanhuan.md +0 -234
  200. package/templates/resources/genres/youth.md +0 -219
  201. package/templates/resources/memory/personal-voice.md +0 -113
  202. package/templates/resources/references/README.md +0 -96
  203. package/templates/resources/references/china-1920s/culture.md +0 -423
  204. package/templates/resources/references/china-1920s/daily-life.md +0 -616
  205. package/templates/resources/references/china-1920s/overview.md +0 -298
  206. package/templates/resources/references/china-1920s/society.md +0 -703
  207. package/templates/resources/references/china-1920s/warlords.md +0 -427
  208. package/templates/resources/references/cultivation-world/daily-life.md +0 -108
  209. package/templates/resources/references/cultivation-world/overview.md +0 -64
  210. package/templates/resources/references/cultivation-world/power-system.md +0 -108
  211. package/templates/resources/references/cultivation-world/sects.md +0 -104
  212. package/templates/resources/references/cultivation-world/world-setting.md +0 -108
  213. package/templates/resources/references/modern-workplace/corporate.md +0 -115
  214. package/templates/resources/references/modern-workplace/daily-life.md +0 -129
  215. package/templates/resources/references/modern-workplace/overview.md +0 -73
  216. package/templates/resources/references/modern-workplace/relationships.md +0 -107
  217. package/templates/resources/references/modern-workplace/tech-industry.md +0 -131
  218. package/templates/resources/references/tang-dynasty/culture.md +0 -135
  219. package/templates/resources/references/tang-dynasty/daily-life.md +0 -139
  220. package/templates/resources/references/tang-dynasty/overview.md +0 -76
  221. package/templates/resources/references/tang-dynasty/politics.md +0 -121
  222. package/templates/resources/references/tang-dynasty/society.md +0 -126
  223. package/templates/resources/requirements/README.md +0 -240
  224. package/templates/resources/requirements/anti-ai-v3.md +0 -46
  225. package/templates/resources/requirements/anti-ai-v4-deprecated.md +0 -442
  226. package/templates/resources/requirements/anti-ai-v5-balanced.md +0 -203
  227. package/templates/resources/requirements/concretization.md +0 -90
  228. package/templates/resources/requirements/fast-paced.md +0 -552
  229. package/templates/resources/requirements/no-poison.md +0 -60
  230. package/templates/resources/requirements/romance-angst.md +0 -102
  231. package/templates/resources/requirements/romance-sweet.md +0 -63
  232. package/templates/resources/requirements/serious-literature.md +0 -45
  233. package/templates/resources/requirements/strong-emotion.md +0 -60
  234. package/templates/resources/scripts/README.md +0 -187
  235. package/templates/resources/scripts/bash/analyze-story.sh +0 -170
  236. package/templates/resources/scripts/bash/check-analyze-stage.sh +0 -108
  237. package/templates/resources/scripts/bash/check-consistency.sh +0 -463
  238. package/templates/resources/scripts/bash/check-facts.sh +0 -214
  239. package/templates/resources/scripts/bash/check-plot.sh +0 -374
  240. package/templates/resources/scripts/bash/check-timeline.sh +0 -346
  241. package/templates/resources/scripts/bash/check-world.sh +0 -395
  242. package/templates/resources/scripts/bash/check-writing-state.sh +0 -854
  243. package/templates/resources/scripts/bash/clarify-story.sh +0 -117
  244. package/templates/resources/scripts/bash/common.sh +0 -151
  245. package/templates/resources/scripts/bash/constitution.sh +0 -114
  246. package/templates/resources/scripts/bash/generate-tasks.sh +0 -65
  247. package/templates/resources/scripts/bash/init-tracking.sh +0 -183
  248. package/templates/resources/scripts/bash/manage-relations.sh +0 -174
  249. package/templates/resources/scripts/bash/migrate-tracking.sh +0 -183
  250. package/templates/resources/scripts/bash/plan-story.sh +0 -100
  251. package/templates/resources/scripts/bash/specify-story.sh +0 -93
  252. package/templates/resources/scripts/bash/tasks-story.sh +0 -96
  253. package/templates/resources/scripts/bash/test-word-count.sh +0 -182
  254. package/templates/resources/scripts/bash/tests/bench-preload-cache.sh +0 -100
  255. package/templates/resources/scripts/bash/tests/run-all-benchmarks.sh +0 -16
  256. package/templates/resources/scripts/bash/tests/test-cache-semantics.sh +0 -199
  257. package/templates/resources/scripts/bash/tests/test-cross-platform.sh +0 -35
  258. package/templates/resources/scripts/bash/tests/test-edge-cases-bash.sh +0 -60
  259. package/templates/resources/scripts/bash/tests/test-phase1-bash.sh +0 -28
  260. package/templates/resources/scripts/bash/tests/test-preload-cache.sh +0 -123
  261. package/templates/resources/scripts/bash/tests/test-regex-precompile.sh +0 -89
  262. package/templates/resources/scripts/bash/tests/test-regression-bash.sh +0 -42
  263. package/templates/resources/scripts/bash/tests/test-task6-verification.sh +0 -200
  264. package/templates/resources/scripts/bash/text-audit.sh +0 -144
  265. package/templates/resources/scripts/bash/track-progress.sh +0 -194
  266. package/templates/resources/scripts/powershell/analyze-story.ps1 +0 -174
  267. package/templates/resources/scripts/powershell/check-analyze-stage.ps1 +0 -110
  268. package/templates/resources/scripts/powershell/check-consistency.ps1 +0 -138
  269. package/templates/resources/scripts/powershell/check-facts.ps1 +0 -195
  270. package/templates/resources/scripts/powershell/check-plot.ps1 +0 -139
  271. package/templates/resources/scripts/powershell/check-timeline.ps1 +0 -112
  272. package/templates/resources/scripts/powershell/check-writing-state.ps1 +0 -486
  273. package/templates/resources/scripts/powershell/clarify-story.ps1 +0 -107
  274. package/templates/resources/scripts/powershell/common.ps1 +0 -36
  275. package/templates/resources/scripts/powershell/constitution.ps1 +0 -145
  276. package/templates/resources/scripts/powershell/generate-tasks.ps1 +0 -70
  277. package/templates/resources/scripts/powershell/init-tracking.ps1 +0 -98
  278. package/templates/resources/scripts/powershell/manage-relations.ps1 +0 -134
  279. package/templates/resources/scripts/powershell/migrate-tracking.ps1 +0 -145
  280. package/templates/resources/scripts/powershell/plan-story.ps1 +0 -99
  281. package/templates/resources/scripts/powershell/specify-story.ps1 +0 -85
  282. package/templates/resources/scripts/powershell/tests/bench-ps-cache.ps1 +0 -80
  283. package/templates/resources/scripts/powershell/tests/test-cross-platform.ps1 +0 -27
  284. package/templates/resources/scripts/powershell/tests/test-edge-cases-ps.ps1 +0 -29
  285. package/templates/resources/scripts/powershell/tests/test-phase1-ps.ps1 +0 -28
  286. package/templates/resources/scripts/powershell/tests/test-ps-cache.ps1 +0 -73
  287. package/templates/resources/scripts/powershell/tests/test-regression-ps.ps1 +0 -40
  288. package/templates/resources/scripts/powershell/text-audit.ps1 +0 -102
  289. package/templates/resources/scripts/powershell/track-progress.ps1 +0 -105
  290. package/templates/resources/styles/README.md +0 -302
  291. package/templates/resources/styles/ancient-style.md +0 -579
  292. package/templates/resources/styles/literary.md +0 -439
  293. package/templates/resources/styles/minimal.md +0 -472
  294. package/templates/resources/styles/natural-voice.md +0 -930
  295. package/templates/resources/styles/web-novel.md +0 -525
  296. package/templates/skills/analysis/character-analysis/SKILL.md +0 -71
  297. package/templates/skills/analysis/foreshadow-analysis/SKILL.md +0 -45
  298. package/templates/skills/analysis/hook-analysis/SKILL.md +0 -111
  299. package/templates/skills/analysis/logic-analysis/SKILL.md +0 -58
  300. package/templates/skills/analysis/opening-analysis/SKILL.md +0 -59
  301. package/templates/skills/analysis/pacing-analysis/SKILL.md +0 -55
  302. package/templates/skills/analysis/power-analysis/SKILL.md +0 -148
  303. package/templates/skills/analysis/reader-analysis/SKILL.md +0 -117
  304. package/templates/skills/analysis/style-analysis/SKILL.md +0 -60
  305. package/templates/skills/analysis/voice-analysis/SKILL.md +0 -42
  306. package/templates/skills/auto-tracking/SKILL.md +0 -280
  307. package/templates/skills/genre-knowledge/fantasy/SKILL.md +0 -355
  308. package/templates/skills/genre-knowledge/mystery/SKILL.md +0 -337
  309. package/templates/skills/genre-knowledge/romance/SKILL.md +0 -228
  310. package/templates/skills/genre-knowledge/sci-fi/SKILL.md +0 -65
  311. package/templates/skills/genre-knowledge/thriller/SKILL.md +0 -95
  312. package/templates/skills/planning/volume-detail/SKILL.md +0 -219
  313. package/templates/skills/quality-assurance/consistency-checker/SKILL.md +0 -412
  314. package/templates/skills/quality-assurance/continuity-tracker/SKILL.md +0 -157
  315. package/templates/skills/quality-assurance/facts-checker/SKILL.md +0 -405
  316. package/templates/skills/quality-assurance/forgotten-elements/SKILL.md +0 -147
  317. package/templates/skills/quality-assurance/getting-started/SKILL.md +0 -224
  318. package/templates/skills/quality-assurance/hook-checker/SKILL.md +0 -164
  319. package/templates/skills/quality-assurance/hook-checker/experts/hook-analyst.md +0 -33
  320. package/templates/skills/quality-assurance/long-series-continuity/SKILL.md +0 -570
  321. package/templates/skills/quality-assurance/pacing-monitor/SKILL.md +0 -143
  322. package/templates/skills/quality-assurance/pov-validator/SKILL.md +0 -135
  323. package/templates/skills/quality-assurance/pre-write-checklist/SKILL.md +0 -583
  324. package/templates/skills/quality-assurance/requirement-detector/CONFLICT_RESOLUTION.md +0 -119
  325. package/templates/skills/quality-assurance/requirement-detector/EXAMPLES.md +0 -146
  326. package/templates/skills/quality-assurance/requirement-detector/KEYWORDS.md +0 -160
  327. package/templates/skills/quality-assurance/requirement-detector/SKILL.md +0 -149
  328. package/templates/skills/quality-assurance/setting-detector/SKILL.md +0 -611
  329. package/templates/skills/quality-assurance/style-detector/CONFLICT_RESOLUTION.md +0 -126
  330. package/templates/skills/quality-assurance/style-detector/EXAMPLES.md +0 -206
  331. package/templates/skills/quality-assurance/style-detector/KEYWORDS.md +0 -207
  332. package/templates/skills/quality-assurance/style-detector/SKILL.md +0 -264
  333. package/templates/skills/quality-assurance/voice-consistency-checker/SKILL.md +0 -103
  334. package/templates/skills/quality-assurance/voice-consistency-checker/experts/voice-analyst.md +0 -21
  335. package/templates/skills/quality-assurance/workflow-guide/SKILL.md +0 -381
  336. package/templates/skills/writing-techniques/character-arc/SKILL.md +0 -267
  337. package/templates/skills/writing-techniques/dialogue-techniques/SKILL.md +0 -366
  338. package/templates/skills/writing-techniques/multi-thread-narrative/SKILL.md +0 -708
  339. package/templates/skills/writing-techniques/multi-thread-narrative/experts/thread-analyst.md +0 -226
  340. package/templates/skills/writing-techniques/pacing-control/SKILL.md +0 -480
  341. package/templates/skills/writing-techniques/reader-expectation/SKILL.md +0 -1026
  342. package/templates/skills/writing-techniques/reader-expectation/experts/expectation-analyst.md +0 -209
  343. package/templates/skills/writing-techniques/revision-polish/SKILL.md +0 -496
  344. package/templates/skills/writing-techniques/revision-polish/experts/revision-editor.md +0 -221
  345. package/templates/skills/writing-techniques/scene-structure/SKILL.md +0 -361
  346. package/templates/skills/writing-techniques/style-learning/SKILL.md +0 -436
  347. package/templates/skills/writing-techniques/writing-balance/.gitkeep +0 -0
  348. package/templates/skills/writing-techniques/writing-balance/SKILL.md +0 -460
  349. package/templates/skills/writing-techniques/writing-techniques/SKILL.md +0 -727
  350. package/templates/tracking/story-facts.json +0 -5
  351. package/templates/tracking/summary/characters-summary.json +0 -7
  352. package/templates/tracking/summary/plot-summary.json +0 -13
  353. package/templates/tracking/summary/timeline-summary.json +0 -8
  354. package/templates/tracking/summary/volume-summaries.json +0 -5
  355. package/templates/tracking/tracking-log.md +0 -110
  356. package/templates/tracking/validation-rules.json +0 -128
  357. /package/templates/resources/{memory/constitution.md → constitution.md} +0 -0
@@ -1,552 +0,0 @@
1
- ---
2
- description: 管理和校验故事设定事实的一致性
3
- argument-hint: [check | update <fact-id> | add | remove <fact-id>] [--volume vol-XX | --range ch-XXX-YYY]
4
- allowed-tools: Read(//tracking/**), Read(//stories/**/content/**), Write(//tracking/story-facts.json), Bash(bash:*), Bash(powershell:*)
5
- scripts:
6
- sh: resources/scripts/bash/check-facts.sh
7
- ps: resources/scripts/powershell/check-facts.ps1
8
- ---
9
-
10
- # /facts - 故事设定事实管理
11
-
12
- 管理和校验故事中的可量化设定事实(数字、名称、地理等),确保全文一致性。
13
-
14
- ---
15
-
16
- ## 数据源:story-facts.json
17
-
18
- **单一数据源原则**:所有可量化的设定事实都应注册在 `tracking/story-facts.json` 中,作为唯一可信来源(Single Source of Truth)。
19
-
20
- ### 数据结构示例
21
-
22
- ```json
23
- {
24
- "version": 1,
25
- "facts": [
26
- {
27
- "id": "finance-monthly-deficit",
28
- "category": "economy",
29
- "type": "number",
30
- "label": "宗门月亏损",
31
- "value": 1000,
32
- "unit": "灵石",
33
- "source": "第2章",
34
- "refs": ["finance-monthly-expense", "finance-monthly-income"],
35
- "derivation": "finance-monthly-expense - finance-monthly-income = 1000"
36
- },
37
- {
38
- "id": "sect-name",
39
- "category": "setting",
40
- "type": "string",
41
- "label": "宗门名称",
42
- "value": "青云宗",
43
- "source": "第1章"
44
- },
45
- {
46
- "id": "sect-rank",
47
- "category": "setting",
48
- "type": "enum",
49
- "label": "宗门等级",
50
- "value": "下三品",
51
- "options": ["上三品", "中三品", "下三品"],
52
- "source": "第1章"
53
- }
54
- ],
55
- "rules": [
56
- {
57
- "id": "rule-deficit",
58
- "type": "arithmetic",
59
- "expression": "finance-monthly-expense - finance-monthly-income == finance-monthly-deficit",
60
- "description": "支出-收入=亏损"
61
- }
62
- ]
63
- }
64
- ```
65
-
66
- ### 字段说明
67
-
68
- #### fact 元素
69
-
70
- | 字段 | 必填 | 说明 |
71
- |------|------|------|
72
- | id | 是 | 唯一标识符,kebab-case 格式 |
73
- | category | 是 | 分类:economy / personnel / setting / geography / timeline |
74
- | type | 是 | 类型:number / string / enum |
75
- | label | 是 | 中文标签,用于报告展示 |
76
- | value | 是 | 当前值 |
77
- | unit | 否 | 单位(数字类型适用) |
78
- | source | 是 | 首次出现的章节或文件 |
79
- | refs | 否 | 关联事实 ID 列表 |
80
- | derivation | 否 | 派生公式(自然语言描述) |
81
- | options | 否 | 枚举类型的可选值列表 |
82
- | constraint | 否 | 自然语言描述的约束条件 |
83
-
84
- #### rule 元素
85
-
86
- | 字段 | 必填 | 说明 |
87
- |------|------|------|
88
- | id | 是 | 规则唯一标识符 |
89
- | type | 是 | 当前仅支持 "arithmetic" |
90
- | expression | 是 | 算术表达式,使用 fact ID 作为变量 |
91
- | description | 是 | 规则说明 |
92
-
93
- ---
94
-
95
- ## 章节引用注释格式
96
-
97
- 在章节头部使用 HTML 注释声明本章引用的事实:
98
-
99
- ```markdown
100
- # 第4章 杂役的价码
101
-
102
- <!-- story-facts: finance-monthly-deficit, finance-reserve, finance-runway, sect-outer-disciples -->
103
-
104
- 第四天,卯时。陆衡站在执事堂门口。
105
- ```
106
-
107
- ### 格式规范
108
-
109
- - 使用 `<!-- story-facts: ... -->` 格式
110
- - 逗号分隔多个 fact ID
111
- - 放在章节标题和正文之间
112
- - 一个章节只允许一个 story-facts 注释(多个时取第一个)
113
-
114
- ---
115
-
116
- ## 数据加载协议(三层 Fallback)
117
-
118
- ### 读取 story-facts.json
119
-
120
- 按以下优先级加载事实数据:
121
-
122
- **Layer 1: MCP 查询(优先)**
123
- - 调用 `query_facts` 获取事实列表
124
- - 支持 `--volume vol-XX` 过滤:`query_facts --volume=vol-XX`
125
- - 支持 `--range ch-XXX-YYY` 过滤:`query_facts --chapter_from=XXX --chapter_to=YYY`
126
-
127
- **Layer 2: 分片 JSON(次优)**
128
- - 检测 `tracking/volumes/` 是否存在
129
- - 无 --volume 参数:读取 `tracking/story-facts.json`(全局事实文件,不按卷分片)
130
- - 有 --volume 参数:读取全局事实文件,按 `source` 字段过滤属于该卷的事实
131
-
132
- **Layer 3: 单文件 JSON(兜底)**
133
- - 读取 `tracking/story-facts.json`
134
-
135
- ### 章节扫描范围
136
-
137
- - `--volume vol-XX`:只扫描该卷范围内的章节文件(从 volume-summaries.json 获取章节范围)
138
- - `--range ch-XXX-YYY`:只扫描指定范围的章节文件
139
- - 无参数:扫描所有章节文件
140
-
141
- ---
142
-
143
- ## 命令用法
144
-
145
- ### `/facts` - 查看和管理
146
-
147
- **无参数调用时**,展示当前所有已注册事实和规则状态。
148
-
149
- #### 执行步骤
150
-
151
- 1. 读取 `tracking/story-facts.json`
152
- 2. 按 category 分组展示所有已注册事实
153
- 3. 展示 rules 列表及当前校验状态(算术是否成立)
154
- 4. 提示用户可用操作:add / remove / update
155
-
156
- #### 输出格式示例
157
-
158
- ```
159
- 📊 Story Facts 数据源
160
-
161
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
162
- ## Economy (3 个)
163
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
164
-
165
- ✓ finance-monthly-income
166
- 宗门月收入 = 500灵石
167
- 来源: 第2章
168
-
169
- ✓ finance-monthly-expense
170
- 宗门月支出 = 1500灵石
171
- 来源: 第2章
172
-
173
- ✓ finance-monthly-deficit
174
- 宗门月亏损 = 1000灵石
175
- 来源: 第2章
176
- 派生自: finance-monthly-expense - finance-monthly-income
177
-
178
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
179
- ## Setting (2 个)
180
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
181
-
182
- ✓ sect-name
183
- 宗门名称 = "青云宗"
184
- 来源: 第1章
185
-
186
- ✓ sect-rank
187
- 宗门等级 = "下三品"
188
- 来源: 第1章
189
- 可选值: [上三品, 中三品, 下三品]
190
-
191
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
192
- ## 算术规则 (1 个)
193
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
194
-
195
- ✓ rule-deficit: 支出-收入=亏损
196
- 表达式: finance-monthly-expense - finance-monthly-income == finance-monthly-deficit
197
- 状态: ✅ 成立
198
-
199
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
200
-
201
- 💡 可用操作:
202
- - 添加新事实: 继续对话,我会引导你填写必要字段
203
- - 移除事实: 提供 fact ID,我会检查依赖关系
204
- - 更新事实: 使用 /facts update <fact-id>
205
- ```
206
-
207
- #### 添加事实(对话式)
208
-
209
- 当用户表达"添加"意图时,通过对话引导填写:
210
-
211
- 1. 询问 category 和 type
212
- 2. 根据 type 询问必填字段(id, label, value, unit, source)
213
- 3. 询问可选字段(refs, derivation, constraint, options)
214
- 4. 确认后写入 `story-facts.json`
215
-
216
- **示例对话**:
217
-
218
- ```
219
- 用户: 添加一个新事实
220
- 助手: 好的,让我们一步步添加。
221
-
222
- 1. 这个事实属于哪个类别?
223
- - economy(经济)
224
- - personnel(人员)
225
- - setting(设定)
226
- - geography(地理)
227
- - timeline(时间线)
228
-
229
- 用户: economy
230
-
231
- 助手: 2. 这个事实的类型是?
232
- - number(数值)
233
- - string(字符串)
234
- - enum(枚举)
235
-
236
- 用户: number
237
-
238
- 助手: 3. 请提供以下信息:
239
- - ID(kebab-case 格式,如 finance-reserve):
240
- - 中文标签(用于展示):
241
- - 数值:
242
- - 单位(可选):
243
- - 首次出现的章节:
244
- ```
245
-
246
- #### 移除事实
247
-
248
- 当用户提供 fact ID 时:
249
-
250
- 1. 检查是否被其他 fact 的 `refs` 字段引用
251
- 2. 检查是否在 `rules` 中被使用
252
- 3. 运行 `{SCRIPT}` 检查是否在章节中被引用
253
- 4. 如有依赖,列出并要求用户确认
254
- 5. 确认后从 `story-facts.json` 删除
255
-
256
- ---
257
-
258
- ### `/facts check` - 全局一致性扫描
259
-
260
- 执行完整的事实一致性校验,包括章节引用和算术规则。
261
-
262
- 支持 `--volume vol-XX` 或 `--range ch-XXX-YYY` 限定校验范围。
263
-
264
- #### MCP 优先策略(推荐)
265
-
266
- 如果 MCP 可用,优先使用全文检索进行校验:
267
- 1. 调用 `query_facts` 获取所有已记录的事实
268
- 2. 对每个事实,调用 `search_content` 全文检索所有提到该事实 key 的章节
269
- 3. 检查搜索结果中的 value 是否与记录一致
270
- 4. 输出不一致列表
271
-
272
- 示例:
273
- - 事实:`{ "key": "天魂珠颜色", "value": "蓝色" }`
274
- - MCP 搜索 "天魂珠" → 找到第 15 章 "蓝色的天魂珠"、第 203 章 "绿色的天魂珠"
275
- - 报告:第 203 章与事实记录不一致(蓝色 vs 绿色)
276
-
277
- 如果 MCP 不可用,回退到脚本扫描方式。
278
-
279
- #### 执行步骤(Fallback)
280
-
281
- 1. **运行脚本获取章节引用报告**:
282
- ```bash
283
- # Bash
284
- bash {SCRIPT} --json
285
-
286
- # PowerShell
287
- powershell -File {SCRIPT} -Json
288
- ```
289
-
290
- 2. **解析脚本输出**(JSON 格式):
291
- ```json
292
- {
293
- "chapters": [
294
- {
295
- "file": "stories/my-story/content/第4章.md",
296
- "facts": ["finance-monthly-deficit", "finance-reserve"]
297
- }
298
- ],
299
- "unreferenced_facts": ["sect-name", "sect-rank"],
300
- "unknown_ids": []
301
- }
302
- ```
303
-
304
- 3. **读取 story-facts.json** 加载所有事实和规则
305
-
306
- 4. **执行算术规则校验**:
307
- - 遍历 `rules` 数组
308
- - 将 expression 中的 fact ID 替换为实际值
309
- - 计算表达式是否成立
310
- - 记录不成立的规则
311
-
312
- 5. **逐章校验声明的事实**:
313
- - 对于 `chapters` 中的每个文件,读取正文内容
314
- - 检查声明的每个 fact 的值是否在正文中一致出现
315
- - 记录不一致的情况
316
-
317
- 6. **输出综合报告**
318
-
319
- #### 输出格式示例
320
-
321
- ```
322
- 🔍 Story Facts 一致性检查报告
323
-
324
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
325
- ## 章节引用扫描
326
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
327
-
328
- ✓ 已扫描 5 个章节
329
- ✓ 3 个章节声明了事实引用
330
- ✓ 8 个已注册事实,5 个被引用
331
-
332
- ⚠️ 未被任何章节引用的事实 (2 个):
333
- - sect-name (宗门名称)
334
- - sect-rank (宗门等级)
335
-
336
- ❌ 章节中引用了未注册的 ID (0 个)
337
-
338
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
339
- ## 算术规则校验
340
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
341
-
342
- ✓ rule-deficit: 1500 - 500 == 1000 ✅ 成立
343
-
344
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
345
- ## 章节正文一致性
346
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
347
-
348
- 检查 第2章.md:
349
- ✓ finance-monthly-income: 500灵石 ✅ 一致
350
- ✓ finance-monthly-expense: 1500灵石 ✅ 一致
351
- ✓ finance-monthly-deficit: 1000灵石 ✅ 一致
352
-
353
- 检查 第4章.md:
354
- ✓ finance-monthly-deficit: 1000灵石 ✅ 一致
355
- ❌ finance-reserve: 期望 5000灵石,实际出现 "五千灵石" ⚠️ 表达不一致
356
-
357
- 检查 第5章.md:
358
- ✓ finance-monthly-deficit: 1000灵石 ✅ 一致
359
-
360
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
361
- ## 总结
362
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
363
-
364
- ✅ 算术规则: 1/1 成立
365
- ⚠️ 正文一致性: 1 处不一致
366
- 💡 建议: 检查 第4章.md 中 finance-reserve 的表达方式
367
- ```
368
-
369
- #### 错误处理
370
-
371
- - **脚本执行失败**: 展示错误信息,提示检查脚本路径
372
- - **story-facts.json 不存在**: 提示初始化(创建空文件)
373
- - **story-facts.json 格式错误**: 展示 JSON 解析错误,提示修复
374
-
375
- ---
376
-
377
- ### `/facts update <fact-id>` - 变更传播
378
-
379
- 更新某个事实的值,并传播到所有引用位置。
380
-
381
- #### 执行步骤
382
-
383
- 1. **读取当前事实**:
384
- - 从 `story-facts.json` 读取 fact 详情
385
- - 展示当前值和相关信息
386
-
387
- 2. **提示输入新值**:
388
- - 根据 type 验证输入格式
389
- - 如果是 enum,检查是否在 options 中
390
-
391
- 3. **检查派生关系**:
392
- - 如果 fact 有 `derivation` 字段,警告可能破坏派生逻辑
393
- - 如果其他 fact 的 `refs` 包含此 ID,列出需要同步更新的派生事实
394
- - 如果 `rules` 中引用了此 ID,列出可能受影响的规则
395
-
396
- 4. **用户确认变更**
397
-
398
- 5. **更新 story-facts.json**
399
-
400
- 6. **运行脚本获取引用报告**:
401
- ```bash
402
- bash {SCRIPT} --json
403
- ```
404
-
405
- 7. **列出所有引用位置**:
406
- - 从 `chapters` 列表中筛选出引用了此 fact 的文件
407
- - 同时检查 tracking 文件(如 `creative-plan.md`, `tasks.md`)中是否有文本引用
408
-
409
- 8. **生成修改清单**,示例:
410
- ```
411
- 📝 需要修改的位置 (3 处):
412
-
413
- 1. stories/my-story/content/第2章.md
414
- 当前: "宗门月收入 500 灵石"
415
- 修改为: "宗门月收入 800 灵石"
416
-
417
- 2. stories/my-story/content/第4章.md
418
- 当前: "每月收入仅有五百灵石"
419
- 修改为: "每月收入仅有八百灵石"
420
-
421
- 3. tracking/plot-tracker.json
422
- 当前: "finance-monthly-income": 500
423
- 修改为: "finance-monthly-income": 800
424
- ```
425
-
426
- 9. **用户确认后逐一修改**:
427
- - 读取每个文件
428
- - 使用 Edit 工具替换旧值为新值
429
- - 提示用户检查是否有遗漏(如中文数字表达)
430
-
431
- #### 示例对话
432
-
433
- ```
434
- 用户: /facts update finance-monthly-income
435
-
436
- 助手: 当前事实信息:
437
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
438
- ID: finance-monthly-income
439
- 标签: 宗门月收入
440
- 类型: number
441
- 当前值: 500
442
- 单位: 灵石
443
- 来源: 第2章
444
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
445
-
446
- 请输入新的数值(当前: 500):
447
-
448
- 用户: 800
449
-
450
- 助手: ⚠️ 此事实被以下规则引用:
451
- - rule-deficit: finance-monthly-expense - finance-monthly-income == finance-monthly-deficit
452
-
453
- 更新后,rule-deficit 将变为:
454
- 1500 - 800 == 1000 ❌ 不成立
455
-
456
- 建议同步更新 finance-monthly-deficit 为 700。
457
-
458
- 是否继续?(yes/no)
459
-
460
- 用户: yes
461
-
462
- 助手: ✓ 已更新 story-facts.json
463
-
464
- 扫描引用位置...
465
-
466
- 📝 找到 2 个章节引用此事实:
467
- - 第2章.md
468
- - 第4章.md
469
-
470
- 是否自动修改这些文件?(yes/no)
471
- ```
472
-
473
- ---
474
-
475
- ## 与 /write 集成
476
-
477
- `/write` 命令在写作流程中会自动调用 facts 系统:
478
-
479
- 1. **资源加载阶段**:
480
- - 如果章节已有 `<!-- story-facts: ... -->` 注释,加载并展示这些事实的当前值
481
- - 提醒作者写作时保持一致
482
-
483
- 2. **质量自检阶段**:
484
- - 调用 facts-checker skill 校验本章声明的事实值
485
- - 验证相关算术规则
486
- - 不一致时输出警告(不阻断写作)
487
-
488
- 3. **后置处理阶段**:
489
- - 检测正文中是否出现新的可量化事实(具体数字 + 单位)
490
- - 如未注册,提示用户是否需要添加到 story-facts.json
491
-
492
- ---
493
-
494
- ## 常见场景
495
-
496
- ### 场景 1: 初次使用
497
-
498
- 1. 执行 `/facts`,发现 story-facts.json 为空
499
- 2. 对话式添加第一个事实
500
- 3. 手动在已写章节头部添加 `<!-- story-facts: ... -->` 注释
501
- 4. 执行 `/facts check` 验证
502
-
503
- ### 场景 2: 写作新章节
504
-
505
- 1. `/write 第10章`
506
- 2. 写作过程中引用了已注册的事实(如"宗门月亏损一千灵石")
507
- 3. 写作完成后,系统自动在章节头部添加注释
508
- 4. facts-checker 校验引用值是否与 story-facts.json 一致
509
-
510
- ### 场景 3: 发现设定矛盾
511
-
512
- 1. `/facts check` 发现 第5章 中 "宗门月亏损" 值不一致
513
- 2. 确认正确值应该是 1000
514
- 3. 使用 Edit 工具手动修复 第5章 正文
515
- 4. 再次 `/facts check` 确认修复
516
-
517
- ### 场景 4: 剧情发展导致设定变更
518
-
519
- 1. 第20章 剧情中宗门收入提升到 1200 灵石
520
- 2. `/facts update finance-monthly-income`
521
- 3. 输入新值 1200
522
- 4. 系统列出所有引用此值的前置章节
523
- 5. 用户决定是否修改旧章节(通常不修改,因为是时间线发展)
524
- 6. 手动在 第20章 中添加新事实 `finance-monthly-income-after-ch20`
525
-
526
- ---
527
-
528
- ## 最佳实践
529
-
530
- 1. **在写作早期建立 facts 数据源**:前 3-5 章出现的关键数字都应注册
531
- 2. **章节引用注释在写作完成后立即添加**:不要等到后期批量补
532
- 3. **定期执行 `/facts check`**:建议每写完 5 章执行一次
533
- 4. **变更事实前先检查影响范围**:使用 `/facts update` 而非直接修改 JSON
534
- 5. **算术规则尽早建立**:发现数值关联时立即添加 rule
535
-
536
- ---
537
-
538
- ## 限制与未来扩展
539
-
540
- ### V1 限制
541
-
542
- - 仅支持 `number`、`string`、`enum` 三种类型
543
- - 仅支持 `arithmetic` 类型的规则
544
- - 正文匹配使用精确字符串比对(不支持中文数字、近义表达)
545
- - 仅扫描章节文件(不扫描 tracking 文件中的引用)
546
-
547
- ### 计划中的功能
548
-
549
- - `date` 类型支持及时间线自动校验
550
- - 正文模糊匹配("五百" = 500)
551
- - 语义约束规则(如 "sect-rank 为下三品时,sect-disciples 应 < 200")
552
- - tracking 文件中的事实引用扫描