novelws 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +100 -623
- package/README.md +79 -594
- package/dist/cli.js +1 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +12 -99
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +17 -108
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/core/config.d.ts +1 -37
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +6 -45
- package/dist/core/config.js.map +1 -1
- package/dist/core/errors.d.ts +0 -31
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +0 -58
- package/dist/core/errors.js.map +1 -1
- package/dist/utils/diagnostics.d.ts +2 -16
- package/dist/utils/diagnostics.d.ts.map +1 -1
- package/dist/utils/diagnostics.js +5 -72
- package/dist/utils/diagnostics.js.map +1 -1
- package/dist/utils/project.d.ts +1 -1
- package/dist/utils/project.d.ts.map +1 -1
- package/dist/utils/project.js +3 -3
- package/dist/utils/project.js.map +1 -1
- package/package.json +1 -2
- package/templates/commands/analyze.md +65 -265
- package/templates/commands/expand.md +70 -0
- package/templates/commands/plan.md +47 -452
- package/templates/commands/specify.md +43 -869
- package/templates/commands/write.md +49 -643
- package/templates/dot-claude/CLAUDE.md +38 -202
- package/templates/resources/anti-ai.md +16 -0
- package/templates/resources/style-reference.md +19 -0
- package/templates/tracking/character-state.json +1 -76
- package/templates/tracking/plot-tracker.json +3 -60
- package/templates/tracking/relationships.json +1 -68
- package/templates/tracking/timeline.json +1 -47
- package/dist/commands/plugin.d.ts +0 -6
- package/dist/commands/plugin.d.ts.map +0 -1
- package/dist/commands/plugin.js +0 -135
- package/dist/commands/plugin.js.map +0 -1
- package/dist/plugins/identifier.d.ts +0 -13
- package/dist/plugins/identifier.d.ts.map +0 -1
- package/dist/plugins/identifier.js +0 -72
- package/dist/plugins/identifier.js.map +0 -1
- package/dist/plugins/installers/base.d.ts +0 -27
- package/dist/plugins/installers/base.d.ts.map +0 -1
- package/dist/plugins/installers/base.js +0 -30
- package/dist/plugins/installers/base.js.map +0 -1
- package/dist/plugins/installers/github.d.ts +0 -22
- package/dist/plugins/installers/github.d.ts.map +0 -1
- package/dist/plugins/installers/github.js +0 -133
- package/dist/plugins/installers/github.js.map +0 -1
- package/dist/plugins/installers/local.d.ts +0 -16
- package/dist/plugins/installers/local.d.ts.map +0 -1
- package/dist/plugins/installers/local.js +0 -69
- package/dist/plugins/installers/local.js.map +0 -1
- package/dist/plugins/installers/npm.d.ts +0 -20
- package/dist/plugins/installers/npm.d.ts.map +0 -1
- package/dist/plugins/installers/npm.js +0 -99
- package/dist/plugins/installers/npm.js.map +0 -1
- package/dist/plugins/manager.d.ts +0 -77
- package/dist/plugins/manager.d.ts.map +0 -1
- package/dist/plugins/manager.js +0 -349
- package/dist/plugins/manager.js.map +0 -1
- package/dist/plugins/registry.d.ts +0 -48
- package/dist/plugins/registry.d.ts.map +0 -1
- package/dist/plugins/registry.js +0 -111
- package/dist/plugins/registry.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -66
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/plugins/types.js +0 -2
- package/dist/plugins/types.js.map +0 -1
- package/dist/plugins/validator.d.ts +0 -19
- package/dist/plugins/validator.d.ts.map +0 -1
- package/dist/plugins/validator.js +0 -164
- package/dist/plugins/validator.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -13
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -48
- package/dist/utils/logger.js.map +0 -1
- package/plugins/authentic-voice/README.md +0 -31
- package/plugins/authentic-voice/commands/authentic-voice.md +0 -73
- package/plugins/authentic-voice/commands/authenticity-audit.md +0 -37
- package/plugins/authentic-voice/config.yaml +0 -30
- package/plugins/authentic-voice/experts/authentic-editor.md +0 -27
- package/plugins/export/README.md +0 -319
- package/plugins/export/commands/export.md +0 -460
- package/plugins/export/commands/generate-cover.md +0 -256
- package/plugins/export/commands/metadata.md +0 -309
- package/plugins/export/config.yaml +0 -47
- package/plugins/export/experts/publishing-expert.md +0 -171
- package/plugins/export/templates/epub/chapter-template.html +0 -13
- package/plugins/export/templates/epub/cover-template.html +0 -14
- package/plugins/export/templates/epub/stylesheet.css +0 -200
- package/plugins/export/templates/pdf/ebook-style.css +0 -137
- package/plugins/export/templates/pdf/print-style.css +0 -179
- package/plugins/export/templates/platforms/jinjiang-format.md +0 -101
- package/plugins/export/templates/platforms/qidian-format.md +0 -108
- package/plugins/export/templates/platforms/tomato-format.md +0 -95
- package/plugins/translate/README.md +0 -265
- package/plugins/translate/commands/glossary.md +0 -731
- package/plugins/translate/commands/translate-preview.md +0 -543
- package/plugins/translate/commands/translate.md +0 -649
- package/plugins/translate/config.yaml +0 -43
- package/plugins/translate/experts/literary-translator.md +0 -605
- package/templates/commands/character.md +0 -287
- package/templates/commands/checklist.md +0 -744
- package/templates/commands/clarify.md +0 -269
- package/templates/commands/constitution.md +0 -269
- package/templates/commands/expert.md +0 -188
- package/templates/commands/facts.md +0 -552
- package/templates/commands/guide.md +0 -900
- package/templates/commands/help-me.md +0 -221
- package/templates/commands/recap.md +0 -748
- package/templates/commands/relations.md +0 -385
- package/templates/commands/revise.md +0 -450
- package/templates/commands/search.md +0 -531
- package/templates/commands/tasks.md +0 -396
- package/templates/commands/timeline.md +0 -309
- package/templates/commands/track-init.md +0 -149
- package/templates/commands/track.md +0 -704
- package/templates/commands/volume-summary.md +0 -471
- package/templates/knowledge/audit-config.json +0 -26
- package/templates/knowledge/character-profiles.md +0 -152
- package/templates/knowledge/character-voices.md +0 -137
- package/templates/knowledge/locations.md +0 -184
- package/templates/knowledge/world-setting.md +0 -121
- package/templates/resources/character-archetypes/01-hero.md +0 -233
- package/templates/resources/character-archetypes/02-mentor.md +0 -177
- package/templates/resources/character-archetypes/03-shadow.md +0 -221
- package/templates/resources/character-archetypes/04-ally.md +0 -178
- package/templates/resources/character-archetypes/05-shapeshifter.md +0 -177
- package/templates/resources/character-archetypes/06-trickster.md +0 -181
- package/templates/resources/character-archetypes/07-threshold-guardian.md +0 -177
- package/templates/resources/character-archetypes/08-herald.md +0 -180
- package/templates/resources/character-archetypes/09-father.md +0 -249
- package/templates/resources/character-archetypes/10-mother.md +0 -202
- package/templates/resources/character-archetypes/11-child.md +0 -183
- package/templates/resources/character-archetypes/12-sage.md +0 -202
- package/templates/resources/character-archetypes/README.md +0 -60
- package/templates/resources/character-archetypes/application-guide.md +0 -222
- package/templates/resources/character-archetypes/archetype-combinations.md +0 -242
- package/templates/resources/character-archetypes/config.yaml +0 -28
- package/templates/resources/character-archetypes/examples-analysis.md +0 -223
- package/templates/resources/config/keyword-mappings.json +0 -226
- package/templates/resources/config/specification-example.md +0 -146
- package/templates/resources/craft/character-arc.md +0 -1153
- package/templates/resources/craft/dialogue.md +0 -1170
- package/templates/resources/craft/hook-design.md +0 -345
- package/templates/resources/craft/pacing.md +0 -1200
- package/templates/resources/craft/power-system.md +0 -254
- package/templates/resources/craft/scene-structure.md +0 -1136
- package/templates/resources/craft/show-not-tell.md +0 -1012
- package/templates/resources/craft/story-structures.md +0 -134
- package/templates/resources/craft/tension-management.md +0 -168
- package/templates/resources/emotional-beats/01-first-meeting.md +0 -145
- package/templates/resources/emotional-beats/02-bonding-moment.md +0 -226
- package/templates/resources/emotional-beats/03-declaration.md +0 -284
- package/templates/resources/emotional-beats/04-triumph.md +0 -240
- package/templates/resources/emotional-beats/05-reunion.md +0 -396
- package/templates/resources/emotional-beats/06-forgiveness.md +0 -204
- package/templates/resources/emotional-beats/07-betrayal.md +0 -204
- package/templates/resources/emotional-beats/08-loss.md +0 -214
- package/templates/resources/emotional-beats/09-rejection.md +0 -254
- package/templates/resources/emotional-beats/10-failure.md +0 -244
- package/templates/resources/emotional-beats/11-misunderstanding.md +0 -205
- package/templates/resources/emotional-beats/12-farewell.md +0 -283
- package/templates/resources/emotional-beats/13-revelation.md +0 -242
- package/templates/resources/emotional-beats/14-point-of-no-return.md +0 -215
- package/templates/resources/emotional-beats/15-dark-night.md +0 -244
- package/templates/resources/emotional-beats/16-sacrifice.md +0 -246
- package/templates/resources/emotional-beats/17-awakening.md +0 -246
- package/templates/resources/emotional-beats/18-confrontation.md +0 -217
- package/templates/resources/emotional-beats/19-bittersweet-goodbye.md +0 -368
- package/templates/resources/emotional-beats/20-moral-dilemma.md +0 -248
- package/templates/resources/emotional-beats/21-temptation.md +0 -240
- package/templates/resources/emotional-beats/22-redemption.md +0 -210
- package/templates/resources/emotional-beats/README.md +0 -104
- package/templates/resources/emotional-beats/beat-sequences.md +0 -276
- package/templates/resources/emotional-beats/config.yaml +0 -30
- package/templates/resources/emotional-beats/pacing-guide.md +0 -390
- package/templates/resources/genres/game-lit.md +0 -174
- package/templates/resources/genres/historical.md +0 -1127
- package/templates/resources/genres/horror.md +0 -211
- package/templates/resources/genres/military.md +0 -209
- package/templates/resources/genres/mystery.md +0 -1123
- package/templates/resources/genres/rebirth.md +0 -177
- package/templates/resources/genres/revenge.md +0 -846
- package/templates/resources/genres/romance.md +0 -948
- package/templates/resources/genres/sci-fi.md +0 -156
- package/templates/resources/genres/sports.md +0 -216
- package/templates/resources/genres/thriller.md +0 -166
- package/templates/resources/genres/urban.md +0 -170
- package/templates/resources/genres/workplace.md +0 -214
- package/templates/resources/genres/wuxia.md +0 -143
- package/templates/resources/genres/xuanhuan.md +0 -234
- package/templates/resources/genres/youth.md +0 -219
- package/templates/resources/memory/personal-voice.md +0 -113
- package/templates/resources/references/README.md +0 -96
- package/templates/resources/references/china-1920s/culture.md +0 -423
- package/templates/resources/references/china-1920s/daily-life.md +0 -616
- package/templates/resources/references/china-1920s/overview.md +0 -298
- package/templates/resources/references/china-1920s/society.md +0 -703
- package/templates/resources/references/china-1920s/warlords.md +0 -427
- package/templates/resources/references/cultivation-world/daily-life.md +0 -108
- package/templates/resources/references/cultivation-world/overview.md +0 -64
- package/templates/resources/references/cultivation-world/power-system.md +0 -108
- package/templates/resources/references/cultivation-world/sects.md +0 -104
- package/templates/resources/references/cultivation-world/world-setting.md +0 -108
- package/templates/resources/references/modern-workplace/corporate.md +0 -115
- package/templates/resources/references/modern-workplace/daily-life.md +0 -129
- package/templates/resources/references/modern-workplace/overview.md +0 -73
- package/templates/resources/references/modern-workplace/relationships.md +0 -107
- package/templates/resources/references/modern-workplace/tech-industry.md +0 -131
- package/templates/resources/references/tang-dynasty/culture.md +0 -135
- package/templates/resources/references/tang-dynasty/daily-life.md +0 -139
- package/templates/resources/references/tang-dynasty/overview.md +0 -76
- package/templates/resources/references/tang-dynasty/politics.md +0 -121
- package/templates/resources/references/tang-dynasty/society.md +0 -126
- package/templates/resources/requirements/README.md +0 -240
- package/templates/resources/requirements/anti-ai-v3.md +0 -46
- package/templates/resources/requirements/anti-ai-v4-deprecated.md +0 -442
- package/templates/resources/requirements/anti-ai-v5-balanced.md +0 -203
- package/templates/resources/requirements/concretization.md +0 -90
- package/templates/resources/requirements/fast-paced.md +0 -552
- package/templates/resources/requirements/no-poison.md +0 -60
- package/templates/resources/requirements/romance-angst.md +0 -102
- package/templates/resources/requirements/romance-sweet.md +0 -63
- package/templates/resources/requirements/serious-literature.md +0 -45
- package/templates/resources/requirements/strong-emotion.md +0 -60
- package/templates/resources/scripts/README.md +0 -187
- package/templates/resources/scripts/bash/analyze-story.sh +0 -170
- package/templates/resources/scripts/bash/check-analyze-stage.sh +0 -108
- package/templates/resources/scripts/bash/check-consistency.sh +0 -463
- package/templates/resources/scripts/bash/check-facts.sh +0 -214
- package/templates/resources/scripts/bash/check-plot.sh +0 -374
- package/templates/resources/scripts/bash/check-timeline.sh +0 -346
- package/templates/resources/scripts/bash/check-world.sh +0 -395
- package/templates/resources/scripts/bash/check-writing-state.sh +0 -854
- package/templates/resources/scripts/bash/clarify-story.sh +0 -117
- package/templates/resources/scripts/bash/common.sh +0 -151
- package/templates/resources/scripts/bash/constitution.sh +0 -114
- package/templates/resources/scripts/bash/generate-tasks.sh +0 -65
- package/templates/resources/scripts/bash/init-tracking.sh +0 -183
- package/templates/resources/scripts/bash/manage-relations.sh +0 -174
- package/templates/resources/scripts/bash/migrate-tracking.sh +0 -183
- package/templates/resources/scripts/bash/plan-story.sh +0 -100
- package/templates/resources/scripts/bash/specify-story.sh +0 -93
- package/templates/resources/scripts/bash/tasks-story.sh +0 -96
- package/templates/resources/scripts/bash/test-word-count.sh +0 -182
- package/templates/resources/scripts/bash/tests/bench-preload-cache.sh +0 -100
- package/templates/resources/scripts/bash/tests/run-all-benchmarks.sh +0 -16
- package/templates/resources/scripts/bash/tests/test-cache-semantics.sh +0 -199
- package/templates/resources/scripts/bash/tests/test-cross-platform.sh +0 -35
- package/templates/resources/scripts/bash/tests/test-edge-cases-bash.sh +0 -60
- package/templates/resources/scripts/bash/tests/test-phase1-bash.sh +0 -28
- package/templates/resources/scripts/bash/tests/test-preload-cache.sh +0 -123
- package/templates/resources/scripts/bash/tests/test-regex-precompile.sh +0 -89
- package/templates/resources/scripts/bash/tests/test-regression-bash.sh +0 -42
- package/templates/resources/scripts/bash/tests/test-task6-verification.sh +0 -200
- package/templates/resources/scripts/bash/text-audit.sh +0 -144
- package/templates/resources/scripts/bash/track-progress.sh +0 -194
- package/templates/resources/scripts/powershell/analyze-story.ps1 +0 -174
- package/templates/resources/scripts/powershell/check-analyze-stage.ps1 +0 -110
- package/templates/resources/scripts/powershell/check-consistency.ps1 +0 -138
- package/templates/resources/scripts/powershell/check-facts.ps1 +0 -195
- package/templates/resources/scripts/powershell/check-plot.ps1 +0 -139
- package/templates/resources/scripts/powershell/check-timeline.ps1 +0 -112
- package/templates/resources/scripts/powershell/check-writing-state.ps1 +0 -486
- package/templates/resources/scripts/powershell/clarify-story.ps1 +0 -107
- package/templates/resources/scripts/powershell/common.ps1 +0 -36
- package/templates/resources/scripts/powershell/constitution.ps1 +0 -145
- package/templates/resources/scripts/powershell/generate-tasks.ps1 +0 -70
- package/templates/resources/scripts/powershell/init-tracking.ps1 +0 -98
- package/templates/resources/scripts/powershell/manage-relations.ps1 +0 -134
- package/templates/resources/scripts/powershell/migrate-tracking.ps1 +0 -145
- package/templates/resources/scripts/powershell/plan-story.ps1 +0 -99
- package/templates/resources/scripts/powershell/specify-story.ps1 +0 -85
- package/templates/resources/scripts/powershell/tests/bench-ps-cache.ps1 +0 -80
- package/templates/resources/scripts/powershell/tests/test-cross-platform.ps1 +0 -27
- package/templates/resources/scripts/powershell/tests/test-edge-cases-ps.ps1 +0 -29
- package/templates/resources/scripts/powershell/tests/test-phase1-ps.ps1 +0 -28
- package/templates/resources/scripts/powershell/tests/test-ps-cache.ps1 +0 -73
- package/templates/resources/scripts/powershell/tests/test-regression-ps.ps1 +0 -40
- package/templates/resources/scripts/powershell/text-audit.ps1 +0 -102
- package/templates/resources/scripts/powershell/track-progress.ps1 +0 -105
- package/templates/resources/styles/README.md +0 -302
- package/templates/resources/styles/ancient-style.md +0 -579
- package/templates/resources/styles/literary.md +0 -439
- package/templates/resources/styles/minimal.md +0 -472
- package/templates/resources/styles/natural-voice.md +0 -930
- package/templates/resources/styles/web-novel.md +0 -525
- package/templates/skills/analysis/character-analysis/SKILL.md +0 -71
- package/templates/skills/analysis/foreshadow-analysis/SKILL.md +0 -45
- package/templates/skills/analysis/hook-analysis/SKILL.md +0 -111
- package/templates/skills/analysis/logic-analysis/SKILL.md +0 -58
- package/templates/skills/analysis/opening-analysis/SKILL.md +0 -59
- package/templates/skills/analysis/pacing-analysis/SKILL.md +0 -55
- package/templates/skills/analysis/power-analysis/SKILL.md +0 -148
- package/templates/skills/analysis/reader-analysis/SKILL.md +0 -117
- package/templates/skills/analysis/style-analysis/SKILL.md +0 -60
- package/templates/skills/analysis/voice-analysis/SKILL.md +0 -42
- package/templates/skills/auto-tracking/SKILL.md +0 -280
- package/templates/skills/genre-knowledge/fantasy/SKILL.md +0 -355
- package/templates/skills/genre-knowledge/mystery/SKILL.md +0 -337
- package/templates/skills/genre-knowledge/romance/SKILL.md +0 -228
- package/templates/skills/genre-knowledge/sci-fi/SKILL.md +0 -65
- package/templates/skills/genre-knowledge/thriller/SKILL.md +0 -95
- package/templates/skills/planning/volume-detail/SKILL.md +0 -219
- package/templates/skills/quality-assurance/consistency-checker/SKILL.md +0 -412
- package/templates/skills/quality-assurance/continuity-tracker/SKILL.md +0 -157
- package/templates/skills/quality-assurance/facts-checker/SKILL.md +0 -405
- package/templates/skills/quality-assurance/forgotten-elements/SKILL.md +0 -147
- package/templates/skills/quality-assurance/getting-started/SKILL.md +0 -224
- package/templates/skills/quality-assurance/hook-checker/SKILL.md +0 -164
- package/templates/skills/quality-assurance/hook-checker/experts/hook-analyst.md +0 -33
- package/templates/skills/quality-assurance/long-series-continuity/SKILL.md +0 -570
- package/templates/skills/quality-assurance/pacing-monitor/SKILL.md +0 -143
- package/templates/skills/quality-assurance/pov-validator/SKILL.md +0 -135
- package/templates/skills/quality-assurance/pre-write-checklist/SKILL.md +0 -583
- package/templates/skills/quality-assurance/requirement-detector/CONFLICT_RESOLUTION.md +0 -119
- package/templates/skills/quality-assurance/requirement-detector/EXAMPLES.md +0 -146
- package/templates/skills/quality-assurance/requirement-detector/KEYWORDS.md +0 -160
- package/templates/skills/quality-assurance/requirement-detector/SKILL.md +0 -149
- package/templates/skills/quality-assurance/setting-detector/SKILL.md +0 -611
- package/templates/skills/quality-assurance/style-detector/CONFLICT_RESOLUTION.md +0 -126
- package/templates/skills/quality-assurance/style-detector/EXAMPLES.md +0 -206
- package/templates/skills/quality-assurance/style-detector/KEYWORDS.md +0 -207
- package/templates/skills/quality-assurance/style-detector/SKILL.md +0 -264
- package/templates/skills/quality-assurance/voice-consistency-checker/SKILL.md +0 -103
- package/templates/skills/quality-assurance/voice-consistency-checker/experts/voice-analyst.md +0 -21
- package/templates/skills/quality-assurance/workflow-guide/SKILL.md +0 -381
- package/templates/skills/writing-techniques/character-arc/SKILL.md +0 -267
- package/templates/skills/writing-techniques/dialogue-techniques/SKILL.md +0 -366
- package/templates/skills/writing-techniques/multi-thread-narrative/SKILL.md +0 -708
- package/templates/skills/writing-techniques/multi-thread-narrative/experts/thread-analyst.md +0 -226
- package/templates/skills/writing-techniques/pacing-control/SKILL.md +0 -480
- package/templates/skills/writing-techniques/reader-expectation/SKILL.md +0 -1026
- package/templates/skills/writing-techniques/reader-expectation/experts/expectation-analyst.md +0 -209
- package/templates/skills/writing-techniques/revision-polish/SKILL.md +0 -496
- package/templates/skills/writing-techniques/revision-polish/experts/revision-editor.md +0 -221
- package/templates/skills/writing-techniques/scene-structure/SKILL.md +0 -361
- package/templates/skills/writing-techniques/style-learning/SKILL.md +0 -436
- package/templates/skills/writing-techniques/writing-balance/.gitkeep +0 -0
- package/templates/skills/writing-techniques/writing-balance/SKILL.md +0 -460
- package/templates/skills/writing-techniques/writing-techniques/SKILL.md +0 -727
- package/templates/tracking/story-facts.json +0 -5
- package/templates/tracking/summary/characters-summary.json +0 -7
- package/templates/tracking/summary/plot-summary.json +0 -13
- package/templates/tracking/summary/timeline-summary.json +0 -8
- package/templates/tracking/summary/volume-summaries.json +0 -5
- package/templates/tracking/tracking-log.md +0 -110
- package/templates/tracking/validation-rules.json +0 -128
- /package/templates/resources/{memory/constitution.md → constitution.md} +0 -0
|
@@ -1,900 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: guide
|
|
3
|
-
description: "智能引导 — 根据当前故事状态自动推荐下一步操作,帮助新用户快速上手"
|
|
4
|
-
argument-hint: [故事目录名]
|
|
5
|
-
allowed-tools: Read, Glob, Grep
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# /guide — 智能引导中心
|
|
9
|
-
|
|
10
|
-
## 概述
|
|
11
|
-
|
|
12
|
-
自动检测当前故事的创作阶段和状态,基于三层优先级(P0/P1/P2)智能推荐**唯一最佳下一步**。
|
|
13
|
-
|
|
14
|
-
### 核心特性
|
|
15
|
-
|
|
16
|
-
- **1 个主推荐 + 最多 2 个备选**:聚焦决策,减少困惑
|
|
17
|
-
- **异常自动优先**:P0 级别问题(写作断点、tracking 严重落后)自动成为主推荐
|
|
18
|
-
- **长篇优化**:区分长篇(50-300章)和超长篇(>300章),差异化建议
|
|
19
|
-
- **健康提示折叠**:P2 级别问题(角色缺席、风格偏移)默认折叠,不干扰主流程
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 上下文感知推荐引擎
|
|
24
|
-
|
|
25
|
-
在给出推荐前,先检测项目当前状态:
|
|
26
|
-
|
|
27
|
-
### 检测清单
|
|
28
|
-
|
|
29
|
-
1. **文件存在性检测**:
|
|
30
|
-
```javascript
|
|
31
|
-
const hasSpec = fileExists('specification.md')
|
|
32
|
-
const hasPlan = fileExists('creative-plan.md')
|
|
33
|
-
const hasTasks = fileExists('tasks.md')
|
|
34
|
-
const chapterCount = countFiles('stories/*/content/*.md')
|
|
35
|
-
const hasTracking = fileExists('tracking/character-state.json')
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
2. **模式检测**:
|
|
39
|
-
```javascript
|
|
40
|
-
const isSingleFileMode = fileExists('tracking/character-state.json')
|
|
41
|
-
const isShardedMode = dirExists('tracking/volumes')
|
|
42
|
-
const isMCPMode = fileExists('tracking/novel-tracking.db')
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
3. **问题检测**:
|
|
46
|
-
```javascript
|
|
47
|
-
const trackingSize = getFileSize('tracking/character-state.json')
|
|
48
|
-
const needMigration = trackingSize > 50 * 1024 // >50KB
|
|
49
|
-
const mcpAvailable = isMCPMode && chapterCount > 300
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### 决策逻辑
|
|
53
|
-
|
|
54
|
-
```yaml
|
|
55
|
-
IF not hasSpec:
|
|
56
|
-
推荐: /specify 或 /constitution
|
|
57
|
-
原因: 缺少故事规格文件
|
|
58
|
-
|
|
59
|
-
ELSE IF hasSpec and not hasPlan:
|
|
60
|
-
推荐: /plan
|
|
61
|
-
原因: 有规格但无计划
|
|
62
|
-
|
|
63
|
-
ELSE IF hasPlan and not hasTasks:
|
|
64
|
-
推荐: /tasks
|
|
65
|
-
原因: 有计划但无任务分解
|
|
66
|
-
|
|
67
|
-
ELSE IF hasTasks and chapterCount == 0:
|
|
68
|
-
推荐: /write
|
|
69
|
-
原因: 任务已分解,可以开始写作
|
|
70
|
-
|
|
71
|
-
ELSE IF chapterCount > 0:
|
|
72
|
-
推荐: /analyze 或 /track --sync
|
|
73
|
-
原因: 已有内容,建议分析或同步
|
|
74
|
-
|
|
75
|
-
IF needMigration:
|
|
76
|
-
警告: /track --migrate --target sharded
|
|
77
|
-
原因: 追踪文件过大(>50KB)
|
|
78
|
-
|
|
79
|
-
IF chapterCount > 300 and not isMCPMode:
|
|
80
|
-
提示: 考虑启用MCP模式获得更好性能
|
|
81
|
-
命令: /track --migrate --target mcp
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## 新手引导模式
|
|
87
|
-
|
|
88
|
-
检测用户是否为新手(通过历史命令数量或配置文件):
|
|
89
|
-
|
|
90
|
-
### 首次使用(显示完整流程图)
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
📖 七步方法论完整流程
|
|
94
|
-
|
|
95
|
-
1. /constitution ─┐
|
|
96
|
-
├─→ 定义创作原则和风格
|
|
97
|
-
2. /specify ──────┘
|
|
98
|
-
|
|
99
|
-
3. /clarify ─────→ 澄清关键决策
|
|
100
|
-
|
|
101
|
-
4. /plan ────────→ 制定创作计划
|
|
102
|
-
|
|
103
|
-
5. /tasks ───────→ 分解任务清单
|
|
104
|
-
|
|
105
|
-
6. /write ───────→ 执行写作
|
|
106
|
-
|
|
107
|
-
7. /analyze ─────→ 质量验证
|
|
108
|
-
|
|
109
|
-
当前位置: ● 1 ○ 2 ○ 3 ○ 4 ○ 5 ○ 6 ○ 7
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### 第2-5次使用(简化提示)
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
📍 当前进度: 已完成 specification.md
|
|
116
|
-
|
|
117
|
-
下一步:
|
|
118
|
-
🎯 /plan - 制定创作计划
|
|
119
|
-
💡 /clarify - 如有疑问可先澄清
|
|
120
|
-
|
|
121
|
-
进度: ● ● ○ ○ ○ ○ ○
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### 熟练用户(仅显示异常)
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
⚠️ 异常提醒:
|
|
128
|
-
- tracking/ 目录为空 → 建议运行 /track-init
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## 数据加载策略
|
|
134
|
-
|
|
135
|
-
本命令在检测项目状态时,采用 **三层回退** 机制:
|
|
136
|
-
|
|
137
|
-
### Layer 3: MCP 查询(优先)
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
// 如果 MCP 已启用且数据已同步
|
|
141
|
-
const volumeStats = await mcp.call('novelws-mcp/stats_volume', {});
|
|
142
|
-
const consistencyStats = await mcp.call('novelws-mcp/stats_consistency', {});
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
**优势**:
|
|
146
|
-
- 高性能聚合统计(章节数、追踪状态)
|
|
147
|
-
- 自动计算一致性指标
|
|
148
|
-
- 跨卷数据对比
|
|
149
|
-
|
|
150
|
-
### Layer 2: 分片 JSON(次优)
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
# 当 tracking/volumes/ 存在时
|
|
154
|
-
# 读取 summary/ 文件夹的摘要数据
|
|
155
|
-
character_summary=$(cat tracking/summary/characters-summary.json)
|
|
156
|
-
plot_summary=$(cat tracking/summary/plot-summary.json)
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
**适用场景**:
|
|
160
|
-
- MCP 未启用或同步延迟
|
|
161
|
-
- 需要快速检测项目状态
|
|
162
|
-
- 摘要数据已足够进行状态判断
|
|
163
|
-
|
|
164
|
-
### Layer 1: 单文件 JSON(兜底)
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
# 传统模式,加载完整文件
|
|
168
|
-
character_state=$(cat tracking/character-state.json)
|
|
169
|
-
plot_tracker=$(cat tracking/plot-tracker.json)
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
**向下兼容**:小型项目(< 300 章)继续使用单文件模式
|
|
173
|
-
|
|
174
|
-
### 检测流程
|
|
175
|
-
|
|
176
|
-
```javascript
|
|
177
|
-
// 1. 检测分片模式
|
|
178
|
-
is_sharded = exists('tracking/volumes/')
|
|
179
|
-
|
|
180
|
-
// 2. 检测 MCP
|
|
181
|
-
has_mcp = exists('mcp-servers.json')
|
|
182
|
-
|
|
183
|
-
// 3. 选择数据源
|
|
184
|
-
if (has_mcp) {
|
|
185
|
-
// Layer 3: 使用 MCP 查询
|
|
186
|
-
stats = await mcp.call('novelws-mcp/stats_volume', {});
|
|
187
|
-
} else if (is_sharded) {
|
|
188
|
-
// Layer 2: 读取 summary 摘要
|
|
189
|
-
stats = readSummaryFiles();
|
|
190
|
-
} else {
|
|
191
|
-
// Layer 1: 读取单文件
|
|
192
|
-
stats = readTrackingFiles();
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
## 执行流程
|
|
199
|
-
|
|
200
|
-
### Step 1: 读取项目状态
|
|
201
|
-
|
|
202
|
-
**检测顺序**(从高优先级到低优先级):
|
|
203
|
-
|
|
204
|
-
```javascript
|
|
205
|
-
// 1. 基础文件检测
|
|
206
|
-
specification = Read('stories/*/specification.md')
|
|
207
|
-
→ 提取 target-words, story-type
|
|
208
|
-
creative_plan = Read('stories/*/creative-plan.md')
|
|
209
|
-
→ 提取 总卷数, 总章节数规划
|
|
210
|
-
tasks = Read('stories/*/tasks.md')
|
|
211
|
-
→ 统计 pending/in_progress/completed 任务数
|
|
212
|
-
chapters = Glob('stories/*/content/*.md')
|
|
213
|
-
→ 统计已写章节数
|
|
214
|
-
|
|
215
|
-
// 2. 检测分片模式
|
|
216
|
-
is_sharded = exists('tracking/volumes/')
|
|
217
|
-
has_mcp = exists('mcp-servers.json') // MCP 是否配置
|
|
218
|
-
|
|
219
|
-
// 3. Tracking 文件检测(仅检测存在性和修改时间)
|
|
220
|
-
// 分片模式:检测 summary/ 和 volumes/
|
|
221
|
-
// 单文件模式:检测根目录 JSON
|
|
222
|
-
if (is_sharded) {
|
|
223
|
-
write_checkpoint = exists('tracking/summary/write-checkpoint.json')
|
|
224
|
-
character_state = exists('tracking/summary/characters-summary.json')
|
|
225
|
-
plot_tracker = exists('tracking/summary/plot-summary.json')
|
|
226
|
-
timeline = exists('tracking/summary/timeline-summary.json')
|
|
227
|
-
story_facts = exists('tracking/summary/story-facts-summary.json')
|
|
228
|
-
tracking_log = exists('tracking/summary/tracking-log-summary.md')
|
|
229
|
-
} else {
|
|
230
|
-
write_checkpoint = exists('tracking/write-checkpoint.json')
|
|
231
|
-
character_state = exists('tracking/character-state.json')
|
|
232
|
-
plot_tracker = exists('tracking/plot-tracker.json')
|
|
233
|
-
timeline = exists('tracking/timeline.json')
|
|
234
|
-
story_facts = exists('tracking/story-facts.json')
|
|
235
|
-
tracking_log = exists('tracking/tracking-log.md')
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// 4. 性能优化
|
|
239
|
-
- 只读取文件头部(前 50 行)判断状态
|
|
240
|
-
- Tracking 文件只检测存在性,不深度解析(除非触发 P0)
|
|
241
|
-
- 缓存读取结果,避免重复
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
**容错规则**:
|
|
245
|
-
- 文件读取失败 → 跳过该检测项,继续其他检测
|
|
246
|
-
- JSON 解析失败 → 降级为"文件存在性检测"
|
|
247
|
-
- 无法确定状态 → 使用默认值(长篇,空白项目)
|
|
248
|
-
|
|
249
|
-
---
|
|
250
|
-
|
|
251
|
-
### Step 2: 计算项目规模
|
|
252
|
-
|
|
253
|
-
**判断逻辑**(针对长篇项目):
|
|
254
|
-
|
|
255
|
-
```javascript
|
|
256
|
-
// 读取规划目标
|
|
257
|
-
planned_chapters = creative_plan.总章节数 || 0
|
|
258
|
-
actual_chapters = chapters.length
|
|
259
|
-
|
|
260
|
-
// 规模分级(考虑分片模式)
|
|
261
|
-
IF is_sharded
|
|
262
|
-
// 如果已启用分片,自动判定为超长篇
|
|
263
|
-
→ project_scale = "超长篇"
|
|
264
|
-
ELSE IF planned_chapters > 500 OR actual_chapters > 300
|
|
265
|
-
→ project_scale = "超长篇"
|
|
266
|
-
ELSE IF planned_chapters > 100 OR actual_chapters > 50
|
|
267
|
-
→ project_scale = "长篇"
|
|
268
|
-
ELSE
|
|
269
|
-
→ project_scale = "长篇" // 默认
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
**规模影响的参数**:
|
|
273
|
-
|
|
274
|
-
| 规模 | Tracking 落后阈值(P0)| 质量检查频率 | 角色缺席警告阈值 |
|
|
275
|
-
|------|---------------------|------------|---------------|
|
|
276
|
-
| 长篇 | > 3 章 | 每 5 章 | > 5 章 |
|
|
277
|
-
| 超长篇 | > 2 章 | 每 3 章 | > 8 章 |
|
|
278
|
-
|
|
279
|
-
---
|
|
280
|
-
|
|
281
|
-
### Step 3: 扫描 P0 优先级(阻塞级 - 必须立即处理)
|
|
282
|
-
|
|
283
|
-
**P0 检测项**(按优先级排序):
|
|
284
|
-
|
|
285
|
-
```javascript
|
|
286
|
-
p0_issues = []
|
|
287
|
-
|
|
288
|
-
// 1. 写作断点未恢复(最高优先级)
|
|
289
|
-
IF write_checkpoint.status == "in_progress"
|
|
290
|
-
p0_issues.push({
|
|
291
|
-
type: "checkpoint",
|
|
292
|
-
priority: 100,
|
|
293
|
-
command: "/write [checkpoint.chapter]",
|
|
294
|
-
reason: "发现未完成的写作,可从断点恢复"
|
|
295
|
-
})
|
|
296
|
-
|
|
297
|
-
// 2. Tracking 严重落后
|
|
298
|
-
tracking_lag = actual_chapters - tracking_log.last_chapter
|
|
299
|
-
IF (project_scale == "长篇" AND tracking_lag > 3) OR
|
|
300
|
-
(project_scale == "超长篇" AND tracking_lag > 2)
|
|
301
|
-
p0_issues.push({
|
|
302
|
-
type: "tracking_lag",
|
|
303
|
-
priority: 90,
|
|
304
|
-
command: "/track --sync",
|
|
305
|
-
reason: `Tracking 数据落后 ${tracking_lag} 章`
|
|
306
|
-
})
|
|
307
|
-
|
|
308
|
-
// 3. 时间线冲突
|
|
309
|
-
IF timeline exists AND timeline.conflict == true
|
|
310
|
-
p0_issues.push({
|
|
311
|
-
type: "timeline_conflict",
|
|
312
|
-
priority: 80,
|
|
313
|
-
command: "/timeline --check",
|
|
314
|
-
reason: "检测到时间线冲突"
|
|
315
|
-
})
|
|
316
|
-
|
|
317
|
-
// 4. 伏笔超紧急
|
|
318
|
-
IF plot_tracker exists
|
|
319
|
-
urgent_plots = plot_tracker.plots.filter(p => p.urgency > 0.9)
|
|
320
|
-
IF urgent_plots.length > 0
|
|
321
|
-
p0_issues.push({
|
|
322
|
-
type: "plot_urgent",
|
|
323
|
-
priority: 70,
|
|
324
|
-
command: "/track --check",
|
|
325
|
-
reason: `${urgent_plots.length} 个伏笔紧急度 > 0.9`
|
|
326
|
-
})
|
|
327
|
-
|
|
328
|
-
// 5. Facts 冲突
|
|
329
|
-
IF story_facts exists
|
|
330
|
-
// 调用 facts-checker 检测规则失败
|
|
331
|
-
failed_rules = check_facts_rules(story_facts)
|
|
332
|
-
IF failed_rules.length > 0
|
|
333
|
-
p0_issues.push({
|
|
334
|
-
type: "facts_conflict",
|
|
335
|
-
priority: 65,
|
|
336
|
-
command: "/facts check",
|
|
337
|
-
reason: `${failed_rules.length} 个事实规则失败`
|
|
338
|
-
})
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
**P0 选择规则**:
|
|
342
|
-
- 如果有 P0 问题 → 选择 priority 最高的作为主推荐
|
|
343
|
-
- P0 优先于 P1/P2
|
|
344
|
-
|
|
345
|
-
---
|
|
346
|
-
|
|
347
|
-
### Step 4: 扫描 P1 优先级(流程级 - 按创作流程推荐)
|
|
348
|
-
|
|
349
|
-
**仅在无 P0 问题时执行**
|
|
350
|
-
|
|
351
|
-
```javascript
|
|
352
|
-
IF p0_issues.length > 0
|
|
353
|
-
skip P1/P2 // P0 优先
|
|
354
|
-
ELSE
|
|
355
|
-
// P1 流程判断
|
|
356
|
-
|
|
357
|
-
// 1. 空白项目
|
|
358
|
-
IF NOT specification exists
|
|
359
|
-
primary_recommendation = {
|
|
360
|
-
command: "/specify",
|
|
361
|
-
reason: "创建故事规格书(定义核心设定)",
|
|
362
|
-
alternatives: []
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// 2. 规格草案
|
|
366
|
-
ELSE IF specification.status == "draft"
|
|
367
|
-
has_pending = specification.pending_items > 0
|
|
368
|
-
primary_recommendation = {
|
|
369
|
-
command: "/specify",
|
|
370
|
-
reason: "继续完善规格书",
|
|
371
|
-
alternatives: has_pending ? ["/clarify"] : []
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
// 3. 规格完成,无计划
|
|
375
|
-
ELSE IF specification.status == "completed" AND NOT creative_plan exists
|
|
376
|
-
primary_recommendation = {
|
|
377
|
-
command: "/plan",
|
|
378
|
-
reason: "制定创作计划",
|
|
379
|
-
alternatives: ["/character create", "/specify --world"]
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
// 4. 计划完成,无任务
|
|
383
|
-
ELSE IF creative_plan exists AND NOT tasks exists
|
|
384
|
-
primary_recommendation = {
|
|
385
|
-
command: "/tasks",
|
|
386
|
-
reason: "生成写作任务列表",
|
|
387
|
-
alternatives: ["/plan --detail vol-01", "/character list"]
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
// 5. 任务就绪,未开始写作
|
|
391
|
-
ELSE IF tasks.pending > 0 AND actual_chapters == 0
|
|
392
|
-
primary_recommendation = {
|
|
393
|
-
command: "/write 第1章",
|
|
394
|
-
reason: "开始写作第一章",
|
|
395
|
-
alternatives: ["/recap", "/character list"]
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
// 6. 写作中(检查离开时长)
|
|
399
|
-
ELSE IF tasks.pending > 0 AND actual_chapters > 0
|
|
400
|
-
time_away = calculate_time_away()
|
|
401
|
-
|
|
402
|
-
IF time_away > 1_day
|
|
403
|
-
primary_recommendation = {
|
|
404
|
-
command: "/recap --brief",
|
|
405
|
-
reason: `距上次写作已 ${time_away},建议先重建上下文`,
|
|
406
|
-
alternatives: ["/write 第[N+1]章"]
|
|
407
|
-
}
|
|
408
|
-
ELSE
|
|
409
|
-
next_chapter = actual_chapters + 1
|
|
410
|
-
primary_recommendation = {
|
|
411
|
-
command: `/write 第${next_chapter}章`,
|
|
412
|
-
reason: "继续写作",
|
|
413
|
-
alternatives: ["/recap --brief", "/facts check"]
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
// 7. 卷完成
|
|
417
|
-
ELSE IF is_volume_complete()
|
|
418
|
-
current_volume = get_current_volume()
|
|
419
|
-
primary_recommendation = {
|
|
420
|
-
command: `/analyze --range=vol-${current_volume}`,
|
|
421
|
-
reason: "分析本卷质量(推荐)",
|
|
422
|
-
alternatives: ["/checklist", `/plan --detail vol-${current_volume + 1}`]
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
// 8. 全书完成
|
|
426
|
-
ELSE IF tasks.pending == 0 AND tasks.completed > 0
|
|
427
|
-
primary_recommendation = {
|
|
428
|
-
command: "/checklist",
|
|
429
|
-
reason: "执行最终检查清单",
|
|
430
|
-
alternatives: ["/analyze"]
|
|
431
|
-
}
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
**辅助函数**:
|
|
435
|
-
|
|
436
|
-
```javascript
|
|
437
|
-
// 计算离开时长
|
|
438
|
-
function calculate_time_away() {
|
|
439
|
-
sources = [
|
|
440
|
-
write_checkpoint?.updatedAt,
|
|
441
|
-
last_chapter_file?.mtime,
|
|
442
|
-
tracking_log?.last_updated
|
|
443
|
-
]
|
|
444
|
-
|
|
445
|
-
last_activity = max(sources.filter(s => s != null))
|
|
446
|
-
return now - last_activity
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
// 判断是否卷完成
|
|
450
|
-
function is_volume_complete() {
|
|
451
|
-
IF NOT creative_plan.volumes exists
|
|
452
|
-
return false
|
|
453
|
-
|
|
454
|
-
current_vol = creative_plan.volumes.find(v => v.status == "in_progress")
|
|
455
|
-
IF NOT current_vol
|
|
456
|
-
return false
|
|
457
|
-
|
|
458
|
-
vol_chapters = current_vol.chapters.length
|
|
459
|
-
vol_completed = chapters.filter(c => c.volume == current_vol.number).length
|
|
460
|
-
|
|
461
|
-
return vol_completed >= vol_chapters
|
|
462
|
-
}
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
---
|
|
466
|
-
|
|
467
|
-
### Step 5: 扫描 P2 优先级(优化级 - 质量提升建议)
|
|
468
|
-
|
|
469
|
-
**仅在无 P0 问题时执行,结果作为健康提示折叠显示**
|
|
470
|
-
|
|
471
|
-
```javascript
|
|
472
|
-
p2_issues = []
|
|
473
|
-
|
|
474
|
-
// 1. 角色长期缺席
|
|
475
|
-
IF character_state exists
|
|
476
|
-
absent_threshold = (project_scale == "超长篇") ? 8 : 5
|
|
477
|
-
|
|
478
|
-
absent_characters = character_state.characters.filter(c => c.absent_chapters > absent_threshold)
|
|
479
|
-
|
|
480
|
-
FOR EACH char IN absent_characters
|
|
481
|
-
score = 0
|
|
482
|
-
IF project_scale == "长篇"
|
|
483
|
-
IF char.absent_chapters >= 5 AND char.absent_chapters <= 7
|
|
484
|
-
score = 30
|
|
485
|
-
ELSE IF char.absent_chapters >= 8 AND char.absent_chapters <= 10
|
|
486
|
-
score = 50
|
|
487
|
-
ELSE IF char.absent_chapters > 10
|
|
488
|
-
score = 70
|
|
489
|
-
ELSE // 超长篇
|
|
490
|
-
IF char.absent_chapters >= 8 AND char.absent_chapters <= 10
|
|
491
|
-
score = 30
|
|
492
|
-
ELSE IF char.absent_chapters >= 11 AND char.absent_chapters <= 15
|
|
493
|
-
score = 50
|
|
494
|
-
ELSE IF char.absent_chapters > 15
|
|
495
|
-
score = 70
|
|
496
|
-
|
|
497
|
-
p2_issues.push({
|
|
498
|
-
type: "character_absent",
|
|
499
|
-
score: score,
|
|
500
|
-
command: "/character list",
|
|
501
|
-
description: `角色「${char.name}」已 ${char.absent_chapters} 章未出场`
|
|
502
|
-
})
|
|
503
|
-
|
|
504
|
-
// 2. 伏笔中等紧急
|
|
505
|
-
IF plot_tracker exists
|
|
506
|
-
medium_plots = plot_tracker.plots.filter(p => p.urgency >= 0.5 AND p.urgency < 0.9)
|
|
507
|
-
|
|
508
|
-
FOR EACH plot IN medium_plots
|
|
509
|
-
score = 0
|
|
510
|
-
IF plot.urgency >= 0.5 AND plot.urgency < 0.6
|
|
511
|
-
score = 20
|
|
512
|
-
ELSE IF plot.urgency >= 0.7 AND plot.urgency < 0.8
|
|
513
|
-
score = 40
|
|
514
|
-
ELSE IF plot.urgency >= 0.8 AND plot.urgency < 0.9
|
|
515
|
-
score = 60
|
|
516
|
-
|
|
517
|
-
p2_issues.push({
|
|
518
|
-
type: "plot_medium",
|
|
519
|
-
score: score,
|
|
520
|
-
command: "/track --check",
|
|
521
|
-
description: `伏笔「${plot.name}」紧急度 ${plot.urgency}`
|
|
522
|
-
})
|
|
523
|
-
|
|
524
|
-
// 3. Tracking 轻微落后
|
|
525
|
-
IF tracking_lag >= 1 AND tracking_lag <= 2
|
|
526
|
-
score = tracking_lag == 1 ? 15 : 30
|
|
527
|
-
p2_issues.push({
|
|
528
|
-
type: "tracking_light",
|
|
529
|
-
score: score,
|
|
530
|
-
command: "/track --sync",
|
|
531
|
-
description: `Tracking 数据落后 ${tracking_lag} 章`
|
|
532
|
-
})
|
|
533
|
-
|
|
534
|
-
// 4. 风格偏移(如果有检测)
|
|
535
|
-
IF style_deviation exists AND style_deviation > threshold
|
|
536
|
-
p2_issues.push({
|
|
537
|
-
type: "style_deviation",
|
|
538
|
-
score: 25,
|
|
539
|
-
command: "/analyze --focus=style",
|
|
540
|
-
description: `检测到风格偏移`
|
|
541
|
-
})
|
|
542
|
-
|
|
543
|
-
// 5. 爽点间隔过长
|
|
544
|
-
recent_chapters = chapters.slice(-5)
|
|
545
|
-
IF recent_chapters.filter(c => c.has_climax == false).length == 5
|
|
546
|
-
p2_issues.push({
|
|
547
|
-
type: "climax_gap",
|
|
548
|
-
score: 35,
|
|
549
|
-
command: "/analyze --focus=hook",
|
|
550
|
-
description: `最近 5 章无高潮标记`
|
|
551
|
-
})
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
**健康提示显示规则**:
|
|
555
|
-
|
|
556
|
-
```javascript
|
|
557
|
-
// 按 score 降序排序
|
|
558
|
-
p2_issues.sort((a, b) => b.score - a.score)
|
|
559
|
-
|
|
560
|
-
// 显示控制
|
|
561
|
-
IF p2_issues.length == 0
|
|
562
|
-
→ 不显示健康提示区域
|
|
563
|
-
ELSE IF p2_issues.length == 1 AND p2_issues[0].score < 30
|
|
564
|
-
→ 不显示(不重要)
|
|
565
|
-
ELSE IF p2_issues.some(i => i.score > 60)
|
|
566
|
-
→ 默认展开显示
|
|
567
|
-
ELSE
|
|
568
|
-
→ 折叠显示,用户可点击展开
|
|
569
|
-
```
|
|
570
|
-
|
|
571
|
-
---
|
|
572
|
-
|
|
573
|
-
### Step 6: 选择备选操作
|
|
574
|
-
|
|
575
|
-
**仅在 P1 流程推荐时执行(P0 场景备选已在 Step 3 中定义)**
|
|
576
|
-
|
|
577
|
-
**动态备选规则**:
|
|
578
|
-
|
|
579
|
-
```javascript
|
|
580
|
-
alternatives = primary_recommendation.alternatives || []
|
|
581
|
-
|
|
582
|
-
// 规则 1: 离开时长 > 1 天 AND 主推荐是 /write
|
|
583
|
-
IF time_away > 1_day AND primary_recommendation.command.startsWith("/write")
|
|
584
|
-
IF NOT alternatives.includes("/recap --brief")
|
|
585
|
-
alternatives.unshift("/recap --brief") // 插入到第一位
|
|
586
|
-
|
|
587
|
-
// 规则 2: 检测到 P2 级别问题
|
|
588
|
-
IF p2_issues.length > 0
|
|
589
|
-
top_p2 = p2_issues[0] // score 最高的问题
|
|
590
|
-
IF top_p2.score > 40 AND NOT alternatives.includes(top_p2.command)
|
|
591
|
-
IF alternatives.length < 2
|
|
592
|
-
alternatives.push(top_p2.command)
|
|
593
|
-
|
|
594
|
-
// 规则 3: 主推荐是流程类命令
|
|
595
|
-
IF primary_recommendation.command IN ["/specify", "/plan", "/tasks"]
|
|
596
|
-
// 备选已在 P1 中定义,不再添加
|
|
597
|
-
|
|
598
|
-
// 限制备选数量为 2 个
|
|
599
|
-
alternatives = alternatives.slice(0, 2)
|
|
600
|
-
```
|
|
601
|
-
|
|
602
|
-
**备选操作的展示格式**:
|
|
603
|
-
|
|
604
|
-
```markdown
|
|
605
|
-
备选操作:
|
|
606
|
-
• [command] — [reason/context]
|
|
607
|
-
```
|
|
608
|
-
|
|
609
|
-
**不推荐的备选(避免噪音)**:
|
|
610
|
-
- ❌ 不把 `/guide` 作为备选(循环引用)
|
|
611
|
-
- ❌ 不把已完成阶段的命令作为备选
|
|
612
|
-
- ❌ 不把过于高级的分析作为备选(如刚开始写作就推荐 /analyze)
|
|
613
|
-
|
|
614
|
-
---
|
|
615
|
-
|
|
616
|
-
### Step 7: 输出推荐结果
|
|
617
|
-
|
|
618
|
-
**标准输出格式**:
|
|
619
|
-
|
|
620
|
-
```
|
|
621
|
-
📍 当前状态
|
|
622
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
623
|
-
📊 进度:第 [actual_chapters] 章 / 共 [planned_chapters] 章([progress_percent]%)
|
|
624
|
-
📚 当前卷:第 [current_volume] 卷 / 共 [total_volumes] 卷
|
|
625
|
-
⏰ 距上次写作:[time_away_display]
|
|
626
|
-
|
|
627
|
-
🎯 下一步推荐
|
|
628
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
629
|
-
▶️ [primary_command] — [primary_reason]
|
|
630
|
-
|
|
631
|
-
[如果有备选操作]
|
|
632
|
-
备选操作:
|
|
633
|
-
• [alt_1_command] — [alt_1_reason]
|
|
634
|
-
• [alt_2_command] — [alt_2_reason]
|
|
635
|
-
|
|
636
|
-
[如果有 P2 问题]
|
|
637
|
-
⚠️ 健康提示([p2_count] 个问题)[可展开]
|
|
638
|
-
• [p2_1_description]
|
|
639
|
-
• [p2_2_description]
|
|
640
|
-
• [p2_3_description]
|
|
641
|
-
```
|
|
642
|
-
|
|
643
|
-
**变量计算**:
|
|
644
|
-
|
|
645
|
-
```javascript
|
|
646
|
-
// 进度百分比
|
|
647
|
-
progress_percent = planned_chapters > 0
|
|
648
|
-
? Math.round((actual_chapters / planned_chapters) * 100)
|
|
649
|
-
: 0
|
|
650
|
-
|
|
651
|
-
// 时间显示
|
|
652
|
-
time_away_display = format_time(time_away)
|
|
653
|
-
// 如:< 1 小时、2 小时、1 天、3 天
|
|
654
|
-
|
|
655
|
-
// 当前卷
|
|
656
|
-
current_volume = get_current_volume_number()
|
|
657
|
-
total_volumes = creative_plan?.volumes?.length || "未知"
|
|
658
|
-
```
|
|
659
|
-
|
|
660
|
-
---
|
|
661
|
-
|
|
662
|
-
### 场景变体
|
|
663
|
-
|
|
664
|
-
#### 场景 1: 空白项目
|
|
665
|
-
|
|
666
|
-
**触发条件**: `NOT specification exists`
|
|
667
|
-
|
|
668
|
-
**输出模板**:
|
|
669
|
-
|
|
670
|
-
```
|
|
671
|
-
🚀 欢迎开始新故事!
|
|
672
|
-
|
|
673
|
-
🎯 下一步推荐
|
|
674
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
675
|
-
▶️ /specify [故事名] — 创建故事规格书
|
|
676
|
-
|
|
677
|
-
💡 完整流程:/specify → /plan → /tasks → /write
|
|
678
|
-
```
|
|
679
|
-
|
|
680
|
-
---
|
|
681
|
-
|
|
682
|
-
#### 场景 2: 卷末
|
|
683
|
-
|
|
684
|
-
**触发条件**: `is_volume_complete() == true`
|
|
685
|
-
|
|
686
|
-
**输出模板**:
|
|
687
|
-
|
|
688
|
-
```
|
|
689
|
-
🎉 第 [current_volume] 卷写作完成!
|
|
690
|
-
|
|
691
|
-
📊 本卷统计:[vol_chapters] 章,[vol_words] 字
|
|
692
|
-
|
|
693
|
-
🎯 下一步推荐
|
|
694
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
695
|
-
▶️ /analyze [故事名] --range=vol-[current_volume] — 分析本卷质量(推荐)
|
|
696
|
-
|
|
697
|
-
备选操作:
|
|
698
|
-
• /checklist — 执行卷末检查清单
|
|
699
|
-
• /plan --detail vol-[next_volume] — 规划下一卷
|
|
700
|
-
```
|
|
701
|
-
|
|
702
|
-
---
|
|
703
|
-
|
|
704
|
-
#### 场景 3: 超长篇新卷开始
|
|
705
|
-
|
|
706
|
-
**触发条件**: `project_scale == "超长篇" AND is_volume_start()`
|
|
707
|
-
|
|
708
|
-
**输出模板**:
|
|
709
|
-
|
|
710
|
-
```
|
|
711
|
-
📚 准备开始第 [next_volume] 卷
|
|
712
|
-
|
|
713
|
-
🎯 下一步推荐
|
|
714
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
715
|
-
▶️ /recap --full — 重建全局上下文(超长篇推荐)
|
|
716
|
-
|
|
717
|
-
备选操作:
|
|
718
|
-
• /plan --detail vol-[next_volume] — 查看本卷规划
|
|
719
|
-
• /character list — 确认角色状态
|
|
720
|
-
|
|
721
|
-
💡 超长篇提示:新卷开始前建议执行完整 recap
|
|
722
|
-
```
|
|
723
|
-
|
|
724
|
-
---
|
|
725
|
-
|
|
726
|
-
#### 场景 4: 分片模式建议
|
|
727
|
-
|
|
728
|
-
**触发条件**: `actual_chapters > 300 AND NOT is_sharded`
|
|
729
|
-
|
|
730
|
-
**输出模板**:
|
|
731
|
-
|
|
732
|
-
```
|
|
733
|
-
📍 当前状态
|
|
734
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
735
|
-
📊 进度:第 [actual_chapters] 章(超过 300 章)
|
|
736
|
-
|
|
737
|
-
💡 超长篇优化建议
|
|
738
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
739
|
-
检测到项目已超过 300 章,建议启用分片模式以提升性能:
|
|
740
|
-
|
|
741
|
-
/track --migrate
|
|
742
|
-
|
|
743
|
-
迁移后的优势:
|
|
744
|
-
• 按卷拆分 tracking 数据,降低单文件大小
|
|
745
|
-
• 命令支持 --volume 参数进行范围操作
|
|
746
|
-
• 可选启用 MCP 加速查询
|
|
747
|
-
|
|
748
|
-
🎯 下一步推荐
|
|
749
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
750
|
-
▶️ [primary_command] — [primary_reason]
|
|
751
|
-
```
|
|
752
|
-
|
|
753
|
-
---
|
|
754
|
-
|
|
755
|
-
#### 场景 5: P0 紧急情况
|
|
756
|
-
|
|
757
|
-
**触发条件**: `p0_issues.length > 0`
|
|
758
|
-
|
|
759
|
-
**输出模板**:
|
|
760
|
-
|
|
761
|
-
```
|
|
762
|
-
📍 当前状态
|
|
763
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
764
|
-
📊 进度:第 [actual_chapters] 章 / 共 [planned_chapters] 章([progress_percent]%)
|
|
765
|
-
|
|
766
|
-
🔴 检测到紧急问题(优先处理)
|
|
767
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
768
|
-
▶️ [p0_command] — [p0_reason]
|
|
769
|
-
|
|
770
|
-
备选操作:
|
|
771
|
-
• [p0_alternative] — [alt_reason]
|
|
772
|
-
|
|
773
|
-
💡 完成紧急修复后,可继续正常流程
|
|
774
|
-
```
|
|
775
|
-
|
|
776
|
-
---
|
|
777
|
-
|
|
778
|
-
## 边界情况处理
|
|
779
|
-
|
|
780
|
-
### 异常状态检测
|
|
781
|
-
|
|
782
|
-
```javascript
|
|
783
|
-
// 1. 文件不全(有 plan 但无 spec)
|
|
784
|
-
IF creative_plan exists AND NOT specification exists
|
|
785
|
-
→ P0 警告: {
|
|
786
|
-
command: "/specify",
|
|
787
|
-
reason: "检测到异常状态:有创作计划但无规格书,建议重新创建规格书"
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
// 2. 多个 P0 同时触发
|
|
791
|
-
IF p0_issues.length > 1
|
|
792
|
-
→ 选择 priority 最高的
|
|
793
|
-
→ 其他 P0 问题作为健康提示展示
|
|
794
|
-
|
|
795
|
-
// 3. 已写章节超过规划章节
|
|
796
|
-
IF actual_chapters > planned_chapters
|
|
797
|
-
→ 添加提示: "⚠️ 已超出计划章节数,建议更新 creative-plan.md"
|
|
798
|
-
|
|
799
|
-
// 4. creative-plan 存在但无卷数信息
|
|
800
|
-
IF creative_plan exists AND NOT creative_plan.volumes
|
|
801
|
-
→ 默认为长篇(>100章)
|
|
802
|
-
|
|
803
|
-
// 5. Tracking 文件损坏/格式错误
|
|
804
|
-
IF tracking_file exists BUT parse_error
|
|
805
|
-
→ P0 警告: {
|
|
806
|
-
command: "/track-init",
|
|
807
|
-
reason: "Tracking 文件格式错误,建议重新初始化"
|
|
808
|
-
}
|
|
809
|
-
```
|
|
810
|
-
|
|
811
|
-
### 容错规则
|
|
812
|
-
|
|
813
|
-
```javascript
|
|
814
|
-
// 文件读取失败
|
|
815
|
-
TRY
|
|
816
|
-
content = Read(file_path)
|
|
817
|
-
CATCH error
|
|
818
|
-
→ 跳过该检测项
|
|
819
|
-
→ 记录日志(仅内部,不展示给用户)
|
|
820
|
-
→ 继续其他检测
|
|
821
|
-
|
|
822
|
-
// JSON 解析失败
|
|
823
|
-
TRY
|
|
824
|
-
data = JSON.parse(content)
|
|
825
|
-
CATCH error
|
|
826
|
-
→ 降级为"文件存在性检测"
|
|
827
|
-
→ 不阻塞整体推荐
|
|
828
|
-
|
|
829
|
-
// 无法判断阶段
|
|
830
|
-
IF cannot_determine_stage
|
|
831
|
-
→ 默认推荐 P1 流程的第一步(/specify)
|
|
832
|
-
→ 添加提示: "💡 无法确定当前阶段,从头开始流程"
|
|
833
|
-
```
|
|
834
|
-
|
|
835
|
-
---
|
|
836
|
-
|
|
837
|
-
## 使用说明
|
|
838
|
-
|
|
839
|
-
### 命令调用
|
|
840
|
-
|
|
841
|
-
```bash
|
|
842
|
-
# 检查当前故事状态(自动检测故事目录)
|
|
843
|
-
/guide
|
|
844
|
-
|
|
845
|
-
# 指定故事目录
|
|
846
|
-
/guide my-story
|
|
847
|
-
```
|
|
848
|
-
|
|
849
|
-
### 优先级覆盖
|
|
850
|
-
|
|
851
|
-
如果用户明确知道要执行的操作,可以直接调用对应命令,无需通过 /guide 推荐。
|
|
852
|
-
|
|
853
|
-
### 健康提示展开
|
|
854
|
-
|
|
855
|
-
P2 健康提示默认折叠,用户可在需要时展开查看详情。
|
|
856
|
-
|
|
857
|
-
---
|
|
858
|
-
|
|
859
|
-
## 注意事项
|
|
860
|
-
|
|
861
|
-
### 性能优化
|
|
862
|
-
|
|
863
|
-
- 只读取文件头部(前 50 行)
|
|
864
|
-
- Tracking 文件只检测存在性,除非触发 P0
|
|
865
|
-
- 使用缓存避免重复读取
|
|
866
|
-
|
|
867
|
-
### 推荐原则
|
|
868
|
-
|
|
869
|
-
- P0 优先于一切
|
|
870
|
-
- P1 按流程推荐
|
|
871
|
-
- P2 仅作提示,不成为主推荐
|
|
872
|
-
|
|
873
|
-
### 扩展性
|
|
874
|
-
|
|
875
|
-
新增命令时,只需在对应优先级表中添加条目:
|
|
876
|
-
- P0:紧急异常场景
|
|
877
|
-
- P1:流程节点
|
|
878
|
-
- P2:质量提示
|
|
879
|
-
|
|
880
|
-
---
|
|
881
|
-
|
|
882
|
-
## 命令优先级参考表
|
|
883
|
-
|
|
884
|
-
| 命令 | P0 场景 | P1 场景 | P2 场景 |
|
|
885
|
-
|------|--------|---------|---------|
|
|
886
|
-
| /specify | 文件不全异常 | 空白项目、规格草案 | - |
|
|
887
|
-
| /clarify | - | 规格有待定项 | - |
|
|
888
|
-
| /plan | - | 规格完成 | - |
|
|
889
|
-
| /tasks | - | 计划完成 | - |
|
|
890
|
-
| /write | 写作断点恢复 | 任务就绪、写作中 | - |
|
|
891
|
-
| /recap | - | 离开>1天 | - |
|
|
892
|
-
| /analyze | - | 卷末 | - |
|
|
893
|
-
| /checklist | - | 全书完成 | - |
|
|
894
|
-
| /track | tracking 落后 >3/2章 | - | tracking 落后 1-2章 |
|
|
895
|
-
| /timeline | 时间线冲突 | - | - |
|
|
896
|
-
| /facts | facts 冲突 | - | - |
|
|
897
|
-
| /character | - | - | 角色缺席 >5/8章 |
|
|
898
|
-
| /revise | - | - | 风格偏移 |
|
|
899
|
-
|
|
900
|
-
---
|