@oh-story/dsh 0.1.16 → 0.1.17

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 (264) hide show
  1. package/README.md +11 -11
  2. package/lib/client.js +26 -15
  3. package/lib/client.js.map +2 -2
  4. package/lib/drama/package.json +4 -0
  5. package/lib/index.js +42 -16
  6. package/lib/index.js.map +2 -2
  7. package/lib/novel-to-game/README.md +3 -3
  8. package/lib/novel-to-game/README_ZH.md +4 -4
  9. package/lib/novel-to-game/VERSION +1 -1
  10. package/lib/novel-to-game/manifest.json +25 -20
  11. package/lib/novel-to-game/package.json +4 -0
  12. package/lib/novel-to-game/skills/game-art-direction/references/art-direction-method.md +4 -0
  13. package/lib/novel-to-game/skills/game-build/SKILL.md +7 -1
  14. package/lib/novel-to-game/skills/game-build/references/baked-sprite-workflow.md +19 -0
  15. package/lib/novel-to-game/skills/game-concept/references/concept-method.md +4 -1
  16. package/lib/novel-to-game/skills/novel-to-game/SKILL.md +6 -3
  17. package/lib/novel-to-game/skills/novel-to-game/references/intake-method.md +1 -0
  18. package/lib/novel-to-game/skills/novel-to-game/references/pipeline-contract.md +13 -2
  19. package/lib/oh-story/manifest.json +417 -592
  20. package/lib/oh-story/package.json +4 -0
  21. package/lib/oh-story/roles/chapter-extractor.md +4 -3
  22. package/lib/oh-story/roles/character-designer.md +20 -85
  23. package/lib/oh-story/roles/consistency-checker.md +5 -5
  24. package/lib/oh-story/roles/narrative-writer.md +9 -9
  25. package/lib/oh-story/roles/story-architect.md +19 -26
  26. package/lib/oh-story/roles/story-explorer.md +4 -5
  27. package/lib/oh-story/roles/story-researcher.md +6 -7
  28. package/lib/oh-story/skills/browser-cdp/SKILL.md +26 -15
  29. package/lib/oh-story/skills/story/SKILL.md +94 -54
  30. package/lib/oh-story/skills/story/VERSION +1 -1
  31. package/lib/oh-story/skills/story-cover/SKILL.md +41 -220
  32. package/lib/oh-story/skills/story-cover/references/api-fallback.md +128 -0
  33. package/lib/oh-story/skills/story-cover/references/cover-styles.md +61 -95
  34. package/lib/oh-story/skills/story-deslop/SKILL.md +32 -27
  35. package/lib/oh-story/skills/story-deslop/references/agent-calls.md +4 -4
  36. package/lib/oh-story/skills/story-deslop/references/banned-words.md +7 -9
  37. package/lib/oh-story/skills/story-deslop/references/deslop-gates.md +12 -12
  38. package/lib/oh-story/skills/story-deslop/references/expression.md +10 -3
  39. package/lib/oh-story/skills/story-deslop/references/story-logic.md +1 -1
  40. package/lib/oh-story/skills/story-deslop/references/style-resolution.md +1 -1
  41. package/lib/oh-story/skills/story-import/SKILL.md +12 -11
  42. package/lib/oh-story/skills/story-import/references/benchmark-sync.md +50 -0
  43. package/lib/oh-story/skills/story-import/references/character-state-reverse.md +3 -4
  44. package/lib/oh-story/skills/story-import/references/deep-analysis.md +2 -3
  45. package/lib/oh-story/skills/story-import/references/import-report.md +5 -4
  46. package/lib/oh-story/skills/story-import/references/import-special-cases.md +6 -16
  47. package/lib/oh-story/skills/story-import/references/import-tracking.md +2 -2
  48. package/lib/oh-story/skills/story-import/references/length-routing.md +1 -43
  49. package/lib/oh-story/skills/story-import/references/outline-reverse-rules.md +8 -8
  50. package/lib/oh-story/skills/story-import/references/outline-reverse.md +2 -2
  51. package/lib/oh-story/skills/story-import/references/structure-mapping-long.md +113 -125
  52. package/lib/oh-story/skills/story-import/references/structure-mapping-short.md +77 -88
  53. package/lib/oh-story/skills/story-import/scripts/build_outline_brief.py +36 -59
  54. package/lib/oh-story/skills/story-import/scripts/check-outline-contract.js +5 -1
  55. package/lib/oh-story/skills/story-import/scripts/outline_view.py +286 -0
  56. package/lib/oh-story/skills/story-long-analyze/SKILL.md +38 -75
  57. package/lib/oh-story/skills/story-long-analyze/references/author-facing.md +21 -23
  58. package/lib/oh-story/skills/story-long-analyze/references/final-checks.md +8 -17
  59. package/lib/oh-story/skills/story-long-analyze/references/inspiration-library.md +18 -5
  60. package/lib/oh-story/skills/story-long-analyze/references/pipeline-ops.md +8 -14
  61. package/lib/oh-story/skills/story-long-analyze/references/stage1-golden-chapters.md +26 -27
  62. package/lib/oh-story/skills/story-long-analyze/references/stage2-extraction.md +74 -162
  63. package/lib/oh-story/skills/story-long-analyze/references/stage3-plot-rhythm.md +124 -309
  64. package/lib/oh-story/skills/story-long-analyze/references/stage4-characters-settings.md +49 -166
  65. package/lib/oh-story/skills/story-long-analyze/references/stage5-report.md +12 -15
  66. package/lib/oh-story/skills/story-long-analyze/references/style-profile-generator.md +110 -34
  67. package/lib/oh-story/skills/story-long-analyze/references/synthesis-inputs.md +12 -2
  68. package/lib/oh-story/skills/story-long-analyze/scripts/inspect_existing_assets.py +3 -1
  69. package/lib/oh-story/skills/story-long-analyze/scripts/manage_analysis_run.py +5 -1
  70. package/lib/oh-story/skills/story-long-scan/SKILL.md +49 -72
  71. package/lib/oh-story/skills/story-long-scan/references/genre-trends.md +47 -167
  72. package/lib/oh-story/skills/story-long-scan/references/platform-ciweimao.md +23 -8
  73. package/lib/oh-story/skills/story-long-scan/references/platform-fanqie.md +24 -22
  74. package/lib/oh-story/skills/story-long-scan/references/platform-jjwxc.md +25 -13
  75. package/lib/oh-story/skills/story-long-scan/references/platform-qidian.md +41 -27
  76. package/lib/oh-story/skills/story-long-scan/references/platform-qimao.md +24 -16
  77. package/lib/oh-story/skills/story-long-scan/references/topic-decision.md +31 -33
  78. package/lib/oh-story/skills/story-long-write/SKILL.md +5 -5
  79. package/lib/oh-story/skills/story-long-write/references/agent-calls.md +1 -1
  80. package/lib/oh-story/skills/story-long-write/references/artifact-protocols.md +51 -24
  81. package/lib/oh-story/skills/story-long-write/references/banned-words.md +7 -9
  82. package/lib/oh-story/skills/story-long-write/references/benchmark-recall.md +3 -3
  83. package/lib/oh-story/skills/story-long-write/references/character-basics.md +57 -95
  84. package/lib/oh-story/skills/story-long-write/references/character-relations.md +119 -269
  85. package/lib/oh-story/skills/story-long-write/references/cross-book-recall.md +2 -2
  86. package/lib/oh-story/skills/story-long-write/references/dialogue-mastery.md +8 -8
  87. package/lib/oh-story/skills/story-long-write/references/emotion-on-page.md +7 -7
  88. package/lib/oh-story/skills/story-long-write/references/emotional-arc-design.md +38 -298
  89. package/lib/oh-story/skills/story-long-write/references/emotional-methods.md +12 -53
  90. package/lib/oh-story/skills/story-long-write/references/female-audience-writing.md +39 -85
  91. package/lib/oh-story/skills/story-long-write/references/genre-readers.md +97 -163
  92. package/lib/oh-story/skills/story-long-write/references/long-chapter-hooks.md +39 -119
  93. package/lib/oh-story/skills/story-long-write/references/long-chapter-quality.md +39 -91
  94. package/lib/oh-story/skills/story-long-write/references/long-genre-catalog.md +81 -310
  95. package/lib/oh-story/skills/story-long-write/references/long-genre-mechanics.md +115 -326
  96. package/lib/oh-story/skills/story-long-write/references/long-reversal.md +1 -1
  97. package/lib/oh-story/skills/story-long-write/references/long-suspense.md +8 -8
  98. package/lib/oh-story/skills/story-long-write/references/opening-design.md +38 -334
  99. package/lib/oh-story/skills/story-long-write/references/outline-methods.md +128 -281
  100. package/lib/oh-story/skills/story-long-write/references/plot-core-methods.md +58 -499
  101. package/lib/oh-story/skills/story-long-write/references/project-files.md +10 -14
  102. package/lib/oh-story/skills/story-long-write/references/reference-index.md +29 -82
  103. package/lib/oh-story/skills/story-long-write/references/revision-diagnosis.md +31 -0
  104. package/lib/oh-story/skills/story-long-write/references/stop-and-fix.md +2 -2
  105. package/lib/oh-story/skills/story-long-write/references/style-combat-face.md +12 -19
  106. package/lib/oh-story/skills/story-long-write/references/style-genre-modules.md +3 -171
  107. package/lib/oh-story/skills/story-long-write/references/style-resolution.md +1 -1
  108. package/lib/oh-story/skills/story-long-write/references/workflow-chapter.md +8 -6
  109. package/lib/oh-story/skills/story-long-write/references/workflow-daily.md +2 -2
  110. package/lib/oh-story/skills/story-long-write/references/workflow-outline.md +47 -47
  111. package/lib/oh-story/skills/story-long-write/references/workflow-revision.md +7 -7
  112. package/lib/oh-story/skills/story-long-write/references/workflow-setup.md +4 -9
  113. package/lib/oh-story/skills/story-long-write/references/workflow-volume.md +72 -98
  114. package/lib/oh-story/skills/story-long-write/references/writing-craft.md +59 -115
  115. package/lib/oh-story/skills/story-long-write/scripts/build_architect_brief.py +38 -18
  116. package/lib/oh-story/skills/story-long-write/scripts/build_writer_prompt.py +23 -11
  117. package/lib/oh-story/skills/story-long-write/scripts/check-outline-contract.js +5 -1
  118. package/lib/oh-story/skills/story-long-write/scripts/outline_view.py +1 -1
  119. package/lib/oh-story/skills/story-review/SKILL.md +26 -24
  120. package/lib/oh-story/skills/story-review/references/agent-prompts.md +13 -9
  121. package/lib/oh-story/skills/story-review/references/banned-words.md +7 -9
  122. package/lib/oh-story/skills/story-review/references/expression.md +10 -3
  123. package/lib/oh-story/skills/story-review/references/quality-rubric.md +7 -7
  124. package/lib/oh-story/skills/story-review/references/review-tracking.md +2 -1
  125. package/lib/oh-story/skills/story-review/references/rubrics/fanqie.md +8 -9
  126. package/lib/oh-story/skills/story-review/references/rubrics/qidian.md +9 -11
  127. package/lib/oh-story/skills/story-review/references/rubrics/zhihu.md +9 -8
  128. package/lib/oh-story/skills/story-review/references/solo.md +6 -5
  129. package/lib/oh-story/skills/story-review/references/story-logic.md +1 -1
  130. package/lib/oh-story/skills/story-review/references/style-resolution.md +1 -1
  131. package/lib/oh-story/skills/story-setup/SKILL.md +24 -31
  132. package/lib/oh-story/skills/story-setup/references/agent-references/agent-reference-profiles.md +12 -13
  133. package/lib/oh-story/skills/story-setup/references/agent-references/banned-words.md +7 -9
  134. package/lib/oh-story/skills/story-setup/references/agent-references/benchmark-style-load.md +1 -1
  135. package/lib/oh-story/skills/story-setup/references/agent-references/character-basics.md +57 -95
  136. package/lib/oh-story/skills/story-setup/references/agent-references/character-relations.md +119 -269
  137. package/lib/oh-story/skills/story-setup/references/agent-references/deslop-gates.md +12 -12
  138. package/lib/oh-story/skills/story-setup/references/agent-references/dialogue-mastery.md +8 -8
  139. package/lib/oh-story/skills/story-setup/references/agent-references/emotion-on-page.md +7 -7
  140. package/lib/oh-story/skills/story-setup/references/agent-references/emotional-arc-design.md +38 -298
  141. package/lib/oh-story/skills/story-setup/references/agent-references/expression.md +10 -3
  142. package/lib/oh-story/skills/story-setup/references/agent-references/female-audience-writing.md +141 -0
  143. package/lib/oh-story/skills/story-setup/references/agent-references/genre-readers.md +96 -161
  144. package/lib/oh-story/skills/story-setup/references/agent-references/long-chapter-hooks.md +39 -119
  145. package/lib/oh-story/skills/story-setup/references/agent-references/long-emotional-methods.md +13 -54
  146. package/lib/oh-story/skills/story-setup/references/agent-references/long-genre-catalog.md +81 -310
  147. package/lib/oh-story/skills/story-setup/references/agent-references/long-genre-mechanics.md +115 -326
  148. package/lib/oh-story/skills/story-setup/references/agent-references/long-reversal.md +1 -1
  149. package/lib/oh-story/skills/story-setup/references/agent-references/long-suspense.md +8 -8
  150. package/lib/oh-story/skills/story-setup/references/agent-references/opening-design.md +38 -334
  151. package/lib/oh-story/skills/story-setup/references/agent-references/outline-methods.md +128 -281
  152. package/lib/oh-story/skills/story-setup/references/agent-references/plot-core-methods.md +58 -499
  153. package/lib/oh-story/skills/story-setup/references/agent-references/short-chapter-hooks.md +63 -171
  154. package/lib/oh-story/skills/story-setup/references/agent-references/short-emotional-methods.md +11 -63
  155. package/lib/oh-story/skills/story-setup/references/agent-references/short-genre-formulas.md +40 -50
  156. package/lib/oh-story/skills/story-setup/references/agent-references/short-reversal.md +14 -39
  157. package/lib/oh-story/skills/story-setup/references/agent-references/story-logic.md +1 -1
  158. package/lib/oh-story/skills/story-setup/references/agent-references/style-combat-face.md +12 -19
  159. package/lib/oh-story/skills/story-setup/references/agent-references/style-genre-modules.md +3 -171
  160. package/lib/oh-story/skills/story-setup/references/agent-references/style-resolution.md +1 -1
  161. package/lib/oh-story/skills/story-setup/references/agent-references/writing-craft.md +59 -115
  162. package/lib/oh-story/skills/story-short-analyze/SKILL.md +41 -90
  163. package/lib/oh-story/skills/story-short-analyze/references/analysis-characters.md +66 -0
  164. package/lib/oh-story/skills/story-short-analyze/references/analysis-short-genres.md +21 -20
  165. package/lib/oh-story/skills/story-short-analyze/references/analysis-short-hooks.md +4 -3
  166. package/lib/oh-story/skills/story-short-analyze/references/analysis-short-mechanics.md +4 -4
  167. package/lib/oh-story/skills/story-short-analyze/references/analysis-short-suspense.md +5 -5
  168. package/lib/oh-story/skills/story-short-analyze/references/analysis-submission.md +52 -0
  169. package/lib/oh-story/skills/story-short-analyze/references/optional-modules.md +23 -73
  170. package/lib/oh-story/skills/story-short-analyze/references/output-contract.md +25 -26
  171. package/lib/oh-story/skills/story-short-analyze/references/quality-checklist.md +20 -38
  172. package/lib/oh-story/skills/story-short-analyze/references/source-story-quality.md +9 -158
  173. package/lib/oh-story/skills/story-short-analyze/references/stage2-3-structure-emotion.md +39 -26
  174. package/lib/oh-story/skills/story-short-analyze/references/stage4-6-reversal-summary.md +42 -71
  175. package/lib/oh-story/skills/story-short-scan/SKILL.md +52 -62
  176. package/lib/oh-story/skills/story-short-scan/references/manual-rank-input.md +16 -12
  177. package/lib/oh-story/skills/story-short-scan/references/platform-dianzhong.md +10 -4
  178. package/lib/oh-story/skills/story-short-scan/references/platform-heiyan.md +15 -6
  179. package/lib/oh-story/skills/story-short-scan/references/real-market-data.md +34 -72
  180. package/lib/oh-story/skills/story-short-scan/references/topic-match.md +33 -13
  181. package/lib/oh-story/skills/story-short-write/SKILL.md +5 -5
  182. package/lib/oh-story/skills/story-short-write/references/agent-calls.md +3 -3
  183. package/lib/oh-story/skills/story-short-write/references/banned-words.md +7 -9
  184. package/lib/oh-story/skills/story-short-write/references/benchmark-recall.md +17 -22
  185. package/lib/oh-story/skills/story-short-write/references/cross-book-recall.md +22 -37
  186. package/lib/oh-story/skills/story-short-write/references/deslop-gates.md +12 -12
  187. package/lib/oh-story/skills/story-short-write/references/dialogue-mastery.md +8 -8
  188. package/lib/oh-story/skills/story-short-write/references/emotional-methods.md +11 -63
  189. package/lib/oh-story/skills/story-short-write/references/expression.md +10 -3
  190. package/lib/oh-story/skills/story-short-write/references/genre-styles//344/270/226/346/203/205/346/211/223/350/204/270.md +3 -3
  191. package/lib/oh-story/skills/story-short-write/references/genre-styles//345/217/214/347/224/267/344/270/273.md +6 -6
  192. package/lib/oh-story/skills/story-short-write/references/genre-styles//345/244/215/344/273/207/346/211/223/350/204/270.md +8 -8
  193. package/lib/oh-story/skills/story-short-write/references/genre-styles//345/256/205/346/226/227/345/256/253/346/226/227.md +4 -4
  194. package/lib/oh-story/skills/story-short-write/references/genre-styles//346/200/273/350/243/201/350/261/252/351/227/250.md +9 -9
  195. package/lib/oh-story/skills/story-short-write/references/genre-styles//346/202/254/347/226/221.md +10 -10
  196. package/lib/oh-story/skills/story-short-write/references/genre-styles//346/260/221/344/277/227/346/200/252/350/260/210.md +7 -7
  197. package/lib/oh-story/skills/story-short-write/references/genre-styles//346/262/231/351/233/225/350/204/221/346/264/236.md +6 -6
  198. package/lib/oh-story/skills/story-short-write/references/genre-styles//347/224/234/345/256/240.md +6 -6
  199. package/lib/oh-story/skills/story-short-write/references/genre-styles//350/277/275/345/246/273/347/201/253/350/221/254/345/234/272.md +12 -12
  200. package/lib/oh-story/skills/story-short-write/references/genre-writing-formulas.md +40 -50
  201. package/lib/oh-story/skills/story-short-write/references/hooks-chapter.md +63 -171
  202. package/lib/oh-story/skills/story-short-write/references/reference-index.md +13 -14
  203. package/lib/oh-story/skills/story-short-write/references/short-craft.md +10 -29
  204. package/lib/oh-story/skills/story-short-write/references/short-deslop.md +2 -2
  205. package/lib/oh-story/skills/story-short-write/references/short-format.md +12 -32
  206. package/lib/oh-story/skills/story-short-write/references/short-reversal.md +14 -39
  207. package/lib/oh-story/skills/story-short-write/references/story-logic.md +1 -1
  208. package/lib/oh-story/skills/story-short-write/references/style-resolution.md +1 -1
  209. package/lib/oh-story/skills/story-short-write/references/submission-craft.md +29 -19
  210. package/lib/oh-story/skills/story-short-write/references/villain-and-reveal.md +14 -19
  211. package/lib/oh-story/skills/story-short-write/references/workflow-design.md +67 -26
  212. package/lib/oh-story/skills/story-short-write/references/workflow-draft.md +10 -11
  213. package/lib/oh-story/skills/story-short-write/references/workflow-revision.md +50 -69
  214. package/lib/oh-story/skills/story-short-write/scripts/check-phase2-contract.js +21 -16
  215. package/lib/types/client/file-activity.d.ts +10 -0
  216. package/lib/types/client/file-activity.d.ts.map +1 -1
  217. package/lib/types/client/index.d.ts.map +1 -1
  218. package/lib/types/native-hooks.d.ts.map +1 -1
  219. package/lib/types/skill-provider.d.ts.map +1 -1
  220. package/lib/types/workspace-route.d.ts.map +1 -1
  221. package/lib/video-recap/package.json +4 -0
  222. package/package.json +23 -23
  223. package/lib/oh-story/skills/story-import/references/format-and-structure.md +0 -168
  224. package/lib/oh-story/skills/story-import/references/state-tracking.md +0 -45
  225. package/lib/oh-story/skills/story-import/references/tracking-transaction.md +0 -146
  226. package/lib/oh-story/skills/story-long-analyze/references/deconstruction-notes.md +0 -270
  227. package/lib/oh-story/skills/story-long-analyze/references/semantic-acceptance-fixtures.md +0 -84
  228. package/lib/oh-story/skills/story-long-analyze/references/style-profile-protocol.md +0 -133
  229. package/lib/oh-story/skills/story-long-scan/references/publishing-guide.md +0 -101
  230. package/lib/oh-story/skills/story-long-scan/references/reader-profiling.md +0 -92
  231. package/lib/oh-story/skills/story-long-write/references/character-design-methods.md +0 -428
  232. package/lib/oh-story/skills/story-long-write/references/commercial-core-methods.md +0 -503
  233. package/lib/oh-story/skills/story-long-write/references/deslop-gates.md +0 -34
  234. package/lib/oh-story/skills/story-long-write/references/expression.md +0 -76
  235. package/lib/oh-story/skills/story-long-write/references/narrative-focus.md +0 -63
  236. package/lib/oh-story/skills/story-long-write/references/outline-conflict.md +0 -457
  237. package/lib/oh-story/skills/story-long-write/references/outline-rhythm.md +0 -389
  238. package/lib/oh-story/skills/story-long-write/references/outline-structure-theory.md +0 -272
  239. package/lib/oh-story/skills/story-long-write/references/plot-emotion-system.md +0 -354
  240. package/lib/oh-story/skills/story-long-write/references/plot-frameworks.md +0 -710
  241. package/lib/oh-story/skills/story-long-write/references/plot-special-topics.md +0 -624
  242. package/lib/oh-story/skills/story-long-write/references/story-logic.md +0 -65
  243. package/lib/oh-story/skills/story-long-write/references/style-craft.md +0 -306
  244. package/lib/oh-story/skills/story-review/references/character-relations.md +0 -433
  245. package/lib/oh-story/skills/story-review/references/dialogue-mastery.md +0 -285
  246. package/lib/oh-story/skills/story-review/references/plot-core-methods.md +0 -522
  247. package/lib/oh-story/skills/story-review/references/review-quality.md +0 -243
  248. package/lib/oh-story/skills/story-setup/references/agent-references/character-design-methods.md +0 -428
  249. package/lib/oh-story/skills/story-setup/references/agent-references/outline-conflict.md +0 -457
  250. package/lib/oh-story/skills/story-setup/references/agent-references/outline-rhythm.md +0 -389
  251. package/lib/oh-story/skills/story-setup/references/agent-references/short-paragraph-hooks.md +0 -145
  252. package/lib/oh-story/skills/story-short-analyze/references/analysis-character-basics.md +0 -433
  253. package/lib/oh-story/skills/story-short-analyze/references/analysis-character-design.md +0 -426
  254. package/lib/oh-story/skills/story-short-analyze/references/analysis-character-relations.md +0 -384
  255. package/lib/oh-story/skills/story-short-analyze/references/analysis-paragraph-hooks.md +0 -144
  256. package/lib/oh-story/skills/story-short-analyze/references/analysis-reader-profile.md +0 -238
  257. package/lib/oh-story/skills/story-short-analyze/references/analysis-writing-techniques.md +0 -464
  258. package/lib/oh-story/skills/story-short-analyze/references/deconstruction-examples.md +0 -79
  259. package/lib/oh-story/skills/story-short-analyze/references/real-market-data.md +0 -89
  260. package/lib/oh-story/skills/story-short-analyze/references/zhihu-style.md +0 -54
  261. package/lib/oh-story/skills/story-short-write/references/hooks-paragraph.md +0 -145
  262. package/lib/oh-story/skills/story-short-write/references/output-contract.md +0 -116
  263. package/lib/oh-story/skills/story-short-write/references/short-prose-quality.md +0 -207
  264. package/lib/oh-story/skills/story-short-write/references/writing-workflow.md +0 -50
@@ -1,109 +1,105 @@
1
- # 结构迁移映射规则(短篇)
1
+ # 结构迁移(短篇)
2
2
 
3
- Phase 3-S 读取本文件和 [format-and-structure.md](format-and-structure.md),将拆文产物迁为 `{短篇标题}/`,保存已写内容与续写基线。外部对标、目标平台与作者交代取自导入记录。继续创作时由 `story-short-write` 执行现有构思完成检查,导入不等于补完未来设计。
3
+ 按本文件把 `拆文库/{导入书名}/` 迁成 `{导入书名}/`。书目录名与拆文目录名相同,写正文守卫据此放行正文迁移。
4
+
5
+ 外部对标、目标平台、完本与否和作者交代取自导入记录。`设定.md` 和 `小节大纲.md` 按短篇写作的构思模板写,续写时直接过它的构思检查;原文证据不够、要等构思时定的项写 `[待补充]`,汇报时列给作者。
4
6
 
5
7
  ## 迁移步骤
6
8
 
7
- 目标工程只有 `{短篇标题}/设定.md`(核心框架 + 本书续写基线)、`小节大纲.md`、`正文.md` 三个单文件,外加可选的 `对标/{对标书名}/`(仅外部对标引用视图:拆文报告、情节节点、写作手法)。**短篇工程与长篇完全不同**:正文是单文件、不切章,**不产** `追踪/`、`大纲/`、`正文/` 等长篇目录,迁移时严禁误建。
9
+ 目标工程只有 `{导入书名}/设定.md`、`小节大纲.md`、`正文.md` 三个单文件,外加可选的 `对标/{对标书名}/`(仅外部对标引用视图)。正文是单文件、不切章,**不产** `追踪/`、`大纲/`、`正文/` 等长篇目录,迁移时严禁误建。
8
10
 
9
- 1. **正文迁移**:将 `拆文库/{导入书名}/原文/` 的全文迁移为单文件 `{标题}/正文.md`,按 format-and-structure.md 规范化格式(小节标记 `###1.`、段间仅单换行、对话引号按项目/平台约定统一)。原文已是成稿,不重写内容,只规范格式。
10
- 2. **设定生成**:从 `拆文报告.md`、`写作手法.md` 反推 `{标题}/设定.md`,含核心框架(对齐 story-short-write 核心框架:基本信息、一句话梗概、核心反转、情绪设计、人设速写)与本书续写基线(已写内容的故事结构、情绪节奏、核心反转机制、既有写作手法;这是本书内部上下文,不是对标摘要)两个区块,规则见下方「设定.md 反推规则」。导入记录里作者交代的偏好与红线一并写进续写基线。
11
- 3. **小节大纲生成**:以 `拆文报告.md` 的结构划分确定各段功能,再从 `情节节点.md` 提取事件,反推 `{标题}/小节大纲.md`。使用固定 12 列表格,每节一行;同一动作链可兑现多个功能,不为凑数拆分。无法判断的格子写 `[待补充]`,填法见下方「小节大纲表格」。
12
- 4. **外部对标引用视图(可选)**:仅当导入记录已显式绑定外部 `{对标书名}` 时,才把 `拆文库/{对标书名}/` 同步为 `{标题}/对标/{对标书名}/`;没有绑定则跳过。不得把 `拆文库/{导入书名}/` 整体复制进 `对标/`。
11
+ 1. **正文迁移**:把 `拆文库/{导入书名}/原文/` 的全文迁成单文件 `{导入书名}/正文.md`,只按下方「正文.md 外壳整理」改格式。原文是作者的成稿,分段、引号、措辞一律不改。
12
+ 2. **设定生成**:从 `拆文报告.md`、`写作手法.md`、`情节节点.md` 反推 `{导入书名}/设定.md`,按下方「设定.md 模板」写。
13
+ 3. **小节大纲生成**:以 `拆文报告.md`「结构划分」确定各段功能,再从 `情节节点.md` 提取事件,反推 `{导入书名}/小节大纲.md`,填法见下方「小节大纲.md 反推规则」。
14
+ 4. **外部对标引用视图(可选)**:仅当导入记录已显式绑定外部 `{对标书名}` 时,按下方「外部对标引用视图」同步;没有绑定则跳过。不得把 `拆文库/{导入书名}/` 整体复制进 `对标/`。
13
15
 
14
16
  迁完按文末质量检查清单自检,在导入记录勾「结构迁移」,直接进入 Phase 5 汇报。
15
17
 
16
18
  ---
17
19
 
18
- ## 与长篇的关键差异
19
-
20
- | 维度 | 短篇 | 长篇 |
21
- |------|------|------|
22
- | 正文 | 单文件 `正文.md`,**不切章** | `正文/第XXX章_章名.md` 多文件 |
23
- | 追踪目录 | **不产** `追踪/` | 产 `追踪/`(`_tracking-state.json`、续写状态卡、逐章记录、角色快照、伏笔视图、双视角时间线) |
24
- | 角色状态 | **不产**角色追踪 | 核心角色各产 `追踪/角色状态/{角色名}.md`,由 `character-state-reverse.md` 反推 |
25
- | 大纲体系 | **不产** 卷纲、细纲 | 产 `大纲/卷纲_第X卷.md` + `大纲/细纲_第N章.md` |
26
- | 大纲目录 | **不产** `大纲/` 目录 | 产 |
27
- | 续写衔接 | story-short-write Phase 3(逐场景写作) | story-long-write 日更循环 |
28
-
29
- ---
30
-
31
20
  ## 映射总览
32
21
 
33
22
  | 拆书产物 | 短篇工程文件 | 转换方式 |
34
23
  |---------|------------|---------|
35
- | 原文全文(`拆文库/{导入书名}/原文/`) | `{标题}/正文.md` | 单文件迁移,按下方『正文.md 格式规范』规范化,不重写内容 |
36
- | `拆文报告.md` 的故事核/题材/结构字段 | `{标题}/设定.md`(核心框架区) | 反推本书核心框架;不继承报告中可能存在的自对标登记 |
37
- | `拆文报告.md` 的结构划分 + `情节节点.md` | `{标题}/小节大纲.md` | 按结构功能组织事件,无法确认的钩子写 `[待补充]` |
38
- | `拆文报告.md` + `写作手法.md` | `{标题}/设定.md`(本书续写基线区) | 把已写内容的结构、情绪、反转和既有写法整理为内部续写上下文 |
39
- | `拆文库/{对标书名}/` | `{标题}/对标/{对标书名}/` | 可选:仅同步用户显式绑定的外部参考作品 |
24
+ | 原文全文(`拆文库/{导入书名}/原文/`) | `{导入书名}/正文.md` | 单文件迁移,只整理格式 |
25
+ | `拆文报告.md`「故事核」「题材」「人物分析」「情感曲线」「反转分析」 | `{导入书名}/设定.md` | 反推本书核心框架;不继承报告中可能存在的自对标登记 |
26
+ | `拆文报告.md`「结构划分」 + `情节节点.md` | `{导入书名}/小节大纲.md` | 按结构功能组织事件,无法确认的格子写 `[待补充]` |
27
+ | `写作手法.md` | `{导入书名}/设定.md`「文风约定」「本书续写基线」 | 记下原文已经在用的写法 |
28
+ | `拆文库/{对标书名}/` | `{导入书名}/对标/{对标书名}/` | 可选:仅同步用户显式绑定的外部参考作品 |
40
29
 
41
30
  ---
42
31
 
43
- ## 设定.md 反推规则
32
+ ## 设定.md 模板
44
33
 
45
- 目标文件使用本文件定义的当前核心框架模板,分两个区块:
46
-
47
- ### 区块一:核心框架
48
-
49
- 从 `拆文报告.md` 的故事核、结构划分、人物分析等部分提取。目标平台优先采用导入记录;反转类型沿用拆文结果,无反转时不补造反转。情绪名称取自情感曲线,强度按 1-10 量表重新判断,不照抄曲线的 -9~+9 分值。
34
+ 小节和字段名与短篇写作构思时的 `设定.md` 一致,续写构思只补缺项、不重写。目标平台优先采用导入记录;反转类型沿用拆文结果,无反转时不补造反转。情绪名称取自拆文报告「情感曲线」,强度按 1-10 量表重新判断,不照抄曲线的 -9~+9 分值。
50
35
 
51
36
  ```markdown
52
37
  ## 短篇核心框架
53
38
 
54
39
  ### 基本信息
55
- - 标题:{导入书名}
56
- - 目标字数:{原文实际字数} 字
57
- - 目标平台:{优先采用导入记录,无则从拆文报告提取,仍无填 [待补充]}
58
- - 目标情绪:{从拆文报告「情感线/爆点分析」提取读者预期感受}
40
+ - 标题(暂定):{导入书名}
41
+ - 目标字数:{完本:各节字数之和;半成品:作者定的全篇字数,没定写 [待补充]} 字
42
+ - 目标平台:{导入记录里的平台,知乎盐言 / 番茄 / 七猫 / 黑岩 / 红果 / 小程序 / 未定 选一}
43
+ - 平台基调:{原文实际用的小节标记、引号和分段习惯,原样记下,续写沿用;视角、节尾钩子、结局质感从原文归纳}
44
+ - 目标情绪:{从拆文报告「情感曲线」「爆点分析」提取读者读完的感受}
59
45
 
60
46
  ### 一句话梗概
61
- {主角 + 困境 + 反转 + 情绪落点(从拆文报告故事核提取)}
47
+ {主角 + 困境 + 反转 + 情绪落点(从拆文报告「故事核」提取)}
62
48
 
63
- ### 核心反转
64
- - 反转类型:{沿用拆文结果:身份/视角/动机/时间线/信息/认知反转,或无反转}
65
- - 反转内容:{一句话描述}
66
- - 铺垫线索:{从拆文报告反转分析提取,回查相关情节节点,至少 3 个;不足时标 [待补充];无反转时写“不适用”}
49
+ ### 核心支点
50
+ - 类型:{沿用拆文结果:身份/视角/动机/时间线/信息/认知反转,或无反转}
51
+ - 核心兑现:{一句话写主揭示;无反转时写报应或关系兑现}
52
+ - 铺垫/期待:{从拆文报告「反转分析」和情节节点回查,有几个写几个}
67
53
 
68
54
  ### 情绪设计
69
- - 开头情绪:{从情感曲线第一个节点提取}(强度 {1-10})
55
+ - 开头情绪:{情感曲线第一个节点}(强度 {1-10})
70
56
  - 中段情绪:{中段情感节点}(强度 {1-10})
71
57
  - 反转情绪:{反转节情感峰值}(强度 {1-10})
72
- - 结尾情绪:{结尾节情感}(强度 {1-10})
58
+ - 结尾情绪:{结尾节情感;半成品还没写到写 [待补充]}(强度 {1-10})
73
59
 
74
60
  ### 人设速写
75
- - 主角:{一句话人设,从人物分析提取}
76
- - 关键角色:{一句话人设}
61
+ - {角色}:{一句话人设};声线:{从对白归纳};口头禅:{原文原句,没有写 [待补充]};禁忌:{原文能看出的,没有写 [待补充]}(每人一行)
77
62
  - 关系:{他们之间的关系}
78
- ```
79
63
 
80
- > 不确定字段一律加 `[待补充]` 标记,不留空字段。
64
+ ### 题材招式
65
+ - {原文已经在用的招式:落在哪几节;构思时按题材包核对,补到 2-3 条}
81
66
 
82
- ### 区块二:本书续写基线
67
+ ### 文风约定
68
+ - {原文明显的句子、标点、用词习惯,从写作手法.md 提取;没有写「无」}
83
69
 
84
- 从 `拆文库/{导入书名}/拆文报告.md` 和 `写作手法.md` 提取,汇总为本书内部续写基线:
70
+ ### 作者已定
71
+ - {导入记录「作者交代」里的偏好、红线、残稿决定,一条一行;没有写「无」}
85
72
 
86
- ```markdown
87
- ## 本书续写基线
88
-
89
- ### 故事结构
90
- {从拆文报告「功能分段」字段提取,概述各段功能}
91
-
92
- ### 情绪节奏
93
- {从情感曲线/爆点分析提取,描述情绪走势与峰值位置}
94
-
95
- ### 核心反转机制
96
- {从反转机制分析提取,含铺垫路径}
73
+ ### 反转与揭露
74
+ - 揭露方式:{证物/证人/偷听撞见/剥洋葱,原文怎么揭的;还没写到写 [待补充]}
75
+ - 真线索:第 {X} 节 {线索};假线索:第 {X} 节 {误导}(原文有几条写几条)
97
76
 
98
- ### 可复用写作手法
99
- {从写作手法.md 或拆文报告「可复用结构」字段提取,≥3 条}
77
+ ## 本书续写基线
78
+ - 已写到:第 {N} 节,{完本 | 半成品}
79
+ - 故事结构:{从拆文报告「结构划分」概述各段功能}
80
+ - 情绪节奏:{情绪走势与峰值在第几节}
81
+
82
+ ## Phase 2 设计校验
83
+ - 题材参考:[待补充]
84
+ - 核心招式:[待补充]
85
+ - 反派设计:不适用({原因})
86
+ - 反转类型:{身份/视角/动机/时间线/信息/认知/无反转}
87
+ - 反转位置:第 {X} 节 ÷ 共 {Y} 节 = {Z}%
88
+ - 付费点:第 {N} 节末
100
89
  ```
101
90
 
91
+ - 「题材参考」「核心招式」导入一律写 `[待补充]`:题材包由续写构思时选,原文已用的招式先记在「题材招式」。
92
+ - 有反派时按拆文报告「人物分析」把「反派设计:不适用」换成身份、动机、作恶方式、致命弱点、报应五行(一字段一行);原文证据不够的字段写 `[待补充]`。
93
+ - 无反转篇写 `反转类型:无反转` 和 `反转位置:不适用({报应兑现/甜度递进等原因})`。有反转但半成品还没写到,写 `反转位置:[待补充]`。
94
+ - 付费点能从原文认出来(知乎盐言多在全文三到四成处的节末)时写节号,并在小节大纲同一节的「结尾承接/钩子」标「付费点」;认不出写 `付费点:[待补充]`。
95
+ - 绑定了外部对标时,在「作者已定」之后加一节 `### 对标摘要(有对标时)`,表头 `| 书名 | 主/副 | 相关性(同题材/弱相关) | 引用强度(辅/参考) | 可借鉴技法 |`。
96
+ - 证据不够的字段写 `[待补充]`,不留空、不留 `{}`。
97
+
102
98
  ---
103
99
 
104
100
  ## 小节大纲.md 反推规则
105
101
 
106
- 以拆文报告的结构划分为依据,结合情节节点和原文分节映射到各小节;结构段可包含多个小节,不与自然段混同。
102
+ 以拆文报告「结构划分」为依据,结合情节节点和原文分节映射到各小节;结构段可包含多个小节,不与自然段混同。行数等于原文小节数,一节一行;半成品只写已写的节,剩下的节由续写构思排。
107
103
 
108
104
  ### 段级映射
109
105
 
@@ -117,7 +113,7 @@ Phase 3-S 读取本文件和 [format-and-structure.md](format-and-structure.md)
117
113
 
118
114
  ### 小节大纲表格
119
115
 
120
- `小节大纲.md` 用 story-short-write 的固定 12 列表格,每节一行,列名和顺序不改:
116
+ 用短篇写作的固定 12 列表格,列名和顺序不改:
121
117
 
122
118
  ```markdown
123
119
  | 结构段/五段功能 | 主事件 | 情节推进 | 情绪 | 人物/关系变化 | 因果/逻辑链 | 读者新获知什么 | 结尾承接/钩子 | 伏笔/物件 | 场景形态 | 对白作用 | 目标字数 |
@@ -127,39 +123,33 @@ Phase 3-S 读取本文件和 [format-and-structure.md](format-and-structure.md)
127
123
 
128
124
  - `结构段/五段功能` 填 开头/铺垫/升级/反转/结尾。
129
125
  - `情节推进` 每个推进单元带 `{对话}` `{冲突}` `{伏笔}` `{回忆}` `{发现}` `{递进}` 之一,有先后用 `->` 连接,按原文实际发生的写,不为凑数拆分。
130
- - 从原文判断不出的格子写 `[待补充]`,留给作者或续写时填写;不写 `{}` 模板占位。
131
- - `目标字数` 写原文该节实际字数,各节之和与 `设定.md` 的目标字数对得上。
132
- - 付费点在哪一节末能从原文认出来时,在该行 `结尾承接/钩子` 标「付费点」;认不出写 `[待补充]`。
133
-
134
- ### 小节数量推算
135
-
136
- 以原文分节标记和转场为准;没有显式分节时,按情节阶段和转场划分。大纲行数须与迁移后正文的小节数一致,不按自然段数或平均字数推算。
126
+ - 从原文判断不出的格子写 `[待补充]`;不写 `{}` 模板占位。
127
+ - `目标字数` 写原文该节的字数(阿拉伯数字);完本时各节之和就是 `设定.md` 的目标字数。
137
128
 
138
129
  ---
139
130
 
140
- ## 正文.md 格式规范
131
+ ## 正文.md 外壳整理
141
132
 
142
- 将原文迁移为单文件 `正文.md`,格式按 `format-and-structure.md` 规范化:
133
+ 导入的是作者自己的成稿,只整理下表所列格式,供后续交付检查识别小节:
143
134
 
144
- | 规范项 | 要求 |
145
- |--------|------|
146
- | 小节标记 | `###1.` `###2.` `###3.`(短篇通用格式;用户指定平台时按 `format-and-structure.md` 平台覆盖表切换) |
147
- | 段落划分 | 按戏剧单元/镜头/一件事结束自然断段;不按固定字数强拆;完整推理、氛围、情绪链可保留稍长段,避免通篇同长度或碎成提纲 |
148
- | 段间空行 | 正文相邻段落之间**只允许一个换行符 `\n`**,不得出现空行或 `\n\n` |
149
- | 对话引号 | 默认 `""` 半角双引号;知乎盐言平台可用 `「」` |
150
- | 缩进 | 无缩进,不用全角/半角空格 |
151
- | Markdown | 正文段落中不使用 `**` `*` `#` `---` 等 Markdown 语法(仅小节标记除外) |
135
+ | 项 | 怎么处理 |
136
+ |----|---------|
137
+ | 小节标记 | 原文已用 `###1.`、`###第N章` 或 `1.` 之一,原样保留;用别的分节写法(如「一、」「(1)」「* * *」)时,全文换成目标平台的标记:知乎盐言 `1.`,番茄、七猫 `###第N章`,其余 `###1.`;原文没有分节时按转场补标记 |
138
+ | 段间空行 | 相邻段落之间只留一个换行,删掉空行;段落边界不动 |
139
+ | 缩进 | 去掉段首的全角/半角空格 |
140
+ | Markdown | 去掉正文里的 `**`、`*`、`---` 等标记(小节标记除外) |
141
+ | 分段、引号、标点、措辞 | 原样保留,不合并、不拆分、不统一引号 |
152
142
 
153
- **原文内容不改动**,只做格式规范化(分段、引号统一、小节标记添加)。
143
+ 原文用的标记、引号和分段习惯记进 `设定.md`「平台基调」,续写照这个写。
154
144
 
155
145
  ---
156
146
 
157
147
  ## 外部对标引用视图(可选)
158
148
 
159
- 仅当用户显式绑定独立外部 `{对标书名}` 时,将 `拆文库/{对标书名}/` 复制为 `{标题}/对标/{对标书名}/`(跳过 `_archive_*/`,归档快照不进对标视图),供续写阶段加载:
149
+ 仅当用户显式绑定独立外部 `{对标书名}` 时,将 `拆文库/{对标书名}/` 复制为 `{导入书名}/对标/{对标书名}/`(跳过 `_archive_*/`,归档快照不进对标视图),供续写阶段加载:
160
150
 
161
151
  ```
162
- {标题}/对标/{对标书名}/
152
+ {导入书名}/对标/{对标书名}/
163
153
  ├── 原文/
164
154
  ├── 拆文报告.md
165
155
  ├── 情节节点.md
@@ -173,11 +163,10 @@ Phase 3-S 读取本文件和 [format-and-structure.md](format-and-structure.md)
173
163
 
174
164
  ## 质量检查清单
175
165
 
176
- Phase 3-S 迁移完成后执行:
166
+ 迁移完成后执行(不念给作者,没通过先修):
177
167
 
178
- - [ ] `正文.md` 单文件存在且格式符合 `format-and-structure.md`(小节标记、段落划分/主语节奏、段间仅单换行、引号格式)
179
- - [ ] `设定.md` 含核心框架区块 + 本书续写基线区块,且核心框架符合本文件模板
180
- - [ ] `小节大纲.md` 数据行数与 `正文.md` 的小节数一致
181
- - [ ] 所有 `[待补充]` 标记已添加(不确定字段不留空)
168
+ - [ ] `正文.md` 单文件存在;小节标记是 `###1.`、`###第N章`、`1.` 之一且全文统一;段间没有空行;分段和引号与原文一致
169
+ - [ ] `设定.md` 含上方模板全部小节;`[待补充]` 只出现在证据不够或要等构思时定的项,没有 `{}` 占位
170
+ - [ ] `小节大纲.md` 数据行数与 `正文.md` 的小节数一致;完本时各节目标字数之和等于设定的目标字数
182
171
  - [ ] 未误建 `追踪/`、`大纲/`、`正文/` 等长篇专属目录
183
172
  - [ ] `拆文库/{导入书名}/` 未被复制到本篇 `对标/`;若绑定外部对标,来源与 `对标/{对标书名}/` 目录名一致
@@ -13,8 +13,9 @@
13
13
  - 本批每章:正文路径、按 visible_chars_v1 测好的历史长度(与写作时章节检查同一口径,
14
14
  story-architect 不能自己跑测量),以及从拆文库摘要里抽出的、写细纲真正要用的字段
15
15
  (关键事件、因果、局面结果、涉及、信息变化、状态变化、章尾钩子,情节点只取「标题|类型|基调」);
16
- 拆文库没有摘要时改用 `.story/work/简化摘要/第NNN章.md`(超过 200 章的书,未深拆章节的简化摘要);
17
- - 卷纲「剧情单元(反推)」表里与本批章节重叠的行(只按表头「章节范围」那一列判断重叠)。
16
+ - 本批第一章另带上一章摘要里的章尾钩子(写章首钩子用);
17
+ - 卷纲里章节范围与本批重叠的剧情单元卡。单元卡用 outline_view.py 的解析识别(写正文时
18
+ `outline_view.py --unit` 也用它),任务包取得到的单元,写正文时也取得到。
18
19
  本书设定与作者已定的事不进包,执行者按规则定点读项目文件与 `.story/work/导入记录.md`。
19
20
 
20
21
  批大小按总量定:请求 10–20 章(全书最后一批可以更少);执行者要读的总量(任务包 + 没有摘要、
@@ -34,11 +35,11 @@ import sys
34
35
  from pathlib import Path
35
36
 
36
37
  sys.path.insert(0, str(Path(__file__).resolve().parent))
38
+ from outline_view import parse as parse_volume, unit_chapter_range # noqa: E402
37
39
  from wordcount_core import METRIC, WordcountError, find_chapter_file, measure_wordcount # noqa: E402
38
40
 
39
41
  RULES = Path(__file__).resolve().parent.parent / "references" / "outline-reverse-rules.md"
40
42
  WORK_DIR = (".story", "work", "排纲")
41
- BRIEF_SUMMARY_DIR = (".story", "work", "简化摘要")
42
43
  MIN_BATCH, MAX_BATCH = 10, 20
43
44
  LOAD_LIMIT = 25000 # 执行者一次要读的量(去空白字数);再加上 agent 模板或 SKILL 入口仍在 35K 内
44
45
  # 摘要里写细纲要用的字段(与 story-long-analyze 摘要投影同名);旧版摘要的同义标签放在别名里。
@@ -56,10 +57,6 @@ FIELD_NAMES = "|".join(name for field in SUMMARY_FIELDS for name in (field[0], *
56
57
  LABEL_RE = re.compile(r"^\s*(?:[-*+]\s*)?(?:\*\*([^*]+?)\*\*|(%s))\s*[::((]" % FIELD_NAMES)
57
58
  POINT_HEADER_RE = re.compile(r"^P(\d+)\s+\*\*(.+?)\*\*\s*[::]\s*(.+)$")
58
59
  POINT_TAG_RE = re.compile(r"^主题标签\s*[::]?\s*[^||]*?\s*[||]\s*基调\s*[::]?\s*(.*?)\s*$")
59
- # 「章节范围」单元格的一段:第X章—第Y章 / 第X-Y章 / 第X章 / 章X-Y / X-Y。
60
- SPAN_CELL_RE = re.compile(
61
- r"^\s*(?:第|章)?\s*(\d+)\s*章?\s*(?:(?:-|~|~|—|–|-|至|到)+\s*第?\s*(\d+)\s*章?)?\s*$"
62
- )
63
60
 
64
61
 
65
62
  def emit(text: str, stream) -> None:
@@ -181,76 +178,56 @@ def summary_lines(text: str) -> list[str]:
181
178
  return out
182
179
 
183
180
 
184
- def chapter_block(project: Path, analysis: Path, chapter: int) -> tuple[str, int, int, bool]:
181
+ def previous_hook(analysis: Path, chapter: int) -> str | None:
182
+ """上一章摘要里的章尾钩子:本批第一章写「章首钩子」用,上一章不在本包里。"""
183
+ summary = analysis / "章节" / f"第{chapter - 1}章_摘要.md"
184
+ if chapter <= 1 or not summary.is_file():
185
+ return None
186
+ blocks = label_blocks(summary.read_text(encoding="utf-8-sig"))
187
+ keys = ("章尾钩子", *dict(SUMMARY_FIELDS)["章尾钩子"])
188
+ return next((flatten(blocks[key]) for key in keys if blocks.get(key)), None)
189
+
190
+
191
+ def chapter_block(project: Path, analysis: Path, chapter: int, first: int) -> tuple[str, int, int, bool]:
185
192
  """返回(本章块、历史长度、执行者还需另读的正文量、是否缺摘要)。"""
186
193
  body, body_text, actual = measure(project, chapter)
187
194
  head = [f"### 第{chapter}章", "",
188
195
  f"- 正文:`{shown_path(body, project.parent)}`;字数目标 {actual}({METRIC})"]
196
+ hook = previous_hook(analysis, chapter) if chapter == first else None
197
+ if hook:
198
+ head.append(f"- 上一章(第{chapter - 1}章)章尾钩子:{hook}")
189
199
  summary = analysis / "章节" / f"第{chapter}章_摘要.md"
190
- brief = project.joinpath(*BRIEF_SUMMARY_DIR) / f"第{chapter:03d}章.md"
191
200
  if summary.is_file():
192
201
  lines = [f"- 摘要要点(抽自 `{shown_path(summary, project.parent)}`):"] + [
193
202
  " " + line for line in summary_lines(summary.read_text(encoding="utf-8").lstrip(""))]
194
203
  return "\n".join(head + lines), actual, 0, False
195
- if brief.is_file():
196
- text = brief.read_text(encoding="utf-8").lstrip("").strip()
197
- return "\n".join(head + ["- 简化摘要(未深拆章节):", "", text]), actual, 0, False
198
204
  note = "- 摘要:未找到,读该章正文反推,证据不足处写 [待补充]"
199
205
  return "\n".join(head + [note]), actual, weight(body_text), True
200
206
 
201
207
 
202
208
  # ---------- 卷纲剧情单元 ----------
203
209
 
204
- def parse_span_cell(cell: str) -> list[tuple[int, int]]:
205
- """只解析「章节范围」这一格;认不出的写法返回空,不去别的列找数字。"""
206
- spans = []
207
- for part in re.split(r"[、,,;;/]", cell):
208
- match = SPAN_CELL_RE.match(part)
209
- if not match:
210
- continue
211
- start = int(match.group(1))
212
- end = int(match.group(2) or start)
213
- if start <= end:
214
- spans.append((start, end))
215
- return spans
216
-
217
-
218
- def split_row(row: str) -> list[str]:
219
- return [cell.strip() for cell in row.strip().strip("|").split("|")]
220
-
221
-
222
- def unit_rows(project: Path, first: int, last: int) -> list[str]:
223
- """从各卷纲的「剧情单元」表里取与本批章节重叠的行,连同表头。"""
210
+ def unit_cards(project: Path, first: int, last: int) -> list[str]:
211
+ """从各卷纲取章节范围与本批重叠的剧情单元卡(连同卡下的子段)。"""
224
212
  volumes = sorted((project / "大纲").glob("卷纲_第*卷.md"))
225
213
  if not volumes:
226
214
  raise SystemExit("ERROR: 大纲/ 下没有卷纲,先在结构迁移时刻写定卷纲")
227
215
  out: list[str] = []
228
216
  for volume in volumes:
229
- lines = volume.read_text(encoding="utf-8").splitlines()
230
- start = next((i for i, line in enumerate(lines) if re.match(r"^#+\s*剧情单元", line)), None)
231
- if start is None:
232
- continue
233
- table: list[str] = []
234
- for line in lines[start + 1:]:
235
- if line.lstrip().startswith("|"):
236
- table.append(line)
237
- elif table or line.strip():
238
- break # 表格结束,或标题下先出现了非表格内容
239
- if len(table) < 3:
240
- continue
241
- column = next((i for i, cell in enumerate(split_row(table[0])) if "章节范围" in cell), None)
242
- if column is None:
243
- continue
244
- hits = []
245
- for row in table[2:]:
246
- cells = split_row(row)
247
- spans = parse_span_cell(cells[column]) if column < len(cells) else []
248
- if any(a <= last and b >= first for a, b in spans):
249
- hits.append(row)
250
- if hits:
251
- out += [f"来源:`{project.name}/大纲/{volume.name}`", "", *table[:2], *hits, ""]
217
+ lines, sections = parse_volume(volume.read_text(encoding="utf-8-sig"))
218
+ for section in sections:
219
+ if section.kind != "单元级" or "剧情单元" not in section.title or section.status == "已退役":
220
+ continue
221
+ span = unit_chapter_range([section], section.unit)
222
+ if span is None or span[0] > last or span[1] < first:
223
+ continue
224
+ end = next((other.start for other in sections
225
+ if other.start > section.start and other.level <= section.level), len(lines))
226
+ out += [f"来源:`{project.name}/大纲/{volume.name}`", "", *lines[section.start:end], ""]
252
227
  if not out:
253
- raise SystemExit(f"ERROR: 卷纲「剧情单元」表里找不到覆盖第{first}-{last}章的行(表头要有「章节范围」列,写成「第X-Y章」),先补卷纲")
228
+ raise SystemExit(f"ERROR: 卷纲里找不到章节范围覆盖第{first}-{last}章的剧情单元卡(卡标题下一行写"
229
+ "「> 作用域:单元级 {单元ID}」,卡里写「- 章节范围:第A-B章」),先补卷纲,"
230
+ "再用 outline_view.py --check --strict 核对")
254
231
  return out
255
232
 
256
233
 
@@ -265,7 +242,7 @@ def render(project: Path, first: int, last: int, blocks: list[str]) -> str:
265
242
  "证据不足标了 [待补充] 的要点(没有写「无」)。\n\n"
266
243
  "包里提到的检查由主会话在你交付后跑,你不执行命令;需要的测量结果已放进包里。")
267
244
  parts = [head, f"\n## 本批章节\n\n路径相对项目根(`{project.parent}`)。\n\n" + "\n\n".join(blocks),
268
- "\n## 卷纲剧情单元(覆盖本批)\n\n" + "\n".join(unit_rows(project, first, last)).rstrip(),
245
+ "\n## 卷纲剧情单元(覆盖本批)\n\n" + "\n".join(unit_cards(project, first, last)).rstrip(),
269
246
  "\n---\n\n<!-- 资料:outline-reverse-rules.md -->\n\n" + RULES.read_text(encoding="utf-8").lstrip("").strip()]
270
247
  return "\n".join(parts) + "\n"
271
248
 
@@ -273,13 +250,13 @@ def render(project: Path, first: int, last: int, blocks: list[str]) -> str:
273
250
  def build(project: Path, analysis: Path, first: int, last: int) -> dict:
274
251
  if not RULES.is_file():
275
252
  raise SystemExit(f"ERROR: 缺少 reference:{RULES}")
276
- fixed = weight(render(project, first, last, [])) # 包头、剧情单元行与规则:章数减少只会更少
253
+ fixed = weight(render(project, first, last, [])) # 包头、剧情单元卡与规则:章数减少只会更少
277
254
  blocks: list[str] = []
278
255
  lengths: dict[int, int] = {}
279
256
  missing: list[int] = []
280
257
  load, extra_reading = fixed, 0
281
258
  for chapter in range(first, last + 1):
282
- block, actual, extra, absent = chapter_block(project, analysis, chapter)
259
+ block, actual, extra, absent = chapter_block(project, analysis, chapter, first)
283
260
  cost = weight(block) + extra
284
261
  if blocks and load + cost > LOAD_LIMIT:
285
262
  break # 包已够大:本章留给下一批
@@ -111,6 +111,10 @@ function readUtf8(file) {
111
111
  }
112
112
  }
113
113
 
114
+ // 回报里的模板出处只列本 skill 带着的文件:导入的副本没有 workflow-outline.md,细纲写法在 outline-reverse-rules.md
115
+ const TEMPLATE_REFERENCES = ['references/workflow-outline.md', 'references/outline-reverse-rules.md']
116
+ .filter((rel) => fs.existsSync(path.join(__dirname, '..', rel)))
117
+
114
118
  function makeCheck(id, ok, file, evidence, expected, repair, severity = 'blocking') {
115
119
  return {
116
120
  id,
@@ -119,7 +123,7 @@ function makeCheck(id, ok, file, evidence, expected, repair, severity = 'blockin
119
123
  file,
120
124
  evidence,
121
125
  expected,
122
- references: ['references/workflow-outline.md'],
126
+ references: TEMPLATE_REFERENCES,
123
127
  repair,
124
128
  }
125
129
  }