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,395 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 世界观一致性检查脚本
|
|
3
|
-
|
|
4
|
-
set -e
|
|
5
|
-
|
|
6
|
-
# 加载通用函数
|
|
7
|
-
SCRIPT_DIR=$(dirname "$0")
|
|
8
|
-
source "$SCRIPT_DIR/common.sh"
|
|
9
|
-
|
|
10
|
-
# 获取当前故事目录
|
|
11
|
-
STORY_DIR=$(get_current_story)
|
|
12
|
-
|
|
13
|
-
if [ -z "$STORY_DIR" ]; then
|
|
14
|
-
echo "错误: 未找到故事项目" >&2
|
|
15
|
-
exit 1
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
# 检查模式
|
|
19
|
-
CHECKLIST_MODE=false
|
|
20
|
-
if [ "$1" = "--checklist" ]; then
|
|
21
|
-
CHECKLIST_MODE=true
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
# 文件路径
|
|
25
|
-
WORLD_SETTING="$STORY_DIR/resources/knowledge/world-setting.md"
|
|
26
|
-
LOCATIONS="$STORY_DIR/resources/knowledge/locations.md"
|
|
27
|
-
CULTURE="$STORY_DIR/resources/knowledge/culture.md"
|
|
28
|
-
RULES="$STORY_DIR/resources/knowledge/rules.md"
|
|
29
|
-
CONTENT_DIR="$STORY_DIR/content"
|
|
30
|
-
|
|
31
|
-
# ANSI颜色代码
|
|
32
|
-
RED='\033[0;31m'
|
|
33
|
-
GREEN='\033[0;32m'
|
|
34
|
-
YELLOW='\033[1;33m'
|
|
35
|
-
BLUE='\033[0;34m'
|
|
36
|
-
NC='\033[0m' # No Color
|
|
37
|
-
|
|
38
|
-
# 统计变量
|
|
39
|
-
TOTAL_CHECKS=0
|
|
40
|
-
PASSED_CHECKS=0
|
|
41
|
-
WARNINGS=0
|
|
42
|
-
ERRORS=0
|
|
43
|
-
ISSUES=()
|
|
44
|
-
|
|
45
|
-
# 检查函数
|
|
46
|
-
check() {
|
|
47
|
-
local name="$1"
|
|
48
|
-
local condition="$2"
|
|
49
|
-
local error_msg="$3"
|
|
50
|
-
|
|
51
|
-
((TOTAL_CHECKS++))
|
|
52
|
-
|
|
53
|
-
if eval "$condition"; then
|
|
54
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
55
|
-
echo -e "${GREEN}✓${NC} $name"
|
|
56
|
-
fi
|
|
57
|
-
((PASSED_CHECKS++))
|
|
58
|
-
else
|
|
59
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
60
|
-
echo -e "${RED}✗${NC} $name: $error_msg"
|
|
61
|
-
fi
|
|
62
|
-
((ERRORS++))
|
|
63
|
-
ISSUES+=("$name|$error_msg")
|
|
64
|
-
fi
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
warn() {
|
|
68
|
-
local msg="$1"
|
|
69
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
70
|
-
echo -e "${YELLOW}⚠${NC} 警告: $msg"
|
|
71
|
-
fi
|
|
72
|
-
((WARNINGS++))
|
|
73
|
-
ISSUES+=("警告|$msg")
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
# 检查设定文件完整性
|
|
77
|
-
check_setting_files() {
|
|
78
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
79
|
-
echo "📁 检查设定文件完整性"
|
|
80
|
-
echo "─────────────────────"
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
|
-
check "world-setting.md" "[ -f '$WORLD_SETTING' ]" "核心世界观文件不存在"
|
|
84
|
-
check "locations.md" "[ -f '$LOCATIONS' ]" "地点描述文件不存在"
|
|
85
|
-
check "culture.md" "[ -f '$CULTURE' ]" "文化风俗文件不存在"
|
|
86
|
-
check "rules.md" "[ -f '$RULES' ]" "特殊规则文件不存在"
|
|
87
|
-
|
|
88
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
89
|
-
echo ""
|
|
90
|
-
fi
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
# 检查术语一致性
|
|
94
|
-
check_terminology() {
|
|
95
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
96
|
-
echo "📝 检查术语一致性"
|
|
97
|
-
echo "────────────────"
|
|
98
|
-
fi
|
|
99
|
-
|
|
100
|
-
if [ -d "$CONTENT_DIR" ]; then
|
|
101
|
-
# 提取世界观文档中的专有名词(简化版,实际应该更复杂)
|
|
102
|
-
local term_count=0
|
|
103
|
-
|
|
104
|
-
if [ -f "$WORLD_SETTING" ]; then
|
|
105
|
-
# 统计专有名词(这里简化为统计加粗或特殊标记的词)
|
|
106
|
-
term_count=$(grep -o '\*\*[^*]*\*\*' "$WORLD_SETTING" 2>/dev/null | wc -l || echo 0)
|
|
107
|
-
fi
|
|
108
|
-
|
|
109
|
-
check "专有名词定义" "[ $term_count -gt 0 ]" "未找到专有名词定义"
|
|
110
|
-
|
|
111
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
112
|
-
echo " 📊 专有名词数量: $term_count"
|
|
113
|
-
fi
|
|
114
|
-
else
|
|
115
|
-
warn "内容目录不存在,跳过术语检查"
|
|
116
|
-
fi
|
|
117
|
-
|
|
118
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
119
|
-
echo ""
|
|
120
|
-
fi
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
# 检查地理逻辑
|
|
124
|
-
check_geography() {
|
|
125
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
126
|
-
echo "🗺️ 检查地理逻辑"
|
|
127
|
-
echo "───────────────"
|
|
128
|
-
fi
|
|
129
|
-
|
|
130
|
-
if [ -f "$LOCATIONS" ]; then
|
|
131
|
-
# 统计定义的地点数
|
|
132
|
-
local location_count=$(grep -c '^##' "$LOCATIONS" 2>/dev/null || echo 0)
|
|
133
|
-
|
|
134
|
-
check "地点定义完整性" "[ $location_count -gt 0 ]" "未定义任何地点"
|
|
135
|
-
|
|
136
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
137
|
-
echo " 📊 已定义地点: ${location_count}个"
|
|
138
|
-
fi
|
|
139
|
-
|
|
140
|
-
# 检查内容中提到的地点是否在定义中
|
|
141
|
-
if [ -d "$CONTENT_DIR" ]; then
|
|
142
|
-
# 这里简化处理,实际应该用更复杂的匹配逻辑
|
|
143
|
-
local undefined_locations=0
|
|
144
|
-
|
|
145
|
-
# TODO: 实现更智能的地点匹配逻辑
|
|
146
|
-
# 目前只做基本的文件检查
|
|
147
|
-
|
|
148
|
-
check "地点引用检查" "[ $undefined_locations -eq 0 ]" "发现未定义的地点引用"
|
|
149
|
-
fi
|
|
150
|
-
else
|
|
151
|
-
warn "地点描述文件不存在"
|
|
152
|
-
fi
|
|
153
|
-
|
|
154
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
155
|
-
echo ""
|
|
156
|
-
fi
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
# 检查文化一致性
|
|
160
|
-
check_culture() {
|
|
161
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
162
|
-
echo "🎭 检查文化一致性"
|
|
163
|
-
echo "────────────────"
|
|
164
|
-
fi
|
|
165
|
-
|
|
166
|
-
if [ -f "$CULTURE" ]; then
|
|
167
|
-
# 统计文化要素
|
|
168
|
-
local culture_count=$(grep -c '^##' "$CULTURE" 2>/dev/null || echo 0)
|
|
169
|
-
|
|
170
|
-
check "文化要素定义" "[ $culture_count -gt 0 ]" "未定义文化要素"
|
|
171
|
-
|
|
172
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
173
|
-
echo " 📊 文化要素: ${culture_count}个"
|
|
174
|
-
fi
|
|
175
|
-
else
|
|
176
|
-
warn "文化风俗文件不存在"
|
|
177
|
-
fi
|
|
178
|
-
|
|
179
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
180
|
-
echo ""
|
|
181
|
-
fi
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
# 检查规则一致性
|
|
185
|
-
check_rules() {
|
|
186
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
187
|
-
echo "⚖️ 检查规则一致性"
|
|
188
|
-
echo "───────────────"
|
|
189
|
-
fi
|
|
190
|
-
|
|
191
|
-
if [ -f "$RULES" ]; then
|
|
192
|
-
# 统计特殊规则
|
|
193
|
-
local rule_count=$(grep -c '^##' "$RULES" 2>/dev/null || echo 0)
|
|
194
|
-
|
|
195
|
-
check "特殊规则定义" "[ $rule_count -gt 0 ]" "未定义特殊规则"
|
|
196
|
-
|
|
197
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
198
|
-
echo " 📊 特殊规则: ${rule_count}条"
|
|
199
|
-
fi
|
|
200
|
-
else
|
|
201
|
-
warn "特殊规则文件不存在"
|
|
202
|
-
fi
|
|
203
|
-
|
|
204
|
-
if [ "$CHECKLIST_MODE" = false ]; then
|
|
205
|
-
echo ""
|
|
206
|
-
fi
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
# 生成普通报告
|
|
210
|
-
generate_report() {
|
|
211
|
-
echo "═══════════════════════════════════════"
|
|
212
|
-
echo "🌍 世界观一致性检查报告"
|
|
213
|
-
echo "═══════════════════════════════════════"
|
|
214
|
-
echo ""
|
|
215
|
-
|
|
216
|
-
check_setting_files
|
|
217
|
-
check_terminology
|
|
218
|
-
check_geography
|
|
219
|
-
check_culture
|
|
220
|
-
check_rules
|
|
221
|
-
|
|
222
|
-
echo "═══════════════════════════════════════"
|
|
223
|
-
echo "📈 检查结果汇总"
|
|
224
|
-
echo "───────────────────"
|
|
225
|
-
echo " 总检查项: ${TOTAL_CHECKS}"
|
|
226
|
-
echo -e " ${GREEN}通过: ${PASSED_CHECKS}${NC}"
|
|
227
|
-
echo -e " ${YELLOW}警告: ${WARNINGS}${NC}"
|
|
228
|
-
echo -e " ${RED}错误: ${ERRORS}${NC}"
|
|
229
|
-
|
|
230
|
-
if [ "$ERRORS" -eq 0 ] && [ "$WARNINGS" -eq 0 ]; then
|
|
231
|
-
echo ""
|
|
232
|
-
echo -e "${GREEN}✅ 完美!所有检查项全部通过${NC}"
|
|
233
|
-
elif [ "$ERRORS" -eq 0 ]; then
|
|
234
|
-
echo ""
|
|
235
|
-
echo -e "${YELLOW}⚠️ 存在${WARNINGS}个警告,建议关注${NC}"
|
|
236
|
-
else
|
|
237
|
-
echo ""
|
|
238
|
-
echo -e "${RED}❌ 发现${ERRORS}个错误,需要修正${NC}"
|
|
239
|
-
fi
|
|
240
|
-
|
|
241
|
-
echo "═══════════════════════════════════════"
|
|
242
|
-
echo ""
|
|
243
|
-
echo "检查时间: $(date '+%Y-%m-%d %H:%M:%S')"
|
|
244
|
-
echo ""
|
|
245
|
-
echo "💡 建议:"
|
|
246
|
-
echo " - 定期更新世界观设定文档"
|
|
247
|
-
echo " - 创建术语表以保持一致性"
|
|
248
|
-
echo " - 记录地点间的距离和方位关系"
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
# 生成 checklist 格式输出
|
|
252
|
-
output_checklist() {
|
|
253
|
-
# 重新执行检查逻辑收集数据
|
|
254
|
-
TOTAL_CHECKS=0
|
|
255
|
-
PASSED_CHECKS=0
|
|
256
|
-
ERRORS=0
|
|
257
|
-
WARNINGS=0
|
|
258
|
-
ISSUES=()
|
|
259
|
-
|
|
260
|
-
check_setting_files
|
|
261
|
-
check_terminology
|
|
262
|
-
check_geography
|
|
263
|
-
check_culture
|
|
264
|
-
check_rules
|
|
265
|
-
|
|
266
|
-
# 输出 checklist 格式
|
|
267
|
-
cat <<EOF
|
|
268
|
-
# 世界观一致性检查 Checklist
|
|
269
|
-
|
|
270
|
-
**检查时间**: $(date '+%Y-%m-%d %H:%M:%S')
|
|
271
|
-
**检查对象**: resources/knowledge/ 目录及已写章节内容
|
|
272
|
-
**检查范围**: 世界观设定、地理逻辑、文化风俗、特殊规则
|
|
273
|
-
|
|
274
|
-
---
|
|
275
|
-
|
|
276
|
-
## 设定文件完整性
|
|
277
|
-
|
|
278
|
-
- [$([ -f "$WORLD_SETTING" ] && echo "x" || echo " ")] CHK001 world-setting.md 存在
|
|
279
|
-
- [$([ -f "$LOCATIONS" ] && echo "x" || echo " ")] CHK002 locations.md 存在
|
|
280
|
-
- [$([ -f "$CULTURE" ] && echo "x" || echo " ")] CHK003 culture.md 存在
|
|
281
|
-
- [$([ -f "$RULES" ] && echo "x" || echo " ")] CHK004 rules.md 存在
|
|
282
|
-
|
|
283
|
-
## 术语一致性
|
|
284
|
-
|
|
285
|
-
- [$([ -d "$CONTENT_DIR" ] && echo "x" || echo " ")] CHK005 专有名词定义完整
|
|
286
|
-
- [ ] CHK006 章节中的术语与设定文档一致(需人工核查)
|
|
287
|
-
|
|
288
|
-
## 地理逻辑
|
|
289
|
-
|
|
290
|
-
EOF
|
|
291
|
-
|
|
292
|
-
if [ -f "$LOCATIONS" ]; then
|
|
293
|
-
local location_count=$(grep -c '^##' "$LOCATIONS" 2>/dev/null || echo 0)
|
|
294
|
-
echo "- [x] CHK007 地点定义完整(已定义 ${location_count} 个地点)"
|
|
295
|
-
else
|
|
296
|
-
echo "- [ ] CHK007 地点定义完整"
|
|
297
|
-
fi
|
|
298
|
-
|
|
299
|
-
cat <<EOF
|
|
300
|
-
- [ ] CHK008 地点间距离和方位合理(需人工核查)
|
|
301
|
-
- [ ] CHK009 章节中的地理描述与设定一致(需人工核查)
|
|
302
|
-
|
|
303
|
-
## 文化一致性
|
|
304
|
-
|
|
305
|
-
EOF
|
|
306
|
-
|
|
307
|
-
if [ -f "$CULTURE" ]; then
|
|
308
|
-
local culture_count=$(grep -c '^##' "$CULTURE" 2>/dev/null || echo 0)
|
|
309
|
-
echo "- [x] CHK010 文化要素定义完整(已定义 ${culture_count} 个要素)"
|
|
310
|
-
else
|
|
311
|
-
echo "- [ ] CHK010 文化要素定义完整"
|
|
312
|
-
fi
|
|
313
|
-
|
|
314
|
-
cat <<EOF
|
|
315
|
-
- [ ] CHK011 风俗描述前后一致(需人工核查)
|
|
316
|
-
- [ ] CHK012 语言和称谓使用统一(需人工核查)
|
|
317
|
-
|
|
318
|
-
## 规则一致性
|
|
319
|
-
|
|
320
|
-
EOF
|
|
321
|
-
|
|
322
|
-
if [ -f "$RULES" ]; then
|
|
323
|
-
local rule_count=$(grep -c '^##' "$RULES" 2>/dev/null || echo 0)
|
|
324
|
-
echo "- [x] CHK013 特殊规则定义完整(已定义 ${rule_count} 条规则)"
|
|
325
|
-
else
|
|
326
|
-
echo "- [ ] CHK013 特殊规则定义完整"
|
|
327
|
-
fi
|
|
328
|
-
|
|
329
|
-
cat <<EOF
|
|
330
|
-
- [ ] CHK014 规则应用前后一致(需人工核查)
|
|
331
|
-
- [ ] CHK015 规则未出现相互矛盾(需人工核查)
|
|
332
|
-
|
|
333
|
-
---
|
|
334
|
-
|
|
335
|
-
## 发现的问题
|
|
336
|
-
|
|
337
|
-
EOF
|
|
338
|
-
|
|
339
|
-
if [ ${#ISSUES[@]} -gt 0 ]; then
|
|
340
|
-
for issue in "${ISSUES[@]}"; do
|
|
341
|
-
IFS='|' read -r name msg <<< "$issue"
|
|
342
|
-
echo "### $name"
|
|
343
|
-
echo ""
|
|
344
|
-
echo "**问题**: $msg"
|
|
345
|
-
echo ""
|
|
346
|
-
done
|
|
347
|
-
else
|
|
348
|
-
echo "*未发现问题*"
|
|
349
|
-
fi
|
|
350
|
-
|
|
351
|
-
cat <<EOF
|
|
352
|
-
|
|
353
|
-
---
|
|
354
|
-
|
|
355
|
-
## 检查统计
|
|
356
|
-
|
|
357
|
-
- **总检查项**: ${TOTAL_CHECKS}
|
|
358
|
-
- **已通过**: ${PASSED_CHECKS}
|
|
359
|
-
- **需改进**: ${ERRORS}
|
|
360
|
-
- **警告**: ${WARNINGS}
|
|
361
|
-
|
|
362
|
-
---
|
|
363
|
-
|
|
364
|
-
## 后续行动
|
|
365
|
-
|
|
366
|
-
- [ ] 补充缺失的设定文档
|
|
367
|
-
- [ ] 创建术语表记录专有名词
|
|
368
|
-
- [ ] 人工核查章节中的世界观描述
|
|
369
|
-
- [ ] 记录地点间的距离和旅行时间
|
|
370
|
-
|
|
371
|
-
---
|
|
372
|
-
|
|
373
|
-
**检查工具**: check-world.sh
|
|
374
|
-
**版本**: 1.0
|
|
375
|
-
EOF
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
# 主函数
|
|
379
|
-
main() {
|
|
380
|
-
if [ "$CHECKLIST_MODE" = true ]; then
|
|
381
|
-
output_checklist
|
|
382
|
-
else
|
|
383
|
-
generate_report
|
|
384
|
-
fi
|
|
385
|
-
|
|
386
|
-
# 根据结果返回适当的退出码
|
|
387
|
-
if [ "$ERRORS" -gt 0 ]; then
|
|
388
|
-
exit 1
|
|
389
|
-
else
|
|
390
|
-
exit 0
|
|
391
|
-
fi
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
# 执行主函数
|
|
395
|
-
main
|