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,531 +0,0 @@
1
- ---
2
- name: search
3
- description: 全文搜索章节内容和 tracking 数据(支持中文分词、正则表达式、范围过滤)
4
- argument-hint: <关键词> [--type=content|tracking|all] [--volume vol-XX] [--fuzzy] [--regex]
5
- recommended-model: claude-haiku-4-5-20251001 # 简单查询,速度优先
6
- allowed-tools: Read, Grep, Bash
7
- ---
8
-
9
- # /search — 全文搜索引擎
10
-
11
- 在章节内容和 tracking 数据中进行高性能全文搜索,支持中文分词、模糊匹配、正则表达式。
12
-
13
- ---
14
-
15
- ## 核心功能
16
-
17
- 1. **章节内容搜索** - 在已写章节中搜索文本片段
18
- 2. **Tracking 数据搜索** - 在角色、情节、事实等数据中搜索
19
- 3. **混合搜索** - 同时搜索内容和数据
20
- 4. **智能排序** - 按相关性、章节顺序、出现频率排序
21
- 5. **上下文预览** - 显示搜索结果的上下文片段
22
-
23
- ---
24
-
25
- ## 数据加载策略
26
-
27
- 本命令采用 **三层回退** 机制执行搜索:
28
-
29
- ### Layer 3: MCP FTS5 全文搜索(优先)
30
-
31
- ```typescript
32
- // 如果 MCP 已启用且数据已同步
33
- const results = await mcp.call('novelws-mcp/search_content', {
34
- query: '沈玉卿',
35
- volume: 'vol-03', // 可选
36
- limit: 50
37
- });
38
- ```
39
-
40
- **优势**:
41
- - **中文分词支持**:自动处理中文分词
42
- - **高性能**:SQLite FTS5 索引,毫秒级响应
43
- - **相关性排序**:基于 BM25 算法自动排序
44
- - **CJK 回退**:FTS5 不支持时自动回退到 LIKE 搜索
45
-
46
- ### Layer 2: 分片 Grep(次优)
47
-
48
- ```bash
49
- # 当 tracking/volumes/ 存在时
50
- if [[ -n "$VOLUME_FILTER" ]]; then
51
- # 仅搜索指定卷
52
- grep -rn "$QUERY" "stories/*/content/" | grep "ch-$(volume_to_range $VOLUME_FILTER)"
53
- grep -rn "$QUERY" "tracking/volumes/$VOLUME_FILTER/"
54
- else
55
- # 搜索所有内容
56
- grep -rn "$QUERY" "stories/*/content/"
57
- grep -rn "$QUERY" "tracking/volumes/"
58
- fi
59
- ```
60
-
61
- **适用场景**:
62
- - MCP 未启用或同步延迟
63
- - 需要正则表达式搜索
64
- - 搜索未索引的新内容
65
-
66
- ### Layer 1: 单文件 Grep(兜底)
67
-
68
- ```bash
69
- # 传统模式,搜索所有文件
70
- grep -rn "$QUERY" "stories/*/content/"
71
- grep -rn "$QUERY" "tracking/"
72
- ```
73
-
74
- **向下兼容**:小型项目(< 300 章)使用标准 Grep
75
-
76
- ---
77
-
78
- ## 执行流程
79
-
80
- ### Step 1: 解析参数
81
-
82
- ```javascript
83
- const args = parseArguments($ARGUMENTS);
84
-
85
- // 搜索关键词(必填)
86
- const query = args.query || args._[0];
87
- if (!query) {
88
- throw new Error("请指定搜索关键词:/search <关键词>");
89
- }
90
-
91
- // 搜索类型(可选)
92
- const searchType = args.type || 'all'; // content | tracking | all
93
-
94
- // 卷过滤(可选)
95
- const volumeFilter = args.volume; // vol-03
96
-
97
- // 搜索模式(可选)
98
- const isFuzzy = args.fuzzy || false; // 模糊匹配
99
- const isRegex = args.regex || false; // 正则表达式
100
- ```
101
-
102
- ### Step 2: 检测数据模式
103
-
104
- ```javascript
105
- const isSharded = fs.existsSync('tracking/volumes/');
106
- const hasMCP = fs.existsSync('mcp-servers.json');
107
-
108
- // 选择搜索策略
109
- let searchStrategy;
110
- if (hasMCP) {
111
- searchStrategy = 'mcp-fts5';
112
- } else if (isSharded) {
113
- searchStrategy = 'sharded-grep';
114
- } else {
115
- searchStrategy = 'single-grep';
116
- }
117
- ```
118
-
119
- ### Step 3: 执行搜索
120
-
121
- 根据搜索策略执行:
122
-
123
- #### MCP FTS5 搜索
124
-
125
- ```typescript
126
- // 章节内容搜索
127
- let contentResults = [];
128
- if (searchType === 'content' || searchType === 'all') {
129
- contentResults = await mcp.call('novelws-mcp/search_content', {
130
- query: query,
131
- volume: volumeFilter,
132
- limit: 50
133
- });
134
- }
135
-
136
- // Tracking 数据搜索(分表查询)
137
- let trackingResults = [];
138
- if (searchType === 'tracking' || searchType === 'all') {
139
- // 搜索角色数据
140
- const characterResults = await mcp.call('novelws-mcp/query_characters', {
141
- search: query,
142
- volume: volumeFilter
143
- });
144
-
145
- // 搜索情节数据
146
- const plotResults = await mcp.call('novelws-mcp/query_plot', {
147
- search: query,
148
- volume: volumeFilter
149
- });
150
-
151
- // 搜索事实数据
152
- const factsResults = await mcp.call('novelws-mcp/query_facts', {
153
- search: query,
154
- volume: volumeFilter
155
- });
156
-
157
- trackingResults = [...characterResults, ...plotResults, ...factsResults];
158
- }
159
- ```
160
-
161
- #### 分片 Grep 搜索
162
-
163
- ```bash
164
- QUERY="$1"
165
- VOLUME_FILTER="$2"
166
-
167
- # 确定章节范围
168
- if [[ -n "$VOLUME_FILTER" ]]; then
169
- # 根据卷编号确定章节范围
170
- # 假设每卷 50 章:vol-01 = ch-001-050, vol-02 = ch-051-100
171
- VOLUME_NUM=$(echo "$VOLUME_FILTER" | sed 's/vol-//')
172
- START_CH=$((($VOLUME_NUM - 1) * 50 + 1))
173
- END_CH=$(($VOLUME_NUM * 50))
174
-
175
- # 搜索章节内容
176
- for i in $(seq $START_CH $END_CH); do
177
- CH_ID=$(printf "ch-%03d" $i)
178
- grep -n "$QUERY" "stories/*/content/${CH_ID}.md" 2>/dev/null
179
- done
180
-
181
- # 搜索 tracking 数据
182
- grep -rn "$QUERY" "tracking/volumes/$VOLUME_FILTER/"
183
- else
184
- # 搜索所有内容
185
- grep -rn "$QUERY" "stories/*/content/"
186
- grep -rn "$QUERY" "tracking/volumes/"
187
- fi
188
- ```
189
-
190
- #### 单文件 Grep 搜索
191
-
192
- ```bash
193
- QUERY="$1"
194
-
195
- # 搜索章节内容
196
- grep -rn "$QUERY" "stories/*/content/"
197
-
198
- # 搜索 tracking 数据
199
- grep -rn "$QUERY" "tracking/" --exclude-dir=volumes
200
- ```
201
-
202
- ### Step 4: 处理搜索结果
203
-
204
- ```javascript
205
- // 合并结果
206
- const allResults = [...contentResults, ...trackingResults];
207
-
208
- // 去重(基于文件路径 + 行号)
209
- const uniqueResults = deduplicateResults(allResults);
210
-
211
- // 排序
212
- const sortedResults = sortResults(uniqueResults, {
213
- // 优先级:完全匹配 > 部分匹配 > 模糊匹配
214
- byRelevance: true,
215
- // 次级排序:章节顺序(ch-001 < ch-002)
216
- byChapterOrder: true
217
- });
218
-
219
- // 提取上下文
220
- const resultsWithContext = sortedResults.map(result => ({
221
- ...result,
222
- context: extractContext(result.file, result.line, 3) // 前后 3 行
223
- }));
224
- ```
225
-
226
- ### Step 5: 生成搜索报告
227
-
228
- ```markdown
229
- # 搜索结果
230
-
231
- **搜索关键词**:[query]
232
- **搜索范围**:[content/tracking/all]
233
- **数据来源**:[MCP FTS5/分片 Grep/单文件 Grep]
234
- **总结果数**:[X] 个
235
-
236
- ---
237
-
238
- ## 一、章节内容([X] 个结果)
239
-
240
- ### 第 [N] 章:[章节标题]
241
-
242
- **文件**:stories/my-story/content/ch-[NNN].md:[行号]
243
-
244
- **匹配片段**:
245
- ```
246
- [上文...]
247
- → [包含关键词的行,高亮关键词]
248
- [下文...]
249
- ```
250
-
251
- **相关性**:★★★★☆ (BM25: 8.5)
252
-
253
- ---
254
-
255
- ### 第 [M] 章:[章节标题]
256
-
257
- ...
258
-
259
- ---
260
-
261
- ## 二、Tracking 数据([X] 个结果)
262
-
263
- ### 角色数据
264
-
265
- **文件**:tracking/volumes/vol-03/character-state.json
266
-
267
- **匹配项**:
268
- ```json
269
- {
270
- "name": "沈玉卿",
271
- "description": "礼部侍郎沈鲤之女,才华横溢",
272
- "introduced_in": "ch-042"
273
- }
274
- ```
275
-
276
- ---
277
-
278
- ### 情节数据
279
-
280
- **文件**:tracking/volumes/vol-03/plot-tracker.json
281
-
282
- **匹配项**:
283
- ```json
284
- {
285
- "id": "plot-015",
286
- "description": "沈玉卿身世之谜",
287
- "planted_in": "ch-042",
288
- "resolved_in": "ch-055"
289
- }
290
- ```
291
-
292
- ---
293
-
294
- ## 三、搜索建议
295
-
296
- ### 相关搜索
297
-
298
- 基于当前搜索,您可能还想搜索:
299
- - "沈鲤"(沈玉卿的父亲)
300
- - "礼部侍郎"(沈玉卿的家族背景)
301
- - "ch-042"(沈玉卿首次出场)
302
-
303
- ### 扩展搜索
304
-
305
- 如果结果不满意,尝试:
306
- - `--fuzzy`:启用模糊匹配
307
- - `--regex`:使用正则表达式(如 "沈[玉鲤]")
308
- - `--volume vol-XX`:缩小搜索范围
309
-
310
- ---
311
-
312
- ## 四、快速操作
313
-
314
- 基于搜索结果,您可能想要:
315
-
316
- 1️⃣ `/character show 沈玉卿` — 查看角色完整档案
317
- 2️⃣ `/recap --chapters 42-55` — 回顾相关章节
318
- 3️⃣ `/facts check "沈玉卿"` — 检查相关事实一致性
319
- ```
320
-
321
- ---
322
-
323
- ## 使用场景
324
-
325
- ### 场景 1:查找角色出场
326
-
327
- ```bash
328
- 用户:我想找"沈玉卿"在哪些章节出现过
329
- 助手:好的,让我搜索一下
330
-
331
- 用户:/search 沈玉卿
332
- 助手:【搜索中...】
333
-
334
- 使用 MCP FTS5 全文搜索...
335
- ✓ 章节内容:找到 23 处匹配
336
- ✓ Tracking 数据:找到 5 处匹配
337
-
338
- 【搜索结果】
339
- 总共找到 28 个结果:
340
-
341
- 章节内容(23 个):
342
- - 第 42 章(首次出场):5 处
343
- - 第 43 章:3 处
344
- - 第 55 章(身世揭露):8 处
345
- - 第 60 章(卷末高潮):7 处
346
-
347
- Tracking 数据(5 个):
348
- - character-state.json:1 处
349
- - relationships.json:2 处
350
- - plot-tracker.json:2 处
351
-
352
- 💡 建议:执行 /character show 沈玉卿 查看完整档案
353
- ```
354
-
355
- ### 场景 2:搜索特定伏笔
356
-
357
- ```bash
358
- 用户:/search "东厂密令" --type=tracking
359
- 助手:仅搜索 Tracking 数据...
360
-
361
- 【搜索结果】
362
- 找到 3 个匹配:
363
-
364
- 1. plot-tracker.json (vol-02):
365
- 伏笔ID: plot-008
366
- 描述:东厂密令泄露事件
367
- 铺设:第 35 章
368
- 回收:第 58 章
369
-
370
- 2. story-facts.json (vol-02):
371
- 事实ID: fact-042
372
- 内容:密令内容为「监视张居正余党」
373
-
374
- 3. timeline.json (vol-02):
375
- 事件:万历三十年六月,密令被截获
376
- ```
377
-
378
- ### 场景 3:卷级搜索
379
-
380
- ```bash
381
- 用户:/search "修炼突破" --volume vol-03
382
- 助手:搜索范围:第 3 卷(第 101-150 章)
383
-
384
- 【搜索结果】
385
- 找到 12 个匹配:
386
-
387
- 第 105 章:1 处
388
- - "经过三个月的闭关,他终于突破到了筑基中期"
389
-
390
- 第 118 章:2 处
391
- - "这次修炼突破来得比预期早"
392
- - "突破后的实力提升明显"
393
-
394
- ...
395
-
396
- 💡 本卷共 3 次修炼突破,平均每 16 章一次
397
- ```
398
-
399
- ### 场景 4:正则表达式搜索
400
-
401
- ```bash
402
- 用户:/search "沈[玉鲤]" --regex
403
- 助手:使用正则表达式模式...
404
-
405
- 【搜索结果】
406
- 找到 45 个匹配:
407
-
408
- - "沈玉卿":28 处
409
- - "沈鲤":17 处
410
-
411
- 按章节分布:
412
- 第 42-55 章:主要是"沈玉卿"
413
- 第 60-65 章:两者都有(父女同时出场)
414
- ```
415
-
416
- ### 场景 5:模糊搜索
417
-
418
- ```bash
419
- 用户:/search "突破" --fuzzy
420
- 助手:启用模糊匹配...
421
-
422
- 【搜索结果】
423
- 精确匹配(42 个):
424
- - "突破":35 处
425
- - "突破口":5 处
426
- - "突破性":2 处
427
-
428
- 相关匹配(18 个):
429
- - "进阶":12 处
430
- - "晋升":6 处
431
-
432
- 💡 提示:模糊匹配会返回语义相似的词,但相关性可能较低
433
- ```
434
-
435
- ---
436
-
437
- ## 搜索语法
438
-
439
- ### 基础搜索
440
-
441
- ```bash
442
- /search <关键词> # 简单搜索
443
- /search "多个词组" # 短语搜索(完全匹配)
444
- ```
445
-
446
- ### 类型过滤
447
-
448
- ```bash
449
- /search <关键词> --type=content # 仅搜索章节内容
450
- /search <关键词> --type=tracking # 仅搜索 tracking 数据
451
- /search <关键词> --type=all # 搜索所有(默认)
452
- ```
453
-
454
- ### 范围过滤
455
-
456
- ```bash
457
- /search <关键词> --volume vol-03 # 仅搜索第 3 卷
458
- ```
459
-
460
- ### 搜索模式
461
-
462
- ```bash
463
- /search <关键词> --fuzzy # 模糊匹配(包含相似词)
464
- /search <关键词> --regex # 正则表达式模式
465
- ```
466
-
467
- ### 组合使用
468
-
469
- ```bash
470
- /search "修炼突破" --volume vol-02 --type=content
471
- /search "沈[玉鲤]" --regex --volume vol-03
472
- ```
473
-
474
- ---
475
-
476
- ## 与其他命令的关系
477
-
478
- ```text
479
- /search → 找到关键信息
480
-
481
- /recap --chapters <range> → 回顾相关章节
482
-
483
- /character show <name> → 查看角色详情
484
-
485
- /facts check <keyword> → 验证事实一致性
486
- ```
487
-
488
- **互补关系**:
489
- - `/search` 快速定位,`/recap` 深度回顾
490
- - `/search` 找到角色出场,`/character` 查看完整档案
491
- - `/search` 发现伏笔,`/track` 管理伏笔状态
492
-
493
- ---
494
-
495
- ## 注意事项
496
-
497
- ### 搜索性能
498
-
499
- - **MCP FTS5**:毫秒级响应,适合频繁搜索
500
- - **分片 Grep**:秒级响应,适合中等规模项目
501
- - **单文件 Grep**:在超长篇项目中可能较慢(> 10 秒)
502
-
503
- ### 搜索精度
504
-
505
- - **中文分词**:MCP FTS5 自动处理中文分词,Grep 需要完全匹配
506
- - **相关性排序**:MCP FTS5 使用 BM25 算法,Grep 按文件顺序
507
- - **上下文提取**:自动显示匹配行前后 3 行上下文
508
-
509
- ### 特殊字符
510
-
511
- - 正则表达式特殊字符需转义:`. * + ? ^ $ ( ) [ ] { } | \`
512
- - 中文标点符号会影响搜索结果,建议使用 `--fuzzy`
513
-
514
- ### 搜索限制
515
-
516
- - 默认返回前 50 个结果
517
- - MCP 搜索不支持跨表关联查询(需分别查询后合并)
518
- - Grep 搜索不支持相关性排序
519
-
520
- ---
521
-
522
- ## 🔗 命令链式提示
523
-
524
- **命令执行完成后,自动附加下一步建议**:
525
-
526
- ```
527
- 💡 下一步建议:
528
- 1️⃣ `/character show <角色名>` — 查看搜索到的角色完整档案
529
- 2️⃣ `/recap --chapters <范围>` — 回顾包含关键词的章节
530
- 3️⃣ `/facts check "<关键词>"` — 检查相关事实一致性
531
- ```