novelws 3.1.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 (358) hide show
  1. package/CHANGELOG.md +115 -564
  2. package/README.md +81 -598
  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 +18 -103
  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 +18 -52
  10. package/dist/commands/upgrade.js.map +1 -1
  11. package/dist/core/config.d.ts +7 -36
  12. package/dist/core/config.d.ts.map +1 -1
  13. package/dist/core/config.js +11 -38
  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 +7 -73
  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 -556
  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/config/keyword-mappings.json +0 -226
  127. package/templates/knowledge/audit-config.json +0 -26
  128. package/templates/knowledge/character-profiles.md +0 -152
  129. package/templates/knowledge/character-voices.md +0 -137
  130. package/templates/knowledge/locations.md +0 -184
  131. package/templates/knowledge/world-setting.md +0 -121
  132. package/templates/knowledge-base/README.md +0 -285
  133. package/templates/knowledge-base/character-archetypes/01-hero.md +0 -233
  134. package/templates/knowledge-base/character-archetypes/02-mentor.md +0 -177
  135. package/templates/knowledge-base/character-archetypes/03-shadow.md +0 -221
  136. package/templates/knowledge-base/character-archetypes/04-ally.md +0 -178
  137. package/templates/knowledge-base/character-archetypes/05-shapeshifter.md +0 -177
  138. package/templates/knowledge-base/character-archetypes/06-trickster.md +0 -181
  139. package/templates/knowledge-base/character-archetypes/07-threshold-guardian.md +0 -177
  140. package/templates/knowledge-base/character-archetypes/08-herald.md +0 -180
  141. package/templates/knowledge-base/character-archetypes/09-father.md +0 -249
  142. package/templates/knowledge-base/character-archetypes/10-mother.md +0 -202
  143. package/templates/knowledge-base/character-archetypes/11-child.md +0 -183
  144. package/templates/knowledge-base/character-archetypes/12-sage.md +0 -202
  145. package/templates/knowledge-base/character-archetypes/README.md +0 -60
  146. package/templates/knowledge-base/character-archetypes/application-guide.md +0 -222
  147. package/templates/knowledge-base/character-archetypes/archetype-combinations.md +0 -242
  148. package/templates/knowledge-base/character-archetypes/config.yaml +0 -28
  149. package/templates/knowledge-base/character-archetypes/examples-analysis.md +0 -223
  150. package/templates/knowledge-base/craft/character-arc.md +0 -1153
  151. package/templates/knowledge-base/craft/dialogue.md +0 -1170
  152. package/templates/knowledge-base/craft/hook-design.md +0 -345
  153. package/templates/knowledge-base/craft/pacing.md +0 -1200
  154. package/templates/knowledge-base/craft/power-system.md +0 -254
  155. package/templates/knowledge-base/craft/scene-structure.md +0 -1136
  156. package/templates/knowledge-base/craft/show-not-tell.md +0 -1012
  157. package/templates/knowledge-base/craft/story-structures.md +0 -134
  158. package/templates/knowledge-base/craft/tension-management.md +0 -168
  159. package/templates/knowledge-base/emotional-beats/01-first-meeting.md +0 -145
  160. package/templates/knowledge-base/emotional-beats/02-bonding-moment.md +0 -226
  161. package/templates/knowledge-base/emotional-beats/03-declaration.md +0 -284
  162. package/templates/knowledge-base/emotional-beats/04-triumph.md +0 -240
  163. package/templates/knowledge-base/emotional-beats/05-reunion.md +0 -396
  164. package/templates/knowledge-base/emotional-beats/06-forgiveness.md +0 -204
  165. package/templates/knowledge-base/emotional-beats/07-betrayal.md +0 -204
  166. package/templates/knowledge-base/emotional-beats/08-loss.md +0 -214
  167. package/templates/knowledge-base/emotional-beats/09-rejection.md +0 -254
  168. package/templates/knowledge-base/emotional-beats/10-failure.md +0 -244
  169. package/templates/knowledge-base/emotional-beats/11-misunderstanding.md +0 -205
  170. package/templates/knowledge-base/emotional-beats/12-farewell.md +0 -283
  171. package/templates/knowledge-base/emotional-beats/13-revelation.md +0 -242
  172. package/templates/knowledge-base/emotional-beats/14-point-of-no-return.md +0 -215
  173. package/templates/knowledge-base/emotional-beats/15-dark-night.md +0 -244
  174. package/templates/knowledge-base/emotional-beats/16-sacrifice.md +0 -246
  175. package/templates/knowledge-base/emotional-beats/17-awakening.md +0 -246
  176. package/templates/knowledge-base/emotional-beats/18-confrontation.md +0 -217
  177. package/templates/knowledge-base/emotional-beats/19-bittersweet-goodbye.md +0 -368
  178. package/templates/knowledge-base/emotional-beats/20-moral-dilemma.md +0 -248
  179. package/templates/knowledge-base/emotional-beats/21-temptation.md +0 -240
  180. package/templates/knowledge-base/emotional-beats/22-redemption.md +0 -210
  181. package/templates/knowledge-base/emotional-beats/README.md +0 -104
  182. package/templates/knowledge-base/emotional-beats/beat-sequences.md +0 -276
  183. package/templates/knowledge-base/emotional-beats/config.yaml +0 -30
  184. package/templates/knowledge-base/emotional-beats/pacing-guide.md +0 -390
  185. package/templates/knowledge-base/genres/game-lit.md +0 -174
  186. package/templates/knowledge-base/genres/historical.md +0 -1127
  187. package/templates/knowledge-base/genres/horror.md +0 -211
  188. package/templates/knowledge-base/genres/military.md +0 -209
  189. package/templates/knowledge-base/genres/mystery.md +0 -1123
  190. package/templates/knowledge-base/genres/rebirth.md +0 -177
  191. package/templates/knowledge-base/genres/revenge.md +0 -846
  192. package/templates/knowledge-base/genres/romance.md +0 -948
  193. package/templates/knowledge-base/genres/sci-fi.md +0 -156
  194. package/templates/knowledge-base/genres/sports.md +0 -216
  195. package/templates/knowledge-base/genres/thriller.md +0 -166
  196. package/templates/knowledge-base/genres/urban.md +0 -170
  197. package/templates/knowledge-base/genres/workplace.md +0 -214
  198. package/templates/knowledge-base/genres/wuxia.md +0 -143
  199. package/templates/knowledge-base/genres/xuanhuan.md +0 -234
  200. package/templates/knowledge-base/genres/youth.md +0 -219
  201. package/templates/knowledge-base/references/README.md +0 -96
  202. package/templates/knowledge-base/references/china-1920s/culture.md +0 -423
  203. package/templates/knowledge-base/references/china-1920s/daily-life.md +0 -616
  204. package/templates/knowledge-base/references/china-1920s/overview.md +0 -298
  205. package/templates/knowledge-base/references/china-1920s/society.md +0 -703
  206. package/templates/knowledge-base/references/china-1920s/warlords.md +0 -427
  207. package/templates/knowledge-base/references/cultivation-world/daily-life.md +0 -108
  208. package/templates/knowledge-base/references/cultivation-world/overview.md +0 -64
  209. package/templates/knowledge-base/references/cultivation-world/power-system.md +0 -108
  210. package/templates/knowledge-base/references/cultivation-world/sects.md +0 -104
  211. package/templates/knowledge-base/references/cultivation-world/world-setting.md +0 -108
  212. package/templates/knowledge-base/references/modern-workplace/corporate.md +0 -115
  213. package/templates/knowledge-base/references/modern-workplace/daily-life.md +0 -129
  214. package/templates/knowledge-base/references/modern-workplace/overview.md +0 -73
  215. package/templates/knowledge-base/references/modern-workplace/relationships.md +0 -107
  216. package/templates/knowledge-base/references/modern-workplace/tech-industry.md +0 -131
  217. package/templates/knowledge-base/references/tang-dynasty/culture.md +0 -135
  218. package/templates/knowledge-base/references/tang-dynasty/daily-life.md +0 -139
  219. package/templates/knowledge-base/references/tang-dynasty/overview.md +0 -76
  220. package/templates/knowledge-base/references/tang-dynasty/politics.md +0 -121
  221. package/templates/knowledge-base/references/tang-dynasty/society.md +0 -126
  222. package/templates/knowledge-base/requirements/README.md +0 -240
  223. package/templates/knowledge-base/requirements/anti-ai-v3.md +0 -46
  224. package/templates/knowledge-base/requirements/anti-ai-v4-deprecated.md +0 -442
  225. package/templates/knowledge-base/requirements/anti-ai-v5-balanced.md +0 -203
  226. package/templates/knowledge-base/requirements/concretization.md +0 -90
  227. package/templates/knowledge-base/requirements/fast-paced.md +0 -552
  228. package/templates/knowledge-base/requirements/no-poison.md +0 -60
  229. package/templates/knowledge-base/requirements/romance-angst.md +0 -102
  230. package/templates/knowledge-base/requirements/romance-sweet.md +0 -63
  231. package/templates/knowledge-base/requirements/serious-literature.md +0 -45
  232. package/templates/knowledge-base/requirements/strong-emotion.md +0 -60
  233. package/templates/knowledge-base/styles/README.md +0 -302
  234. package/templates/knowledge-base/styles/ancient-style.md +0 -579
  235. package/templates/knowledge-base/styles/literary.md +0 -439
  236. package/templates/knowledge-base/styles/minimal.md +0 -472
  237. package/templates/knowledge-base/styles/natural-voice.md +0 -930
  238. package/templates/knowledge-base/styles/web-novel.md +0 -525
  239. package/templates/memory/personal-voice.md +0 -113
  240. package/templates/scripts/README.md +0 -187
  241. package/templates/scripts/bash/analyze-story.sh +0 -170
  242. package/templates/scripts/bash/check-analyze-stage.sh +0 -108
  243. package/templates/scripts/bash/check-consistency.sh +0 -463
  244. package/templates/scripts/bash/check-facts.sh +0 -214
  245. package/templates/scripts/bash/check-plot.sh +0 -374
  246. package/templates/scripts/bash/check-timeline.sh +0 -346
  247. package/templates/scripts/bash/check-world.sh +0 -395
  248. package/templates/scripts/bash/check-writing-state.sh +0 -854
  249. package/templates/scripts/bash/clarify-story.sh +0 -117
  250. package/templates/scripts/bash/common.sh +0 -151
  251. package/templates/scripts/bash/constitution.sh +0 -114
  252. package/templates/scripts/bash/generate-tasks.sh +0 -65
  253. package/templates/scripts/bash/init-tracking.sh +0 -183
  254. package/templates/scripts/bash/manage-relations.sh +0 -174
  255. package/templates/scripts/bash/migrate-tracking.sh +0 -183
  256. package/templates/scripts/bash/plan-story.sh +0 -100
  257. package/templates/scripts/bash/specify-story.sh +0 -93
  258. package/templates/scripts/bash/tasks-story.sh +0 -96
  259. package/templates/scripts/bash/test-word-count.sh +0 -182
  260. package/templates/scripts/bash/tests/bench-preload-cache.sh +0 -100
  261. package/templates/scripts/bash/tests/run-all-benchmarks.sh +0 -16
  262. package/templates/scripts/bash/tests/test-cache-semantics.sh +0 -199
  263. package/templates/scripts/bash/tests/test-cross-platform.sh +0 -35
  264. package/templates/scripts/bash/tests/test-edge-cases-bash.sh +0 -60
  265. package/templates/scripts/bash/tests/test-phase1-bash.sh +0 -28
  266. package/templates/scripts/bash/tests/test-preload-cache.sh +0 -123
  267. package/templates/scripts/bash/tests/test-regex-precompile.sh +0 -89
  268. package/templates/scripts/bash/tests/test-regression-bash.sh +0 -42
  269. package/templates/scripts/bash/tests/test-task6-verification.sh +0 -200
  270. package/templates/scripts/bash/text-audit.sh +0 -144
  271. package/templates/scripts/bash/track-progress.sh +0 -194
  272. package/templates/scripts/powershell/analyze-story.ps1 +0 -174
  273. package/templates/scripts/powershell/check-analyze-stage.ps1 +0 -110
  274. package/templates/scripts/powershell/check-consistency.ps1 +0 -138
  275. package/templates/scripts/powershell/check-facts.ps1 +0 -195
  276. package/templates/scripts/powershell/check-plot.ps1 +0 -139
  277. package/templates/scripts/powershell/check-timeline.ps1 +0 -112
  278. package/templates/scripts/powershell/check-writing-state.ps1 +0 -486
  279. package/templates/scripts/powershell/clarify-story.ps1 +0 -107
  280. package/templates/scripts/powershell/common.ps1 +0 -36
  281. package/templates/scripts/powershell/constitution.ps1 +0 -145
  282. package/templates/scripts/powershell/generate-tasks.ps1 +0 -70
  283. package/templates/scripts/powershell/init-tracking.ps1 +0 -98
  284. package/templates/scripts/powershell/manage-relations.ps1 +0 -134
  285. package/templates/scripts/powershell/migrate-tracking.ps1 +0 -145
  286. package/templates/scripts/powershell/plan-story.ps1 +0 -99
  287. package/templates/scripts/powershell/specify-story.ps1 +0 -85
  288. package/templates/scripts/powershell/tests/bench-ps-cache.ps1 +0 -80
  289. package/templates/scripts/powershell/tests/test-cross-platform.ps1 +0 -27
  290. package/templates/scripts/powershell/tests/test-edge-cases-ps.ps1 +0 -29
  291. package/templates/scripts/powershell/tests/test-phase1-ps.ps1 +0 -28
  292. package/templates/scripts/powershell/tests/test-ps-cache.ps1 +0 -73
  293. package/templates/scripts/powershell/tests/test-regression-ps.ps1 +0 -40
  294. package/templates/scripts/powershell/text-audit.ps1 +0 -102
  295. package/templates/scripts/powershell/track-progress.ps1 +0 -105
  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/specification-example.md +0 -146
  351. package/templates/tracking/story-facts.json +0 -5
  352. package/templates/tracking/summary/characters-summary.json +0 -7
  353. package/templates/tracking/summary/plot-summary.json +0 -13
  354. package/templates/tracking/summary/timeline-summary.json +0 -8
  355. package/templates/tracking/summary/volume-summaries.json +0 -5
  356. package/templates/tracking/tracking-log.md +0 -110
  357. package/templates/tracking/validation-rules.json +0 -128
  358. /package/templates/{memory → resources}/constitution.md +0 -0
@@ -1,486 +0,0 @@
1
- # 检查写作状态脚本
2
- # 用于 /write 命令
3
-
4
- param(
5
- [switch]$Json
6
- )
7
-
8
- # ============================================
9
- # Phase 1: 文件时间戳缓存
10
- # ============================================
11
- #
12
- # 缓存值约定:
13
- # - LastWriteTime 对象: 文件存在,值为修改时间
14
- # - $null: 文件不存在(预加载时已确认)
15
- # - 未缓存: 键不存在于 HashTable 中
16
-
17
- # 缓存存储(HashTable)
18
- $script:FileMTimeCache = @{}
19
- $script:PreloadCompleted = $false
20
-
21
- # ============================================
22
- # Phase 2: 资源去重机制
23
- # ============================================
24
- #
25
- # 用于避免在单次脚本执行中重复检查同一资源文件
26
-
27
- # Phase 2: 资源去重 HashTable
28
- $script:loadedResourcesSet = @{}
29
-
30
- # Phase 2: 检查资源是否已加载
31
- # 参数: Path (string) - 资源路径
32
- # 返回: $true(已加载),$false(未加载)
33
- function Is-ResourceLoaded {
34
- param([string]$path)
35
- return $script:loadedResourcesSet.ContainsKey($path)
36
- }
37
-
38
- # Phase 2: 标记资源为已加载
39
- # 参数: Path (string) - 资源路径
40
- function Mark-ResourceLoaded {
41
- param([string]$path)
42
- $script:loadedResourcesSet[$path] = $true
43
- }
44
-
45
- # ============================================
46
- # Phase 3: 缓存文件清理机制
47
- # ============================================
48
- #
49
- # 清理超过 24 小时的旧缓存文件,避免磁盘空间浪费
50
- # 防御性设计:缓存目录不存在时直接返回
51
-
52
- function Cleanup-OldCache {
53
- $cacheDir = Join-Path $ProjectRoot ".specify" ".cache"
54
-
55
- # 缓存目录不存在,无需清理
56
- if (-not (Test-Path $cacheDir)) {
57
- return
58
- }
59
-
60
- # 删除超过 24 小时的缓存文件
61
- $cutoffTime = (Get-Date).AddDays(-1)
62
- Get-ChildItem -Path $cacheDir -Filter "*.json" -File -ErrorAction SilentlyContinue |
63
- Where-Object { $_.LastWriteTime -lt $cutoffTime } |
64
- Remove-Item -Force -ErrorAction SilentlyContinue
65
-
66
- # 删除空目录
67
- Get-ChildItem -Path $cacheDir -Directory -ErrorAction SilentlyContinue |
68
- Where-Object { (Get-ChildItem $_.FullName -ErrorAction SilentlyContinue).Count -eq 0 } |
69
- Remove-Item -Force -ErrorAction SilentlyContinue
70
- }
71
-
72
- # 预加载文件修改时间到缓存
73
- # 参数: FilePathList (string[]) - 文件路径列表
74
- # 说明: 预加载策略避免多次磁盘访问
75
- function Preload-FileMTimes {
76
- param(
77
- [Parameter(Mandatory=$true)]
78
- [string[]]$FilePathList
79
- )
80
-
81
- foreach ($filePath in $FilePathList) {
82
- # 文件不存在:记录为 $null
83
- if (-not (Test-Path $filePath -PathType Leaf)) {
84
- $script:FileMTimeCache[$filePath] = $null
85
- continue
86
- }
87
-
88
- # 读取文件时间戳
89
- try {
90
- $fileInfo = Get-Item $filePath -ErrorAction Stop
91
- $script:FileMTimeCache[$filePath] = $fileInfo.LastWriteTime
92
- } catch {
93
- # Get-Item 失败:记录为空 DateTime
94
- $script:FileMTimeCache[$filePath] = [DateTime]::MinValue
95
- }
96
- }
97
- }
98
-
99
- # 获取文件修改时间(从缓存)
100
- # 参数: FilePath (string) - 文件路径
101
- # 返回: DateTime 对象,或 $null(文件不存在),或 MinValue(读取失败)
102
- function Get-FileMTimeFromCache {
103
- param(
104
- [Parameter(Mandatory=$true)]
105
- [string]$FilePath
106
- )
107
-
108
- if ($script:FileMTimeCache.ContainsKey($FilePath)) {
109
- return $script:FileMTimeCache[$FilePath]
110
- }
111
-
112
- # 未缓存:返回 MinValue
113
- return [DateTime]::MinValue
114
- }
115
-
116
- # 检查文件是否存在(基于缓存)
117
- # 参数: FilePath (string) - 文件路径
118
- # 返回: $true(文件存在),$false(文件不存在或未缓存)
119
- function Test-FileExistsCached {
120
- param(
121
- [Parameter(Mandatory=$true)]
122
- [string]$FilePath
123
- )
124
-
125
- $mtime = Get-FileMTimeFromCache $FilePath
126
-
127
- # $null: 文件不存在
128
- # MinValue: Get-Item 失败或未缓存
129
- # 其他 DateTime: 文件存在
130
- return ($null -ne $mtime -and $mtime -ne [DateTime]::MinValue)
131
- }
132
-
133
- # 导入通用函数
134
- . "$PSScriptRoot\common.ps1"
135
-
136
- # 获取项目根目录
137
- $ProjectRoot = Get-ProjectRoot
138
- Set-Location $ProjectRoot
139
-
140
- # 获取当前故事
141
- $StoryName = Get-ActiveStory
142
- $StoryDir = Join-Path "stories" $StoryName
143
-
144
- # 预加载文件时间戳(性能优化)
145
- if (-not $script:PreloadCompleted) {
146
- $preloadFileList = @(
147
- # 知识库文件
148
- (Join-Path $ProjectRoot ".specify/templates/knowledge-base/craft/dialogue.md")
149
- (Join-Path $ProjectRoot ".specify/templates/knowledge-base/craft/scene-structure.md")
150
- (Join-Path $ProjectRoot ".specify/templates/knowledge-base/craft/character-arc.md")
151
- (Join-Path $ProjectRoot ".specify/templates/knowledge-base/craft/pacing.md")
152
- (Join-Path $ProjectRoot ".specify/templates/knowledge-base/craft/show-not-tell.md")
153
- # Skill 文件
154
- (Join-Path $ProjectRoot ".specify/templates/skills/writing-techniques/dialogue-techniques/SKILL.md")
155
- (Join-Path $ProjectRoot ".specify/templates/skills/writing-techniques/scene-structure/SKILL.md")
156
- (Join-Path $ProjectRoot ".specify/templates/skills/writing-techniques/character-arc/SKILL.md")
157
- (Join-Path $ProjectRoot ".specify/templates/skills/writing-techniques/pacing-control/SKILL.md")
158
- (Join-Path $ProjectRoot ".specify/templates/skills/quality-assurance/consistency-checker/SKILL.md")
159
- # 规格文件
160
- (Join-Path $StoryDir "specification.md")
161
- )
162
-
163
- Preload-FileMTimes -FilePathList $preloadFileList
164
- $script:PreloadCompleted = $true
165
- }
166
-
167
- # Phase 3: 清理旧缓存(轻量级,不影响性能)
168
- Cleanup-OldCache
169
-
170
- # ==================== 资源加载报告生成函数 ====================
171
-
172
- function Generate-LoadReport {
173
- param (
174
- [string]$StoryDir
175
- )
176
-
177
- # Phase 3: 性能监控
178
- $stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
179
-
180
- $specFile = Join-Path $StoryDir "specification.md"
181
- $warnings = @()
182
-
183
- # 默认加载所有资源
184
- $knowledgeBaseFiles = @(
185
- ".specify/templates/knowledge-base/craft/dialogue.md",
186
- ".specify/templates/knowledge-base/craft/scene-structure.md",
187
- ".specify/templates/knowledge-base/craft/character-arc.md",
188
- ".specify/templates/knowledge-base/craft/pacing.md",
189
- ".specify/templates/knowledge-base/craft/show-not-tell.md"
190
- )
191
-
192
- $skillsFiles = @(
193
- ".specify/templates/skills/writing-techniques/dialogue-techniques",
194
- ".specify/templates/skills/writing-techniques/scene-structure",
195
- ".specify/templates/skills/writing-techniques/character-arc",
196
- ".specify/templates/skills/writing-techniques/pacing-control",
197
- ".specify/templates/skills/quality-assurance/consistency-checker"
198
- )
199
-
200
- $disabledResources = @()
201
- $hasConfig = $false
202
-
203
- if (Test-Path $specFile) {
204
- $content = Get-Content $specFile -Raw
205
- if ($content -match "resource-loading:") {
206
- $hasConfig = $true
207
- }
208
- }
209
-
210
- # 检查文件存在性(使用缓存 + Phase 2: 资源去重)
211
- foreach ($kb in $knowledgeBaseFiles) {
212
- # Phase 2: 资源去重检查
213
- if (Is-ResourceLoaded $kb) {
214
- continue
215
- }
216
-
217
- # 标记为已加载
218
- Mark-ResourceLoaded $kb
219
-
220
- # 检查文件是否存在(使用完整路径)
221
- $fullPath = Join-Path $ProjectRoot $kb
222
- if (-not (Test-FileExistsCached $fullPath)) {
223
- $warnings += "知识库文件不存在: $kb"
224
- }
225
- }
226
-
227
- foreach ($skill in $skillsFiles) {
228
- $skillPath = "$skill/SKILL.md"
229
-
230
- # Phase 2: 资源去重检查
231
- if (Is-ResourceLoaded $skillPath) {
232
- continue
233
- }
234
-
235
- # 标记为已加载
236
- Mark-ResourceLoaded $skillPath
237
-
238
- # 检查文件是否存在(使用完整路径)
239
- $fullPath = Join-Path $ProjectRoot $skillPath
240
- if (-not (Test-FileExistsCached $fullPath)) {
241
- $warnings += "Skill 文件不存在: $skillPath"
242
- }
243
- }
244
-
245
- # Phase 2: 检测缓存命中(基于 specification.md 是否已被缓存加载且有效)
246
- # 仅当文件在缓存中且成功读取时,才视为"缓存命中"
247
- # 缓存语义: $null = 文件不存在, MinValue = stat 失败, DateTime = 成功读取
248
- $cached = $script:FileMTimeCache.ContainsKey($specFile) -and
249
- $script:FileMTimeCache[$specFile] -ne $null -and
250
- $script:FileMTimeCache[$specFile] -ne [DateTime]::MinValue
251
- $cacheHint = "此报告基于缓存生成(specification.md 未修改)。AI 可复用本次会话中已加载的资源。"
252
-
253
- # 生成 JSON
254
- $report = @{
255
- status = "ready"
256
- timestamp = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
257
- has_config = $hasConfig
258
- cached = $cached
259
- session_cache_enabled = $true
260
- resources = @{
261
- "knowledge-base" = $knowledgeBaseFiles
262
- skills = $skillsFiles
263
- disabled = $disabledResources
264
- }
265
- warnings = $warnings
266
- }
267
-
268
- # 仅在缓存命中时添加 cache_hint
269
- if ($cached) {
270
- $report.cache_hint = $cacheHint
271
- }
272
-
273
- # Phase 3: 性能指标
274
- $stopwatch.Stop()
275
- $report.performance = @{
276
- generation_time_ms = $stopwatch.ElapsedMilliseconds
277
- cache_hit = $cached
278
- }
279
-
280
- return $report | ConvertTo-Json -Depth 10
281
- }
282
-
283
- # JSON 模式
284
- if ($Json) {
285
- try {
286
- $report = Generate-LoadReport -StoryDir $StoryDir
287
- Write-Output $report
288
- exit 0
289
- } catch {
290
- Write-Error "生成资源加载报告失败: $_"
291
- exit 1
292
- }
293
- }
294
-
295
- Write-Host "写作状态检查"
296
- Write-Host "============"
297
- Write-Host "当前故事:$StoryName"
298
- Write-Host ""
299
-
300
- # 检查方法论文档
301
- function Test-MethodologyDocs {
302
- $missing = @()
303
-
304
- if (-not (Test-Path ".specify\memory\constitution.md")) {
305
- $missing += "宪法"
306
- }
307
- if (-not (Test-Path "$StoryDir\specification.md")) {
308
- $missing += "规格"
309
- }
310
- if (-not (Test-Path "$StoryDir\creative-plan.md")) {
311
- $missing += "计划"
312
- }
313
- if (-not (Test-Path "$StoryDir\tasks.md")) {
314
- $missing += "任务"
315
- }
316
-
317
- if ($missing.Count -gt 0) {
318
- Write-Host "⚠️ 缺少以下基准文档:" -ForegroundColor Yellow
319
- foreach ($doc in $missing) {
320
- Write-Host " - $doc"
321
- }
322
- Write-Host ""
323
- Write-Host "建议按照七步方法论完成前置步骤:"
324
- Write-Host "1. /constitution - 创建创作宪法"
325
- Write-Host "2. /specify - 定义故事规格"
326
- Write-Host "3. /clarify - 澄清关键决策"
327
- Write-Host "4. /plan - 制定创作计划"
328
- Write-Host "5. /tasks - 生成任务清单"
329
- return $false
330
- }
331
-
332
- Write-Host "✅ 方法论文档完整" -ForegroundColor Green
333
- return $true
334
- }
335
-
336
- # 检查待写作任务
337
- function Test-PendingTasks {
338
- $tasksFile = "$StoryDir\tasks.md"
339
-
340
- if (-not (Test-Path $tasksFile)) {
341
- Write-Host "❌ 任务文件不存在" -ForegroundColor Red
342
- return $false
343
- }
344
-
345
- # 统计任务状态
346
- $content = Get-Content $tasksFile -Raw
347
- $pending = ([regex]::Matches($content, '^- \[ \]', [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
348
- $inProgress = ([regex]::Matches($content, '^- \[~\]', [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
349
- $completed = ([regex]::Matches($content, '^- \[x\]', [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
350
-
351
- Write-Host ""
352
- Write-Host "任务状态:"
353
- Write-Host " 待开始:$pending"
354
- Write-Host " 进行中:$inProgress"
355
- Write-Host " 已完成:$completed"
356
-
357
- if ($pending -eq 0 -and $inProgress -eq 0) {
358
- Write-Host ""
359
- Write-Host "🎉 所有任务已完成!" -ForegroundColor Green
360
- Write-Host "建议运行 /analyze 进行综合验证"
361
- return $true
362
- }
363
-
364
- # 显示下一个待写作任务
365
- Write-Host ""
366
- Write-Host "下一个写作任务:"
367
- $lines = $content -split "`n"
368
- foreach ($line in $lines) {
369
- if ($line -match '^- \[ \]') {
370
- Write-Host $line
371
- break
372
- }
373
- }
374
-
375
- return $true
376
- }
377
-
378
- # 检查已完成内容
379
- function Test-CompletedContent {
380
- $contentDir = "$StoryDir\content"
381
-
382
- if (Test-Path $contentDir) {
383
- $mdFiles = Get-ChildItem "$contentDir\*.md" -ErrorAction SilentlyContinue
384
- $chapterCount = $mdFiles.Count
385
-
386
- if ($chapterCount -gt 0) {
387
- Write-Host ""
388
- Write-Host "已完成章节:$chapterCount"
389
- Write-Host "最近写作:"
390
-
391
- $recentFiles = $mdFiles |
392
- Sort-Object LastWriteTime -Descending |
393
- Select-Object -First 3
394
-
395
- foreach ($file in $recentFiles) {
396
- Write-Host " - $($file.Name)"
397
- }
398
- }
399
- }
400
- else {
401
- Write-Host ""
402
- Write-Host "尚未开始写作"
403
- }
404
- }
405
-
406
- # ==================== 新增:资源加载检查函数 ====================
407
-
408
- function Check-KnowledgeBaseAvailable {
409
- $missing = @()
410
- $available = @()
411
-
412
- $craftFiles = @(
413
- ".specify/templates/knowledge-base/craft/dialogue.md",
414
- ".specify/templates/knowledge-base/craft/scene-structure.md",
415
- ".specify/templates/knowledge-base/craft/character-arc.md",
416
- ".specify/templates/knowledge-base/craft/pacing.md",
417
- ".specify/templates/knowledge-base/craft/show-not-tell.md"
418
- )
419
-
420
- foreach ($file in $craftFiles) {
421
- $fullPath = Join-Path $ProjectRoot $file
422
-
423
- # 使用缓存检查文件是否存在
424
- if (Test-FileExistsCached $fullPath) {
425
- $available += $file
426
- } else {
427
- $missing += $file
428
- }
429
- }
430
-
431
- if ($missing.Count -gt 0) {
432
- Write-Host "⚠️ 缺少以下 knowledge-base 文件:"
433
- foreach ($file in $missing) {
434
- Write-Host " - $file"
435
- }
436
- return $false
437
- }
438
-
439
- Write-Host "✅ Knowledge-base 文件完整 ($($available.Count) 个)"
440
- return $true
441
- }
442
-
443
- function Check-SkillsAvailable {
444
- $missing = @()
445
- $available = @()
446
-
447
- $skillDirs = @(
448
- ".specify/templates/skills/writing-techniques/dialogue-techniques",
449
- ".specify/templates/skills/writing-techniques/scene-structure",
450
- ".specify/templates/skills/writing-techniques/character-arc",
451
- ".specify/templates/skills/writing-techniques/pacing-control"
452
- )
453
-
454
- foreach ($dir in $skillDirs) {
455
- $skillPath = Join-Path $ProjectRoot "$dir/SKILL.md"
456
-
457
- # 使用缓存检查文件是否存在
458
- if (Test-FileExistsCached $skillPath) {
459
- $available += $dir
460
- } else {
461
- $missing += $dir
462
- }
463
- }
464
-
465
- if ($missing.Count -gt 0) {
466
- Write-Host "⚠️ 缺少以下 skills:"
467
- foreach ($dir in $missing) {
468
- Write-Host " - $dir/SKILL.md"
469
- }
470
- return $false
471
- }
472
-
473
- Write-Host "✅ Skills 完整 ($($available.Count) 个)"
474
- return $true
475
- }
476
-
477
- # 主流程
478
- if (-not (Test-MethodologyDocs)) {
479
- exit 1
480
- }
481
-
482
- Test-PendingTasks | Out-Null
483
- Test-CompletedContent
484
-
485
- Write-Host ""
486
- Write-Host "准备就绪,可以开始写作"
@@ -1,107 +0,0 @@
1
- param(
2
- [switch]$Json,
3
- [switch]$PathsOnly
4
- )
5
-
6
- # 澄清故事大纲的支撑脚本
7
- # 用于 /clarify 命令,扫描并返回当前故事路径
8
-
9
- Set-StrictMode -Version Latest
10
- $ErrorActionPreference = "Stop"
11
-
12
- # Get script directory
13
- $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
14
-
15
- # Source common functions
16
- . "$ScriptDir\common.ps1"
17
-
18
- # Get project root
19
- $ProjectRoot = Get-ProjectRoot
20
- Set-Location $ProjectRoot
21
-
22
- # Find the current story directory
23
- $StoriesDir = "stories"
24
- if (-not (Test-Path $StoriesDir -PathType Container)) {
25
- if ($Json) {
26
- Write-Output '{"error": "No stories directory found"}'
27
- } else {
28
- Write-Error "错误:未找到 stories 目录,请先运行 /specify 创建故事规格"
29
- }
30
- exit 1
31
- }
32
-
33
- # Get the latest story
34
- $StoryDirs = Get-ChildItem -Path $StoriesDir -Directory | Sort-Object Name -Descending
35
- if ($StoryDirs.Count -eq 0) {
36
- if ($Json) {
37
- Write-Output '{"error": "No story found"}'
38
- } else {
39
- Write-Error "错误:未找到故事,请先运行 /specify 创建故事规格"
40
- }
41
- exit 1
42
- }
43
-
44
- $StoryDir = $StoryDirs[0]
45
- $StoryName = $StoryDir.Name
46
-
47
- # Find story file (新格式 specification.md)
48
- $StoryFile = Join-Path $StoryDir.FullName "specification.md"
49
-
50
- if (-not (Test-Path $StoryFile -PathType Leaf)) {
51
- if ($Json) {
52
- Write-Output '{"error": "Story file not found (specification.md required)"}'
53
- } else {
54
- Write-Error "错误:未找到故事文件 specification.md"
55
- }
56
- exit 1
57
- }
58
-
59
- # Check if clarification already exists
60
- $ClarificationExists = $false
61
- $StoryContent = Get-Content $StoryFile -Raw
62
- if ($StoryContent -match "## 澄清记录") {
63
- $ClarificationExists = $true
64
- }
65
-
66
- # Count existing clarification sessions
67
- $ClarificationCount = 0
68
- if ($ClarificationExists) {
69
- $matches = [regex]::Matches($StoryContent, "### 澄清会话")
70
- $ClarificationCount = $matches.Count
71
- }
72
-
73
- # Convert paths to forward slashes for JSON
74
- $StoryFilePath = $StoryFile.Replace('\', '/')
75
- $StoryDirPath = $StoryDir.FullName.Replace('\', '/')
76
- $ProjectRootPath = $ProjectRoot.Replace('\', '/')
77
-
78
- # Output in JSON format if requested
79
- if ($Json) {
80
- if ($PathsOnly) {
81
- # Minimal output for command template
82
- $output = @{
83
- STORY_PATH = $StoryFilePath
84
- STORY_NAME = $StoryName
85
- STORY_DIR = $StoryDirPath
86
- }
87
- } else {
88
- # Full output for analysis
89
- $output = @{
90
- STORY_PATH = $StoryFilePath
91
- STORY_NAME = $StoryName
92
- STORY_DIR = $StoryDirPath
93
- CLARIFICATION_EXISTS = $ClarificationExists
94
- CLARIFICATION_COUNT = $ClarificationCount
95
- PROJECT_ROOT = $ProjectRootPath
96
- }
97
- }
98
- Write-Output (ConvertTo-Json $output -Compress)
99
- } else {
100
- Write-Output "找到故事:$StoryName"
101
- Write-Output "文件路径:$StoryFile"
102
- if ($ClarificationExists) {
103
- Write-Output "已有澄清会话:$ClarificationCount 次"
104
- } else {
105
- Write-Output "尚未进行过澄清"
106
- }
107
- }
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env pwsh
2
- # 公用函数(PowerShell)
3
-
4
- Set-StrictMode -Version Latest
5
- $ErrorActionPreference = 'Stop'
6
-
7
- function Get-ProjectRoot {
8
- $current = (Get-Location).Path
9
- while ($true) {
10
- $cfg = Join-Path $current ".specify/config.json"
11
- if (Test-Path $cfg) { return $current }
12
- $parent = Split-Path $current -Parent
13
- if (-not $parent -or $parent -eq $current) { break }
14
- $current = $parent
15
- }
16
- throw "未找到项目根目录(缺少 .specify/config.json)"
17
- }
18
-
19
- function Get-CurrentStoryDir {
20
- $root = Get-ProjectRoot
21
- $stories = Join-Path $root "stories"
22
- if (-not (Test-Path $stories)) { return $null }
23
- $dirs = Get-ChildItem -Path $stories -Directory | Sort-Object LastWriteTime -Descending
24
- if ($dirs.Count -gt 0) { return $dirs[0].FullName }
25
- return $null
26
- }
27
-
28
- function Get-ActiveStory {
29
- $storyDir = Get-CurrentStoryDir
30
- if ($storyDir) {
31
- return Split-Path $storyDir -Leaf
32
- }
33
- # 如果没有故事,返回默认名称
34
- return "story-$(Get-Date -Format 'yyyyMMdd')"
35
- }
36
-