novelws 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/README.md +94 -66
  3. package/dist/commands/init.d.ts.map +1 -1
  4. package/dist/commands/init.js +35 -33
  5. package/dist/commands/init.js.map +1 -1
  6. package/dist/commands/upgrade.d.ts.map +1 -1
  7. package/dist/commands/upgrade.js +63 -6
  8. package/dist/commands/upgrade.js.map +1 -1
  9. package/dist/core/config.d.ts +22 -15
  10. package/dist/core/config.d.ts.map +1 -1
  11. package/dist/core/config.js +28 -16
  12. package/dist/core/config.js.map +1 -1
  13. package/dist/core/errors.d.ts +16 -0
  14. package/dist/core/errors.d.ts.map +1 -1
  15. package/dist/core/errors.js +26 -0
  16. package/dist/core/errors.js.map +1 -1
  17. package/dist/utils/diagnostics.d.ts +64 -0
  18. package/dist/utils/diagnostics.d.ts.map +1 -0
  19. package/dist/utils/diagnostics.js +227 -0
  20. package/dist/utils/diagnostics.js.map +1 -0
  21. package/package.json +1 -1
  22. package/templates/commands/analyze.md +27 -110
  23. package/templates/commands/character.md +32 -180
  24. package/templates/commands/checklist.md +27 -27
  25. package/templates/commands/clarify.md +2 -2
  26. package/templates/commands/constitution.md +8 -8
  27. package/templates/commands/expert.md +3 -3
  28. package/templates/commands/facts.md +9 -9
  29. package/templates/commands/guide.md +129 -19
  30. package/templates/commands/help-me.md +221 -0
  31. package/templates/commands/plan.md +27 -26
  32. package/templates/commands/recap.md +16 -16
  33. package/templates/commands/relations.md +13 -13
  34. package/templates/commands/revise.md +16 -15
  35. package/templates/commands/search.md +11 -10
  36. package/templates/commands/specify.md +4 -4
  37. package/templates/commands/tasks.md +9 -9
  38. package/templates/commands/timeline.md +13 -13
  39. package/templates/commands/track-init.md +8 -8
  40. package/templates/commands/track.md +177 -552
  41. package/templates/commands/volume-summary.md +6 -6
  42. package/templates/commands/write.md +148 -38
  43. package/templates/dot-claude/CLAUDE.md +5 -5
  44. package/templates/{config → resources/config}/keyword-mappings.json +19 -19
  45. package/templates/resources/genres/horror.md +211 -0
  46. package/templates/resources/genres/military.md +209 -0
  47. package/templates/resources/genres/sports.md +216 -0
  48. package/templates/resources/genres/workplace.md +214 -0
  49. package/templates/resources/genres/youth.md +219 -0
  50. package/templates/{knowledge-base/requirements/anti-ai-v4.md → resources/requirements/anti-ai-v4-deprecated.md} +13 -1
  51. package/templates/resources/requirements/anti-ai-v5-balanced.md +203 -0
  52. package/templates/{scripts → resources/scripts}/README.md +8 -8
  53. package/templates/{scripts → resources/scripts}/bash/analyze-story.sh +1 -1
  54. package/templates/resources/scripts/bash/check-analyze-stage.sh +108 -0
  55. package/templates/{scripts → resources/scripts}/bash/check-consistency.sh +7 -7
  56. package/templates/{scripts → resources/scripts}/bash/check-facts.sh +1 -1
  57. package/templates/{scripts → resources/scripts}/bash/check-plot.sh +2 -2
  58. package/templates/{scripts → resources/scripts}/bash/check-timeline.sh +3 -3
  59. package/templates/{scripts → resources/scripts}/bash/check-world.sh +5 -5
  60. package/templates/{scripts → resources/scripts}/bash/check-writing-state.sh +26 -26
  61. package/templates/{scripts → resources/scripts}/bash/common.sh +3 -3
  62. package/templates/{scripts → resources/scripts}/bash/constitution.sh +1 -1
  63. package/templates/{scripts → resources/scripts}/bash/init-tracking.sh +13 -13
  64. package/templates/{scripts → resources/scripts}/bash/manage-relations.sh +10 -10
  65. package/templates/resources/scripts/bash/migrate-tracking.sh +183 -0
  66. package/templates/{scripts → resources/scripts}/bash/plan-story.sh +2 -2
  67. package/templates/{scripts → resources/scripts}/bash/specify-story.sh +1 -1
  68. package/templates/{scripts → resources/scripts}/bash/tasks-story.sh +2 -2
  69. package/templates/{scripts → resources/scripts}/bash/tests/bench-preload-cache.sh +3 -3
  70. package/templates/{scripts → resources/scripts}/bash/tests/test-cross-platform.sh +1 -1
  71. package/templates/{scripts → resources/scripts}/bash/tests/test-preload-cache.sh +1 -1
  72. package/templates/{scripts → resources/scripts}/bash/tests/test-regex-precompile.sh +4 -4
  73. package/templates/{scripts → resources/scripts}/bash/text-audit.sh +3 -3
  74. package/templates/{scripts → resources/scripts}/bash/track-progress.sh +5 -5
  75. package/templates/{scripts → resources/scripts}/powershell/analyze-story.ps1 +1 -1
  76. package/templates/{scripts → resources/scripts}/powershell/check-consistency.ps1 +8 -8
  77. package/templates/{scripts → resources/scripts}/powershell/check-plot.ps1 +2 -2
  78. package/templates/{scripts → resources/scripts}/powershell/check-timeline.ps1 +2 -2
  79. package/templates/{scripts → resources/scripts}/powershell/check-writing-state.ps1 +31 -31
  80. package/templates/{scripts → resources/scripts}/powershell/common.ps1 +2 -2
  81. package/templates/{scripts → resources/scripts}/powershell/constitution.ps1 +1 -1
  82. package/templates/{scripts → resources/scripts}/powershell/init-tracking.ps1 +5 -5
  83. package/templates/{scripts → resources/scripts}/powershell/manage-relations.ps1 +6 -6
  84. package/templates/{scripts → resources/scripts}/powershell/migrate-tracking.ps1 +1 -1
  85. package/templates/{scripts → resources/scripts}/powershell/plan-story.ps1 +2 -2
  86. package/templates/{scripts → resources/scripts}/powershell/specify-story.ps1 +1 -1
  87. package/templates/{scripts → resources/scripts}/powershell/tests/bench-ps-cache.ps1 +10 -10
  88. package/templates/{scripts → resources/scripts}/powershell/tests/test-ps-cache.ps1 +4 -4
  89. package/templates/{scripts → resources/scripts}/powershell/text-audit.ps1 +2 -2
  90. package/templates/{scripts → resources/scripts}/powershell/track-progress.ps1 +2 -2
  91. package/templates/skills/analysis/character-analysis/SKILL.md +1 -1
  92. package/templates/skills/analysis/foreshadow-analysis/SKILL.md +1 -1
  93. package/templates/skills/analysis/hook-analysis/SKILL.md +2 -2
  94. package/templates/skills/analysis/logic-analysis/SKILL.md +2 -2
  95. package/templates/skills/analysis/opening-analysis/SKILL.md +1 -1
  96. package/templates/skills/analysis/pacing-analysis/SKILL.md +1 -1
  97. package/templates/skills/analysis/power-analysis/SKILL.md +3 -3
  98. package/templates/skills/analysis/reader-analysis/SKILL.md +1 -1
  99. package/templates/skills/analysis/style-analysis/SKILL.md +1 -1
  100. package/templates/skills/analysis/voice-analysis/SKILL.md +1 -1
  101. package/templates/skills/auto-tracking/SKILL.md +1 -1
  102. package/templates/skills/quality-assurance/consistency-checker/SKILL.md +1 -1
  103. package/templates/skills/quality-assurance/facts-checker/SKILL.md +2 -2
  104. package/templates/skills/quality-assurance/hook-checker/SKILL.md +2 -2
  105. package/templates/skills/quality-assurance/long-series-continuity/SKILL.md +7 -7
  106. package/templates/skills/quality-assurance/pre-write-checklist/SKILL.md +22 -22
  107. package/templates/skills/quality-assurance/setting-detector/SKILL.md +15 -15
  108. package/templates/skills/quality-assurance/voice-consistency-checker/SKILL.md +1 -1
  109. package/templates/skills/writing-techniques/character-arc/SKILL.md +1 -1
  110. package/templates/skills/writing-techniques/multi-thread-narrative/SKILL.md +1 -1
  111. package/templates/skills/writing-techniques/reader-expectation/SKILL.md +1 -1
  112. package/templates/skills/writing-techniques/revision-polish/SKILL.md +1 -1
  113. package/templates/skills/writing-techniques/style-learning/SKILL.md +2 -2
  114. package/templates/skills/writing-techniques/writing-balance/.gitkeep +0 -0
  115. package/templates/skills/writing-techniques/writing-balance/SKILL.md +460 -0
  116. package/templates/skills/writing-techniques/writing-techniques/SKILL.md +727 -0
  117. package/templates/knowledge-base/README.md +0 -285
  118. package/templates/scripts/powershell/check-writing-state.ps1.backup +0 -135
  119. /package/templates/{knowledge-base → resources}/character-archetypes/01-hero.md +0 -0
  120. /package/templates/{knowledge-base → resources}/character-archetypes/02-mentor.md +0 -0
  121. /package/templates/{knowledge-base → resources}/character-archetypes/03-shadow.md +0 -0
  122. /package/templates/{knowledge-base → resources}/character-archetypes/04-ally.md +0 -0
  123. /package/templates/{knowledge-base → resources}/character-archetypes/05-shapeshifter.md +0 -0
  124. /package/templates/{knowledge-base → resources}/character-archetypes/06-trickster.md +0 -0
  125. /package/templates/{knowledge-base → resources}/character-archetypes/07-threshold-guardian.md +0 -0
  126. /package/templates/{knowledge-base → resources}/character-archetypes/08-herald.md +0 -0
  127. /package/templates/{knowledge-base → resources}/character-archetypes/09-father.md +0 -0
  128. /package/templates/{knowledge-base → resources}/character-archetypes/10-mother.md +0 -0
  129. /package/templates/{knowledge-base → resources}/character-archetypes/11-child.md +0 -0
  130. /package/templates/{knowledge-base → resources}/character-archetypes/12-sage.md +0 -0
  131. /package/templates/{knowledge-base → resources}/character-archetypes/README.md +0 -0
  132. /package/templates/{knowledge-base → resources}/character-archetypes/application-guide.md +0 -0
  133. /package/templates/{knowledge-base → resources}/character-archetypes/archetype-combinations.md +0 -0
  134. /package/templates/{knowledge-base → resources}/character-archetypes/config.yaml +0 -0
  135. /package/templates/{knowledge-base → resources}/character-archetypes/examples-analysis.md +0 -0
  136. /package/templates/{specification-example.md → resources/config/specification-example.md} +0 -0
  137. /package/templates/{knowledge-base → resources}/craft/character-arc.md +0 -0
  138. /package/templates/{knowledge-base → resources}/craft/dialogue.md +0 -0
  139. /package/templates/{knowledge-base → resources}/craft/hook-design.md +0 -0
  140. /package/templates/{knowledge-base → resources}/craft/pacing.md +0 -0
  141. /package/templates/{knowledge-base → resources}/craft/power-system.md +0 -0
  142. /package/templates/{knowledge-base → resources}/craft/scene-structure.md +0 -0
  143. /package/templates/{knowledge-base → resources}/craft/show-not-tell.md +0 -0
  144. /package/templates/{knowledge-base → resources}/craft/story-structures.md +0 -0
  145. /package/templates/{knowledge-base → resources}/craft/tension-management.md +0 -0
  146. /package/templates/{knowledge-base → resources}/emotional-beats/01-first-meeting.md +0 -0
  147. /package/templates/{knowledge-base → resources}/emotional-beats/02-bonding-moment.md +0 -0
  148. /package/templates/{knowledge-base → resources}/emotional-beats/03-declaration.md +0 -0
  149. /package/templates/{knowledge-base → resources}/emotional-beats/04-triumph.md +0 -0
  150. /package/templates/{knowledge-base → resources}/emotional-beats/05-reunion.md +0 -0
  151. /package/templates/{knowledge-base → resources}/emotional-beats/06-forgiveness.md +0 -0
  152. /package/templates/{knowledge-base → resources}/emotional-beats/07-betrayal.md +0 -0
  153. /package/templates/{knowledge-base → resources}/emotional-beats/08-loss.md +0 -0
  154. /package/templates/{knowledge-base → resources}/emotional-beats/09-rejection.md +0 -0
  155. /package/templates/{knowledge-base → resources}/emotional-beats/10-failure.md +0 -0
  156. /package/templates/{knowledge-base → resources}/emotional-beats/11-misunderstanding.md +0 -0
  157. /package/templates/{knowledge-base → resources}/emotional-beats/12-farewell.md +0 -0
  158. /package/templates/{knowledge-base → resources}/emotional-beats/13-revelation.md +0 -0
  159. /package/templates/{knowledge-base → resources}/emotional-beats/14-point-of-no-return.md +0 -0
  160. /package/templates/{knowledge-base → resources}/emotional-beats/15-dark-night.md +0 -0
  161. /package/templates/{knowledge-base → resources}/emotional-beats/16-sacrifice.md +0 -0
  162. /package/templates/{knowledge-base → resources}/emotional-beats/17-awakening.md +0 -0
  163. /package/templates/{knowledge-base → resources}/emotional-beats/18-confrontation.md +0 -0
  164. /package/templates/{knowledge-base → resources}/emotional-beats/19-bittersweet-goodbye.md +0 -0
  165. /package/templates/{knowledge-base → resources}/emotional-beats/20-moral-dilemma.md +0 -0
  166. /package/templates/{knowledge-base → resources}/emotional-beats/21-temptation.md +0 -0
  167. /package/templates/{knowledge-base → resources}/emotional-beats/22-redemption.md +0 -0
  168. /package/templates/{knowledge-base → resources}/emotional-beats/README.md +0 -0
  169. /package/templates/{knowledge-base → resources}/emotional-beats/beat-sequences.md +0 -0
  170. /package/templates/{knowledge-base → resources}/emotional-beats/config.yaml +0 -0
  171. /package/templates/{knowledge-base → resources}/emotional-beats/pacing-guide.md +0 -0
  172. /package/templates/{knowledge-base → resources}/genres/game-lit.md +0 -0
  173. /package/templates/{knowledge-base → resources}/genres/historical.md +0 -0
  174. /package/templates/{knowledge-base → resources}/genres/mystery.md +0 -0
  175. /package/templates/{knowledge-base → resources}/genres/rebirth.md +0 -0
  176. /package/templates/{knowledge-base → resources}/genres/revenge.md +0 -0
  177. /package/templates/{knowledge-base → resources}/genres/romance.md +0 -0
  178. /package/templates/{knowledge-base → resources}/genres/sci-fi.md +0 -0
  179. /package/templates/{knowledge-base → resources}/genres/thriller.md +0 -0
  180. /package/templates/{knowledge-base → resources}/genres/urban.md +0 -0
  181. /package/templates/{knowledge-base → resources}/genres/wuxia.md +0 -0
  182. /package/templates/{knowledge-base → resources}/genres/xuanhuan.md +0 -0
  183. /package/templates/{memory → resources/memory}/constitution.md +0 -0
  184. /package/templates/{memory → resources/memory}/personal-voice.md +0 -0
  185. /package/templates/{knowledge-base → resources}/references/README.md +0 -0
  186. /package/templates/{knowledge-base → resources}/references/china-1920s/culture.md +0 -0
  187. /package/templates/{knowledge-base → resources}/references/china-1920s/daily-life.md +0 -0
  188. /package/templates/{knowledge-base → resources}/references/china-1920s/overview.md +0 -0
  189. /package/templates/{knowledge-base → resources}/references/china-1920s/society.md +0 -0
  190. /package/templates/{knowledge-base → resources}/references/china-1920s/warlords.md +0 -0
  191. /package/templates/{knowledge-base → resources}/references/cultivation-world/daily-life.md +0 -0
  192. /package/templates/{knowledge-base → resources}/references/cultivation-world/overview.md +0 -0
  193. /package/templates/{knowledge-base → resources}/references/cultivation-world/power-system.md +0 -0
  194. /package/templates/{knowledge-base → resources}/references/cultivation-world/sects.md +0 -0
  195. /package/templates/{knowledge-base → resources}/references/cultivation-world/world-setting.md +0 -0
  196. /package/templates/{knowledge-base → resources}/references/modern-workplace/corporate.md +0 -0
  197. /package/templates/{knowledge-base → resources}/references/modern-workplace/daily-life.md +0 -0
  198. /package/templates/{knowledge-base → resources}/references/modern-workplace/overview.md +0 -0
  199. /package/templates/{knowledge-base → resources}/references/modern-workplace/relationships.md +0 -0
  200. /package/templates/{knowledge-base → resources}/references/modern-workplace/tech-industry.md +0 -0
  201. /package/templates/{knowledge-base → resources}/references/tang-dynasty/culture.md +0 -0
  202. /package/templates/{knowledge-base → resources}/references/tang-dynasty/daily-life.md +0 -0
  203. /package/templates/{knowledge-base → resources}/references/tang-dynasty/overview.md +0 -0
  204. /package/templates/{knowledge-base → resources}/references/tang-dynasty/politics.md +0 -0
  205. /package/templates/{knowledge-base → resources}/references/tang-dynasty/society.md +0 -0
  206. /package/templates/{knowledge-base → resources}/requirements/README.md +0 -0
  207. /package/templates/{knowledge-base → resources}/requirements/anti-ai-v3.md +0 -0
  208. /package/templates/{knowledge-base → resources}/requirements/concretization.md +0 -0
  209. /package/templates/{knowledge-base → resources}/requirements/fast-paced.md +0 -0
  210. /package/templates/{knowledge-base → resources}/requirements/no-poison.md +0 -0
  211. /package/templates/{knowledge-base → resources}/requirements/romance-angst.md +0 -0
  212. /package/templates/{knowledge-base → resources}/requirements/romance-sweet.md +0 -0
  213. /package/templates/{knowledge-base → resources}/requirements/serious-literature.md +0 -0
  214. /package/templates/{knowledge-base → resources}/requirements/strong-emotion.md +0 -0
  215. /package/templates/{scripts → resources/scripts}/bash/clarify-story.sh +0 -0
  216. /package/templates/{scripts → resources/scripts}/bash/generate-tasks.sh +0 -0
  217. /package/templates/{scripts → resources/scripts}/bash/test-word-count.sh +0 -0
  218. /package/templates/{scripts → resources/scripts}/bash/tests/run-all-benchmarks.sh +0 -0
  219. /package/templates/{scripts → resources/scripts}/bash/tests/test-cache-semantics.sh +0 -0
  220. /package/templates/{scripts → resources/scripts}/bash/tests/test-edge-cases-bash.sh +0 -0
  221. /package/templates/{scripts → resources/scripts}/bash/tests/test-phase1-bash.sh +0 -0
  222. /package/templates/{scripts → resources/scripts}/bash/tests/test-regression-bash.sh +0 -0
  223. /package/templates/{scripts → resources/scripts}/bash/tests/test-task6-verification.sh +0 -0
  224. /package/templates/{scripts → resources/scripts}/powershell/check-analyze-stage.ps1 +0 -0
  225. /package/templates/{scripts → resources/scripts}/powershell/check-facts.ps1 +0 -0
  226. /package/templates/{scripts → resources/scripts}/powershell/clarify-story.ps1 +0 -0
  227. /package/templates/{scripts → resources/scripts}/powershell/generate-tasks.ps1 +0 -0
  228. /package/templates/{scripts → resources/scripts}/powershell/tests/test-cross-platform.ps1 +0 -0
  229. /package/templates/{scripts → resources/scripts}/powershell/tests/test-edge-cases-ps.ps1 +0 -0
  230. /package/templates/{scripts → resources/scripts}/powershell/tests/test-phase1-ps.ps1 +0 -0
  231. /package/templates/{scripts → resources/scripts}/powershell/tests/test-regression-ps.ps1 +0 -0
  232. /package/templates/{knowledge-base → resources}/styles/README.md +0 -0
  233. /package/templates/{knowledge-base → resources}/styles/ancient-style.md +0 -0
  234. /package/templates/{knowledge-base → resources}/styles/literary.md +0 -0
  235. /package/templates/{knowledge-base → resources}/styles/minimal.md +0 -0
  236. /package/templates/{knowledge-base → resources}/styles/natural-voice.md +0 -0
  237. /package/templates/{knowledge-base → resources}/styles/web-novel.md +0 -0
@@ -0,0 +1,460 @@
1
+ ---
2
+ name: writing-balance-monitor
3
+ description: "Use when writing to monitor writing balance across 6 dimensions - provides real-time scoring and improvement suggestions to avoid AI-like patterns"
4
+ allowed-tools: Read
5
+ ---
6
+
7
+ # Writing Balance - 智能写作平衡监控
8
+
9
+ ## Skill类型
10
+ - **类别**: writing-techniques
11
+ - **激活方式**: /write 命令自动激活
12
+ - **优先级**: 高(核心创作质量保障)
13
+
14
+ ## 设计理念
15
+
16
+ 从"禁止列表"转向"平衡评分"——不强制100分,70-85分即为优秀。
17
+
18
+ **核心原则**:
19
+ 1. **平衡优于完美** - 允许适度使用AI常用词,但要求多样化
20
+ 2. **自然优于机械** - 长短句混合、词汇丰富、层次分明
21
+ 3. **指导优于禁止** - 给出改进建议,而非简单拒绝
22
+
23
+ ## 功能概述
24
+
25
+ 实时监控写作平衡度,提供6个维度的评分和具体改进建议。
26
+
27
+ ---
28
+
29
+ ## 核心指标(6个维度)
30
+
31
+ ### 1. 句长分布平衡度 (Sentence Length Distribution)
32
+
33
+ **检测标准**:
34
+ - 短句(<12字): 30-40%
35
+ - 中句(12-25字): 40-50%
36
+ - 长句(>25字): 10-20%
37
+
38
+ **评分算法**:
39
+
40
+ ```python
41
+ # 伪代码示例
42
+ def score_sentence_length(sentences):
43
+ short = count(len(s) < 12 for s in sentences)
44
+ medium = count(12 <= len(s) <= 25 for s in sentences)
45
+ long = count(len(s) > 25 for s in sentences)
46
+
47
+ total = len(sentences)
48
+ short_pct = short / total
49
+ medium_pct = medium / total
50
+ long_pct = long / total
51
+
52
+ # 理想分布:短35% 中50% 长15%
53
+ ideal = (0.35, 0.50, 0.15)
54
+ actual = (short_pct, medium_pct, long_pct)
55
+
56
+ # 计算偏差(欧氏距离)
57
+ deviation = sqrt(sum((a - i)^2 for a, i in zip(actual, ideal)))
58
+
59
+ # 转换为分数(0-100)
60
+ score = max(0, 100 - deviation * 200)
61
+ return score
62
+ ```
63
+
64
+ **示例输出**:
65
+ ```yaml
66
+ 句长分布:85/100 ✅
67
+ 短句: 38% (目标30-40%)
68
+ 中句: 48% (目标40-50%)
69
+ 长句: 14% (目标10-20%)
70
+
71
+ 改进建议: 当前分布良好,保持节奏变化
72
+ ```
73
+
74
+ **常见问题**:
75
+ - ❌ 短句过多(>60%)→ 节奏单一,缺乏张力
76
+ - ❌ 长句过多(>30%)→ 读者容易疲劳
77
+ - ✅ 平衡分布 → 节奏自然,适合长篇阅读
78
+
79
+ ---
80
+
81
+ ### 2. 词汇丰富度 (Lexical Diversity)
82
+
83
+ **检测标准**:
84
+ - TTR (Type-Token Ratio) > 0.65
85
+ - 高频词(出现5次+)不超过总词数的15%
86
+ - 同义词轮换("说"的同义词:讲、开口、道、答、回、问、应)
87
+
88
+ **评分算法**:
89
+ ```python
90
+ def score_lexical_diversity(text):
91
+ tokens = tokenize(text)
92
+ types = set(tokens)
93
+ ttr = len(types) / len(tokens)
94
+
95
+ # TTR > 0.65 为优秀
96
+ if ttr >= 0.65:
97
+ score = 100
98
+ else:
99
+ score = (ttr / 0.65) * 100
100
+
101
+ return score, ttr
102
+ ```
103
+
104
+ **示例输出**:
105
+ ```yaml
106
+ 词汇丰富度:72/100 ⚠️
107
+ TTR: 0.58 (目标>0.65)
108
+ 高频词: "说"出现8次
109
+
110
+ 改进建议:
111
+ - "说"的同义词:讲、开口、道、答、回、问、应
112
+ - 尝试用动作/表情代替对话标签
113
+ ```
114
+
115
+ ---
116
+
117
+ ### 3. 描写层次感 (Descriptive Depth)
118
+
119
+ **检测标准**:
120
+ - 感官分布: 视觉40% | 听觉20% | 触/嗅/味40%
121
+ - 形容词密度: 4-8个/100字
122
+ - 动/名/形平衡: 5:3:2
123
+
124
+ **评分算法**:
125
+ ```python
126
+ def score_descriptive_depth(text):
127
+ adjectives = extract_adjectives(text)
128
+ adj_density = len(adjectives) / (len(text) / 100)
129
+
130
+ # 4-8个/100字为理想
131
+ if 4 <= adj_density <= 8:
132
+ score = 100
133
+ elif adj_density < 4:
134
+ score = (adj_density / 4) * 100
135
+ else: # > 8
136
+ score = 100 - (adj_density - 8) * 10
137
+
138
+ return score
139
+ ```
140
+
141
+ **示例输出**:
142
+ ```yaml
143
+ 描写层次:68/100 ⚠️
144
+ 形容词密度: 3.2/100字 (目标4-8)
145
+ 感官分布: 视觉85% 听觉10% 其他5%
146
+
147
+ 改进建议:
148
+ - 增加触觉描写(温度、质感)
149
+ - 增加嗅觉描写(气味、香味)
150
+ - 当前过度依赖视觉,尝试多感官交叉
151
+ ```
152
+
153
+ ---
154
+
155
+ ### 4. 成语/四字词使用度 (Idiom Usage)
156
+
157
+ **检测标准**:
158
+ - ≤5个成语/1000字
159
+ - 口语化成语优先
160
+ - 避免连续使用
161
+
162
+ **白名单**(口语化成语,可用):
163
+ - 一言难尽、莫名其妙、不以为然、若无其事、心照不宣
164
+ - 半信半疑、理所当然、面面相觑、目瞪口呆、张口结舌
165
+
166
+ **黑名单**(文言成语,避免):
167
+ - 肝肠寸断、踌躇满志、从容不迫、五味杂陈、百感交集
168
+ - 欣喜若狂、怒不可遏、忐忑不安、惴惴不安、如释重负
169
+
170
+ **评分算法**:
171
+ ```python
172
+ def score_idiom_usage(text, idioms):
173
+ count = len(idioms)
174
+ limit = len(text) / 1000 * 5 # 5个/1000字
175
+
176
+ if count <= limit:
177
+ score = 100
178
+ else:
179
+ score = max(0, 100 - (count - limit) * 10)
180
+
181
+ # 检查黑名单成语
182
+ blacklist_count = count_blacklist_idioms(idioms)
183
+ score -= blacklist_count * 15
184
+
185
+ return max(0, score)
186
+ ```
187
+
188
+ **示例输出**:
189
+ ```yaml
190
+ 成语使用:90/100 ✅
191
+ 总数: 2个/1000字 (目标≤5)
192
+ 口语化: 2个 ✅
193
+ 文言化: 0个 ✅
194
+
195
+ 改进建议: 成语使用合理,保持当前水平
196
+ ```
197
+
198
+ ---
199
+
200
+ ### 5. 句式变化度 (Sentence Pattern Variety)
201
+
202
+ **检测标准**:
203
+ - 避免连续3个以上相同句式
204
+ - 主谓宾/倒装/省略/疑问句混合
205
+ - AI高频句式限制频率(≤2次/1000字)
206
+
207
+ **AI高频句式**(需要限制频率):
208
+ 1. "在...下" - 在月光的照耀下
209
+ 2. "仿佛...一般" - 快得仿佛一阵风一般
210
+ 3. "此时此刻" - 此时此刻,她的心情
211
+ 4. "让...让..." - 温热的触感让她的思绪
212
+ 5. "然而" - 然而,事情并不像
213
+
214
+ **评分算法**:
215
+ ```python
216
+ def score_pattern_variety(sentences):
217
+ patterns = extract_patterns(sentences)
218
+ consecutive = max_consecutive_same_pattern(patterns)
219
+ ai_patterns = count_ai_patterns(sentences)
220
+
221
+ # 连续相同句式扣分
222
+ score = 100 - max(0, consecutive - 2) * 20
223
+
224
+ # AI高频句式扣分
225
+ ai_limit = len(sentences) / 1000 * 2
226
+ if ai_patterns > ai_limit:
227
+ score -= (ai_patterns - ai_limit) * 10
228
+
229
+ return max(0, score)
230
+ ```
231
+
232
+ **示例输出**:
233
+ ```yaml
234
+ 句式变化:65/100 ⚠️
235
+ 连续相同句式: 5个主谓宾结构
236
+ AI高频句式: "在...下"出现3次
237
+
238
+ 改进建议:
239
+ - 增加倒装句:"门,开了"而非"门开了"
240
+ - 增加省略句:"他走了。没回头。"
241
+ - 减少"在...下"句式(当前3次,建议≤2次/1000字)
242
+ ```
243
+
244
+ ---
245
+
246
+ ### 6. 自然度评分 (Naturalness Score)
247
+
248
+ **检测标准**:
249
+ - 标点变化: 句号70% | 问号10% | 感叹号5% | 逗号15%
250
+ - 段落长度: 1-6句混合
251
+ - 对话真实: 语气词、口头禅、未完成句
252
+
253
+ **评分算法**:
254
+ ```python
255
+ def score_naturalness(text, paragraphs, dialogues):
256
+ # 标点分布评分
257
+ punctuation_score = score_punctuation_variety(text)
258
+
259
+ # 段落长度评分
260
+ para_lengths = [count_sentences(p) for p in paragraphs]
261
+ para_score = score_paragraph_variety(para_lengths)
262
+
263
+ # 对话真实度评分
264
+ dialogue_score = score_dialogue_naturalness(dialogues)
265
+
266
+ return (punctuation_score + para_score + dialogue_score) / 3
267
+ ```
268
+
269
+ **示例输出**:
270
+ ```yaml
271
+ 自然度:80/100 ✅
272
+ 标点分布: 句号75% 问号8% 感叹号3% 逗号14%
273
+ 段落长度: 1-5句混合 ✅
274
+ 对话真实度: 包含语气词"啊、吧" ✅
275
+
276
+ 改进建议: 自然度良好,对话真实感强
277
+ ```
278
+
279
+ ---
280
+
281
+ ## 综合评估输出格式
282
+
283
+ 当用户使用 `/write` 命令完成一段写作后,自动输出平衡度评估报告:
284
+
285
+ ```yaml
286
+ 📊 写作平衡度评估报告
287
+
288
+ 总分:78/100 (良好)
289
+
290
+ 详细维度:
291
+ ✅ 句长分布:85/100 (短30% 中50% 长20%)
292
+ ⚠️ 词汇丰富度:72/100 ("说"出现8次,建议轮换)
293
+ ⚠️ 描写层次:68/100 (形容词偏少,建议增加触觉描写)
294
+ ✅ 成语使用:90/100 (仅2个,且均为口语化)
295
+ ⚠️ 句式变化:65/100 (连续5个主谓宾结构)
296
+ ✅ 自然度:80/100 (段落长度自然,对话真实)
297
+
298
+ 改进建议(优先级排序):
299
+ 1. 【高】增加1-2个长句(>30字)丰富节奏
300
+ 2. 【中】"说"的同义词:讲、开口、道、答
301
+ 3. 【中】第3段加入嗅觉描写(咖啡香气)
302
+ 4. 【低】尝试倒装句增加句式变化
303
+ ```
304
+
305
+ **评分等级**:
306
+ - 90-100: 优秀 ⭐⭐⭐⭐⭐
307
+ - 80-89: 良好 ⭐⭐⭐⭐
308
+ - 70-79: 良好 ⭐⭐⭐
309
+ - 60-69: 及格 ⚠️ 需改进
310
+ - <60: 不及格 ❌ 需要大幅调整
311
+
312
+ **说明**:
313
+ - 总分70-85为推荐范围(过高可能过度优化)
314
+ - 不要追求100分(会导致僵化)
315
+ - 维度间可以互补(如句式变化略低但词汇丰富度高)
316
+
317
+ ---
318
+
319
+ ## 配置化支持
320
+
321
+ 用户可在 `specification.md` 中自定义阈值:
322
+
323
+ ```yaml
324
+ writing_balance_config:
325
+ strictness: medium # strict | medium | loose
326
+
327
+ # 自定义目标分布
328
+ sentence_length_target:
329
+ short: 35% # 默认30-40%
330
+ medium: 50% # 默认40-50%
331
+ long: 15% # 默认10-20%
332
+
333
+ # 成语配置
334
+ allow_idioms: true
335
+ idiom_limit_per_1000: 5
336
+
337
+ # 形容词密度
338
+ adjective_density: 6 # per 100 words
339
+
340
+ # 自定义白名单(额外允许的词)
341
+ custom_whitelist:
342
+ - "某个特殊成语"
343
+
344
+ # 自定义黑名单(额外禁用的词)
345
+ custom_blacklist:
346
+ - "某个讨厌的词"
347
+ ```
348
+
349
+ **严格度模式**:
350
+ - **strict**: 阈值更严格,评分更严苛(适合追求极致去AI的作者)
351
+ - **medium**: 默认平衡模式(推荐)
352
+ - **loose**: 宽松模式,允许更多灵活性(适合快速创作)
353
+
354
+ ---
355
+
356
+ ## 使用示例
357
+
358
+ ### 场景1:写作中实时监控
359
+
360
+ ```
361
+ 用户: /write 继续写第3章
362
+
363
+ [AI生成500字内容]
364
+
365
+ AI自动评估:
366
+ 📊 写作平衡度评估报告
367
+ 总分:82/100 (良好) ⭐⭐⭐⭐
368
+
369
+ 详细维度:
370
+ ✅ 句长分布:88/100
371
+ ✅ 词汇丰富度:85/100
372
+ ⚠️ 描写层次:70/100 (可增加嗅觉描写)
373
+ ✅ 成语使用:95/100
374
+ ✅ 句式变化:80/100
375
+ ✅ 自然度:85/100
376
+
377
+ 改进建议:
378
+ - 当前平衡度良好,可继续保持
379
+ - 可选:增加1-2处嗅觉描写增强沉浸感
380
+ ```
381
+
382
+ ### 场景2:用户主动检查
383
+
384
+ ```
385
+ 用户: /analyze --focus=balance --range ch-10
386
+
387
+ [AI分析第10章]
388
+
389
+ 输出:
390
+ 📊 第10章 写作平衡度评估
391
+
392
+ 总分:68/100 (及格) ⚠️
393
+
394
+ 详细维度:
395
+ ⚠️ 句长分布:55/100 (短句72%,过多)
396
+ ⚠️ 词汇丰富度:60/100 (TTR=0.52)
397
+ ✅ 描写层次:85/100
398
+ ✅ 成语使用:90/100
399
+ ⚠️ 句式变化:58/100 (连续10个主谓宾)
400
+ ✅ 自然度:80/100
401
+
402
+ 改进建议(优先级排序):
403
+ 1. 【高】增加5-8个长句(>30字),当前长句仅3%
404
+ 2. 【高】句式过于单一,尝试倒装/省略/疑问句
405
+ 3. 【中】扩展词汇,参考同义词表
406
+ ```
407
+
408
+ ---
409
+
410
+ ## 与 anti-ai-v4 的对比
411
+
412
+ | 维度 | anti-ai-v4(禁止列表) | writing-balance(平衡评分) |
413
+ |------|----------------------|---------------------------|
414
+ | **方法** | 200+禁用词 + 7层规则 | 6个维度评分 |
415
+ | **结果** | 零AI味,但文学性差 | 平衡AI识别度与自然表达 |
416
+ | **句长** | 强制80%<15字 | 灵活分布(短30-40% 中40-50% 长10-20%) |
417
+ | **形容词** | 限制3个/100字 | 允许4-8个/100字 |
418
+ | **成语** | 完全禁用 | 允许口语成语(≤5个/1000字) |
419
+ | **用户体验** | 规则机械,缺乏灵活性 | 给出建议,用户可选择 |
420
+
421
+ ---
422
+
423
+ ## 实施建议
424
+
425
+ 1. **渐进式启用**: 先用 `loose` 模式熟悉系统,再逐步调整为 `medium`
426
+ 2. **保留v4选项**: 如果用户确实需要极端去AI,可以在配置中启用 `anti-ai-v4-mode: true`
427
+ 3. **定期校准**: 每写完10章后,运行一次全章节平衡度分析
428
+ 4. **个性化配置**: 根据自己的写作风格调整阈值
429
+
430
+ ---
431
+
432
+ ## 技术实现说明
433
+
434
+ **For Claude Code**:
435
+ - 本Skill在 `/write` 命令结束后自动激活
436
+ - 读取用户配置(如有):`specification.md` 中的 `writing_balance_config`
437
+ - 分析生成的文本,计算6个维度评分
438
+ - 输出综合报告和改进建议
439
+
440
+ **注意**:
441
+ - 评分算法为伪代码示例,实际实现由AI根据文本内容分析
442
+ - 不需要复杂的NLP库,基于正则表达式和简单统计即可
443
+ - 重点是给出有价值的建议,而非精确的数值
444
+
445
+ ---
446
+
447
+ ## 版本历史
448
+
449
+ - **v1.0** (2026-02-15): 初始版本,6个维度评分系统
450
+ - 替代: anti-ai-v4.md(保留为 anti-ai-v4-deprecated.md)
451
+
452
+ ---
453
+
454
+ ## 参考资料
455
+
456
+ - 设计文档: `docs/plans/2026-02-14-optimization-design.md`
457
+ - 替代规则: `resources/requirements/anti-ai-v4-deprecated.md`
458
+ - 协同Skill: `templates/skills/writing-techniques/writing-techniques/SKILL.md`
459
+
460
+ ---