@oh-story/dsh 0.1.9 → 0.1.11

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 (529) hide show
  1. package/README.md +14 -14
  2. package/lib/client.js +209 -73
  3. package/lib/client.js.map +3 -3
  4. package/lib/drama/manifest.json +248 -168
  5. package/lib/drama/skills/short-drama/SKILL.md +16 -4
  6. package/lib/drama/skills/short-drama/assets/project-template/short-drama.json +3 -0
  7. package/lib/drama/skills/short-drama/references/creator-documents.md +3 -0
  8. package/lib/drama/skills/short-drama/references/knowhow-index.md +15 -0
  9. package/lib/drama/skills/short-drama/scripts/creator_markdown_check.py +14 -0
  10. package/lib/drama/skills/short-drama/scripts/project_tool.py +131 -0
  11. package/lib/drama/skills/short-drama-assets/SKILL.md +2 -1
  12. package/lib/drama/skills/short-drama-assets/references/asset-review-checklist.md +2 -0
  13. package/lib/drama/skills/short-drama-assets/references/character-and-look.md +10 -0
  14. package/lib/drama/skills/short-drama-assets/references/continuity-lock.md +6 -9
  15. package/lib/drama/skills/short-drama-assets/references/era-anchors.md +37 -0
  16. package/lib/drama/skills/short-drama-assets/references/stage-contract.md +2 -0
  17. package/lib/drama/skills/short-drama-assets/references/voice-direction.md +28 -0
  18. package/lib/drama/skills/short-drama-develop/SKILL.md +10 -4
  19. package/lib/drama/skills/short-drama-develop/assets/adaptation-map.example.jsonl +1 -1
  20. package/lib/drama/skills/short-drama-develop/assets/creative-brief.md +8 -0
  21. package/lib/drama/skills/short-drama-develop/references/adaptation-craft.md +80 -13
  22. package/lib/drama/skills/short-drama-develop/references/episode-design.md +95 -12
  23. package/lib/drama/skills/short-drama-develop/references/genre-and-hook-playbook.md +9 -5
  24. package/lib/drama/skills/short-drama-develop/references/genre-cards//345/244/215/344/273/207/346/211/223/350/204/270.md +1 -1
  25. package/lib/drama/skills/short-drama-develop/references/genre-cards//347/263/273/347/273/237/346/265/201.md +51 -0
  26. package/lib/drama/skills/short-drama-develop/references/genre-cards//351/200/206/350/242/255.md +51 -0
  27. package/lib/drama/skills/short-drama-develop/references/genre-cards//351/207/215/347/224/237/347/251/277/350/266/212.md +51 -0
  28. package/lib/drama/skills/short-drama-develop/references/genre-cards.md +10 -7
  29. package/lib/drama/skills/short-drama-develop/references/premise-devices.md +15 -9
  30. package/lib/drama/skills/short-drama-develop/references/serial-character-and-memory.md +3 -2
  31. package/lib/drama/skills/short-drama-develop/references/stage-contract.md +14 -7
  32. package/lib/drama/skills/short-drama-develop/references/story-craft.md +7 -3
  33. package/lib/drama/skills/short-drama-edit/SKILL.md +65 -44
  34. package/lib/drama/skills/short-drama-edit/assets/remotion/README.md +49 -13
  35. package/lib/drama/skills/short-drama-edit/assets/remotion/package.json +4 -2
  36. package/lib/drama/skills/short-drama-edit/assets/remotion/src/Overlay.tsx +31 -0
  37. package/lib/drama/skills/short-drama-edit/assets/remotion/src/Root.tsx +5 -5
  38. package/lib/drama/skills/short-drama-edit/assets/remotion/src/Subtitles.tsx +68 -69
  39. package/lib/drama/skills/short-drama-edit/assets/remotion/src/font.ts +39 -29
  40. package/lib/drama/skills/short-drama-edit/assets/remotion/src/rules.mjs +188 -0
  41. package/lib/drama/skills/short-drama-edit/assets/remotion/src/schema.ts +26 -13
  42. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/Card.tsx +72 -0
  43. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/CornerChip.tsx +39 -0
  44. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/ScreenText.tsx +36 -0
  45. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/SystemPanel.tsx +44 -0
  46. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/TaskPanel.tsx +100 -0
  47. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/chrome.tsx +197 -0
  48. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/tokens.ts +62 -0
  49. package/lib/drama/skills/short-drama-edit/assets/remotion/tsconfig.json +1 -0
  50. package/lib/drama/skills/short-drama-edit/assets//345/211/252/350/276/221/345/215/225.md +6 -4
  51. package/lib/drama/skills/short-drama-edit/references/cut-craft.md +26 -67
  52. package/lib/drama/skills/short-drama-edit/references/delivery-verify.md +31 -56
  53. package/lib/drama/skills/short-drama-edit/references/generated-footage.md +42 -78
  54. package/lib/drama/skills/short-drama-edit/references/sound-and-subtitles.md +44 -92
  55. package/lib/drama/skills/short-drama-edit/references/stage-contract.md +14 -16
  56. package/lib/drama/skills/short-drama-edit/scripts/edit_tool.py +1272 -125
  57. package/lib/drama/skills/short-drama-edit/scripts/selftest.py +113 -9
  58. package/lib/drama/skills/short-drama-image-prompts/SKILL.md +2 -0
  59. package/lib/drama/skills/short-drama-image-prompts/references/common-recipe.md +11 -0
  60. package/lib/drama/skills/short-drama-novel-analyze/SKILL.md +3 -3
  61. package/lib/drama/skills/short-drama-novel-analyze/assets/episode-candidate.example.jsonl +2 -2
  62. package/lib/drama/skills/short-drama-novel-analyze/references/adaptation-triage.md +8 -4
  63. package/lib/drama/skills/short-drama-novel-analyze/references/adaptation-value.md +10 -3
  64. package/lib/drama/skills/short-drama-novel-analyze/references/aggregation-and-entities.md +25 -1
  65. package/lib/drama/skills/short-drama-novel-analyze/references/stage-contract.md +1 -0
  66. package/lib/drama/skills/short-drama-produce/SKILL.md +5 -1
  67. package/lib/drama/skills/short-drama-produce/references/adapter-contract.md +14 -20
  68. package/lib/drama/skills/short-drama-produce/references/providers/minimax-h3-video.md +8 -26
  69. package/lib/drama/skills/short-drama-produce/references/providers/minimax-speech.md +41 -0
  70. package/lib/drama/skills/short-drama-produce/scripts/provider_adapters.py +142 -1
  71. package/lib/drama/skills/short-drama-review/SKILL.md +4 -5
  72. package/lib/drama/skills/short-drama-review/references/production-quality-gates.md +6 -19
  73. package/lib/drama/skills/short-drama-review/references/review-method.md +6 -1
  74. package/lib/drama/skills/short-drama-review/references/rubric-assets-prompts.md +11 -0
  75. package/lib/drama/skills/short-drama-review/references/rubric-story-script.md +77 -3
  76. package/lib/drama/skills/short-drama-review/references/rubric-visual-motion.md +24 -35
  77. package/lib/drama/skills/short-drama-review/references/stage-contract.md +3 -0
  78. package/lib/drama/skills/short-drama-storyboard/SKILL.md +23 -11
  79. package/lib/drama/skills/short-drama-storyboard/references/blocking-playbooks.md +1 -1
  80. package/lib/drama/skills/short-drama-storyboard/references/lighting-craft.md +39 -0
  81. package/lib/drama/skills/short-drama-storyboard/references/production-shot-grammar.md +2 -2
  82. package/lib/drama/skills/short-drama-storyboard/references/shot-craft.md +139 -34
  83. package/lib/drama/skills/short-drama-storyboard/references/stage-contract.md +5 -3
  84. package/lib/drama/skills/short-drama-video-prompts/SKILL.md +15 -12
  85. package/lib/drama/skills/short-drama-video-prompts/references/camera-audio-continuity.md +29 -0
  86. package/lib/drama/skills/short-drama-video-prompts/references/delivery-profile.md +4 -5
  87. package/lib/drama/skills/short-drama-video-prompts/references/generability.md +4 -2
  88. package/lib/drama/skills/short-drama-video-prompts/references/minimax-h3.md +52 -39
  89. package/lib/drama/skills/short-drama-video-prompts/references/motion-recipe.md +24 -21
  90. package/lib/drama/skills/short-drama-video-prompts/references/performance-action-timing.md +9 -23
  91. package/lib/drama/skills/short-drama-video-prompts/references/production-prompt-grammar.md +14 -26
  92. package/lib/drama/skills/short-drama-video-prompts/references/review-and-fixtures.md +1 -1
  93. package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.0.md +2 -3
  94. package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.5.md +34 -9
  95. package/lib/drama/skills/short-drama-video-prompts/references/stage-contract.md +3 -2
  96. package/lib/drama/skills/short-drama-video-prompts/references/target-model-profile.md +8 -1
  97. package/lib/drama/skills/short-drama-video-prompts/references/wan-3.0.md +103 -0
  98. package/lib/drama/skills/short-drama-video-prompts/scripts/motion_timing_check.py +8 -7
  99. package/lib/drama/skills/short-drama-write/SKILL.md +10 -7
  100. package/lib/drama/skills/short-drama-write/references/dialogue-craft.md +1 -1
  101. package/lib/drama/skills/short-drama-write/references/script-craft.md +56 -3
  102. package/lib/drama/skills/short-drama-write/references/stage-contract.md +4 -0
  103. package/lib/drama/skills/short-drama-write/scripts/duration_estimate.py +48 -2
  104. package/lib/index.js +346 -98
  105. package/lib/index.js.map +4 -4
  106. package/lib/novel-to-game/README.md +299 -59
  107. package/lib/novel-to-game/README_ZH.md +299 -56
  108. package/lib/novel-to-game/VERSION +1 -1
  109. package/lib/novel-to-game/examples/jin-ping-mei/build/BUILD_BRIEF.md +3 -1
  110. package/lib/novel-to-game/examples/jin-ping-mei/build/app/RUN.md +11 -3
  111. package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/new-guofeng.css +397 -8
  112. package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/style.css +0 -31
  113. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/data.js +71 -73
  114. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/engine.js +78 -89
  115. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/main.js +37 -14
  116. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/text.js +5 -5
  117. package/lib/novel-to-game/examples/jin-ping-mei/build/app/package.json +2 -1
  118. package/lib/novel-to-game/examples/jin-ping-mei/qa/README.md +11 -16
  119. package/lib/novel-to-game/examples/jin-ping-mei/qa/verification.json +11 -11
  120. package/lib/novel-to-game/examples/jin-ping-mei/qa/verify_playable_model.mjs +23 -0
  121. package/lib/novel-to-game/manifest.json +77 -87
  122. package/lib/novel-to-game/skills/game-art-direction/SKILL.md +7 -12
  123. package/lib/novel-to-game/skills/game-art-direction/references/art-direction-method.md +27 -106
  124. package/lib/novel-to-game/skills/game-build/SKILL.md +13 -14
  125. package/lib/novel-to-game/skills/game-build/references/blender-asset-workflow.md +24 -0
  126. package/lib/novel-to-game/skills/game-build/references/build-brief-contract.md +45 -82
  127. package/lib/novel-to-game/skills/game-build/references/generative-media-pipeline.md +14 -45
  128. package/lib/novel-to-game/skills/game-build/references/playable-model-contract.md +30 -65
  129. package/lib/novel-to-game/skills/game-build/references/tts-production-contract.md +13 -27
  130. package/lib/novel-to-game/skills/game-concept/SKILL.md +13 -15
  131. package/lib/novel-to-game/skills/game-concept/references/concept-method.md +28 -75
  132. package/lib/novel-to-game/skills/game-qa/SKILL.md +6 -7
  133. package/lib/novel-to-game/skills/game-qa/references/test-design-method.md +9 -5
  134. package/lib/novel-to-game/skills/game-world-design/SKILL.md +12 -16
  135. package/lib/novel-to-game/skills/game-world-design/references/narrative-design-method.md +23 -72
  136. package/lib/novel-to-game/skills/game-world-design/references/numeric-design-method.md +14 -48
  137. package/lib/novel-to-game/skills/game-world-design/references/world-design-method.md +36 -103
  138. package/lib/novel-to-game/skills/novel-game-analyze/SKILL.md +4 -10
  139. package/lib/novel-to-game/skills/novel-game-analyze/references/gameability-protocol.md +4 -4
  140. package/lib/novel-to-game/skills/novel-to-game/SKILL.md +9 -21
  141. package/lib/novel-to-game/skills/novel-to-game/references/intake-method.md +5 -4
  142. package/lib/novel-to-game/skills/novel-to-game/references/pipeline-contract.md +5 -8
  143. package/lib/oh-story/manifest.json +607 -327
  144. package/lib/oh-story/roles/chapter-extractor.md +177 -237
  145. package/lib/oh-story/roles/character-designer.md +1 -2
  146. package/lib/oh-story/roles/consistency-checker.md +15 -13
  147. package/lib/oh-story/roles/narrative-writer.md +36 -38
  148. package/lib/oh-story/roles/story-architect.md +9 -61
  149. package/lib/oh-story/roles/story-explorer.md +20 -125
  150. package/lib/oh-story/roles/story-researcher.md +0 -1
  151. package/lib/oh-story/skills/story/SKILL.md +15 -9
  152. package/lib/oh-story/skills/story/VERSION +1 -1
  153. package/lib/oh-story/skills/story/references/author-memory-maintenance.md +75 -0
  154. package/lib/oh-story/skills/story/references/author-memory.md +46 -94
  155. package/lib/oh-story/skills/story/scripts/author_memory_commit.py +934 -170
  156. package/lib/oh-story/skills/story-cover/SKILL.md +10 -1
  157. package/lib/oh-story/skills/story-deslop/SKILL.md +59 -73
  158. package/lib/oh-story/skills/story-deslop/references/agent-calls.md +5 -0
  159. package/lib/oh-story/skills/story-deslop/references/anti-ai-writing.md +12 -11
  160. package/lib/oh-story/skills/story-deslop/references/author-memory-maintenance.md +75 -0
  161. package/lib/oh-story/skills/story-deslop/references/author-memory.md +46 -94
  162. package/lib/oh-story/skills/story-deslop/references/banned-words.md +2 -2
  163. package/lib/oh-story/skills/story-deslop/references/deslop-gates.md +22 -5
  164. package/lib/oh-story/skills/story-deslop/references/style-resolution.md +4 -4
  165. package/lib/oh-story/skills/story-deslop/scripts/author_memory_commit.py +934 -170
  166. package/lib/oh-story/skills/story-deslop/scripts/check-ai-patterns.js +155 -8
  167. package/lib/oh-story/skills/story-import/SKILL.md +64 -584
  168. package/lib/oh-story/skills/story-import/references/character-state-reverse.md +1 -1
  169. package/lib/oh-story/skills/story-import/references/deep-analysis.md +47 -0
  170. package/lib/oh-story/skills/story-import/references/format-and-structure.md +1 -1
  171. package/lib/oh-story/skills/story-import/references/import-report.md +64 -0
  172. package/lib/oh-story/skills/story-import/references/import-special-cases.md +34 -0
  173. package/lib/oh-story/skills/story-import/references/import-tracking.md +95 -0
  174. package/lib/oh-story/skills/story-import/references/length-routing.md +1 -1
  175. package/lib/oh-story/skills/story-import/references/outline-reverse-rules.md +79 -0
  176. package/lib/oh-story/skills/story-import/references/outline-reverse.md +24 -0
  177. package/lib/oh-story/skills/story-import/references/state-tracking.md +4 -69
  178. package/lib/oh-story/skills/story-import/references/structure-mapping-long.md +98 -92
  179. package/lib/oh-story/skills/story-import/references/structure-mapping-short.md +24 -12
  180. package/lib/oh-story/skills/story-import/references/tracking-initialization.md +1 -1
  181. package/lib/oh-story/skills/story-import/references/tracking-transaction.md +15 -11
  182. package/lib/oh-story/skills/story-import/scripts/build_outline_brief.py +332 -0
  183. package/lib/oh-story/skills/story-import/scripts/check-outline-contract.js +132 -27
  184. package/lib/oh-story/skills/story-import/scripts/tracking_commit.py +478 -15
  185. package/lib/oh-story/skills/story-import/scripts/wordcount_core.py +182 -23
  186. package/lib/oh-story/skills/story-long-analyze/SKILL.md +81 -270
  187. package/lib/oh-story/skills/story-long-analyze/references/author-facing.md +252 -0
  188. package/lib/oh-story/skills/story-long-analyze/references/deconstruction-notes.md +3 -3
  189. package/lib/oh-story/skills/story-long-analyze/references/final-checks.md +19 -0
  190. package/lib/oh-story/skills/story-long-analyze/references/index-rebuild.md +11 -0
  191. package/lib/oh-story/skills/story-long-analyze/references/inspiration-library.md +105 -0
  192. package/lib/oh-story/skills/story-long-analyze/references/pipeline-ops.md +138 -64
  193. package/lib/oh-story/skills/story-long-analyze/references/semantic-acceptance-fixtures.md +84 -0
  194. package/lib/oh-story/skills/story-long-analyze/references/stage1-golden-chapters.md +128 -0
  195. package/lib/oh-story/skills/story-long-analyze/references/stage2-extraction.md +229 -0
  196. package/lib/oh-story/skills/story-long-analyze/references/stage3-plot-rhythm.md +480 -0
  197. package/lib/oh-story/skills/story-long-analyze/references/stage4-characters-settings.md +195 -0
  198. package/lib/oh-story/skills/story-long-analyze/references/stage5-report.md +33 -0
  199. package/lib/oh-story/skills/story-long-analyze/references/style-profile-generator.md +55 -128
  200. package/lib/oh-story/skills/story-long-analyze/references/style-profile-protocol.md +6 -6
  201. package/lib/oh-story/skills/story-long-analyze/references/synthesis-inputs.md +39 -0
  202. package/lib/oh-story/skills/story-long-analyze/scripts/build_chapter_index.py +466 -0
  203. package/lib/oh-story/skills/story-long-analyze/scripts/inspect_existing_assets.py +702 -0
  204. package/lib/oh-story/skills/story-long-analyze/scripts/inspiration_index.py +864 -0
  205. package/lib/oh-story/skills/story-long-analyze/scripts/manage_analysis_run.py +1145 -0
  206. package/lib/oh-story/skills/story-long-analyze/scripts/render_relation_chart.py +425 -0
  207. package/lib/oh-story/skills/story-long-scan/SKILL.md +45 -194
  208. package/lib/oh-story/skills/story-long-scan/references/platform-ciweimao.md +19 -0
  209. package/lib/oh-story/skills/story-long-scan/references/platform-fanqie.md +45 -0
  210. package/lib/oh-story/skills/story-long-scan/references/platform-jjwxc.md +28 -0
  211. package/lib/oh-story/skills/story-long-scan/references/platform-qidian.md +35 -0
  212. package/lib/oh-story/skills/story-long-scan/references/platform-qimao.md +27 -0
  213. package/lib/oh-story/skills/story-long-scan/references/topic-decision.md +6 -2
  214. package/lib/oh-story/skills/story-long-write/SKILL.md +49 -81
  215. package/lib/oh-story/skills/story-long-write/references/agent-calls.md +47 -0
  216. package/lib/oh-story/skills/story-long-write/references/anti-ai-writing.md +12 -11
  217. package/lib/oh-story/skills/story-long-write/references/artifact-protocols.md +24 -202
  218. package/lib/oh-story/skills/story-long-write/references/author-memory-maintenance.md +75 -0
  219. package/lib/oh-story/skills/story-long-write/references/author-memory.md +46 -94
  220. package/lib/oh-story/skills/story-long-write/references/banned-words.md +2 -2
  221. package/lib/oh-story/skills/story-long-write/references/benchmark-recall.md +7 -11
  222. package/lib/oh-story/skills/story-long-write/references/character-relations.md +49 -1
  223. package/lib/oh-story/skills/story-long-write/references/cross-book-recall.md +26 -0
  224. package/lib/oh-story/skills/story-long-write/references/deslop-gates.md +171 -0
  225. package/lib/oh-story/skills/story-long-write/references/dialogue-mastery.md +4 -0
  226. package/lib/oh-story/skills/story-long-write/references/emotion-on-page.md +116 -0
  227. package/lib/oh-story/skills/story-long-write/references/emotional-arc-design.md +1 -114
  228. package/lib/oh-story/skills/story-long-write/references/emotional-methods.md +2 -2
  229. package/lib/oh-story/skills/story-long-write/references/genre-prose-cards.md +1 -1
  230. package/lib/oh-story/skills/story-long-write/references/long-chapter-quality.md +7 -15
  231. package/lib/oh-story/skills/story-long-write/references/long-format.md +0 -8
  232. package/lib/oh-story/skills/story-long-write/references/long-genre-catalog.md +1 -1
  233. package/lib/oh-story/skills/story-long-write/references/long-genre-mechanics.md +3 -3
  234. package/lib/oh-story/skills/story-long-write/references/opening-design.md +2 -2
  235. package/lib/oh-story/skills/story-long-write/references/outline-conflict.md +4 -4
  236. package/lib/oh-story/skills/story-long-write/references/outline-methods.md +7 -7
  237. package/lib/oh-story/skills/story-long-write/references/outline-rhythm.md +3 -3
  238. package/lib/oh-story/skills/story-long-write/references/outline-structure-theory.md +14 -69
  239. package/lib/oh-story/skills/story-long-write/references/plot-frameworks.md +1 -1
  240. package/lib/oh-story/skills/story-long-write/references/plot-special-topics.md +2 -2
  241. package/lib/oh-story/skills/story-long-write/references/project-files.md +19 -13
  242. package/lib/oh-story/skills/story-long-write/references/reader-contract-and-progression.md +13 -5
  243. package/lib/oh-story/skills/story-long-write/references/reference-index.md +5 -6
  244. package/lib/oh-story/skills/story-long-write/references/stop-and-fix.md +9 -0
  245. package/lib/oh-story/skills/story-long-write/references/style-combat-face.md +1 -58
  246. package/lib/oh-story/skills/story-long-write/references/style-genre-modules.md +1 -1
  247. package/lib/oh-story/skills/story-long-write/references/style-resolution.md +4 -4
  248. package/lib/oh-story/skills/story-long-write/references/tracking-initialization.md +1 -1
  249. package/lib/oh-story/skills/story-long-write/references/tracking-transaction.md +15 -11
  250. package/lib/oh-story/skills/story-long-write/references/workflow-chapter.md +81 -121
  251. package/lib/oh-story/skills/story-long-write/references/workflow-daily.md +41 -139
  252. package/lib/oh-story/skills/story-long-write/references/workflow-outline.md +157 -0
  253. package/lib/oh-story/skills/story-long-write/references/workflow-revision.md +57 -67
  254. package/lib/oh-story/skills/story-long-write/references/workflow-setup.md +112 -253
  255. package/lib/oh-story/skills/story-long-write/references/workflow-volume.md +142 -0
  256. package/lib/oh-story/skills/story-long-write/references/writer-prompt-fallback.md +6 -4
  257. package/lib/oh-story/skills/story-long-write/references/writing-craft.md +19 -65
  258. package/lib/oh-story/skills/story-long-write/scripts/author_memory_commit.py +934 -170
  259. package/lib/oh-story/skills/story-long-write/scripts/build_architect_brief.py +260 -0
  260. package/lib/oh-story/skills/story-long-write/scripts/build_writer_prompt.py +226 -25
  261. package/lib/oh-story/skills/story-long-write/scripts/check-ai-patterns.js +155 -8
  262. package/lib/oh-story/skills/story-long-write/scripts/check-outline-contract.js +132 -27
  263. package/lib/oh-story/skills/story-long-write/scripts/check-outline-copy.js +7 -2
  264. package/lib/oh-story/skills/story-long-write/scripts/outline_view.py +7 -4
  265. package/lib/oh-story/skills/story-long-write/scripts/storyctl.py +304 -46
  266. package/lib/oh-story/skills/story-long-write/scripts/tracking_commit.py +478 -15
  267. package/lib/oh-story/skills/story-long-write/scripts/wordcount_core.py +182 -23
  268. package/lib/oh-story/skills/story-review/SKILL.md +31 -302
  269. package/lib/oh-story/skills/story-review/references/agent-prompts.md +184 -0
  270. package/lib/oh-story/skills/story-review/references/anti-ai-writing.md +12 -11
  271. package/lib/oh-story/skills/story-review/references/author-memory-maintenance.md +75 -0
  272. package/lib/oh-story/skills/story-review/references/author-memory.md +46 -94
  273. package/lib/oh-story/skills/story-review/references/banned-words.md +2 -2
  274. package/lib/oh-story/skills/story-review/references/batch-review.md +19 -0
  275. package/lib/oh-story/skills/story-review/references/character-relations.md +49 -1
  276. package/lib/oh-story/skills/story-review/references/dialogue-mastery.md +4 -0
  277. package/lib/oh-story/skills/story-review/references/review-quality.md +6 -11
  278. package/lib/oh-story/skills/story-review/references/review-tracking.md +10 -0
  279. package/lib/oh-story/skills/story-review/references/solo.md +52 -0
  280. package/lib/oh-story/skills/story-review/references/style-resolution.md +4 -4
  281. package/lib/oh-story/skills/story-review/references/tracking-initialization.md +1 -1
  282. package/lib/oh-story/skills/story-review/references/tracking-transaction.md +15 -11
  283. package/lib/oh-story/skills/story-review/scripts/author_memory_commit.py +934 -170
  284. package/lib/oh-story/skills/story-review/scripts/check-ai-patterns.js +155 -8
  285. package/lib/oh-story/skills/story-review/scripts/tracking_commit.py +478 -15
  286. package/lib/oh-story/skills/story-review/scripts/wordcount_core.py +182 -23
  287. package/lib/oh-story/skills/story-setup/SKILL.md +71 -452
  288. package/lib/oh-story/skills/story-setup/references/agent-references/agent-quality.md +4 -4
  289. package/lib/oh-story/skills/story-setup/references/agent-references/anti-ai-writing.md +12 -11
  290. package/lib/oh-story/skills/story-setup/references/agent-references/banned-words.md +2 -2
  291. package/lib/oh-story/skills/story-setup/references/agent-references/benchmark-style-load.md +107 -0
  292. package/lib/oh-story/skills/story-setup/references/agent-references/character-relations.md +49 -1
  293. package/lib/oh-story/skills/story-setup/references/agent-references/deslop-gates.md +22 -5
  294. package/lib/oh-story/skills/story-setup/references/agent-references/dialogue-mastery.md +4 -0
  295. package/lib/oh-story/skills/story-setup/references/agent-references/emotion-on-page.md +116 -0
  296. package/lib/oh-story/skills/story-setup/references/agent-references/emotional-arc-design.md +1 -114
  297. package/lib/oh-story/skills/story-setup/references/agent-references/format-and-structure.md +1 -1
  298. package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards.md +1 -1
  299. package/lib/oh-story/skills/story-setup/references/agent-references/long-emotional-methods.md +2 -2
  300. package/lib/oh-story/skills/story-setup/references/agent-references/long-genre-catalog.md +1 -1
  301. package/lib/oh-story/skills/story-setup/references/agent-references/long-genre-mechanics.md +3 -3
  302. package/lib/oh-story/skills/story-setup/references/agent-references/long-quality.md +7 -5
  303. package/lib/oh-story/skills/story-setup/references/agent-references/opening-design.md +2 -2
  304. package/lib/oh-story/skills/story-setup/references/agent-references/outline-conflict.md +4 -4
  305. package/lib/oh-story/skills/story-setup/references/agent-references/outline-methods.md +7 -7
  306. package/lib/oh-story/skills/story-setup/references/agent-references/outline-rhythm.md +3 -3
  307. package/lib/oh-story/skills/story-setup/references/agent-references/short-emotional-methods.md +1 -1
  308. package/lib/oh-story/skills/story-setup/references/agent-references/short-genre-formulas.md +0 -15
  309. package/lib/oh-story/skills/story-setup/references/agent-references/short-reversal.md +1 -1
  310. package/lib/oh-story/skills/story-setup/references/agent-references/style-combat-face.md +1 -58
  311. package/lib/oh-story/skills/story-setup/references/agent-references/style-genre-modules.md +1 -1
  312. package/lib/oh-story/skills/story-setup/references/agent-references/style-resolution.md +4 -4
  313. package/lib/oh-story/skills/story-setup/references/agent-references/writing-craft.md +19 -65
  314. package/lib/oh-story/skills/story-setup/references/diagnostics.md +4 -4
  315. package/lib/oh-story/skills/story-short-analyze/SKILL.md +56 -110
  316. package/lib/oh-story/skills/story-short-analyze/references/analysis-character-relations.md +1 -1
  317. package/lib/oh-story/skills/story-short-analyze/references/analysis-method.md +42 -0
  318. package/lib/oh-story/skills/story-short-analyze/references/optional-modules.md +97 -0
  319. package/lib/oh-story/skills/story-short-analyze/references/output-contract.md +9 -47
  320. package/lib/oh-story/skills/story-short-analyze/references/quality-checklist.md +80 -0
  321. package/lib/oh-story/skills/story-short-analyze/references/source-story-quality.md +4 -4
  322. package/lib/oh-story/skills/story-short-analyze/references/stage2-3-structure-emotion.md +308 -0
  323. package/lib/oh-story/skills/story-short-analyze/references/stage4-6-reversal-summary.md +611 -0
  324. package/lib/oh-story/skills/story-short-scan/SKILL.md +35 -65
  325. package/lib/oh-story/skills/story-short-scan/references/manual-rank-input.md +36 -0
  326. package/lib/oh-story/skills/story-short-scan/references/platform-dianzhong.md +24 -0
  327. package/lib/oh-story/skills/story-short-scan/references/platform-heiyan.md +21 -0
  328. package/lib/oh-story/skills/story-short-scan/references/topic-match.md +38 -0
  329. package/lib/oh-story/skills/story-short-write/SKILL.md +23 -175
  330. package/lib/oh-story/skills/story-short-write/references/agent-calls.md +13 -0
  331. package/lib/oh-story/skills/story-short-write/references/author-memory-maintenance.md +75 -0
  332. package/lib/oh-story/skills/story-short-write/references/author-memory.md +46 -94
  333. package/lib/oh-story/skills/story-short-write/references/banned-words.md +2 -2
  334. package/lib/oh-story/skills/story-short-write/references/benchmark-recall.md +1 -21
  335. package/lib/oh-story/skills/story-short-write/references/dialogue-mastery.md +4 -0
  336. package/lib/oh-story/skills/story-short-write/references/emotional-methods.md +1 -1
  337. package/lib/oh-story/skills/story-short-write/references/genre-writing-formulas.md +0 -15
  338. package/lib/oh-story/skills/story-short-write/references/output-contract.md +9 -47
  339. package/lib/oh-story/skills/story-short-write/references/reference-index.md +17 -47
  340. package/lib/oh-story/skills/story-short-write/references/scene-craft.md +40 -0
  341. package/lib/oh-story/skills/story-short-write/references/short-craft.md +7 -43
  342. package/lib/oh-story/skills/story-short-write/references/short-format.md +3 -3
  343. package/lib/oh-story/skills/story-short-write/references/short-prose-quality.md +2 -1
  344. package/lib/oh-story/skills/story-short-write/references/short-reversal.md +1 -1
  345. package/lib/oh-story/skills/story-short-write/references/style-resolution.md +4 -4
  346. package/lib/oh-story/skills/story-short-write/references/submission-craft.md +1 -1
  347. package/lib/oh-story/skills/story-short-write/references/villain-and-reveal.md +5 -10
  348. package/lib/oh-story/skills/story-short-write/references/workflow-design.md +21 -13
  349. package/lib/oh-story/skills/story-short-write/references/workflow-draft.md +116 -0
  350. package/lib/oh-story/skills/story-short-write/references/workflow-revision.md +99 -0
  351. package/lib/oh-story/skills/story-short-write/references/writing-workflow.md +7 -119
  352. package/lib/oh-story/skills/story-short-write/scripts/author_memory_commit.py +934 -170
  353. package/lib/oh-story/skills/story-short-write/scripts/check-ai-patterns.js +155 -8
  354. package/lib/oh-story/skills/story-short-write/scripts/check-outline-copy.js +7 -2
  355. package/lib/types/client/drama-production-view.d.ts.map +1 -1
  356. package/lib/types/client/file-activity.d.ts +19 -1
  357. package/lib/types/client/file-activity.d.ts.map +1 -1
  358. package/lib/types/client/index.d.ts.map +1 -1
  359. package/lib/types/client/production-prompts.d.ts +7 -0
  360. package/lib/types/client/production-prompts.d.ts.map +1 -1
  361. package/lib/types/client/production-runtime.d.ts +16 -0
  362. package/lib/types/client/production-runtime.d.ts.map +1 -1
  363. package/lib/types/client/video-studio.d.ts.map +1 -1
  364. package/lib/types/drama-adapters.d.ts +5 -3
  365. package/lib/types/drama-adapters.d.ts.map +1 -1
  366. package/lib/types/native-hooks.d.ts +53 -1
  367. package/lib/types/native-hooks.d.ts.map +1 -1
  368. package/lib/types/role-identity.d.ts +17 -0
  369. package/lib/types/role-identity.d.ts.map +1 -0
  370. package/lib/types/role-tool.d.ts.map +1 -1
  371. package/lib/types/skill-provider.d.ts.map +1 -1
  372. package/lib/types/video-project.d.ts.map +1 -1
  373. package/lib/types/workspace-route.d.ts.map +1 -1
  374. package/lib/video-recap/CHANGELOG.md +60 -1
  375. package/lib/video-recap/README.en.md +348 -137
  376. package/lib/video-recap/README.md +340 -136
  377. package/lib/video-recap/manifest.json +406 -251
  378. package/lib/video-recap/skills/video-assemble/SKILL.md +30 -15
  379. package/lib/video-recap/skills/video-assemble/references/audio-modes.md +63 -0
  380. package/lib/video-recap/skills/video-assemble/references/explicit-audio-mix.md +75 -0
  381. package/lib/video-recap/skills/video-assemble/references/foreground-compose.md +118 -0
  382. package/lib/video-recap/skills/video-assemble/references/narration-adoption.md +103 -0
  383. package/lib/video-recap/skills/video-assemble/references/packaging.md +45 -0
  384. package/lib/video-recap/skills/video-assemble/references/pair-media.md +74 -0
  385. package/lib/video-recap/skills/video-assemble/references/source-score.md +147 -0
  386. package/lib/video-recap/skills/video-assemble/references/subtitle-track.md +202 -0
  387. package/lib/video-recap/skills/video-assemble/scripts/adoption/__init__.py +1 -0
  388. package/lib/video-recap/skills/video-assemble/scripts/adoption/audio_mix_binding.py +279 -0
  389. package/lib/video-recap/skills/video-assemble/scripts/adoption/frozen_audio.py +187 -0
  390. package/lib/video-recap/skills/video-assemble/scripts/adoption/narration_binding.py +323 -0
  391. package/lib/video-recap/skills/video-assemble/scripts/adoption/strict_inputs.py +109 -0
  392. package/lib/video-recap/skills/video-assemble/scripts/adoption/strict_publish.py +130 -0
  393. package/lib/video-recap/skills/video-assemble/scripts/artifacts.py +10 -46
  394. package/lib/video-recap/skills/video-assemble/scripts/assemble.py +378 -119
  395. package/lib/video-recap/skills/video-assemble/scripts/assemble_constants.py +29 -12
  396. package/lib/video-recap/skills/video-assemble/scripts/assembly_contract.py +95 -44
  397. package/lib/video-recap/skills/video-assemble/scripts/assembly_settings.py +75 -32
  398. package/lib/video-recap/skills/video-assemble/scripts/audio_mix.py +11 -11
  399. package/lib/video-recap/skills/video-assemble/scripts/compose_foreground.py +293 -0
  400. package/lib/video-recap/skills/video-assemble/scripts/export_jianying.py +71 -78
  401. package/lib/video-recap/skills/video-assemble/scripts/jianying/__init__.py +1 -0
  402. package/lib/video-recap/skills/video-assemble/scripts/{jianying_builders.py → jianying/builders.py} +39 -67
  403. package/lib/video-recap/skills/video-assemble/scripts/{jianying_model.py → jianying/model.py} +3 -11
  404. package/lib/video-recap/skills/video-assemble/scripts/{jianying_optional.py → jianying/optional.py} +1 -1
  405. package/lib/video-recap/skills/video-assemble/scripts/jianying/schema.py +53 -0
  406. package/lib/video-recap/skills/video-assemble/scripts/{jianying_templates.py → jianying/templates.py} +1 -1
  407. package/lib/video-recap/skills/video-assemble/scripts/{jianying_timeline_contract.py → jianying/timeline_contract.py} +34 -13
  408. package/lib/video-recap/skills/video-assemble/scripts/{jianying_writer.py → jianying/writer.py} +7 -17
  409. package/lib/video-recap/skills/video-assemble/scripts/lib.py +37 -4
  410. package/lib/video-recap/skills/video-assemble/scripts/media.py +12 -21
  411. package/lib/video-recap/skills/video-assemble/scripts/narration_audio.py +64 -34
  412. package/lib/video-recap/skills/video-assemble/scripts/packaging.py +122 -0
  413. package/lib/video-recap/skills/video-assemble/scripts/pair_media.py +216 -0
  414. package/lib/video-recap/skills/video-assemble/scripts/render_preflight.py +1 -3
  415. package/lib/video-recap/skills/video-assemble/scripts/source_score.py +469 -0
  416. package/lib/video-recap/skills/video-assemble/scripts/source_subtitles.py +25 -9
  417. package/lib/video-recap/skills/video-assemble/scripts/subtitles/__init__.py +1 -0
  418. package/lib/video-recap/skills/video-assemble/scripts/{subtitle_core.py → subtitles/core.py} +13 -6
  419. package/lib/video-recap/skills/video-assemble/scripts/{subtitle_render.py → subtitles/render.py} +5 -4
  420. package/lib/video-recap/skills/video-assemble/scripts/subtitles/track.py +324 -0
  421. package/lib/video-recap/skills/video-assemble/scripts/subtitles/track_binding.py +200 -0
  422. package/lib/video-recap/skills/video-assemble/scripts/timeline.py +30 -46
  423. package/lib/video-recap/skills/video-assemble/scripts/timeline_emit.py +91 -7
  424. package/lib/video-recap/skills/video-assemble/scripts/visual_render.py +22 -8
  425. package/lib/video-recap/skills/video-cut/SKILL.md +34 -16
  426. package/lib/video-recap/skills/video-cut/references/shot-review.md +50 -0
  427. package/lib/video-recap/skills/video-cut/scripts/cut.py +2 -28
  428. package/lib/video-recap/skills/video-cut/scripts/cut_cli.py +58 -62
  429. package/lib/video-recap/skills/video-cut/scripts/cut_contract.py +21 -106
  430. package/lib/video-recap/skills/video-cut/scripts/cut_render.py +14 -9
  431. package/lib/video-recap/skills/video-cut/scripts/lib.py +39 -0
  432. package/lib/video-recap/skills/video-cut/scripts/narration_mapping.py +2 -155
  433. package/lib/video-recap/skills/video-cut/scripts/narrative_selection.py +244 -0
  434. package/lib/video-recap/skills/video-cut/scripts/shot_review.py +357 -0
  435. package/lib/video-recap/skills/video-recap/SKILL.md +86 -42
  436. package/lib/video-recap/skills/video-recap/references/audio-routing.md +126 -0
  437. package/lib/video-recap/skills/video-recap/references/config-playbook.md +12 -8
  438. package/lib/video-recap/skills/video-recap/references/data-schema.md +44 -33
  439. package/lib/video-recap/skills/video-recap/references/resource-library.md +151 -0
  440. package/lib/video-recap/skills/video-recap/references/shift-left-qc-schema.md +1 -1
  441. package/lib/video-recap/skills/video-recap/scripts/doctor.py +123 -30
  442. package/lib/video-recap/skills/video-recap/scripts/final_qc.py +22 -75
  443. package/lib/video-recap/skills/video-recap/scripts/lib.py +3 -3
  444. package/lib/video-recap/skills/video-recap/scripts/library.py +509 -0
  445. package/lib/video-recap/skills/video-recap/scripts/materials.py +63 -91
  446. package/lib/video-recap/skills/video-recap/scripts/mimo_qc.py +8 -70
  447. package/lib/video-recap/skills/video-recap/scripts/project_binding.py +286 -0
  448. package/lib/video-recap/skills/video-recap/scripts/qc/__init__.py +1 -0
  449. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_client.py → qc/mimo_client.py} +1 -1
  450. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_evidence.py → qc/mimo_evidence.py} +33 -66
  451. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_observations.py → qc/mimo_observations.py} +3 -11
  452. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_payload.py → qc/mimo_payload.py} +4 -7
  453. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_report.py → qc/mimo_report.py} +17 -28
  454. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_runner.py → qc/mimo_runner.py} +2 -2
  455. package/lib/video-recap/skills/video-recap/scripts/qc_contract.py +0 -19
  456. package/lib/video-recap/skills/video-recap/scripts/recap_cli.py +119 -50
  457. package/lib/video-recap/skills/video-recap/scripts/recap_inspect.py +32 -114
  458. package/lib/video-recap/skills/video-recap/scripts/recap_review.py +9 -23
  459. package/lib/video-recap/skills/video-recap/scripts/recap_runner.py +387 -334
  460. package/lib/video-recap/skills/video-recap/scripts/recap_runtime.py +23 -23
  461. package/lib/video-recap/skills/video-recap/scripts/recap_source.py +278 -0
  462. package/lib/video-recap/skills/video-recap/scripts/recap_stage_qc.py +25 -12
  463. package/lib/video-recap/skills/video-recap/scripts/recap_timeline.py +59 -52
  464. package/lib/video-recap/skills/video-recap/scripts/resource_lock.py +162 -0
  465. package/lib/video-recap/skills/video-script/SKILL.md +16 -13
  466. package/lib/video-recap/skills/video-script/references/creative-editing-playbook.md +9 -5
  467. package/lib/video-recap/skills/video-script/references/promotional-copy.md +68 -0
  468. package/lib/video-recap/skills/video-script/references/research-guide.md +1 -1
  469. package/lib/video-recap/skills/video-script/scripts/evidence_bundle.py +24 -76
  470. package/lib/video-recap/skills/video-script/scripts/lib.py +10 -87
  471. package/lib/video-recap/skills/video-script/scripts/narration_lint.py +63 -39
  472. package/lib/video-recap/skills/video-script/scripts/review.py +0 -2
  473. package/lib/video-recap/skills/video-script/scripts/review_grounding.py +35 -59
  474. package/lib/video-recap/skills/video-script/scripts/review_response.py +66 -128
  475. package/lib/video-recap/skills/video-script/scripts/review_runner.py +12 -20
  476. package/lib/video-recap/skills/video-script/scripts/speech_ownership.py +4 -4
  477. package/lib/video-recap/skills/video-script/scripts/validate.py +53 -42
  478. package/lib/video-recap/skills/video-understanding/SKILL.md +6 -4
  479. package/lib/video-recap/skills/video-understanding/references/data-schema.md +50 -156
  480. package/lib/video-recap/skills/video-understanding/references/research-guide.md +4 -4
  481. package/lib/video-recap/skills/video-understanding/scripts/asr.py +85 -65
  482. package/lib/video-recap/skills/video-understanding/scripts/asr_timing_evidence.py +270 -0
  483. package/lib/video-recap/skills/video-understanding/scripts/brief.py +2 -5
  484. package/lib/video-recap/skills/video-understanding/scripts/briefing/__init__.py +1 -0
  485. package/lib/video-recap/skills/{video-script/scripts/agent_brief.py → video-understanding/scripts/briefing/builder.py} +38 -35
  486. package/lib/video-recap/skills/video-understanding/scripts/{brief_context.py → briefing/context.py} +4 -35
  487. package/lib/video-recap/skills/{video-script/scripts/brief_inputs.py → video-understanding/scripts/briefing/inputs.py} +9 -31
  488. package/lib/video-recap/skills/{video-script/scripts/brief_timeline.py → video-understanding/scripts/briefing/timeline.py} +5 -6
  489. package/lib/video-recap/skills/video-understanding/scripts/consolidate.py +65 -116
  490. package/lib/video-recap/skills/video-understanding/scripts/detect.py +31 -40
  491. package/lib/video-recap/skills/video-understanding/scripts/lib.py +30 -86
  492. package/lib/video-recap/skills/video-understanding/scripts/narration_lint.py +63 -39
  493. package/lib/video-recap/skills/video-understanding/scripts/speech_ownership.py +4 -4
  494. package/lib/video-recap/skills/video-understanding/scripts/storyboard.py +17 -79
  495. package/lib/video-recap/skills/video-understanding/scripts/understanding_brief.py +14 -40
  496. package/lib/video-recap/skills/video-understanding/scripts/understanding_cache.py +64 -46
  497. package/lib/video-recap/skills/video-understanding/scripts/understanding_runner.py +31 -11
  498. package/lib/video-recap/skills/video-understanding/scripts/understanding_storyboard.py +19 -14
  499. package/lib/video-recap/skills/video-understanding/scripts/vlm.py +80 -108
  500. package/lib/video-recap/skills/video-voiceover/SKILL.md +29 -19
  501. package/lib/video-recap/skills/video-voiceover/references/index-tts.md +31 -0
  502. package/lib/video-recap/skills/video-voiceover/scripts/approved_text_policy.py +123 -0
  503. package/lib/video-recap/skills/video-voiceover/scripts/dub.py +51 -59
  504. package/lib/video-recap/skills/video-voiceover/scripts/lib.py +8 -44
  505. package/lib/video-recap/skills/video-voiceover/scripts/providers/__init__.py +1 -0
  506. package/lib/video-recap/skills/video-voiceover/scripts/providers/index_tts.py +184 -0
  507. package/lib/video-recap/skills/video-voiceover/scripts/voiceover.py +212 -134
  508. package/package.json +45 -45
  509. package/lib/novel-to-game/skills/game-world-design/references/dialogue-design-method.md +0 -58
  510. package/lib/novel-to-game/skills/game-world-design/references/game-writing-craft.md +0 -53
  511. package/lib/novel-to-game/skills/novel-to-game/references/intake-benchmark-reference.md +0 -38
  512. package/lib/oh-story/skills/story-long-analyze/references/material-decomposition.md +0 -530
  513. package/lib/oh-story/skills/story-long-analyze/references/output-templates.md +0 -559
  514. package/lib/oh-story/skills/story-long-scan/references/scan-output-format.md +0 -207
  515. package/lib/oh-story/skills/story-long-write/references/state-tracking.md +0 -108
  516. package/lib/oh-story/skills/story-short-analyze/references/material-decomposition.md +0 -678
  517. package/lib/oh-story/skills/story-short-analyze/references/output-templates.md +0 -561
  518. package/lib/video-recap/skills/video-assemble/scripts/jianying_schema.py +0 -98
  519. package/lib/video-recap/skills/video-recap/references/creative-editing-playbook.md +0 -225
  520. package/lib/video-recap/skills/video-recap/references/research-guide.md +0 -74
  521. package/lib/video-recap/skills/video-recap/references/timeline-and-jianying.md +0 -250
  522. package/lib/video-recap/skills/video-script/scripts/brief_context.py +0 -348
  523. package/lib/video-recap/skills/video-script/scripts/narration.py +0 -12
  524. package/lib/video-recap/skills/video-understanding/scripts/agent_brief.py +0 -399
  525. package/lib/video-recap/skills/video-understanding/scripts/brief_inputs.py +0 -290
  526. package/lib/video-recap/skills/video-understanding/scripts/brief_timeline.py +0 -327
  527. /package/lib/video-recap/skills/video-assemble/scripts/{jianying_tracks.py → jianying/tracks.py} +0 -0
  528. /package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_contract.py → qc/mimo_contract.py} +0 -0
  529. /package/lib/video-recap/skills/video-voiceover/scripts/{fish_audio.py → providers/fish_audio.py} +0 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: story-setup
3
- version: 1.2.10
3
+ version: 1.3.2
4
4
  description: "网文写作工具集基础设施部署与检查。为 Claude Code / OpenCode / Codex / Google Antigravity / ZCode / OpenClaw / Reasonix 提供内置适配;Web AI / 通用 Agent 可走 skills + AGENTS.md 文件模式。触发方式:/story-setup、$story-setup、「准备写书」「帮我搭一下环境」「配置写作项目」「检查写作环境」。"
5
5
  metadata: {"openclaw":{"source":"https://github.com/zenstory-ai/oh-story-claudecode"}}
6
6
  ---
@@ -10,476 +10,105 @@ metadata: {"openclaw":{"source":"https://github.com/zenstory-ai/oh-story-claudec
10
10
 
11
11
  **执行铁律:不覆盖用户已有配置,合并而非替换。**
12
12
 
13
+ 作者第一次部署的顺序:判断当前宿主 → 确认项目根 → 按宿主部署 → 验收 → 告诉作者下一步。本文件只写各宿主通用的流程;每个宿主专属的部署清单、算法、校验和安装报告提示在各自的部署文件里,**只读本次目标宿主的那一份**(见 Phase 2)。
14
+
13
15
  ## 选择模式
14
16
 
15
17
  - 参数为 `check`,或用户只要求检查部署、诊断环境、排查 agent 不可用时:完整读取 [references/diagnostics.md](references/diagnostics.md),按其中流程仅检查并报告;不进入下面的部署流程。
16
- - 用户要求安装、更新或修复时:执行下面的部署流程。检查后已明确授权的修复沿用本文件的部署与合并规则。
18
+ - 用户要求安装、更新或修复时:执行下面的部署流程。检查后已明确授权的修复沿用本文件与宿主部署文件的部署与合并规则。
17
19
 
18
20
  ---
19
21
 
20
- ## Phase 1:检测项目状态
22
+ ## Phase 1:判断宿主与项目
21
23
 
22
- **先自检参考目录**:以正在执行的本 `SKILL.md` 所在目录为准,列出与它同级的 `references/` 下的子目录,核对下面 9 个名字是否都在**且都非空**——`agent-references`、`templates`、`opencode`、`codex`、`antigravity`、`zcode`、`openclaw`、`reasonix`、`generic`;同级 `scripts/merge-claude-settings.py`、`scripts/merge-codex-hooks.py`、`scripts/merge-antigravity-hooks.py`、`scripts/generate-antigravity-agents.mjs`、`scripts/deploy-antigravity-skills.py` 与 `scripts/copy-path-safety.py` 也必须存在(Claude/Codex/Antigravity hooks 合并、Antigravity Skills 物化与 agent 生成、递归复制安全检查依赖它们)。有缺即 skill 包没装全,**立即停止,不写任何部署文件**,报告里区分「缺目录」「目录为空」和「缺脚本」,并给修复指令:「story-setup 参考资料包不完整,缺 {路径}。按你的安装方式重装 oh-story-claudecode(命令行装的重跑 `npx skills add zenstory-ai/oh-story-claudecode -y -g`,marketplace / Plugin Management 装的在面板里重装),再执行 /story-setup。」
24
+ **先自检参考目录**:以正在执行的本 `SKILL.md` 所在目录为准,列出与它同级的 `references/` 下的子目录,核对下面 9 个名字是否都在**且都非空**——`agent-references`、`templates`、`opencode`、`codex`、`antigravity`、`zcode`、`openclaw`、`reasonix`、`generic`;同级 `references/deploy-*.md`(8 份宿主部署文件)、`scripts/merge-claude-settings.py`、`scripts/merge-codex-hooks.py`、`scripts/merge-antigravity-hooks.py`、`scripts/generate-antigravity-agents.mjs`、`scripts/deploy-antigravity-skills.py` 与 `scripts/copy-path-safety.py` 也必须存在(宿主部署步骤、Claude/Codex/Antigravity hooks 合并、Antigravity Skills 物化与 agent 生成、递归复制安全检查依赖它们)。有缺即 skill 包没装全,**立即停止,不写任何部署文件**,报告里区分「缺目录」「目录为空」和「缺脚本或部署文件」,并给修复指令:「story-setup 参考资料包不完整,缺 {路径}。按你的安装方式重装 oh-story-claudecode(命令行装的重跑 `npx skills add zenstory-ai/oh-story-claudecode -y -g`,marketplace / Plugin Management 装的在面板里重装),再执行 /story-setup。」
23
25
 
24
26
  > 判据是「有没有 `SKILL.md`」:只看正在执行的 `SKILL.md` 同级的 `references/`。项目内 `.claude/skills/story-setup/`、`.codex/skills/story-setup/` 和 OpenCode 的 `skills/story-setup/` 只有 `references/agent-references/`、不含 `SKILL.md`,不会是执行目录,也不要拿它们核对。Antigravity / ZCode / OpenClaw / Reasonix / generic 的项目副本是整份 skill 拷贝、自带 `SKILL.md`,9 个子目录本就齐全,照常核对即可。
25
27
 
26
28
  1. 检查当前目录是否已部署过(存在 `.story-deployed`)
27
- - `agents_version` 缺失、非整数或小于 `30` → 标记为待更新,继续执行当前部署
28
- - `agents_version: 30` → 使用 AskUserQuestion 确认是否重新部署;提示里写明重新部署只用**当前本地 skill 包**刷新项目文件,要拿 skill 本身的新版本得先更新 oh-story-claudecode(`npx skills add` 或 marketplace),再回来重跑
29
- - `agents_version` 大于 `30` → 当前 story-setup 比项目部署旧;停止以避免降级覆盖,提示先更新 oh-story-claudecode,不写任何部署文件
30
- - 同时读 `target_cli` 字段。**已部署项目以 sentinel 里的值为准**:非空时(逗号分隔的多端组合原样保留)跳过下面第 5-12 步的环境探测与选择,直接按这些端重新部署。只有字段缺失或为空,才回落到探测。用户明确要求增删目标端时,用 AskUserQuestion 在现有值基础上改,改完的值写回 sentinel。
29
+ - `agents_version` 缺失、非整数或小于 `34` → 标记为待更新,继续执行当前部署
30
+ - `agents_version: 34` → 使用 AskUserQuestion 确认是否重新部署;提示里写明重新部署只用**当前本地 skill 包**刷新项目文件,要拿 skill 本身的新版本得先更新 oh-story-claudecode(`npx skills add` 或 marketplace),再回来重跑
31
+ - `agents_version` 大于 `34` → 当前 story-setup 比项目部署旧;停止以避免降级覆盖,提示先更新 oh-story-claudecode,不写任何部署文件
32
+ - 同时读 `target_cli` 字段。**已部署项目以 sentinel 里的值为准**:非空时(逗号分隔的多端组合原样保留)这些端照常重新部署,不再让作者选;第 4 步仍判断当前宿主:判断出来且不在其中(作者换了软件)→ AskUserQuestion 问「这个文件夹之前是给 {已部署宿主名} 装的,你现在用的是 {当前宿主名},要一起装上吗?」(「一起装上(推荐)」「只更新原来的」),选前者就加进 `target_cli`;判断不出不问。字段缺失或为空才走第 4-6 步。用户明确要求增删目标端时,用 AskUserQuestion 在现有值基础上改,改完的值写回 sentinel。
33
+ - `target_cli` 不含 opencode、但项目里有 `.opencode/plugins/story-hooks.ts` 或 `.opencode/agents/`(多端部署时 OpenCode 曾被版本门拦下)→ 用 AskUserQuestion 问是否把 OpenCode 加回来;选加回则先过 [references/deploy-opencode.md](references/deploy-opencode.md) 的「部署前置」,通过后写回 `target_cli`
31
34
  2. 检查是否有书名目录(包含 `追踪/` 子目录的目录,或用户自定义结构)
32
35
  - 有 → 识别为长篇项目,显示当前项目信息
33
36
  - 无 → 识别为新项目或短篇项目
34
- 3. 检查 `.claude/settings.local.json` 是否存在
35
- - 存在 → 读取现有配置,后续合并
36
- - 不存在 → 后续创建新文件
37
- 4. 检查 `.active-book` 文件是否存在
38
- - 存在 → 显示当前活跃书目
39
- - 不存在 → 跳过
40
- 5. 检查 `opencode.json` 或 `.opencode/` 是否存在
41
- - 存在 → 识别为 opencode 项目,`target_cli = opencode`
42
- - 不存在 → 跳过
43
- 6. 检查 `.codex/`、`.codex/config.toml`、`.codex/agents/`、`.codex/hooks.json`、`AGENTS.md` 中的 Codex 段
44
- - 存在 → 识别为 Codex 项目,`target_cli = codex`
45
- - 不存在 → 跳过
46
- 7. 检查 `.agents/hooks.json`、`.agents/agents/`,或 `.agents/rules/oh-story.md` 中的 Antigravity 标记
47
- - 存在 → 识别为 Google Antigravity 项目,`target_cli = antigravity`
48
- - 不存在 → 跳过
49
- 8. 检查 `.zcode/`、`.zcode/config.json`、`zcode.json`、`.zcode/skills/`、`.zcode/commands/`、`AGENTS.md` 中的 ZCode 段
50
- - 存在 → 识别为 ZCode 项目,`target_cli = zcode`
51
- - 不存在 → 跳过
52
- 9. 检查 `openclaw.json`、`.openclaw/`,或 `AGENTS.md` 中的 OpenClaw 段(标题行含 `网文写作工具集(OpenClaw)`)
53
- - 存在 → 识别为 OpenClaw 项目,`target_cli = openclaw`
54
- - 不存在 → 跳过
55
- 10. 检查 `.reasonix/`、`reasonix-plugin.json`、`REASONIX.md`,或 `AGENTS.md` 中的 Reasonix 段(标题行含 `网文写作工具集(Reasonix)`)
56
- - 存在 → 识别为 Reasonix 项目,`target_cli = reasonix`
57
- - 不存在 → 跳过
58
- 11. 检查 `AGENTS.md` 中的通用段(标题行含 `网文写作工具集(通用 Agent / Web AI)`)
59
- - 存在 → 识别为通用 Web AI 项目,`target_cli = generic`
60
- - 不存在 → 跳过
61
-
62
- > 第 9-11 步只认各端**互斥**的标记。`skills/*/SKILL.md` 的 `metadata.openclaw` 不作 OpenClaw 信号:13 个 skill 全都带这个字段,而 OpenClaw / Reasonix / generic 三条 skills-only 路径部署出的 `skills/` 长得一样,用它判定会把后两者一律误认成 OpenClaw。`.agents/skills/` 由 Antigravity、Codex 与 Reasonix 共用,也不单独作准;Antigravity 必须由 hooks/agents/rule 专属标记识别。后三端真正的分辨点是各自 `AGENTS.md` 模板的标题行。
63
-
64
- 12. 如 `.claude/` 或 `CLAUDE.md`、OpenCode、Codex、Antigravity、ZCode、OpenClaw、Reasonix、generic 标记同时存在 → 使用 AskUserQuestion 让用户选择目标环境(选项:Claude Code / OpenCode / Codex / Google Antigravity / ZCode / OpenClaw / Reasonix / 通用 Web AI 或其他 Agent / 任意组合)
65
- 13. 如八类标记都不存在(全新项目)→ 使用 AskUserQuestion 让用户选择目标环境
66
- - 用户选择 opencode → `target_cli = opencode`,部署时创建 `opencode.json` 和 `.opencode/`
67
- - 用户选择 claude-code → 按现有逻辑处理
68
- - 用户选择 codex → `target_cli = codex`,部署时创建 `.codex/`
69
- - 用户选择 antigravity → `target_cli = antigravity`,部署时创建 `.agents/skills`、`.agents/agents`、`.agents/rules`、`.agents/hooks` 并合并 `.agents/hooks.json`
70
- - 用户选择 zcode → `target_cli = zcode`,部署时创建 `.zcode/`、合并根 `AGENTS.md`,不创建项目 custom agents
71
- - 用户选择 openclaw → `target_cli = openclaw`,部署时复制 OpenClaw 兼容 skills 到项目 `skills/`
72
- - 用户选择 reasonix → `target_cli = reasonix`,部署时复制 skills 到项目 `skills/`、写入 Reasonix 版 `AGENTS.md`,不创建项目 custom agents/hooks
73
- - 用户选择通用 Web AI / 其他 Agent → `target_cli = generic`,部署通用 `AGENTS.md` 与项目本地 `skills/`;不写平台专属 hooks/agents
74
- - 用户选择多端 → `target_cli = claude-code,opencode,codex,antigravity,zcode,openclaw,reasonix,generic` 的子集(仅包含用户选择的端)
37
+ 3. 检查 `.active-book` 文件是否存在:存在 → 显示当前活跃书目;不存在 → 跳过
38
+ 4. **判断当前宿主(能判断就不问作者)**。依次看,第一条能定下来的就用:
39
+ - 你自身的运行环境:系统提示、可用工具名或 skill 调用语法已表明你运行在 Claude Code、Codex、OpenCode、Google Antigravity(含命令行 `agy`)、ZCode、OpenClaw 或 Reasonix 里;
40
+ - 正在执行的本 `SKILL.md` 的安装位置带有宿主专属目录(如 `.claude/`、`.codex/`、`.zcode/`、`.gemini/`、`.openclaw/`、`.opencode/`);
41
+ - 判断不出(例如网页版 AI、自建 Agent,或以上信号互相矛盾)→ 第 5 步的项目标记只当候选,交第 6 步问作者。
42
+ 5. 看项目里已有哪些宿主的标记:
43
+ - `.claude/` 或 `CLAUDE.md` → `target_cli = claude-code`
44
+ - `opencode.json`、`opencode.jsonc` 或 `.opencode/` → `target_cli = opencode`
45
+ - `.codex/`、`.codex/config.toml`、`.codex/agents/`、`.codex/hooks.json`、`AGENTS.md` 中的 Codex 段 → `target_cli = codex`
46
+ - `.agents/hooks.json`、`.agents/agents/`,或 `.agents/rules/oh-story.md` 中的 Antigravity 标记 → `target_cli = antigravity`
47
+ - `.zcode/`、`.zcode/config.json`、`zcode.json`、`.zcode/skills/`、`.zcode/commands/`、`AGENTS.md` 中的 ZCode 段 → `target_cli = zcode`
48
+ - `openclaw.json`、`.openclaw/`,或 `AGENTS.md` 中的 OpenClaw 段(标题行含 `网文写作工具集(OpenClaw)`)→ `target_cli = openclaw`
49
+ - `.reasonix/`、`reasonix-plugin.json`、`REASONIX.md`,或 `AGENTS.md` 中的 Reasonix 段(标题行含 `网文写作工具集(Reasonix)`)→ `target_cli = reasonix`
50
+ - `AGENTS.md` 中的通用段(标题行含 `网文写作工具集(通用 Agent / Web AI)`)→ `target_cli = generic`
51
+
52
+ > 后三类只认各端**互斥**的标记:`skills/*/SKILL.md` 的 `metadata.openclaw` 不作 OpenClaw 信号(13 个 skill 都带,三条 skills-only 路径部署出的 `skills/` 一样);`.agents/skills/` 由 Antigravity、Codex 与 Reasonix 共用,也不单独作准。
53
+ 6. 定下 `target_cli`:
54
+ - 第 4 步定出了当前宿主 → `target_cli` 就是它。项目里另有其他宿主的标记时,用 AskUserQuestion 问一句白话:「这个文件夹之前也给 {其他宿主名} 装过写作工具,这次要一起更新吗?」选项:「只装 {当前宿主名}(推荐)」「一起更新」。作者一开始就说要装多个时照办。
55
+ - 定不出、项目标记恰好只有一个宿主 → AskUserQuestion 问「上次是给 {宿主名} 装的,这次还是它吗?」,是就用它,不是按下一条问。
56
+ - 定不出、其余情况 → 用 AskUserQuestion 问:「你现在是在哪个软件里跟我对话?」选项用产品名加一句说明:Claude Code(Anthropic 的命令行 / 桌面版)、Codex(OpenAI 的命令行)、OpenCode、Google Antigravity(含命令行 agy)、ZCode、OpenClaw、Reasonix(DeepSeek 的命令行)、网页版 AI 或其他工具(NarraFork、自建 Agent 等)、好几个都要用。提问工具一次放不下这么多选项时,把项目标记里出现过的放前面,其余让作者在「其他」里直接写名字。
57
+ - 作者的答案按「Claude Code → `claude-code`、网页版 AI 或其他工具 → `generic`、其余取小写产品名」换成 `target_cli`;多端为 `claude-code,opencode,codex,antigravity,zcode,openclaw,reasonix,generic` 中选中的端。
58
+ 7. **确认项目根(通常不问)**:项目根就是当前工作目录。只有当前目录是用户主目录、磁盘根目录、系统目录,或就是本 skill 包自身的安装/源码目录时,才用一句白话问作者:「写作工具要装在哪个文件夹?一般就是放书稿的那个文件夹。」其他情况直接部署,在安装报告的「部署明细」里写明装在哪。
75
59
 
76
60
  ## Phase 2:部署基础设施
77
61
 
78
- 使用 AskUserQuestion 确认部署位置后,依次执行。
79
-
80
- 整个 Phase 2 幂等:目录复制、文件写入和下表各合并算法重复执行结果一致。因环境原因(工具不可用、权限被拒、网络失败)中途失败时,直接从头重跑本 Phase,不需要先清理半成品;`create only if absent` 的用户状态文件(见下表 Owner class)不会被二次覆盖。
62
+ 整个 Phase 2 幂等:目录复制、文件写入和各宿主部署文件里的合并算法重复执行结果一致。因环境原因(工具不可用、权限被拒、网络失败)中途失败时,直接从头重跑本 Phase,不需要先清理半成品;`create only if absent` 的用户状态文件(见各部署清单的 Owner class)不会被二次覆盖。
81
63
 
82
- **两列基准目录不同**:`Source path` 相对正在执行的这份 skill 包,`Target path` 相对用户项目根。执行每一行(以及下面各端部署算法里的每个递归复制步骤)之前,先把通配符具体化为单个源/目标,再用本 `SKILL.md` 同级的 `scripts/copy-path-safety.py` 检查。该脚本按 `Path.resolve` / `realpath` 语义跟随已有 symlink,并在两侧都存在时用 `samefile` 核对文件系统对象;**只转绝对路径或比较字符串不算检查完成**。读取其 JSON:`status: same` 时 no-op,禁止复制;仅 `copy_allowed: true` 时可以复制;`source_missing`、`unsafe_target_within_source` 或 `filesystem_identity_error` 必须停止该步骤并报告。无法运行脚本时只能用当前环境的文件系统 API 做完全相同的 canonical realpath、same-object 与 target-descendant 检查;无法确认就停止,不得尝试复制。OpenClaw / Reasonix / generic 的项目副本是整份 skill 拷贝,重跑时执行的就是项目里那份;Reasonix / Codex 还可能经 `.agents/skills → ../skills` symlink 加载,路径文本不同也可能指向同一目录,照字面复制会把目录嵌进自身并撑满磁盘。
64
+ **两列基准目录不同**:部署清单里 `Source path` 相对正在执行的这份 skill 包,`Target path` 相对用户项目根。执行每一行(以及各宿主部署算法里的每个递归复制步骤)之前,先把通配符具体化为单个源/目标,再用本 `SKILL.md` 同级的 `scripts/copy-path-safety.py` 检查。该脚本按 `Path.resolve` / `realpath` 语义跟随已有 symlink,并在两侧都存在时用 `samefile` 核对文件系统对象;**只转绝对路径或比较字符串不算检查完成**。读取其 JSON:`status: same` 时 no-op,禁止复制;仅 `copy_allowed: true` 时可以复制;`source_missing`、`unsafe_target_within_source` 或 `filesystem_identity_error` 必须停止该步骤并报告。无法运行脚本时只能用当前环境的文件系统 API 做完全相同的 canonical realpath、same-object 与 target-descendant 检查;无法确认就停止,不得尝试复制。OpenClaw / Reasonix / generic 的项目副本是整份 skill 拷贝,重跑时执行的就是项目里那份;Reasonix / Codex 还可能经 `.agents/skills → ../skills` symlink 加载,路径文本不同也可能指向同一目录,照字面复制会把目录嵌进自身并撑满磁盘。
83
65
 
84
66
  **部署前清理自嵌套残留**:`{.claude,.codex,.zcode}/skills/story-setup/references/agent-references/` 与项目根 `skills/story-setup/references/agent-references/` 里若多出 `agent-references/` 层(可能嵌了多层),以及 `skills/story-setup/skills/`,整段删掉再部署,并在安装报告里列出删掉的路径。
85
67
 
86
- ### Step 1:部署清单(机械可检查)
87
-
88
- | Source path | Target path | Owner class | Merge mode | Validation check |
89
- |-------------|-------------|-------------|------------|------------------|
90
- | `skills/story-setup/references/templates/CLAUDE.md.tmpl` | `CLAUDE.md` | user+managed | marker/section merge | contains story skill routing sections |
91
- | `skills/story-setup/references/templates/hooks/` | `.claude/hooks/` | story-setup managed | recursive replace | `session-*.sh`, `detect-story-gaps.sh`, `validate-story-commit.sh`, `guard-outline-before-prose.sh`, `check-prose-after-write.sh`, `story_hook_core.js`, `story_hook_cli.js`, `lib/common.sh`, `lib/sentinel.sh` exist;`story_hook_core.js` 与 OpenCode/ZCode 副本字节一致 |
92
- | `skills/story-setup/references/templates/rules/*.md` | `.claude/rules/*.md` | story-setup managed | replace | every rule contains `paths` frontmatter |
93
- | `skills/story-setup/references/templates/agents/*.md` | `.claude/agents/*.md` | story-setup managed | replace | 7 agent files exist |
94
- | `skills/story-setup/references/agent-references/*.md` | `.claude/skills/story-setup/references/agent-references/*.md` | story-setup managed | replace | every `story-setup/references/agent-references/*.md` reference resolves |
95
- | `skills/story-setup/references/templates/settings-hooks.json` | `.claude/settings.local.json` | user+managed | replace managed registrations by stable hook identity | hook JSON valid;旧 matcher 注册已迁移、当前模板命令各一份、用户 hook 保留 |
96
- | `skills/story-setup/scripts/merge-claude-settings.py` | 部署时执行,不复制到项目 | story-setup helper | execute | 替换已知 story hook 注册、保留用户 hooks/顶层字段,v24→v25 迁移与重复执行幂等 |
97
- | `skills/story-setup/scripts/copy-path-safety.py` | 每个递归复制步骤前执行,不复制到项目专用目录 | story-setup helper | execute | JSON 仅 `copy_allowed: true` 时允许复制;symlink 同对象 no-op;target 位于 source 内时停止 |
98
- | generated sentinel | `.story-deployed` | story-setup managed | replace | contains `agents_version`, `setup_skill_version`, `target_cli`, `resolver_strategy`, `references_dir` |
99
- | `skills/story-setup/references/opencode/AGENTS.md.tmpl` | `AGENTS.md` | user+managed | marker/section merge | contains story skill routing sections | target_cli 含 opencode |
100
- | `skills/story-setup/references/opencode/agents/` | `.opencode/agents/` | story-setup managed | replace | 7 agent files exist(replace 前按「配置 OpenCode Agent 模型」中的「保留已有模型配置」缓存现有 `model:`,避免覆盖用户已配模型) | target_cli 含 opencode |
101
- | `skills/story-setup/references/opencode/plugin.ts` | `.opencode/plugins/story-hooks.ts` | story-setup managed | replace | TypeScript plugin file exists | target_cli 含 opencode |
102
- | `skills/story-setup/references/opencode/story_hook_core.js` | `.opencode/plugins/lib/story_hook_core.js` | story-setup managed | replace | Node syntax valid;与 ZCode 副本字节一致;被 story-hooks.ts import | target_cli 含 opencode |
103
- | `skills/story-setup/references/opencode/commands/` | `.opencode/commands/` | story-setup managed | replace | 13 command files exist | target_cli 含 opencode |
104
- | `skills/story-setup/references/opencode/opencode.json.patch` | merge into `opencode.json` | user+managed | merge by plugin/permission key | plugin entry registered | target_cli 含 opencode |
105
- | repository `skills/story-setup/references/agent-references/` | `skills/story-setup/references/agent-references/` | story-setup managed | replace | every reference resolves | target_cli 含 opencode |
106
- | `skills/story-setup/references/opencode/pre-commit.sh` | `.git/hooks/pre-commit` | user+managed | append or create | file exists and is executable;含 marker 块则替换块内容,不含则检测 exit 0 位置智能插入 | target_cli 含 opencode |
107
- | `skills/story-setup/references/codex/AGENTS.md.tmpl` | `AGENTS.md` | user+managed | marker/section merge | contains Codex story skill routing sections | target_cli 含 codex |
108
- | `skills/story-setup/references/codex/agents/` | `.codex/agents/` | story-setup managed | replace | 7 TOML agent files parse and contain `name`/`description`/`developer_instructions` | target_cli 含 codex |
109
- | `skills/story-setup/references/codex/hooks/hooks.json` | `.codex/hooks.json` | user+managed | replace managed registrations by stable hook identity | hook JSON valid; all stale direct/launcher registrations removed, current 6 registrations present exactly once | target_cli 含 codex |
110
- | `skills/story-setup/references/codex/hooks/{story_codex_hook.py,run-story-hook.sh,run-story-hook.cmd}` | `.codex/hooks/` 同名文件 | story-setup managed | replace | Python/shell/cmd launcher 文件齐全 | target_cli 含 codex |
111
- | `skills/story-setup/scripts/merge-codex-hooks.py` | 部署时执行,不复制到项目 | story-setup helper | execute | 替换已知管理注册、保留用户 hooks 与未知顶层字段,结果幂等 | target_cli 含 codex |
112
- | `skills/story-setup/references/agent-references/` | `.codex/skills/story-setup/references/agent-references/` | story-setup managed | replace | every reference resolves | target_cli 含 codex |
113
- | current package skill root + `scripts/deploy-antigravity-skills.py` | `.agents/skills/{browser-cdp,story*}/` | story-setup managed for 13 known skill names | atomically replace known dirs; preserve unknown skills; never write through symlink | 13 real skill directories with valid `SKILL.md` exist | target_cli 含 antigravity |
114
- | `skills/story-setup/scripts/generate-antigravity-agents.mjs` + Claude agent sources | `.agents/agents/agent-name/agent.md`(`agent-name` 为实际名称) | story-setup managed for 7 known agent definitions | generate then atomically replace known definitions; preserve unknown user agents | 7 Markdown agents parse; exact Antigravity tool names; `mainAgent: false`, `subagent: true` | target_cli 含 antigravity |
115
- | `skills/story-setup/references/antigravity/rules/oh-story.md` | `.agents/rules/oh-story.md` | story-setup managed | replace | `trigger: always_on`; under 12,000 characters | target_cli 含 antigravity |
116
- | `skills/story-setup/references/antigravity/hooks/hooks.json` | `.agents/hooks.json` | user+managed | replace only top-level `oh-story` group | valid Antigravity named-group schema; user groups preserved; idempotent | target_cli 含 antigravity |
117
- | `skills/story-setup/references/antigravity/hooks/{story_antigravity_hook.js,story_hook_core.js}` | `.agents/hooks/` same names | story-setup managed | replace | Node syntax valid; core byte-identical to shared source; hook contract tests pass | target_cli 含 antigravity |
118
- | `skills/story-setup/scripts/merge-antigravity-hooks.py` | deployment helper only | story-setup helper | execute | atomically replaces only `oh-story`, preserves user groups, idempotent | target_cli 含 antigravity |
119
- | `skills/story-setup/references/zcode/AGENTS.md.tmpl` | `AGENTS.md` | user+managed | marker/section merge | contains ZCode `$story-*` routing and solo fallback | target_cli 含 zcode |
120
- | repository `skills/{browser-cdp,story*}/` | `.zcode/skills/{browser-cdp,story*}/` | story-setup managed for known skill names | replace known skill dirs only | 13 `SKILL.md` files exist and satisfy ZCode frontmatter limits | target_cli 含 zcode |
121
- | `skills/story-setup/references/zcode/commands/` | `.zcode/commands/` | story-setup managed for known command names | replace known command files only | 13 commands have valid names/frontmatter | target_cli 含 zcode |
122
- | `skills/story-setup/references/zcode/hooks/story_zcode_hook.js` | `.zcode/hooks/story_zcode_hook.js` | story-setup managed | replace | Node syntax valid; hook contract tests pass | target_cli 含 zcode |
123
- | `skills/story-setup/references/zcode/hooks/story_hook_core.js` | `.zcode/hooks/story_hook_core.js` | story-setup managed | replace | Node syntax valid; hook contract tests pass | target_cli 含 zcode |
124
- | `skills/story-setup/references/zcode/config.json.patch` | merge into `.zcode/config.json` | user+managed | merge by event+matcher+process args | JSON valid; 按「ZCode 部署算法」第 4 步 hooks 互斥分支校验——未装 oh-story 插件时 `hooks.enabled=true`、only supported events;已装插件时校验 `.zcode/config.json` 不含(或已移除)这批 oh-story hooks 注册 | target_cli 含 zcode |
125
- | `skills/story-setup/references/openclaw/AGENTS.md.tmpl` | `AGENTS.md` | user+managed | marker/section merge | contains OpenClaw story skill routing sections | target_cli 含 openclaw |
126
- | `skills/story-setup/references/generic/AGENTS.md.tmpl` | `AGENTS.md` | user+managed | marker/section merge | contains generic story skill routing sections | target_cli 含 generic |
127
- | `skills/story-setup/references/reasonix/AGENTS.md.tmpl` | `AGENTS.md` | user+managed | marker/section merge | contains Reasonix story skill routing sections and solo/direct fallback | target_cli 含 reasonix |
128
- | repository `skills/{browser-cdp,story*}/` | `skills/{browser-cdp,story*}/` | story-setup managed for known skill names | replace known skill dirs only | 13 `SKILL.md` files exist; OpenClaw-compatible frontmatter | target_cli 含 openclaw 或 generic 或 reasonix |
129
- | repository `skills/story-setup/references/agent-references/` | 随上一行整份 skill 拷贝落地,本行 no-op | story-setup managed | 不单独复制 | every reference resolves | target_cli 含 openclaw 或 generic 或 reasonix |
130
-
131
- ### opencode.json 合并算法
132
-
133
- 部署 `opencode.json.patch` 时按以下规则合并:
134
-
135
- 1. 读取现有 `opencode.json`(如存在),解析 JSON
136
- 2. 合并 `plugin` 数组:将 `./.opencode/plugins/story-hooks.ts` 加入数组,去重
137
- 3. 保留用户已有的其他配置字段(`permission`、`model`、`provider` 等),不覆盖
138
- 4. 写入合并后的 `opencode.json`
139
-
140
- ### Step 2:部署 CLAUDE.md
141
-
142
- - 读取 `skills/story-setup/references/templates/CLAUDE.md.tmpl`
143
- - 替换占位符(见下方「模板占位符」段)
144
- - 写入项目根目录 `CLAUDE.md`(如已存在,按「CLAUDE.md 合并策略」处理)
145
-
146
- ### Step 3:部署 Hooks
147
-
148
- - **递归复制完整目录树**:将 `skills/story-setup/references/templates/hooks/` 复制到用户项目 `.claude/hooks/`
149
- - 必须保留子目录 `lib/`,其中:
150
- - `lib/common.sh` 提供 `project_root`、`discover_active_book`、`discover_all_books`
151
- - `lib/sentinel.sh` 提供 `.story-deployed` 字段读取
152
- - 只需对 `.claude/hooks/*.sh` 设置执行权限(`chmod +x`);`lib/*.sh` 由 hook `source`,不要求可执行位
153
-
154
- ### Step 4:部署 Rules
155
-
156
- - 读取 `skills/story-setup/references/templates/rules/` 下所有 `.md` 文件
157
- - 复制到用户项目的 `.claude/rules/` 目录
158
-
159
- ### Step 5:部署 Agents
160
-
161
- - 读取 `skills/story-setup/references/templates/agents/` 下所有 `.md` 文件
162
- - 复制到用户项目的 `.claude/agents/` 目录
163
- - Agent 文件属于 story-setup 管理文件,可安全覆盖;版本升级时按 `UPGRADING.md` 的版本检测结果重新部署
164
- - **`target_cli` 含 opencode 时,覆盖 `.opencode/agents/` 之前先执行下面「配置 OpenCode Agent 模型」的 Step 1 缓存现有 `model:`**。那一步写在本节后面,但必须先跑——照顺序读到哪做到哪会先覆盖再缓存,用户已配的模型就没了。
165
- - **部署后必须新开会话**:agent 只在会话启动时注册;原因与必须输出的报告文案见「验证安装」中的「输出安装报告」。
166
-
167
- #### Agent 兼容性处理
168
-
169
- - Agent 正文以 Claude Code Markdown 为真源;OpenCode 的 `.opencode/agents/*.md` 与 Codex 的 `.codex/agents/*.toml` 由 `references/opencode/agents/`、`references/codex/agents/` 下的预生成产物直接复制。Antigravity 的 `.agents/agents/agent-name/agent.md`(`agent-name` 为实际名称)则在部署时调用随 story-setup 下发的 `scripts/generate-antigravity-agents.mjs`,把 Claude 工具名、模型档、reference 根和调用术语确定性转换为 Antigravity 2.0 契约;不得把 Claude frontmatter 原样复制过去。
170
- - **ZCode 3.3.4 不部署项目 agents**:其自定义子智能体只支持用户级 `~/.zcode/agents/`,plugin manifest 中的 `agents` 当前不执行。不要创建 `.zcode/agents/` 或修改用户 home;相关 Skill 必须直接 solo/direct 并报告 fallback。
171
- - **OpenClaw Phase 1 不部署 agents**:OpenClaw 只部署 skills,agent 协作相关 skill 必须按既有 fallback 规则降级 solo/direct,不要把 Claude/OpenCode agent frontmatter 直接复制成 OpenClaw agent。
172
- - 部署到项目后,agent 内引用的参考资料必须走 `story-setup/references/agent-references/*.md` 这一本 skill 内复制路径;不要跨 skill 引用其他 skill 的 references。各 adapter 只使用当前规范前缀:Claude Code 为 `.claude/skills/`,Antigravity 为 `.agents/skills/`,OpenCode / OpenClaw / Reasonix / generic 为 `skills/`,Codex 为 `.codex/skills/`,ZCode 为 `.zcode/skills/`;不在运行时遍历历史备选路径。
173
-
174
- #### 部署 Agent References
175
-
176
- - 将 `skills/story-setup/references/agent-references/` 下所有 `.md` 复制到项目内 `.claude/skills/story-setup/references/agent-references/`
177
- - 校验:凡 agent 或 reference 中出现 `story-setup/references/agent-references/<file>.md`,源包与目标包都必须存在 `<file>.md`
178
-
179
- #### 部署 Codex Agents(target_cli 含 codex 时)
180
-
181
- - 读取 `skills/story-setup/references/codex/agents/` 下所有 `.toml` 文件,复制到用户项目 `.codex/agents/`
182
- - Agent 文件属于 story-setup 管理文件,可安全覆盖;`references/codex/agents/` 里的 TOML 由仓库根的 `scripts/generate-codex-agents.py` 从 Claude agent 模板确定性生成后提交入库,部署只做复制
183
- - 校验每个 TOML 都能解析,且包含 Codex 必需字段:`name`、`description`、`developer_instructions`
184
- - 只读职责 agent(`chapter-extractor`、`consistency-checker`、`story-explorer`)必须保留 `sandbox_mode = "read-only"`
185
- - **部署后必须 trust + 新开 Codex 会话**(报告文案与 fallback 规则见「验证 Codex 部署」);若运行时返回 `unknown agent_type`,调用方必须降级 solo/direct 并报告 fallback。
186
- - 将 `skills/story-setup/references/agent-references/` 同步复制到 `.codex/skills/story-setup/references/agent-references/`,作为 Codex agent 的项目内参考资料主路径
187
-
188
- #### 部署 Antigravity Agents(target_cli 含 antigravity 时)
189
-
190
- - 先确认 `node` 在 PATH;Antigravity agent 生成与项目 hooks 都依赖 Node。缺失时停止 Antigravity 这一目标的部署,不留下半成品,并提示安装 Node 后重跑。
191
- - 执行 `node "{story-setup skill目录}/scripts/generate-antigravity-agents.mjs" --source "{story-setup skill目录}/references/templates/agents" --dest "{项目}/.agents/agents"`。生成器先渲染全部 7 个 agent,再原子替换这 7 个已知 `.agents/agents/agent-name/agent.md` 定义(`agent-name` 为实际名称),并清理旧版同名扁平 `.md`;保留其他用户 agent,任一源 frontmatter 异常时不得留下半更新目录,也不得沿 managed agent symlink 写出项目外。
192
- - 校验 7 个 `.md`:`name` 与文件名一致;`mainAgent: false`、`subagent: true`;模型只使用 `flash` / `pro`;工具只来自 Antigravity 官方名称 `view_file`、`find_by_name`、`grep_search`、`write_to_file`、`replace_file_content`、`multi_replace_file_content`、`run_command`;不得残留 Claude 的 `Read/Glob/Grep/Write/Edit/Bash` 工具名或 `.claude/skills/` reference 前缀。
193
- - 只读 agent(`chapter-extractor`、`consistency-checker`、`story-explorer`)不得包含写文件或命令工具;其他 agent 按 Claude 真源的能力边界映射。
194
- - Antigravity 通过 `invoke_subagent` 的 `TypeName` 调用这些 agent。部署后新开 Antigravity conversation,再用 `story-review` 验证 full/lean;运行时无法解析某个 custom agent 时按 skill 的 solo/direct fallback 执行。
195
-
196
- #### 配置 OpenCode Agent 模型
197
-
198
- > 仅当 `target_cli` 含 `opencode` 时执行。OpenCode 子代理不指定模型时继承主模型,导致低成本 Agent 也消耗主模型额度。此步骤自动检测用户模型并写入 `model:` 字段。
199
-
200
- ##### Step 1:保留已有模型配置(必须在 `.opencode/agents/` 的 replace 之前执行)
201
-
202
- OpenCode agents 部署是 `replace`,会覆盖上次写入的 `model:`。所以在执行该 replace **之前**先扫描现有 `.opencode/agents/*.md`,缓存每个 agent 的 `model:`(agent 名 → 模型 ID)。后续检测失败/超时、或用户跳过某一级时,用缓存值回填,避免把用户上次配好的低成本模型抹成主模型。若 replace 已先发生、缓存为空,则按全新部署处理,并在安装报告中提示"未能保留上次模型配置"。
203
-
204
- ##### Step 2:获取模型列表
205
-
206
- 优先执行 `opencode models --verbose`,它输出含 cost(input/output/cache 单价)、context、capabilities 的 metadata;不可用或解析失败时回退到 `opencode models` 纯文本(每行 `provider/model`)。两者都用 60000ms(60 秒)超时,因为首次运行需加载 models.dev 缓存。
207
-
208
- - 成功 → 进入「模型分级」
209
- - 超时 → 重试一次(缓存可能未预热);仍然超时则按「保留已有模型配置」缓存回填已有 `model:`、跳过自动配置,在安装报告中输出手动配置指南
210
- - 失败(命令不存在、输出为空等)→ 同上:回填「保留已有模型配置」缓存、跳过自动配置、输出手动配置指南
211
-
212
- ##### Step 3:模型分级
213
-
214
- **优先按成本分级(有 `--verbose` 时)**:按每模型实际 cost 从低到高分档——低端取最便宜/免费档、中端取中价档、高端取最贵或上下文/能力最强档。免费模型按真实 cost=0 归低端,**不按名字里的营销词**(如 `nemotron-3-ultra-free` 名含 `ultra` 但 cost=0,应归低端)。无 cost 数据的模型也据此进入候选,不被丢弃。
215
-
216
- **回退按关键词分级(无 `--verbose` 或无 cost 时)**:按模型 ID 中最后一个 `/` 之后的模型名按 `-`、`.`、`_` 分割为段,逐段精确匹配关键词(不区分大小写)。例如 `minimax-m3` 拆为 `[minimax, m3]`,不匹配 `mini` 也不匹配 `max`;`claude-haiku-4.5` 拆为 `[claude, haiku, 4, 5]`,匹配 `haiku`。关键词分级是启发式,安装报告中标注 `分级依据:关键词(heuristic)`。
217
-
218
- | 等级 | 匹配关键词 | 对应 Agent |
219
- |------|-----------|-----------|
220
- | 低端 | `haiku`, `flash`, `mini`, `nano`, `lite` | chapter-extractor, consistency-checker, story-explorer |
221
- | 中端 | `sonnet`, `plus` | story-researcher, narrative-writer, character-designer |
222
- | 高端 | `opus`, `pro`, `ultra`, `max` | story-architect |
223
-
224
- - 一个模型可能匹配多个等级的关键词,取最高等级
225
- - 关键词回退下未匹配任何关键词的模型仍列入候选附加建议(按成本分级则一律纳入),并在安装报告列出,提示"可通过自定义输入使用"
226
- - 同一等级内,如果包含多个模型供应商,优先列出知名供应商(anthropic、openai、google、deepseek)的模型
227
-
228
- ##### Step 4:逐级交互选择
229
-
230
- 按 低端 → 中端 → 高端 顺序,每级用 AskUserQuestion 让用户选择。
231
-
232
- **低端选项结构:**
233
-
234
- ```
235
- 问题:"为低成本 Agent(chapter-extractor, consistency-checker, story-explorer)选择模型:"
236
- 选项:
237
- - provider/model-id
238
- - provider/model-id
239
- - 自定义输入(手动输入完整模型 ID,ID 拼写错误要到运行时才会暴露)
240
- - 跳过,使用主模型(成本可能较高)
241
- ```
242
-
243
- **中端选项结构:**
244
-
245
- ```
246
- 问题:"为写作质量关键 Agent(narrative-writer, character-designer, story-researcher)选择模型:"
247
- 选项:
248
- - provider/model-id
249
- - provider/model-id
250
- - 自定义输入(请勿使用低端模型,会影响正文质量;ID 拼写错误要到运行时才会暴露)
251
- - 跳过,使用主模型(主模型质量通常足够)
252
- ```
253
-
254
- **高端选项结构:**
255
-
256
- ```
257
- 问题:"为总指挥 Agent(story-architect)选择模型:"
258
- 选项:
259
- - provider/model-id
260
- - provider/model-id
261
- - 自定义输入(手动输入完整模型 ID,ID 拼写错误要到运行时才会暴露)
262
- - 跳过,使用主模型(成本可能较高)
263
- ```
264
-
265
- 规则:
266
- - 候选最多显示 5 个,超过则截断并提示"更多模型请使用自定义输入"。**每一级无论候选数是否为 0 都用 AskUserQuestion 弹出**,选项至少含:候选模型(如有)、`自定义输入`、`保留现有模型`(「保留已有模型配置」缓存到该 agent 的 model,无则不显示此项)、`跳过,用主模型`。候选为 0 时仍弹窗,并在问题说明里给出对应警告 + 列出未分级/未入档模型供参考——不再静默跳过交互(否则用户够不到自定义输入)。
267
- - `自定义输入`:用户输入 `provider/model-id` 完整 ID;写入前校验为单行、无控制字符、匹配 `^[A-Za-z0-9._-]+/[A-Za-z0-9._:+-]+$`,不符则提示重输或改选跳过。
268
- - `保留现有模型`:写回「保留已有模型配置」缓存的该 agent model(重新部署时保住用户上次配置),不算"跳过"。
269
- - `跳过,用主模型`:显式清除——不写该 agent 的 `model:`,agent 继承主模型。想保留上次配置请选 `保留现有模型`。
270
- - 各级候选为 0 时在问题说明里给出提示:
271
- - 低端:"未检测到低成本模型,这 3 个 agent 将使用主模型,成本可能较高"
272
- - 中端:"未检测到匹配的中端模型。narrative-writer、character-designer、story-researcher 将使用主模型。如主模型质量足够此配置合理;如需降本,请用自定义输入指定不低于主模型质量的中端模型,或从下方未分级模型里选。"
273
- - 高端:"未检测到高端模型,story-architect 将使用主模型"
274
-
275
- ##### Step 5:写入 model 字段
276
-
277
- 对应用户选择的 agent 文件(`.opencode/agents/*.md`,由部署清单中 OpenCode agents 部署步骤在此步骤之前已部署),在 frontmatter 末尾、closing `---` 之前,以**零缩进的顶层字段**插入 `model:`(不要插进 `permission:` 等多行 map 的缩进块内部)。值含 YAML 特殊字符时加引号,确保不破坏 frontmatter:
278
-
279
- ```yaml
280
- ---
281
- description: ...
282
- mode: subagent
283
- permission:
284
- read: allow
285
- edit: deny
286
- steps: 12
287
- model: provider/model-id
288
- ---
289
- ```
290
-
291
- - 如果 agent 文件已有 `model:` 字段(重新部署场景),替换该顶层 `model:` 的值,不新增重复键
292
- - `保留现有模型`:写回「保留已有模型配置」缓存的该 agent model
293
- - `跳过,用主模型`:不写入 `model:` 字段
294
- - 检测失败/超时、没走到本步骤的等级:用「保留已有模型配置」缓存回填 `model:`,避免 replace 抹掉用户上次配置
295
-
296
- ### Step 6:合并 Hooks 注册到 settings.local.json
297
-
298
- 1. 按现有跨平台规则探测 Python:`for PYBIN in python3 python py; do "$PYBIN" -c "" 2>/dev/null && break; done`;无可用解释器时停止,不手写或简化合并。
299
- 2. 调用 `"$PYBIN" "{story-setup skill目录}/scripts/merge-claude-settings.py" --existing "{项目}/.claude/settings.local.json" --template "{story-setup skill目录}/references/templates/settings-hooks.json" --output "{项目}/.claude/settings.local.json"`。
300
- 3. helper 会移除所有已知 story-setup hook 的历史注册,再追加当前模板;因此 matcher/timeout/if 能随版本升级,同时混在旧 block 中的用户 hook 与未知顶层字段原样保留。写后解析 JSON,验证模板命令各一份、用户配置仍在,再复跑 helper 比较文件字节确认幂等。
301
-
302
- ### Codex hooks.json 合并算法(target_cli 含 codex 时)
303
-
304
- Codex 项目 hooks 部署到 `.codex/hooks.json`;运行脚本部署到 `.codex/hooks/story_codex_hook.py`、`run-story-hook.sh`、`run-story-hook.cmd`。JSON 只负责定位项目根与传递 event,解释器探测由平台 launcher 统一处理。
305
-
306
- 1. 定位当前 story-setup skill 目录,读取 `references/codex/hooks/hooks.json` 作为唯一当前模板,读取项目 `.codex/hooks.json`(不存在时视为空对象)。
307
- 2. 按现有跨平台规则探测可用 Python:`for PYBIN in python3 python py; do "$PYBIN" -c "" 2>/dev/null && break; done`;无可用解释器时停止,不手写或简化 JSON 合并。
308
- 3. 调用 `"$PYBIN" "{story-setup skill目录}/scripts/merge-codex-hooks.py" --existing "{项目}/.codex/hooks.json" --template "{story-setup skill目录}/references/codex/hooks/hooks.json" --output "{项目}/.codex/hooks.json"`。该 helper 会识别旧直调 `story_codex_hook.py`、当前 `run-story-hook.sh` 和 `run-story-hook.cmd` 三类管理身份,先移除所有已知管理注册,再追加当前模板。
309
- 4. 保留用户已有的非 story-setup hooks、matcher 块与未知顶层字段。重复执行必须幂等;禁止再按原始 `command` 字符串追加去重,否则 v17 直调命令会与 v18 launcher 双重注册。
310
- 5. 写入后解析 JSON 验证:旧直调 `story_codex_hook.py` 命令数为 0,当前模板 6 个注册各存在且仅存在一次,用户 hook 与未知顶层字段仍在。然后提示用户:项目 `.codex/` 层需要被 Codex trust,非 managed command hooks 还需要在 `/hooks` 中 review/trust 后才会运行;Windows 下走 `commandWindows`,launcher 从当前目录向上定位项目 `.codex/hooks/`,与 POSIX 路径的嵌套目录行为一致。
311
-
312
- ### Antigravity 部署算法(target_cli 含 antigravity 时)
313
-
314
- Antigravity 2.0 使用项目 `.agents/` customization 根。部署 Skills、Always-On Rule、7 个 custom subagents 与 workspace Hooks;不修改用户 home 下的 `~/.gemini/`。
315
-
316
- 1. 找到当前 skill 包的 13 个已知 skill 目录(`browser-cdp` 与 `story*`),调用 `deploy-antigravity-skills.py --source "{当前 skill 包根}" --dest "{项目}/.agents/skills"` 原子物化。helper 只替换 13 个已知名称、保留用户其他 skills,并在源目标同一 realpath 时 no-op。目标必须是**真实目录**,不要新建顶层 `.agents/skills → ../skills` symlink:Antigravity 2.0 项目部署以真实目录作为受支持路径。
317
- - 若已有 `.agents/skills` 是 symlink,helper 必须先停止且不沿链接写入。用 AskUserQuestion 说明:迁移会把链接当前可见的所有 skills 复制到新的项目内真实目录、只更新 13 个 oh-story 名称、保留链接目标原样,但会把 symlink 本身替换成目录;这可能形成较大的 git diff。只有用户明确同意后才加 `--migrate-symlink` 重跑,拒绝则停止 Antigravity 部署并报告未获得完整支持。这个确认不得被“多端部署”或已有 Codex symlink 跳过。
318
- 2. 按上方「部署 Antigravity Agents」运行生成器,原子更新 `.agents/agents/` 中 7 个已知 `.agents/agents/agent-name/agent.md` 定义(`agent-name` 为实际名称)并保留其他用户 agent;不从用户 home 搬运 agent。
319
- 3. 复制 `references/antigravity/rules/oh-story.md` 到 `.agents/rules/oh-story.md`,验证 `trigger: always_on` 且文件小于 Antigravity 12,000 字符上限。该 rule 承担 skill 路由、写作硬约束与 compact 后恢复;Antigravity IDE 不以根 `AGENTS.md` 作为 workspace rule,所以不要用 AGENTS 模板代替。
320
- 4. 复制 `references/antigravity/hooks/story_antigravity_hook.js` 与同目录 `story_hook_core.js` 到 `.agents/hooks/`,验证 `node --check`。hook 命令以 `.agents/`(`hooks.json` 所在目录)为工作目录,必须使用 `hooks/story_antigravity_hook.js`,不得写成 `.agents/hooks/...`。共享 core 必须与 Claude/OpenCode/ZCode 源字节一致。
321
- 5. 合并 `references/antigravity/hooks/hooks.json` 到 `.agents/hooks.json`:按跨平台规则探测 Python 3,调用 `merge-antigravity-hooks.py {项目}/.agents/hooks.json {skill目录}/references/antigravity/hooks/hooks.json`。helper 只替换顶层 `oh-story` named group,保留其他用户 hook groups;写后复跑并比较字节确认幂等。禁止把 Claude/Codex 的外层 `{ "hooks": ... }` schema 写入 Antigravity。
322
- 6. 校验事件边界:只注册 `PreToolUse`、`PostToolUse`、`PreInvocation`、`Stop`。PreToolUse 必须为每次调用输出 `decision`;PostToolUse 必须只输出 `{}`,正文 findings 经 session `artifactDirectoryPath` 暂存并由下一次 PreInvocation 注入;若模型准备直接结束,Stop 最多强制继续一次,避免无限循环。Antigravity 外部 hooks 没有 SessionStart/PreCompact/PostCompact,首次上下文由 `invocationNum=0` 的 PreInvocation 注入,compact 后由 Always-On Rule 强制读取 `追踪/上下文.md`。
323
- 7. `.story-deployed` 的 `target_cli` 写 `antigravity` 或多端组合,`references_dir` 写 `.agents/skills/story-setup/references/agent-references`。安装报告提示新开 conversation 使 Skills/Rules/Agents/Hooks 重新扫描;同时明确 Node 是 hook 运行时依赖。
324
-
325
- Antigravity IDE 与交互式 `agy` 共用这套 workspace `.agents/` 产物,但仍需分别实机 smoke test。不要依赖 `npx skills add -g` 当前把全局 skill 写到哪个 `~/.gemini/*` 目录;`story-setup` 的支持承诺只覆盖上述项目内真实目录部署。
326
-
327
- ### ZCode 部署算法(target_cli 含 zcode 时)
328
-
329
- ZCode 首版部署 Skills、Commands、AGENTS.md 和支持事件内的 Hooks;不部署 `.zcode/agents` 或 `.zcode/rules`。
68
+ ### Step 1:按宿主部署
330
69
 
331
- 1. 复制仓库当前 `skills/` 下 13 个包含 `SKILL.md` 的目录到 `.zcode/skills/{skill-name}/`;仅替换这些已知目录,保留用户其他 Skills。
332
- 2. 复制 `references/zcode/commands/*.md` 到 `.zcode/commands/`;仅替换 13 个同名命令,保留用户其他 Commands。
333
- 3. 复制 `references/zcode/hooks/story_zcode_hook.js` 和 `references/zcode/hooks/story_hook_core.js` 到 `.zcode/hooks/`。
334
- 4. 读取 `references/zcode/config.json.patch` 和现有 `.zcode/config.json`(如只有根 `zcode.json`,仍创建 `.zcode/config.json` 承载 oh-story 项目 Hooks,不改写根文件):
335
- - 保留用户所有未知字段、MCP、plugins、skills/commands disable overrides;
336
- - **hooks 互斥(避免双触发)**:若本项目经已安装的 oh-story 插件运行(marketplace 安装,仓库根 `.zcode-plugin/plugin.json` 的 `hooks.json` 已全局注册 SessionStart/PreToolUse/PostToolUse),则**跳过**下面把 `config.json.patch` 的 `hooks` 块合并进 `.zcode/config.json`——插件 manifest 已注册这批 hooks,再合并会让同一事件跑两遍(PreToolUse 拦两次、PostToolUse 注入两次)。只有未装插件(直接克隆 / 手动导入 references)时才合并 hooks。不确定时以「ZCode 是否已通过本插件注册这套 hooks」为准;skills/commands/hook 文件/AGENTS 与 config 的非 hook 字段两条路径都照常部署。
337
- - 合并 hooks(仅未装插件时):设置 `hooks.enabled: true`;用户已有更大的 `timeoutMs` 时保留,否则取模板值;对 `hooks.events` 的 SessionStart、PreToolUse、PostToolUse 按 `event + matcher + process command + args` 去重追加;不复制 ZCode 不支持的 PreCompact、PostCompact、SessionEnd、SubagentStop、Notification。
338
- 5. 将 `references/zcode/AGENTS.md.tmpl` 按「AGENTS.md 合并策略」写入根 `AGENTS.md`。
339
- 6. `.story-deployed` 的 `target_cli` 写入 `zcode` 或多端组合,`references_dir` 写 `.zcode/skills/story-setup/references/agent-references`。
340
- 7. 安装报告明确说明:ZCode 3.3.4 的项目/plugin custom agents 不执行,所有专业角色走 solo/direct;系统需要可用的 `node` 命令运行项目 Hook。
70
+ 对 `target_cli` 里的每个宿主,**完整读取**对应部署文件,按其中的部署清单(机械可检查)与算法依次执行;不读其他宿主的文件。
341
71
 
342
- Plugin 安装不经过本算法:仓库根 `.zcode-plugin/plugin.json` 直接暴露同一组 Skills/Commands/Hooks。Plugin Skills 优先级低于 workspace `.zcode/skills`;两者同时存在时项目快照优先,升级项目快照需重新运行 `$story-setup`。**Hooks 只能注册一份**:插件 manifest 与 workspace `.zcode/config.json` 注册的是同一批事件,装了插件就不要再把 `config.json.patch` 的 hooks 合并进 `.zcode/config.json`(见上算法第 4 步的 hooks 互斥),否则 PreToolUse/PostToolUse 会双触发;插件在场时以插件 manifest 为 hooks 唯一注册源。
72
+ | `target_cli` | 部署文件 |
73
+ |---|---|
74
+ | `claude-code` | [references/deploy-claude-code.md](references/deploy-claude-code.md) |
75
+ | `opencode` | [references/deploy-opencode.md](references/deploy-opencode.md)(先过其中「部署前置」版本门) |
76
+ | `codex` | [references/deploy-codex.md](references/deploy-codex.md) |
77
+ | `antigravity` | [references/deploy-antigravity.md](references/deploy-antigravity.md) |
78
+ | `zcode` | [references/deploy-zcode.md](references/deploy-zcode.md) |
79
+ | `openclaw` | [references/deploy-openclaw.md](references/deploy-openclaw.md) |
80
+ | `reasonix` | [references/deploy-reasonix.md](references/deploy-reasonix.md) |
81
+ | `generic` | [references/deploy-generic.md](references/deploy-generic.md) |
343
82
 
344
- ### OpenClaw skills-only 部署算法(target_cli 含 openclaw 时)
83
+ 多端部署时几个宿主共用根 `AGENTS.md`,按下方「AGENTS.md 合并策略」合并成一份;某一端被自己的前置条件拦下(如 OpenCode 版本门、Antigravity 缺 Node)时,按该端部署文件的规定处理,其他端照常部署。
345
84
 
346
- OpenClaw Phase 1 只部署 skills,不部署 OpenClaw agents/hooks/plugin。
347
-
348
- 1. 读取仓库当前 `skills/` 下所有包含 `SKILL.md` 的 story skill 目录(13 个:`browser-cdp` 与 `story*`)。
349
- 2. 写入目标项目 `skills/{skill-name}/`,仅替换这些 story-setup 管理的已知 skill 目录;保留用户在 `skills/` 下的其他目录。
350
- 3. 每个 `SKILL.md` 必须满足 OpenClaw frontmatter 约束:`name` / `description` 是单行键值,`metadata` 是单行 JSON 对象且含 `metadata.openclaw`。
351
- 4. 复制 `skills/story-setup/references/openclaw/AGENTS.md.tmpl` 到项目 `AGENTS.md`,按「AGENTS.md 合并策略」合并。
352
- 5. `.story-deployed` 的 `target_cli` 写入 `openclaw` 或多端组合;`references_dir` 对 OpenClaw 写 `skills/story-setup/references/agent-references`。
353
- 6. 安装报告提示项见 Phase 3 第 10 步。
354
-
355
- ### Reasonix skills-only 部署算法(target_cli 含 reasonix 时)
356
-
357
- Reasonix(DeepSeek-Reasonix CLI)当前只部署 skills 与 `AGENTS.md`,不部署 Reasonix hooks/custom agents(hook I/O 契约与子代理行为缺少可校验的真实 CLI,留待后续阶段)。
358
-
359
- 1. 读取仓库当前 `skills/` 下所有包含 `SKILL.md` 的 story skill 目录(13 个:`browser-cdp` 与 `story*`)到目标项目 `skills/{skill-name}/`;仅替换这些 story-setup 管理的已知 skill 目录,保留用户其他目录。
360
- 2. 在项目根创建 `.agents/skills → ../skills` 相对 symlink(与 Codex 共用的 skill root),使 Reasonix 原生扫描 `.agents/skills` 时发现这些 skill;若已是指向 `skills/` 的 symlink 则保留,若被占用为普通目录则不覆盖并在安装报告提示。Windows 未启用 symlink 时跳过本步,改走根 `reasonix-plugin.json` 的 `reasonix plugin install`。
361
- 3. 复制 `skills/story-setup/references/reasonix/AGENTS.md.tmpl` 到项目 `AGENTS.md`,按「AGENTS.md 合并策略」合并。
362
- 4. `.story-deployed` 的 `target_cli` 写入 `reasonix` 或多端组合;`references_dir` 对 Reasonix 写 `skills/story-setup/references/agent-references`。
363
- 5. 安装报告提示项见 Phase 3 第 12 步。
364
-
365
- ### 通用 Web AI / 其他 Agent 部署算法(target_cli 含 generic 时)
366
-
367
- 通用路径面向 NarraFork、Web AI、自定义 Agent 等可读取项目文件的环境,只部署通用文件,不声明平台原生 hooks/agents 能力。
368
-
369
- 1. 复制仓库当前 `skills/` 下所有包含 `SKILL.md` 的 story skill 目录(13 个:`browser-cdp` 与 `story*`)到目标项目 `skills/{skill-name}/`;仅替换这些 story-setup 管理的已知 skill 目录,保留用户其他目录。
370
- 2. 复制 `skills/story-setup/references/generic/AGENTS.md.tmpl` 到项目 `AGENTS.md`,按「AGENTS.md 合并策略」合并。
371
- 3. `.story-deployed` 的 `target_cli` 写入 `generic` 或多端组合;`references_dir` 对 generic 写 `skills/story-setup/references/agent-references`。
372
- 4. 安装报告提示项见 Phase 3 第 11 步。
373
-
374
- ### Step 7:创建部署标记
85
+ ### Step 2:创建部署标记
375
86
 
376
87
  - 创建 `.story-deployed` 文件(sentinel file)
377
88
  - 写入以下字段(YAML `key: value` 格式,hook 用 `references/templates/hooks/lib/sentinel.sh` 读取):
378
89
  ```
379
90
  deployed_at: <date -u +"%Y-%m-%dT%H:%M:%SZ">
380
- agents_version: 30
381
- setup_skill_version: 1.2.10
91
+ agents_version: 34
92
+ setup_skill_version: 1.3.2
382
93
  target_cli: claude-code(或 opencode、codex、antigravity、zcode、openclaw、reasonix、generic,或其任意组合)
383
94
  resolver_strategy: project-local-skill-reference
384
- references_dir: .claude/skills/story-setup/references/agent-references(Codex 写 .codex/skills/...;Antigravity 写 .agents/skills/...;ZCode 写 .zcode/skills/...;OpenClaw / Reasonix / generic 写 skills/...;多端用逗号分隔)
95
+ references_dir: .claude/skills/story-setup/references/agent-references(Codex 写 .codex/skills/...;Antigravity 写 .agents/skills/...;ZCode 写 .zcode/skills/...;OpenCode / OpenClaw / Reasonix / generic 写 skills/...;多端用逗号分隔)
385
96
  ```
386
97
  - 此文件供 session-start.sh 和写作 skill 检测部署状态,避免重复提示
387
- - target_cli 含 claude-code 时,同时创建一次性标记文件 `.claude/.agents-pending-restart`(空文件即可)。session-start.sh 在下一个会话启动时据此确认 agents 已随新会话注册,并自动删除该标记——用来向用户确认「重启已生效」。ZCode 不创建该标记,因为它不部署项目 agents。
388
- - 如果 `.story-deployed` 已存在但 `agents_version` 缺失、非整数或小于 `30`,按本次流程更新 hooks/agents/rules/reference bundle(具体变更见 `UPGRADING.md`);大于 `30` 时已在 Phase 1 停止,不得降级覆盖
98
+ - 宿主部署文件里「部署标记补充」要求的额外标记一并创建(如 Claude Code 的重启确认标记)
99
+ - 如果 `.story-deployed` 已存在但 `agents_version` 缺失、非整数或小于 `34`,按本次流程更新 hooks/agents/rules/reference bundle(具体变更见 `UPGRADING.md`);大于 `34` 时已在 Phase 1 停止,不得降级覆盖
389
100
 
390
101
  ## Phase 3:验证安装
391
102
 
392
- 按 `.story-deployed.target_cli` 选择对应端的检查:第 1–4 项仅用于 Claude Code,第 5 项是所有端共有的部署标记检查,第 6 项是部署报告,第 7–13 项按目标端各选其一。仅检查模式复用第 1–5 项与对应端的第 7–13 项,跳过第 6 项,且其中要求实际执行 hook 或写入 fixture 的子项改为只做静态校验(文件存在、语法有效、注册项齐全),不运行会写入项目的 hook,也不创建部署标记。
393
-
394
- 1. 验证 hooks 注册:
395
- - 检查 `.claude/settings.local.json` 中的 hooks 字段是否正确
396
- - 检查 `.claude/hooks/` 下的脚本是否存在且有执行权限
397
- - 检查 `.claude/hooks/lib/common.sh` 与 `.claude/hooks/lib/sentinel.sh` 是否存在
398
- 2. 验证 rules 路径:
399
- - 检查 `.claude/rules/` 下的规则文件是否存在且包含 `paths` frontmatter
400
- 3. 验证 agents:
401
- - 检查 `.claude/agents/` 下的 7 个 agent 定义文件是否存在
402
- 4. 验证 agent reference bundle:
403
- - 检查 `.claude/skills/story-setup/references/agent-references/` 下 reference 文件完整
404
- - 检查所有 `story-setup/references/agent-references/<file>.md` 都能解析到 deployed bundle
405
- 5. 验证部署标记:
406
- - 检查 `.story-deployed` 是否存在且包含时间戳、`agents_version: 30`、`setup_skill_version: 1.2.10`、`target_cli`、`resolver_strategy`、`references_dir`
407
- 6. 输出安装报告:
408
- - 列出所有已部署的文件
409
- - 列出需要注意的事项(如已有配置已合并)
410
- - **⚠️ 重启提示(必须醒目输出)**:本次部署写入了 `.claude/agents/`,但这些 custom agent 只在「会话启动」时才会被 Claude Code 注册成 `subagent_type`。**请新开一个 Claude Code 会话再开始写作**,否则当前会话里 story-review / story-long-write 等想 spawn `story-architect`、`narrative-writer` 等时会拿到「subagent_type 不可用」并降级 solo(单视角,失去多 agent 协作)。判断是否生效:新会话里跑 `/story-review`,报告头若是 `Effective Mode: full/lean` 即注册成功;若是 `Fallback: ... -> solo` 说明还在旧会话或未注册。
411
- - 重启后即可使用 `/story-long-write` 或 `/story-short-write`
412
- - 如果执行了「配置 OpenCode Agent 模型」,输出 Agent 模型配置摘要:
413
- ```
414
- Agent 模型配置:
415
- story-architect → <高端模型>(provider/model-id)
416
- narrative-writer → <中端模型>(provider/model-id)
417
- character-designer → <中端模型>(provider/model-id)
418
- story-researcher → <中端模型>(provider/model-id)
419
- chapter-extractor → <低端模型>(provider/model-id)
420
- consistency-checker → <低端模型>(provider/model-id)
421
- story-explorer → <低端模型>(provider/model-id)
422
- ```
423
- - 如果自动检测失败(`opencode models` 不可用),输出手动配置指南:
424
- ```
425
- 无法自动检测模型列表。以下 Agent 未配置模型,将使用主模型,成本可能较高:
426
- - chapter-extractor(建议使用低成本模型)
427
- - consistency-checker(建议使用低成本模型)
428
- - story-explorer(建议使用低成本模型)
429
-
430
- 手动配置方法:编辑 .opencode/agents/{agent名}.md,在 frontmatter 中添加:
431
- model: provider/model-id
432
-
433
- 可用模型列表与成本可通过 opencode models --verbose 查看(输出含每模型 cost/context)。
434
- 模型库与定价见 OpenCode 官方模型源 https://models.dev/。
435
- ```
436
- 7. 验证 opencode 部署(仅当 target_cli 含 opencode 时):
437
- - 检查 `.opencode/agents/` 下的 7 个 agent 定义文件是否存在,且 frontmatter 包含 `mode: subagent` 和 `permission` 字段
438
- - 检查 `.opencode/plugins/story-hooks.ts` 是否存在
439
- - 检查 `.opencode/plugins/lib/story_hook_core.js` 存在且 `node --check` 通过(story-hooks.ts import 之,与 `.zcode` 副本字节一致的共享写正文守卫核;置于 `lib/` 子目录以避开 OpenCode 单层 `.opencode/plugins/*.js` 插件自动发现)
440
- - 检查 `.opencode/commands/` 下的 13 个 command 文件是否存在
441
- - 检查 `skills/story-setup/references/agent-references/` 下 reference 文件完整且数量与源目录一致
442
- - 检查 `opencode.json` 的 `plugin` 数组是否包含 story-hooks 条目
443
- - 检查 `.git/hooks/pre-commit` 是否存在且有执行权限(Windows 上跳过执行权限检查)
444
- - 检查 `.opencode/agents/` 下 agent 文件 frontmatter 可被 YAML 解析、`model:`(如有配置)是合法顶层标量,而非仅 grep 到 `model:` 子串
445
- 8. 验证 Codex 部署(仅当 target_cli 含 codex 时):
446
- - 检查 `AGENTS.md` 含 Codex story skill routing sections
447
- - 检查 `.codex/agents/` 下 7 个 `.toml` agent 定义文件存在并可解析
448
- - 检查 `.codex/hooks.json` 存在且 JSON 有效,Unix `command` 仅通过 `run-story-hook.sh` 启动,Windows `commandWindows` 仅通过 `run-story-hook.cmd` 启动;不存在直调 `story_codex_hook.py` 的注册
449
- - 检查 `.codex/hooks/story_codex_hook.py`、`run-story-hook.sh`、`run-story-hook.cmd` 存在,Python 语法有效,POSIX/Windows launcher 能从嵌套 cwd 定位项目根
450
- - 检查 `.codex/skills/story-setup/references/agent-references/` 下 reference 文件完整且数量与源目录一致
451
- - 安装报告必须提示:Codex 需要 trust 项目 `.codex/` 配置层,并在 `/hooks` review/trust 非 managed hooks;部署后新开 Codex 会话让 custom agents 生效;若当前运行时仍返回 `unknown agent_type`,按各 skill 的 fallback 规则降级 solo/direct
452
- 9. 验证 Antigravity 部署(仅当 target_cli 含 antigravity 时):
453
- - 检查 `.agents/skills/` 下 13 个 story skills 为真实目录且 `SKILL.md` 可读;`.agents/skills/story-setup/references/agent-references/` 完整
454
- - 检查 `.agents/agents/` 下 7 个 Markdown agent 可解析,名称、模型档、官方工具白名单、只读边界与 `.agents/skills/` reference 前缀正确
455
- - 检查 `.agents/rules/oh-story.md` 为 `trigger: always_on` 且未超过 12,000 字符
456
- - 检查 `.agents/hooks.json` 有效、顶层 `oh-story` group 恰有 PreToolUse/PostToolUse/PreInvocation/Stop,用户 hook groups 保留;检查 `.agents/hooks/story_antigravity_hook.js` 与 `story_hook_core.js` 语法有效
457
- - 用 fixture 验证:PreToolUse 缺纲/追踪时 deny、普通写入 allow、commit advisory;PostToolUse stdout 恒为 `{}` 且把正文 findings 写进 session artifact;下一次 PreInvocation 注入 findings;Stop 对未处理 findings 最多 continue 一次;干净正文清除 pending state
458
- - 安装报告必须提示:新开 Antigravity conversation 刷新 customization;Hooks 依赖 PATH 中的 `node`;外部 hook API 没有 PreCompact/PostCompact,compact 恢复由 Always-On Rule 读取 `追踪/上下文.md`;IDE 与交互式 `agy` 仍建议分别实机 smoke test;`agy 1.1.22 -p` 每次 headless 启动都可能在静默鉴权前扫描 workspace,鉴权后不重载 custom agents/hooks,因此当前不在支持面内,可能报 `subagent not found` 或回退写入 `~/.gemini/antigravity-cli/scratch/`;命令行写作从项目目录进入交互式 `agy`,确认 `/skills`、`/agents`、`/hooks` 已发现 oh-story 后再发任务,测试后检查 scratch 无意外小说产物
459
- 10. 验证 ZCode 部署(仅当 target_cli 含 zcode 时):
460
- - 检查根 `AGENTS.md` 含 ZCode `$story-*` 路由、大纲守卫和 solo/direct fallback
461
- - 检查 `.zcode/skills/` 下 13 个 Skills 与 `.zcode/commands/` 下 13 个 Commands,验证 frontmatter 和命名
462
- - 检查 `.zcode/hooks/story_zcode_hook.js`、`.zcode/hooks/story_hook_core.js` 存在且 `node --check` 通过
463
- - 检查 `.zcode/config.json` JSON 有效,并按「ZCode 部署算法」第 4 步的 hooks 互斥分支校验:未装 oh-story 插件时,`hooks.enabled=true`、仅注册 ZCode 支持事件、所有 `process` args 指向项目 Hook;已装 oh-story 插件(`.zcode-plugin/plugin.json` 已全局注册这批 hooks)时,改为校验 `.zcode/config.json` 不含(或已移除)这批 oh-story hooks 注册——**不得**为了让校验通过而把 `config.json.patch` 的 hooks 块合并回去,否则同一事件双触发
464
- - 检查 `.zcode/skills/story-setup/references/agent-references/` 完整且所有 reference 路径可解析
465
- - 用 fixture 调用 SessionStart、PreToolUse deny/allow、PostToolUse,确认无发现时 stdout 为空、有输出时符合 ZCode 严格 JSON
466
- - 安装报告必须提示:ZCode 3.3.4 不执行项目/plugin custom agents,full/lean 多 Agent 请求会稳定降级 solo/direct;Hook 依赖 PATH 中的 `node`;部署后新开 ZCode session 刷新 Skills/Commands/AGENTS.md
467
- 11. 验证 OpenClaw 部署(仅当 target_cli 含 openclaw 时):
468
- - 检查 `AGENTS.md` 含 OpenClaw story skill routing sections
469
- - 检查 `skills/` 下 13 个 story skill 目录存在,且每个 `SKILL.md` 包含单行 `name`、单行 `description`、单行 JSON `metadata.openclaw`
470
- - 检查 `skills/story-setup/references/agent-references/` 下 reference 文件完整且数量与源目录一致
471
- - 安装报告必须提示:OpenClaw Phase 1 是 skills-only;未部署 OpenClaw agents/hooks,运行时硬拦截不可用,写正文前大纲守卫、commit 提醒、session/compact 自动注入只作为 skill 内软约束;OpenClaw 在 session 启动时 snapshot eligible skills,部署后如命令/skills 未出现,需新开 OpenClaw session 或等待 skills watcher 刷新
472
- 12. 验证通用 Web AI / 其他 Agent 部署(仅当 target_cli 含 generic 时):
473
- - 检查 `AGENTS.md` 含通用 story skill routing sections
474
- - 检查 `skills/` 下 13 个 story skill 目录存在,且每个 `SKILL.md` 可读
475
- - 检查 `skills/story-setup/references/agent-references/` 下 reference 文件完整且数量与源目录一致
476
- - 安装报告必须提示:generic 不部署平台专属 hooks/custom agents;大纲守卫、commit 提醒、session/compact 注入等硬拦截与多 agent 协作都按 skill 内软约束或 solo/direct fallback 执行
477
- 13. 验证 Reasonix 部署(仅当 target_cli 含 reasonix 时):
478
- - 检查 `AGENTS.md` 含 Reasonix story skill routing sections 与 solo/direct fallback 说明
479
- - 检查 `skills/` 下 13 个 story skill 目录存在,且每个 `SKILL.md` 可读
480
- - 检查项目 `.agents/skills` 为指向 `skills/` 的 symlink(POSIX;使 Reasonix 原生扫描发现 skill);Windows 未建 symlink 时改为确认根 `reasonix-plugin.json` 可用于 `reasonix plugin install`
481
- - 检查 `skills/story-setup/references/agent-references/` 下 reference 文件完整且数量与源目录一致
482
- - 安装报告必须提示:Reasonix 当前是 skills-only;未部署 Reasonix hooks/custom agents,写正文前大纲守卫、commit 提醒、session/compact 自动注入只作为 skill 内软约束,涉及专业 Agent 的 Skill 走 solo/direct fallback;可用 `reasonix doctor capabilities` 校验 skill 发现,部署后如未显示新 skills,新开 Reasonix session 或走根 `reasonix-plugin.json` 原生 plugin 安装
103
+ 仅检查模式复用第 1–2 项,跳过第 3 项,且其中要求实际执行 hook 或写入 fixture 的子项改为只做静态校验(文件存在、语法有效、注册项齐全),不运行会写入项目的 hook,也不创建部署标记。
104
+
105
+ 1. 对 `target_cli` 里的每个宿主,执行其部署文件的「验证」一节。
106
+ 2. 验证部署标记:
107
+ - 检查 `.story-deployed` 是否存在且包含时间戳、`agents_version: 34`、`setup_skill_version: 1.3.2`、`target_cli`、`resolver_strategy`、`references_dir`
108
+ 3. 输出安装报告。读者是不懂编程的作者,按这个顺序写:
109
+ - **先写「现在可以做什么」**:用写书的话列本次部署后真正可用的事(如「可以开新书、续写:说 /story-long-write」「可以拆一本对标书」),端的限制如实翻译(如「这个工具里审稿由我一个人完成,没有分工助手」)。
110
+ - **再写「你还需要做的事」**:逐条可照做,如「新开一个会话」「在 Codex 里打开 /hooks,把 oh-story 的几条信任一下」「先安装 Node」;没有就写「无需其他操作」。这两段不出现脚本名、字段名、状态名或文件路径;各宿主部署文件「安装报告必须提示」的内容先翻译进这两段。
111
+ - **最后是简短的「部署明细」**:装在哪个文件夹、已部署文件、已合并的配置、删掉的残留路径、宿主部署文件要求的摘要(如 OpenCode 模型配置)和技术原因,放在报告末尾。
483
112
 
484
113
  ---
485
114
 
@@ -492,17 +121,7 @@ Reasonix(DeepSeek-Reasonix CLI)当前只部署 skills 与 `AGENTS.md`,不
492
121
  | `{目标平台}` | 目标发布平台 | 起点、番茄、晋江、知乎盐言 |
493
122
  | `{作者名}` | 用户笔名或昵称 | 未指定时用「作者」 |
494
123
 
495
- 替换时去掉花括号。如果用户未指定项目名,用当前目录名。未指定的占位符保留原样不替换。
496
-
497
- ## CLAUDE.md 合并策略
498
-
499
- 用户已有 CLAUDE.md 时,按 marker/section 合并:
500
- 1. 优先识别 story-setup 管理块标记(如果旧项目已有标记,只替换标记内内容)
501
- 2. 无标记时,读取用户现有 CLAUDE.md,按 `##` 标题切分为 section map
502
- 3. 读取模板 CLAUDE.md.tmpl,同样切分
503
- 4. 模板中的标准 section(Skill 路由表、文件结构、协作规则、Compact 后恢复上下文)**覆盖**用户同名 section
504
- 5. 用户独有的 section(自定义内容)**保留**不动
505
- 6. 未知冲突用 AskUserQuestion 让用户选择保留哪个版本
124
+ 替换时去掉花括号。如果用户未指定项目名,用当前目录名。未指定的占位符保留原样不替换。CLAUDE.md 的合并策略在 Claude Code 部署文件里。
506
125
 
507
126
  ## AGENTS.md 合并策略(OpenCode / Codex / ZCode / OpenClaw / Reasonix / generic)
508
127
 
@@ -510,15 +129,15 @@ Reasonix(DeepSeek-Reasonix CLI)当前只部署 skills 与 `AGENTS.md`,不
510
129
  1. 优先识别 story-setup 管理块标记(如果旧项目已有标记,只替换标记内内容)
511
130
  2. 无标记时,读取用户现有 AGENTS.md,按 `##` 标题切分为 section map
512
131
  3. OpenCode 使用 `skills/story-setup/references/opencode/AGENTS.md.tmpl`;Codex 使用 `skills/story-setup/references/codex/AGENTS.md.tmpl`;ZCode 使用 `skills/story-setup/references/zcode/AGENTS.md.tmpl`;OpenClaw 使用 `skills/story-setup/references/openclaw/AGENTS.md.tmpl`;Reasonix 使用 `skills/story-setup/references/reasonix/AGENTS.md.tmpl`;通用 Web AI / 其他 Agent 使用 `skills/story-setup/references/generic/AGENTS.md.tmpl`
513
- 4. 模板中的标准 section(Skill 路由表、文件结构、协作规则、Compact 后恢复上下文)覆盖同名 section;用户独有 section 保留
132
+ 4. 模板中的标准 section(Skill 路由表、文件结构、协作规则、与作者协作、Compact 后恢复上下文;模板有而用户文件没有的 section 直接补入)覆盖同名 section;用户独有 section 保留
514
133
  5. 多端同时部署时,Codex/OpenCode/ZCode/OpenClaw/Reasonix/generic 共同可用的通用段落只保留一份;工具特有说明以小节区分,避免互相覆盖
515
134
 
516
135
  ## 重新部署
517
136
 
518
137
  - `.story-deployed` 不存在 → 全新安装,Phase 2 全部执行
519
- - `.story-deployed` 存在且 `agents_version: 30` → 提示已部署,AskUserQuestion 确认是否重新部署;提示里写明重新部署只用当前本地 skill 包刷新项目文件,skill 本身的更新走 `npx skills add` 或 marketplace
520
- - `.story-deployed` 存在但 `agents_version` 缺失、非整数或小于 `30` → 提示需要更新,重新执行 Phase 2 覆盖 agents/hooks/rules/reference bundle,CLAUDE.md / AGENTS.md / settings.local.json / .codex/hooks.json / `.agents/hooks.json` / .zcode/config.json 走合并策略
521
- - `.story-deployed` 存在且 `agents_version` 大于 `30` → 当前 skill 版本过旧,停止并提示先更新 oh-story-claudecode;不覆盖项目中的更新部署
138
+ - `.story-deployed` 存在且 `agents_version: 34` → 提示已部署,AskUserQuestion 确认是否重新部署;提示里写明重新部署只用当前本地 skill 包刷新项目文件,skill 本身的更新走 `npx skills add` 或 marketplace
139
+ - `.story-deployed` 存在但 `agents_version` 缺失、非整数或小于 `34` → 提示需要更新,重新执行 Phase 2 覆盖 agents/hooks/rules/reference bundle,CLAUDE.md / AGENTS.md / settings.local.json / .codex/hooks.json / `.agents/hooks.json` / .zcode/config.json 走合并策略
140
+ - `.story-deployed` 存在且 `agents_version` 大于 `34` → 当前 skill 版本过旧,停止并提示先更新 oh-story-claudecode;不覆盖项目中的更新部署
522
141
 
523
142
  ---
524
143
 
@@ -526,9 +145,9 @@ Reasonix(DeepSeek-Reasonix CLI)当前只部署 skills 与 `AGENTS.md`,不
526
145
 
527
146
  | 文件 | 用途 |
528
147
  |------|------|
529
- | references/templates/hooks/ | 8 个 hook 脚本模板 + `story_hook_core.js`(正文网/大纲守卫/连续性/commit 侦测的共享实现,与 OpenCode/ZCode 同一份)+ `story_hook_cli.js`(bash hook 调核的 node 桥)+ `lib/common.sh`/`lib/sentinel.sh`(正文兜底 `check-prose-after-write.sh` 限 PostToolUse Write/Edit;`cat>`/`tee` 等 Bash 写正文由 Codex Stop 回合末 git 扫描兜,Claude/OpenCode 的 Bash 仅 pre-guard) |
530
- | references/antigravity/ | Antigravity 2.0 Always-On Rule、named-group hooks 模板与 I/O adapter;正文写后 findings 经 session artifact 桥接到 PreInvocation/Stop |
531
- | references/zcode/ | ZCode AGENTS、13 Commands、workspace config patch 与严格 JSON Hook runner |
148
+ | references/deploy-*.md | 8 份宿主部署文件:各自的部署清单、算法、验证与安装报告提示,按 Phase 2 Step 1 只读目标宿主那份 |
149
+ | [references/diagnostics.md](references/diagnostics.md) | 仅检查模式 |
150
+ | UPGRADING.md | 各版本升级要点 |
532
151
 
533
152
  ---
534
153