@cloud411716/fancy-webnovel 1.0.46 → 3.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/client.js +369 -0
- package/cordis.patch.yml +4 -13
- package/docs/douyin-plugin.md +118 -0
- package/docs/material-library/README.md +404 -0
- package/docs/material-library/import.js +437 -0
- package/docs/material-library/prompt.md +370 -0
- package/docs/material-library/queries.surql +94 -0
- package/docs/material-library/sample.jsonl +14 -0
- package/docs/material-library/schema.surql +46 -0
- package/docs/mcp-profile.example.yml +24 -0
- package/docs/story-graph-design.md +602 -0
- package/docs/story-graph-validation.md +81 -0
- package/docs/workspace-mcp.md +284 -0
- package/index.js +26 -38
- package/lib/atomic-write.js +109 -0
- package/lib/chapter-order.js +100 -0
- package/lib/chinese-num.js +111 -0
- package/lib/confirmation.js +80 -0
- package/lib/db-init.js +123 -0
- package/lib/deployed-state.js +141 -0
- package/lib/direction-labels.js +265 -0
- package/lib/error-codes.js +104 -0
- package/lib/infra.js +594 -0
- package/lib/llm-wiki.js +109 -0
- package/lib/material-db.js +149 -0
- package/lib/path-guard.js +150 -0
- package/lib/projects.js +400 -0
- package/lib/scraper-utils.js +305 -0
- package/lib/surreal-server.js +338 -0
- package/lib/topic-decision.js +860 -0
- package/lib/topic-fields.js +251 -0
- package/lib/topic-schema.js +225 -0
- package/lib/workspace.js +501 -0
- package/package.json +62 -5
- package/plugins/fancy-analyze/analyze-definitions.md +519 -0
- package/plugins/fancy-analyze/command-input.js +65 -0
- package/plugins/fancy-analyze/index.js +2024 -0
- package/plugins/fancy-analyze/ingest-coverage.js +107 -0
- package/plugins/fancy-analyze/schema-analyze.md +627 -0
- package/plugins/fancy-analyze/schema-write.md +178 -0
- package/plugins/fancy-analyze/scripts/append-summary-chapter.js +612 -0
- package/plugins/fancy-analyze/scripts/split_source.js +292 -0
- package/plugins/fancy-analyze/summary-progress.js +495 -0
- package/plugins/fancy-analyze/templates.js +1179 -0
- package/plugins/fancy-bootstrap/index.js +313 -0
- package/plugins/fancy-bootstrap/scripts/init.js +177 -0
- package/plugins/fancy-bootstrap/scripts/path-utils.js +21 -0
- package/plugins/fancy-bootstrap/templates.js +71 -0
- package/plugins/fancy-db/index.js +172 -0
- package/plugins/fancy-douyin/deploy.js +134 -0
- package/plugins/fancy-douyin/index.js +551 -0
- package/plugins/fancy-douyin/prompts/01-analysis-prompt.md +84 -0
- package/plugins/fancy-douyin/scripts/crawl-note.cjs +194 -0
- package/plugins/fancy-douyin/scripts/lib.cjs +197 -0
- package/plugins/fancy-douyin/scripts/scan-account.cjs +128 -0
- package/plugins/fancy-douyin/scripts/start-chrome.cjs +203 -0
- package/plugins/fancy-douyin/state.js +197 -0
- package/plugins/fancy-douyin/templates.js +127 -0
- package/plugins/fancy-export/exporter.js +805 -0
- package/plugins/fancy-export/index.js +63 -0
- package/plugins/fancy-import/import-core.js +1118 -0
- package/plugins/fancy-import/import-driver.js +604 -0
- package/plugins/fancy-import/index.js +738 -0
- package/plugins/fancy-import/prompts/01-import-prompt.md +131 -0
- package/plugins/fancy-import/templates.js +58 -0
- package/plugins/fancy-material/exporter.js +153 -0
- package/plugins/fancy-material/genres.js +256 -0
- package/plugins/fancy-material/index.js +835 -0
- package/plugins/fancy-material/inventory.js +143 -0
- package/plugins/fancy-material/kinds.js +313 -0
- package/plugins/fancy-material/queue.js +55 -0
- package/plugins/fancy-material/scripts/query.js +254 -0
- package/plugins/fancy-material/templates.js +258 -0
- package/plugins/fancy-material/tool-deploy.js +138 -0
- package/plugins/fancy-material/validate.js +149 -0
- package/plugins/fancy-project/index.js +133 -0
- package/plugins/fancy-scan/existing-block.js +100 -0
- package/plugins/fancy-scan/index.js +708 -0
- package/plugins/fancy-scan/prompts/01-analysis-prompt.md +302 -0
- package/plugins/fancy-scan/scripts/append-block.js +725 -0
- package/plugins/fancy-scan/scripts/report-validate.js +824 -0
- package/plugins/fancy-scan/scripts/run-scan.js +667 -0
- package/plugins/fancy-scan/scripts/scrapers/fanqie-rank-scraper.js +923 -0
- package/plugins/fancy-scan/scripts/scrapers/jjwxc-rank-scraper.js +469 -0
- package/plugins/fancy-scan/scripts/scrapers/qimao-rank-scraper.js +629 -0
- package/plugins/fancy-scan/templates/blocks.js +155 -0
- package/plugins/fancy-scan/templates/platforms.js +372 -0
- package/plugins/fancy-scan/templates/report-schema.js +90 -0
- package/plugins/fancy-scan/templates.js +694 -0
- package/plugins/fancy-scan/tool-deploy.js +335 -0
- package/plugins/fancy-scan/wait-turn.js +46 -0
- package/plugins/fancy-story-builder/db/README.md +106 -0
- package/plugins/fancy-story-builder/db/client.js +228 -0
- package/plugins/fancy-story-builder/db/commands.js +145 -0
- package/plugins/fancy-story-builder/db/ids.js +39 -0
- package/plugins/fancy-story-builder/db/import.js +798 -0
- package/plugins/fancy-story-builder/db/project.js +299 -0
- package/plugins/fancy-story-builder/db/query.js +361 -0
- package/plugins/fancy-story-builder/db/schema.js +417 -0
- package/plugins/fancy-story-builder/db/stage-sync.js +238 -0
- package/plugins/fancy-story-builder/deploy-manifest.js +239 -0
- package/plugins/fancy-story-builder/deslop-driver.js +821 -0
- package/plugins/fancy-story-builder/flesh-output.js +168 -0
- package/plugins/fancy-story-builder/index.js +6861 -0
- package/plugins/fancy-story-builder/patch-driver.js +390 -0
- package/plugins/fancy-story-builder/prompts/01-skeleton-prompt.md +563 -0
- package/plugins/fancy-story-builder/prompts/02-flesh-prompt.md +602 -0
- package/plugins/fancy-story-builder/prompts/03-rhythm-prompt.md +539 -0
- package/plugins/fancy-story-builder/prompts/04-writing-prompt.md +225 -0
- package/plugins/fancy-story-builder/prompts/05-deslop-prompt.md +96 -0
- package/plugins/fancy-story-builder/purpose-template.md +83 -0
- package/plugins/fancy-story-builder/references/formulas-rhythm.json +302 -0
- package/plugins/fancy-story-builder/references/formulas-skeleton.json +402 -0
- package/plugins/fancy-story-builder/references/genre-profiles.json +3514 -0
- package/plugins/fancy-story-builder/references/glossary.md +594 -0
- package/plugins/fancy-story-builder/references/index.md +581 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/00-index.md +174 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/01-scene.md +150 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/02-chapter-workflow.md +99 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/03-opening-chapter.md +104 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/04-dialogue-mastery.md +274 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/05-genre-formulas.md +432 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/06-tone-ensemble.md +259 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/07-ledger-audit.md +222 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/08-diagnosis-revision.md +205 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/09-reading-power.md +135 -0
- package/plugins/fancy-story-builder/references//345/206/231/344/275/234/346/214/207/345/257/274/10-deslop.md +129 -0
- package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/00-index.md +98 -0
- package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/01-upgrade-rhythm.md +300 -0
- package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/02-arc-rhythm.md +168 -0
- package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/03-highpoint-hooks.md +189 -0
- package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/04-satisfaction.md +226 -0
- package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/05-foreshadow-density.md +195 -0
- package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/06-chapter-outline.md +226 -0
- package/plugins/fancy-story-builder/references//350/212/202/345/245/217/346/214/207/345/257/274/07-audit.md +181 -0
- package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/00-index.md +100 -0
- package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/01-character.md +243 -0
- package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/02-worldbuilding.md +245 -0
- package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/03-relations.md +185 -0
- package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/04-emotion-methods.md +286 -0
- package/plugins/fancy-story-builder/references//350/241/200/350/202/211/346/214/207/345/257/274/05-audit.md +187 -0
- package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/00-index.md +91 -0
- package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/01-positioning.md +209 -0
- package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/02-packaging.md +135 -0
- package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/03-entities.md +305 -0
- package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/04-conflict.md +328 -0
- package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/05-quota.md +187 -0
- package/plugins/fancy-story-builder/references//351/252/250/346/236/266/346/214/207/345/257/274/06-audit.md +160 -0
- package/plugins/fancy-story-builder/rhythm-output.js +140 -0
- package/plugins/fancy-story-builder/schema-setting.json +1100 -0
- package/plugins/fancy-story-builder/schema-setting.md +232 -0
- package/plugins/fancy-story-builder/scripts/ai-patterns.js +619 -0
- package/plugins/fancy-story-builder/scripts/brief-validate.js +164 -0
- package/plugins/fancy-story-builder/scripts/check-guide-compliance.js +289 -0
- package/plugins/fancy-story-builder/scripts/content-quality.js +416 -0
- package/plugins/fancy-story-builder/scripts/deslop-validate.js +143 -0
- package/plugins/fancy-story-builder/scripts/error-classes.js +112 -0
- package/plugins/fancy-story-builder/scripts/flesh-validate.js +1312 -0
- package/plugins/fancy-story-builder/scripts/formula-engine.js +112 -0
- package/plugins/fancy-story-builder/scripts/graph-utils.js +1484 -0
- package/plugins/fancy-story-builder/scripts/label-coverage.js +171 -0
- package/plugins/fancy-story-builder/scripts/prompt-drift-check.js +441 -0
- package/plugins/fancy-story-builder/scripts/reading-power.js +298 -0
- package/plugins/fancy-story-builder/scripts/reference-log.js +110 -0
- package/plugins/fancy-story-builder/scripts/rhythm-validate.js +1312 -0
- package/plugins/fancy-story-builder/scripts/schema-pages.js +2668 -0
- package/plugins/fancy-story-builder/scripts/semantic-lint.js +381 -0
- package/plugins/fancy-story-builder/scripts/skeleton-quota.js +145 -0
- package/plugins/fancy-story-builder/scripts/skeleton-validate.js +1973 -0
- package/plugins/fancy-story-builder/scripts/stage-batches.js +1405 -0
- package/plugins/fancy-story-builder/scripts/stage-contract.js +429 -0
- package/plugins/fancy-story-builder/scripts/story-artifacts.js +933 -0
- package/plugins/fancy-story-builder/scripts/upstream-query.js +198 -0
- package/plugins/fancy-story-builder/scripts/v2/baseline.js +112 -0
- package/plugins/fancy-story-builder/scripts/v2/cast.js +517 -0
- package/plugins/fancy-story-builder/scripts/v2/context.js +434 -0
- package/plugins/fancy-story-builder/scripts/v2/contracts.js +493 -0
- package/plugins/fancy-story-builder/scripts/v2/core.js +419 -0
- package/plugins/fancy-story-builder/scripts/v2/engine.js +1068 -0
- package/plugins/fancy-story-builder/scripts/v2/export-markdown.js +794 -0
- package/plugins/fancy-story-builder/scripts/v2/genre.js +195 -0
- package/plugins/fancy-story-builder/scripts/v2/knowledge.js +321 -0
- package/plugins/fancy-story-builder/scripts/v2/macro.js +409 -0
- package/plugins/fancy-story-builder/scripts/v2/manifest.js +538 -0
- package/plugins/fancy-story-builder/scripts/v2/migrate.js +137 -0
- package/plugins/fancy-story-builder/scripts/v2/prompts.js +1335 -0
- package/plugins/fancy-story-builder/scripts/v2/rhythm.js +618 -0
- package/plugins/fancy-story-builder/scripts/v2/scale.js +843 -0
- package/plugins/fancy-story-builder/scripts/v2/snapshot.js +121 -0
- package/plugins/fancy-story-builder/scripts/v2/stages.js +273 -0
- package/plugins/fancy-story-builder/scripts/v2/writing.js +216 -0
- package/plugins/fancy-story-builder/scripts/writing-rules.js +167 -0
- package/plugins/fancy-story-builder/scripts/writing-validate.js +682 -0
- package/plugins/fancy-story-builder/skeleton-output.js +199 -0
- package/plugins/fancy-story-builder/stage-driver.js +1049 -0
- package/plugins/fancy-story-builder/storydb/README.md +271 -0
- package/plugins/fancy-story-builder/storydb/cli.js +458 -0
- package/plugins/fancy-story-builder/storydb/client.js +351 -0
- package/plugins/fancy-story-builder/storydb/compile.js +452 -0
- package/plugins/fancy-story-builder/storydb/context.js +288 -0
- package/plugins/fancy-story-builder/storydb/definitions.js +699 -0
- package/plugins/fancy-story-builder/storydb/driver.js +106 -0
- package/plugins/fancy-story-builder/storydb/dsh-tools.js +313 -0
- package/plugins/fancy-story-builder/storydb/export.js +175 -0
- package/plugins/fancy-story-builder/storydb/ids.js +31 -0
- package/plugins/fancy-story-builder/storydb/impact.js +170 -0
- package/plugins/fancy-story-builder/storydb/import.js +559 -0
- package/plugins/fancy-story-builder/storydb/mcp.js +99 -0
- package/plugins/fancy-story-builder/storydb/prompts.js +952 -0
- package/plugins/fancy-story-builder/storydb/stage-command.js +379 -0
- package/plugins/fancy-story-builder/storydb/stage.js +426 -0
- package/plugins/fancy-story-builder/storydb/store.js +891 -0
- package/plugins/fancy-story-builder/storydb/tools.js +592 -0
- package/plugins/fancy-story-builder/storydb/validation.js +183 -0
- package/plugins/fancy-story-builder/templates/v2/10-scale/scale-template.json +144 -0
- package/plugins/fancy-story-builder/templates/v2/20-macro/emotion-template.json +15 -0
- package/plugins/fancy-story-builder/templates/v2/20-macro/endings-template.json +16 -0
- package/plugins/fancy-story-builder/templates/v2/20-macro/lines-template.json +28 -0
- package/plugins/fancy-story-builder/templates/v2/20-macro/roles-template.json +10 -0
- package/plugins/fancy-story-builder/templates/v2/20-macro/story-template.json +19 -0
- package/plugins/fancy-story-builder/templates/v2/20-macro/volumes-template.json +24 -0
- package/plugins/fancy-story-builder/templates/v2/20-macro/world-template.json +24 -0
- package/plugins/fancy-story-builder/templates/v2/30-cast/characters-template.json +49 -0
- package/plugins/fancy-story-builder/templates/v2/30-cast/climaxes-template.json +14 -0
- package/plugins/fancy-story-builder/templates/v2/30-cast/conflicts-template.json +30 -0
- package/plugins/fancy-story-builder/templates/v2/30-cast/factions-template.json +18 -0
- package/plugins/fancy-story-builder/templates/v2/30-cast/foreshadows-template.json +29 -0
- package/plugins/fancy-story-builder/templates/v2/30-cast/information-template.json +29 -0
- package/plugins/fancy-story-builder/templates/v2/30-cast/items-template.json +13 -0
- package/plugins/fancy-story-builder/templates/v2/30-cast/locations-template.json +12 -0
- package/plugins/fancy-story-builder/templates/v2/30-cast/payoffs-template.json +16 -0
- package/plugins/fancy-story-builder/templates/v2/30-cast/relations-template.json +44 -0
- package/plugins/fancy-story-builder/templates/v2/40-rhythm/chapter-map-template.json +81 -0
- package/plugins/fancy-story-builder/templates/v2/40-rhythm/outline-template.json +162 -0
- package/plugins/fancy-story-builder/templates/v2/50-writing/ledger-template.json +46 -0
- package/plugins/fancy-story-builder/templates/v2/60-deslop/report-template.json +10 -0
- package/plugins/fancy-story-builder/templates//350/212/202/345/245/217//346/227/266/345/272/217/346/230/240/345/260/204/346/250/241/346/235/277.json +427 -0
- package/plugins/fancy-story-builder/templates//350/212/202/345/245/217//347/253/240/350/212/202/347/273/206/347/272/262/346/250/241/346/235/277.json +34 -0
- package/plugins/fancy-story-builder/templates//350/212/202/345/245/217//347/253/240/350/212/202/350/247/204/345/210/222/346/250/241/346/235/277.json +24 -0
- package/plugins/fancy-story-builder/templates//350/212/202/345/245/217//350/212/202/345/245/217/345/217/202/346/225/260/346/250/241/346/235/277.json +27 -0
- package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//344/270/226/347/225/214/350/247/202/350/247/204/345/210/231/346/250/241/346/235/277.json +168 -0
- package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/205/263/351/224/256/351/201/223/345/205/267/346/250/241/346/235/277.json +184 -0
- package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/205/266/344/273/226/345/256/236/344/275/223/346/250/241/346/235/277.json +62 -0
- package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/206/262/347/252/201/346/250/241/346/235/277.json +131 -0
- package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/211/247/346/203/205/346/250/241/346/235/277.json +85 -0
- package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/212/277/345/212/233/346/250/241/346/235/277.json +103 -0
- package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//345/234/260/347/202/271/346/250/241/346/235/277.json +68 -0
- package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//347/273/223/345/261/200/346/250/241/346/235/277.json +142 -0
- package/plugins/fancy-story-builder/templates//350/241/200/350/202/211//350/247/222/350/211/262/346/250/241/346/235/277.json +292 -0
- package/plugins/fancy-story-builder/templates//351/252/250/346/236/266//345/205/263/347/263/273/346/250/241/346/235/277.json +266 -0
- package/plugins/fancy-story-builder/templates//351/252/250/346/236/266//345/256/236/344/275/223/346/250/241/346/235/277.json +336 -0
- package/plugins/fancy-story-builder/templates//351/252/250/346/236/266//345/261/202/347/272/247/346/250/241/346/235/277.json +65 -0
- package/plugins/fancy-story-builder/templates//351/252/250/346/236/266//346/241/206/346/236/266/346/250/241/346/235/277.json +308 -0
- package/plugins/fancy-story-builder/templates.js +1446 -0
- package/plugins/fancy-story-builder/wiki-references.js +540 -0
- package/plugins/fancy-story-builder/writing-driver.js +1388 -0
- package/plugins/fancy-topic/index.js +1057 -0
- package/plugins/fancy-topic/prompts/01-exploration-prompt.md +115 -0
- package/plugins/fancy-topic/scripts/save-suggestion.js +219 -0
- package/plugins/fancy-topic/scripts/select-topic.js +317 -0
- package/plugins/fancy-topic/templates.js +476 -0
- package/plugins/fancy-topic/tool-deploy.js +200 -0
- package/commands/bootstrap/index.js +0 -164
- package/commands/bootstrap/init-project.js +0 -121
- package/commands/scan/index.js +0 -283
- package/commands/scan/platforms/fanqie.js +0 -146
- package/commands/scan/platforms/jinjiang.js +0 -143
- package/commands/scan/platforms/qidian.js +0 -102
- package/commands/scan/platforms/qimao.js +0 -127
- package/commands/scan/scraper.js +0 -195
- package/infra.js +0 -160
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
# 网文生成系统 · 总索引
|
|
2
|
+
|
|
3
|
+
> 本文件是整个体系的使用者入口。回答:这套体系有哪些文件、每个文件干什么、文件之间怎么依赖、常见任务怎么查。
|
|
4
|
+
> 本文件不定义方法、不写公式、不写验证逻辑、不定义数据结构。
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 一、体系概览
|
|
9
|
+
|
|
10
|
+
四阶段单向流水线,每个阶段读上游、产出本阶段文件、由脚本校验、通过后进入下游。
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
任务输入
|
|
14
|
+
│
|
|
15
|
+
▼
|
|
16
|
+
┌─────────────────────────────┐
|
|
17
|
+
│ 骨架:有什么、有多少、怎么连 │ 4 个 JSON
|
|
18
|
+
│ (无章节号) │
|
|
19
|
+
└──────────────┬──────────────┘
|
|
20
|
+
│ 只读
|
|
21
|
+
▼
|
|
22
|
+
┌─────────────────────────────┐
|
|
23
|
+
│ 血肉:每个实体具体什么样 │ 8 个 JSON
|
|
24
|
+
│ (无章节号) │
|
|
25
|
+
└──────────────┬──────────────┘
|
|
26
|
+
│ 只读
|
|
27
|
+
▼
|
|
28
|
+
┌─────────────────────────────┐
|
|
29
|
+
│ 节奏:什么时间发生什么 │ 4 个 JSON
|
|
30
|
+
│ (章节号唯一出现处) │
|
|
31
|
+
└──────────────┬──────────────┘
|
|
32
|
+
│ 只读
|
|
33
|
+
▼
|
|
34
|
+
┌─────────────────────────────┐
|
|
35
|
+
│ 写作:具体怎么写 │ 逐章正文 + 台账
|
|
36
|
+
│ (会变的阶段) │
|
|
37
|
+
└─────────────────────────────┘
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**核心规则**:
|
|
41
|
+
- 下游只读上游,不写上游
|
|
42
|
+
- 新 ID 只能出现在骨架阶段
|
|
43
|
+
- 章节号只能出现在节奏阶段
|
|
44
|
+
- 每个文件生成后立即单检,不过不进下一个
|
|
45
|
+
- 每个阶段有独立的 `.stage-status.json`
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 二、文件分类
|
|
50
|
+
|
|
51
|
+
五类文件,五种职责:
|
|
52
|
+
|
|
53
|
+
| 类型 | 只做 | 不包含 |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `glossary.md` | 定义(术语、ID、枚举、字段归属) | 方法论、公式、验证、结构 |
|
|
56
|
+
| `formulas-*.json` | 量化约束 | 方法论、验证、结构 |
|
|
57
|
+
| `模板/*.json` | 数据结构 | 默认值、公式、验证、示例值 |
|
|
58
|
+
| `*指导/*.md` | 方法论 | 数字区间、检查清单、错误代码、数据结构 |
|
|
59
|
+
| `*-validate.js` | 验证 | 方法论、硬编码公式/枚举/结构 |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 三、全部文件清单
|
|
64
|
+
|
|
65
|
+
**总计 59 个体系文件 + 本索引 = 60 个文件**。
|
|
66
|
+
|
|
67
|
+
### 3.1 基础层(3 个)
|
|
68
|
+
|
|
69
|
+
| 文件 | 版本 | 职责 |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| `references/glossary.md` | v1.3 | 术语总表:四阶段边界、术语定义、15 个 ID 前缀、26 个枚举、章节号字段清单(含 `ch`/`turning`/`resolution`)、字段归属、生命周期 |
|
|
72
|
+
| `references/formulas-skeleton.json` | v1.1 | 骨架阶段 **30 条**数量公式(含 3 条 `world_rule_counts`;`ending_count` 用条件表达式;`faction_relation_count` 下界改为 n-1) |
|
|
73
|
+
| `references/formulas-rhythm.json` | v1.1 | 节奏阶段 10 个节:`constraints`(7 条联合可行性,脚本强制)+ `arc_phase_ratio` / `upgrade_guides` / `bridge_guides` / `hook_guides` / `satisfaction_guides` / `expectation_guides` / `foreshadow_guides` / `outline_guides` / `faction_guides`(9 个参考节,指导文件引用,脚本不强制) |
|
|
74
|
+
|
|
75
|
+
### 3.2 骨架阶段(13 个)
|
|
76
|
+
|
|
77
|
+
**模板(4 个)**:
|
|
78
|
+
|
|
79
|
+
| 文件 | 内容 |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `模板/骨架/框架模板.json` | capacity / input_snapshot / quota / volume_ratio / derivations |
|
|
82
|
+
| `模板/骨架/实体模板.json` | 12 类常规实体数组(characters / conflicts / factions / ... / branches)+ 可选 other_entities 题材扩展 |
|
|
83
|
+
| `模板/骨架/关系模板.json` | 9 类关系数组(character_relations / faction_membership / ... / main_line_branch_relation) |
|
|
84
|
+
| `模板/骨架/层级模板.json` | volumes / acts / main_line_span / branch_span |
|
|
85
|
+
|
|
86
|
+
**脚本(1 个)**:
|
|
87
|
+
|
|
88
|
+
| 文件 | 版本 | 能力 |
|
|
89
|
+
|---|---|---|
|
|
90
|
+
| `references/skeleton-validate.js` | v2.5 | 单文件 + 全量模式;从 glossary 读枚举、从 formulas 读公式、从模板读结构;无章节号、无时序;新增 `QUOTA_MISMATCH` / `BOOK_ENDING_COUNT` / `VOLUME_COUNT_MISMATCH` / `ACT_INDEX_DUP` / `SPAN_RATIO_RANGE` / **关系组合重复检查(7 类)** / `NO_SELF_RELATION` / `EMPTY_HARD_CONSTRAINTS` / `CROSS_TYPE_NAME_DUP` / `NAME_ALIAS_SUSPECT`(归一化后的全称/简称/别名软重复)/ `faction_relation_count` 一致性;图检查 import `graph-utils.js`;`evalExpr` 支持三元运算符 |
|
|
91
|
+
|
|
92
|
+
**提示词(1 个)**:
|
|
93
|
+
|
|
94
|
+
| 文件 | 版本 | 内容 |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| `prompts/01-skeleton-prompt.md` | v1.1 | 前置检查(无上游)、4 文件生成顺序、每文件循环、5 次 BLOCKED、全量 3 轮 BLOCKED;§6.3 拓扑顺序补全 `faction_relation_count`;"27 条"改为"30 条" |
|
|
97
|
+
|
|
98
|
+
**指导(7 个)**:
|
|
99
|
+
|
|
100
|
+
| 文件 | 职责 |
|
|
101
|
+
|---|---|
|
|
102
|
+
| `references/骨架指导/00-index.md` | 骨架阶段入口 |
|
|
103
|
+
| `references/骨架指导/01-positioning.md` | 定位、需求矩阵、平台矩阵、一句话故事 |
|
|
104
|
+
| `references/骨架指导/02-packaging.md` | 书名、简介、标签、一句话卖点 |
|
|
105
|
+
| `references/骨架指导/03-entities.md` | 角色/势力/其他实体建卡方法论 |
|
|
106
|
+
| `references/骨架指导/04-conflict.md` | 矛盾四重、死亡赌注、黏结剂、双线 |
|
|
107
|
+
| `references/骨架指导/05-quota.md` | 数量决策方法论(在公式区间内选终值) |
|
|
108
|
+
| `references/骨架指导/06-audit.md` | 骨架验证流程与问题记录 |
|
|
109
|
+
|
|
110
|
+
### 3.3 血肉阶段(16 个)
|
|
111
|
+
|
|
112
|
+
**模板(8 个)**:
|
|
113
|
+
|
|
114
|
+
| 文件 | 内容 |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `模板/血肉/角色模板.json` | 角色档案(描述/目标/缺陷/弧光/语言/关系/退场) |
|
|
117
|
+
| `模板/血肉/冲突模板.json` | 冲突档案(描述/矛盾/升级路径/信息差/收束) |
|
|
118
|
+
| `模板/血肉/势力模板.json` | 势力档案(目标/资源/内部结构/压制手段/成员详述) |
|
|
119
|
+
| `模板/血肉/剧情模板.json` | 主线驱动 + 支线目标 |
|
|
120
|
+
| `模板/血肉/地点模板.json` | 地点档案(空间特征/关键事件/叙事作用) |
|
|
121
|
+
| `模板/血肉/结局模板.json` | 结局档案(冲突解决/反套路/余韵/章节设计/伏笔回收计划) |
|
|
122
|
+
| `模板/血肉/世界观规则模板.json` | R/I/SR 三类规则 + rule_conflict_plan |
|
|
123
|
+
| `模板/血肉/关键道具模板.json` | core/branch/symbolic items + details |
|
|
124
|
+
|
|
125
|
+
**脚本(1 个)**:
|
|
126
|
+
|
|
127
|
+
| 文件 | 版本 | 能力 |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `references/flesh-validate.js` | v1.2 | 单文件 + 全量模式;`--upstream=<骨架>`;检查 `FLESH_CHAPTER_FORBIDDEN` / 引用完整性 / 名称一致性 / arc 兼容性 / details 对应 / 规则前缀 / `FLESH_GROUP_CATEGORY_MISMATCH` / `FLESH_FREETEXT_CHAPTER_REF`(warning)/ `completenessCheck` 覆盖 9 类(用文件类型作 key) |
|
|
130
|
+
|
|
131
|
+
**提示词(1 个)**:
|
|
132
|
+
|
|
133
|
+
| 文件 | 版本 | 内容 |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| `prompts/02-flesh-prompt.md` | v1.0 | 前置检查(读骨架 PASSED)、8 文件生成顺序、每文件循环、5 次 BLOCKED、全量 3 轮 BLOCKED;各文件"已填/不填"清单 |
|
|
136
|
+
|
|
137
|
+
**指导(6 个)**:
|
|
138
|
+
|
|
139
|
+
| 文件 | 职责 |
|
|
140
|
+
|---|---|
|
|
141
|
+
| `references/血肉指导/00-index.md` | 血肉阶段入口 |
|
|
142
|
+
| `references/血肉指导/01-character.md` | 人物深化、缺陷五类、弧光类型、语言档案、执念 |
|
|
143
|
+
| `references/血肉指导/02-worldbuilding.md` | 世界背景、力量体系、势力卡、物品卡、地点卡、设定校验 |
|
|
144
|
+
| `references/血肉指导/03-relations.md` | 关系网细化、支线设计、多线管理 |
|
|
145
|
+
| `references/血肉指导/04-emotion-methods.md` | 情绪弧线类型、叠加规则、引擎七环、三板斧、题材策略 |
|
|
146
|
+
| `references/血肉指导/05-audit.md` | 血肉验证流程与问题记录 |
|
|
147
|
+
|
|
148
|
+
### 3.4 节奏阶段(14 个)
|
|
149
|
+
|
|
150
|
+
**模板(4 个)**:
|
|
151
|
+
|
|
152
|
+
| 文件 | 内容 |
|
|
153
|
+
|---|---|
|
|
154
|
+
| `模板/节奏/章节规划模板.json` | 每章:ch / volume / act / scene_focus |
|
|
155
|
+
| `模板/节奏/时序映射模板.json` | 12 类时序映射(含关系阶段)——所有章节号在此 |
|
|
156
|
+
| `模板/节奏/节奏参数模板.json` | chapter_hook_rate / 三参数 / derivations |
|
|
157
|
+
| `模板/节奏/章节细纲模板.json` | 每章细纲(功能/情绪/爽点/伏笔/势力/钩子/字数) |
|
|
158
|
+
|
|
159
|
+
**脚本(1 个)**:
|
|
160
|
+
|
|
161
|
+
| 文件 | 版本 | 能力 |
|
|
162
|
+
|---|---|---|
|
|
163
|
+
| `references/rhythm-validate.js` | v1.2 | 单文件 + 全量模式;**强制 `--upstream` 至少两个目录(骨架 + 血肉)**;7 条联合约束 / 章节范围 / 时序一致性 / 布局吻合 / 覆盖性 / 钩子 / 图连通 / `RHYTHM_ACT_INVALID` / `RHYTHM_COVERAGE_SKIPPED`;启动时校验业务常量 `大伏笔` / `全书级` |
|
|
164
|
+
|
|
165
|
+
**提示词(1 个)**:
|
|
166
|
+
|
|
167
|
+
| 文件 | 版本 | 内容 |
|
|
168
|
+
|---|---|---|
|
|
169
|
+
| `prompts/03-rhythm-prompt.md` | v1.0 | 前置检查(双上游)、§7.2.2 联合可行性收敛算法、§7.2.3 时序映射填法、生成顺序、5 次 BLOCKED、全量 3 轮 BLOCKED |
|
|
170
|
+
|
|
171
|
+
**指导(8 个)**:
|
|
172
|
+
|
|
173
|
+
| 文件 | 职责 |
|
|
174
|
+
|---|---|
|
|
175
|
+
| `references/节奏指导/00-index.md` | 节奏阶段入口 |
|
|
176
|
+
| `references/节奏指导/01-upgrade-rhythm.md` | 升级感三步法、粒度五分类、情绪模块、桥段结构、嵌套图 |
|
|
177
|
+
| `references/节奏指导/02-arc-rhythm.md` | 弧线类型回顾、叠加算法、关键点换算到章 |
|
|
178
|
+
| `references/节奏指导/03-highpoint-hooks.md` | 高潮 8 类、章首 7 式、章尾 13 式、钩子强度 |
|
|
179
|
+
| `references/节奏指导/04-satisfaction.md` | 爽点分布、压制换算、期待管理、断期待诊断 |
|
|
180
|
+
| `references/节奏指导/05-foreshadow-density.md` | 伏笔密度、唤醒策略、超期处理 |
|
|
181
|
+
| `references/节奏指导/06-chapter-outline.md` | 细纲字段设计、钩子排布、伏笔推进、势力出场 |
|
|
182
|
+
| `references/节奏指导/07-audit.md` | 节奏验证流程与问题记录 |
|
|
183
|
+
|
|
184
|
+
### 3.5 写作阶段(11 个)
|
|
185
|
+
|
|
186
|
+
**脚本(1 个)**:
|
|
187
|
+
|
|
188
|
+
| 文件 | 版本 | 能力 |
|
|
189
|
+
|---|---|---|
|
|
190
|
+
| `references/writing-validate.js` | v1.2 | 单章校验;`--chapter=N`;`--upstream=<骨架>,<血肉>,<节奏>`;章节标题兼容三种格式(`# 第N章` / `# 第NNN章` / `# 第X章`,中文数字支持到"万");`EMPTY_BODY` / 字数 / 禁用词(`基本一致` / `无重大问题`)/ 与细纲对照;`UPSTREAM_PARTIAL` 在 outline 或 avgWords 任一缺失时触发;零反引号 |
|
|
191
|
+
|
|
192
|
+
**提示词(1 个)**:
|
|
193
|
+
|
|
194
|
+
| 文件 | 版本 | 内容 |
|
|
195
|
+
|---|---|---|
|
|
196
|
+
| `prompts/04-writing-prompt.md` | v1.1 | 前置检查(三上游)、逐章生成、单章校验、台账更新、5 次 BLOCKED;禁用词清单与脚本对齐;章节标题三种格式 |
|
|
197
|
+
|
|
198
|
+
**指导(9 个)**:
|
|
199
|
+
|
|
200
|
+
| 文件 | 职责 |
|
|
201
|
+
|---|---|
|
|
202
|
+
| `references/写作指导/00-index.md` | 写作阶段入口(加载顺序、产出清单、决策路由) |
|
|
203
|
+
| `references/写作指导/01-scene.md` | 场景五要素、进出场、画面感、比例、非对话信息传递 |
|
|
204
|
+
| `references/写作指导/02-chapter-workflow.md` | 八步流程、批量生成、版本管理 |
|
|
205
|
+
| `references/写作指导/03-opening-chapter.md` | 五段式、题材变体、平台差异 |
|
|
206
|
+
| `references/写作指导/04-dialogue-mastery.md` | 权力博弈、潜台词、场景路由、语言差异化、弹幕 |
|
|
207
|
+
| `references/写作指导/05-genre-formulas.md` | 21 个题材公式的结构骨架 |
|
|
208
|
+
| `references/写作指导/06-tone-ensemble.md` | 喜剧/悲剧/文学/群像/单元剧/非线性 |
|
|
209
|
+
| `references/写作指导/07-ledger-audit.md` | 4 类台账、单元末/卷末盘点、上下文加载、改稿影响 |
|
|
210
|
+
| `references/写作指导/08-diagnosis-revision.md` | 八种症状诊断树、修改优先级、四轮打磨、复验 |
|
|
211
|
+
|
|
212
|
+
### 3.6 公共工具(2 个)
|
|
213
|
+
|
|
214
|
+
| 文件 | 版本 | 职责 |
|
|
215
|
+
|---|---|---|
|
|
216
|
+
| `references/graph-utils.js` | v1.4 | 图工具库:`SimpleGraph` / `getIsolatedNodes` / `getDisconnectedCoreNodes` / `checkBidirectionalSymmetry` / `parseGlossaryFromMd`(统一 glossary 解析,剥离反引号,跳过计数类型) |
|
|
217
|
+
| `references/check-guide-compliance.js` | v1.2 | 检查指导文件是否符合五条禁令(不数字区间 / 不检查清单 / 错误代码只在白名单节 / 有"与其他文件的关系"节 / 不重复枚举值);**audit 文件豁免错误代码检查,写作指导豁免数字区间检查** |
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 四、文件依赖关系
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
glossary.md ────────────────────────────────┐
|
|
225
|
+
│ │
|
|
226
|
+
│ 被引用 │
|
|
227
|
+
▼ ▼
|
|
228
|
+
formulas-skeleton.json ──────────► skeleton-validate.js
|
|
229
|
+
formulas-rhythm.json ────────────► rhythm-validate.js
|
|
230
|
+
│ ▲
|
|
231
|
+
│ │
|
|
232
|
+
▼ │
|
|
233
|
+
模板/骨架/*.json ──────────────────────────┤
|
|
234
|
+
模板/血肉/*.json ─────────────► flesh-validate.js
|
|
235
|
+
模板/节奏/*.json ─────────────► rhythm-validate.js
|
|
236
|
+
writing-validate.js
|
|
237
|
+
▲
|
|
238
|
+
│
|
|
239
|
+
prompts/01-skeleton-prompt.md ──────┘(编排)
|
|
240
|
+
prompts/02-flesh-prompt.md ─────────┘
|
|
241
|
+
prompts/03-rhythm-prompt.md ────────┘
|
|
242
|
+
prompts/04-writing-prompt.md ───────┘
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**关键依赖**:
|
|
246
|
+
- 所有模板的 `enumRef` 依赖 `glossary.md` 的枚举
|
|
247
|
+
- 所有脚本的枚举校验依赖 `glossary.md`
|
|
248
|
+
- `skeleton-validate.js` 的公式校验依赖 `formulas-skeleton.json`(30 条)
|
|
249
|
+
- `rhythm-validate.js` 的联合约束依赖 `formulas-rhythm.json` 的 `constraints` 节(7 条)
|
|
250
|
+
- 各阶段脚本通过 `--upstream` 读上游 JSON
|
|
251
|
+
- 三个校验脚本(skeleton / flesh / rhythm)都 `import { parseGlossaryFromMd } from './graph-utils.js'`
|
|
252
|
+
- 提示词通过读指导文件获得方法论、读模板获得结构、调脚本获得验证
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## 五、常见任务导航
|
|
257
|
+
|
|
258
|
+
### 5.1 "我要从零开始生成骨架"
|
|
259
|
+
|
|
260
|
+
1. 读 `prompts/01-skeleton-prompt.md` 全文
|
|
261
|
+
2. 按提示词的"六、生成顺序"逐个生成 4 个 JSON
|
|
262
|
+
3. 每个文件生成后按"七、每文件生成循环"调 `skeleton-validate.js` 单检
|
|
263
|
+
4. 全部通过后跑 `--all`
|
|
264
|
+
5. 输出交付摘要
|
|
265
|
+
|
|
266
|
+
### 5.2 "我要在已完成的骨架上补血肉"
|
|
267
|
+
|
|
268
|
+
1. 确认骨架 `.stage-status.json` 的 `all_check.status === "PASSED"`
|
|
269
|
+
2. 读 `prompts/02-flesh-prompt.md` 全文
|
|
270
|
+
3. 按提示词的"六、生成顺序"逐个生成 8 个 JSON
|
|
271
|
+
4. 每个文件生成后调 `flesh-validate.js --upstream=<骨架>` 单检
|
|
272
|
+
5. 全部通过后跑 `--all`
|
|
273
|
+
6. 输出交付摘要
|
|
274
|
+
|
|
275
|
+
### 5.3 "我要在血肉基础上排节奏"
|
|
276
|
+
|
|
277
|
+
1. 确认骨架和血肉的 `.stage-status.json` 都 PASSED
|
|
278
|
+
2. 读 `prompts/03-rhythm-prompt.md` 全文
|
|
279
|
+
3. **重点读 7.2.2**(联合可行性收敛算法)和 **7.2.3**(时序映射填法)
|
|
280
|
+
4. 按提示词的"六、生成顺序"(章节规划 → 节奏参数 → 时序映射 → 章节细纲)逐个生成
|
|
281
|
+
5. 每个文件生成后调 `rhythm-validate.js --upstream=<骨架>,<血肉>` 单检
|
|
282
|
+
6. 全部通过后跑 `--all`
|
|
283
|
+
7. 输出交付摘要
|
|
284
|
+
|
|
285
|
+
### 5.4 "我要在节奏基础上写正文"
|
|
286
|
+
|
|
287
|
+
1. 确认骨架、血肉、节奏的 `.stage-status.json` 都 PASSED
|
|
288
|
+
2. 读 `prompts/04-writing-prompt.md` 全文
|
|
289
|
+
3. 按提示词的"六、生成顺序"逐章生成
|
|
290
|
+
4. 每章生成后调 `writing-validate.js --chapter=N --upstream=<骨架>,<血肉>,<节奏>` 单检
|
|
291
|
+
5. 每章通过后更新 4 个台账
|
|
292
|
+
6. 第 T 章通过后做完本检查 + 输出交付摘要
|
|
293
|
+
|
|
294
|
+
### 5.5 "我要加一个角色"
|
|
295
|
+
|
|
296
|
+
1. 判断是否影响框架(`quota.character_counts`)
|
|
297
|
+
2. 若影响,先改 `框架.json` 的 `quota` 与 `derivations`
|
|
298
|
+
3. 改 `实体.json` 加新角色(`id` 从 `C001` 到 `C0NN` 连续)
|
|
299
|
+
4. 改 `关系.json` 给新角色建关系(至少一条,否则会报 `G_ISOLATED`)
|
|
300
|
+
5. 重跑骨架阶段 `--all` 确认无破坏(`QUOTA_MISMATCH` 会检查 quota 与实体数量一致)
|
|
301
|
+
6. 重跑血肉阶段(新角色需要补血肉档案)
|
|
302
|
+
7. 重跑节奏阶段(新角色需要补时序映射)
|
|
303
|
+
8. 重跑写作阶段(如果已经在写正文)
|
|
304
|
+
|
|
305
|
+
### 5.6 "我要改章节总数 500 → 600"
|
|
306
|
+
|
|
307
|
+
**不能走增量**,全量重跑:
|
|
308
|
+
|
|
309
|
+
1. 改 `框架.json` 的 `capacity.target_chapters`
|
|
310
|
+
2. 全部 30 条公式的 `derivations` 重算
|
|
311
|
+
3. 从骨架阶段第 1 步重新生成所有文件
|
|
312
|
+
4. 每阶段单检 + 全量
|
|
313
|
+
5. 全部通过后交付
|
|
314
|
+
|
|
315
|
+
### 5.7 "我要改某个角色的背景描述"
|
|
316
|
+
|
|
317
|
+
1. 判断是否影响框架(通常不影响)
|
|
318
|
+
2. 直接改 `血肉/角色.json` 对应角色的字段
|
|
319
|
+
3. 重跑 `flesh-validate.js --input=角色.json ... --upstream=<骨架>`
|
|
320
|
+
4. 若角色涉及时序(如退场章),重跑节奏阶段的时序映射
|
|
321
|
+
5. 若已在写正文,重新生成受影响的章
|
|
322
|
+
|
|
323
|
+
### 5.8 "我要改某条支线的章节范围"
|
|
324
|
+
|
|
325
|
+
1. 判断改动后 `branch_chapter_total` / `overlap_chapter_count` / `main_progress_chapter_count` 是否变化
|
|
326
|
+
2. 若变化,先改 `节奏参数.json` 并重算
|
|
327
|
+
3. 改 `时序映射.json` 的 `branch_timeline`
|
|
328
|
+
4. 重跑 `rhythm-validate.js --input=时序映射.json ... --upstream=<骨架>,<血肉>`
|
|
329
|
+
5. 重跑全量
|
|
330
|
+
6. 若已写正文,重新生成受影响的章
|
|
331
|
+
|
|
332
|
+
### 5.9 "脚本报错了怎么办"
|
|
333
|
+
|
|
334
|
+
1. **单文件校验 status:1**:读 `errors[]`,按 `path` 定位字段,按 `hint` 修改,重跑
|
|
335
|
+
2. **单文件校验 status:2**:脚本自己没能跑完(参数错 / 文件读不到 / 上游缺失 / glossary 读不出来)。
|
|
336
|
+
**原因不在 stderr** —— 4 个校验器的 stderr 是空的,原因在 **stdout 的 `errors[0].message`** 里
|
|
337
|
+
(只有 `check-guide-compliance.js` 相反:它 exit 2 时 stdout 为空、原因在 stderr)。
|
|
338
|
+
**改命令,不要改产物**
|
|
339
|
+
3. **全量校验 status:1**:读 `errors[]`,按 `file` 或 `path` 前缀分组,先改根因文件,重跑单检,重跑全量
|
|
340
|
+
4. **连续 5 次 status:1**:触发 BLOCKED。按提示词的 BLOCKED 格式输出,停止,等人工介入
|
|
341
|
+
5. **全量 3 轮失败**:触发 BLOCKED。同上
|
|
342
|
+
|
|
343
|
+
### 5.10 "我要检查指导文件是否符合规范"
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
node references/check-guide-compliance.js --dir=references/骨架指导
|
|
347
|
+
node references/check-guide-compliance.js --dir=references/血肉指导
|
|
348
|
+
node references/check-guide-compliance.js --dir=references/节奏指导
|
|
349
|
+
node references/check-guide-compliance.js --dir=references/写作指导
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
输出 JSON:`{status, total_files, total_errors, total_warnings, results}`。error 需修复,warning 可选。
|
|
353
|
+
|
|
354
|
+
**怎么判**:`status:0` = 通过;`status:1` = 有问题,逐个文件的错在 `results[].errors[]` 里;
|
|
355
|
+
`status:2` = 脚本自己没跑完 —— **这个脚本是例外:它的 stdout 是空的,原因在 stderr**
|
|
356
|
+
(`需要 --dir 或 --file` / `目录不存在: …` / `glossary.md 解析失败: …`)。**改命令,不要改指导文件**。
|
|
357
|
+
|
|
358
|
+
**v1.2 注**:audit 文件(文件名匹配 `0X-audit.md`)整体豁免 `ERROR_CODE_IN_BODY`;写作指导目录豁免 `RANGE_IN_GUIDE`。
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
## 六、ID 前缀速查
|
|
363
|
+
|
|
364
|
+
| 前缀 | 实体 | 出现阶段 |
|
|
365
|
+
|---|---|---|
|
|
366
|
+
| C | 角色 | 骨架 |
|
|
367
|
+
| X | 冲突 | 骨架 |
|
|
368
|
+
| F | 势力 | 骨架 |
|
|
369
|
+
| V | 卷 | 骨架 |
|
|
370
|
+
| FS | 伏笔 | 骨架 |
|
|
371
|
+
| M | 主线 | 骨架 |
|
|
372
|
+
| B | 支线 | 骨架 |
|
|
373
|
+
| L | 地点 | 骨架 |
|
|
374
|
+
| E | 结局 | 骨架 |
|
|
375
|
+
| R | 核心规则 | 骨架 |
|
|
376
|
+
| I | 信息规则 | 骨架 |
|
|
377
|
+
| SR | 社会规则 | 骨架 |
|
|
378
|
+
| P | 关键道具 | 骨架 |
|
|
379
|
+
| CL | 高潮 | 骨架 |
|
|
380
|
+
| PL | 爽点 | 骨架 |
|
|
381
|
+
|
|
382
|
+
**章节**:无独立 ID,节奏阶段用 `ch: N` 复合键。
|
|
383
|
+
|
|
384
|
+
完整定义见 `references/glossary.md` 第四节。
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## 七、字段归属速查
|
|
389
|
+
|
|
390
|
+
| 阶段 | 文件 | 顶层字段 |
|
|
391
|
+
|---|---|---|
|
|
392
|
+
| 骨架 | 框架.json | capacity / input_snapshot / quota / volume_ratio / derivations |
|
|
393
|
+
| 骨架 | 实体.json | characters / conflicts / factions / locations / items / endings / foreshadows / climaxes / pleasures / world_rules / main_lines / branches |
|
|
394
|
+
| 骨架 | 关系.json | character_relations / faction_membership / faction_relations / conflict_participants / branch_protagonist / item_owner / location_conflict / ending_character / main_line_branch_relation |
|
|
395
|
+
| 骨架 | 层级.json | volumes / acts / main_line_span / branch_span |
|
|
396
|
+
| 血肉 | 角色.json | characters(id + name + 描述层) |
|
|
397
|
+
| 血肉 | 冲突.json | conflicts |
|
|
398
|
+
| 血肉 | 势力.json | factions |
|
|
399
|
+
| 血肉 | 剧情.json | main_lines / branches |
|
|
400
|
+
| 血肉 | 地点.json | locations |
|
|
401
|
+
| 血肉 | 结局.json | endings |
|
|
402
|
+
| 血肉 | 世界观规则.json | core_rules / information_rules / social_rules / rule_conflict_plan |
|
|
403
|
+
| 血肉 | 关键道具.json | core_items / branch_items / symbolic_items / details |
|
|
404
|
+
| 节奏 | 章节规划.json | chapters |
|
|
405
|
+
| 节奏 | 时序映射.json | character_timeline / conflict_timeline / foreshadow_timeline / climax_timeline / pleasure_timeline / hook_timeline / main_line_timeline / branch_timeline / location_timeline / item_timeline / ending_timeline |
|
|
406
|
+
| 节奏 | 节奏参数.json | chapter_hook_rate / branch_chapter_total / overlap_chapter_count / main_progress_chapter_count / derivations |
|
|
407
|
+
| 节奏 | 章节细纲.json | outlines |
|
|
408
|
+
|
|
409
|
+
完整定义见 `references/glossary.md` 第七节。
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## 八、章节号归属速查
|
|
414
|
+
|
|
415
|
+
**以下字段只能出现在节奏阶段**(完整清单见 `glossary.md` 第六节):
|
|
416
|
+
|
|
417
|
+
| 字段 | 含义 |
|
|
418
|
+
|---|---|
|
|
419
|
+
| `chapter` / `ch` | 单章号 |
|
|
420
|
+
| `start` / `end` | 区间 |
|
|
421
|
+
| `turning` | 支线转折章 |
|
|
422
|
+
| `resolution` | 支线/冲突收束章(与 `resolution_chapter` 等价) |
|
|
423
|
+
| `appear_start` / `appear_end` | 出现区间 |
|
|
424
|
+
| `exit_chapter` | 退场章 |
|
|
425
|
+
| `buried_chapter` / `recovered_chapter` | 伏笔埋/收 |
|
|
426
|
+
| `escalation_nodes[].chapter` | 冲突升级节点 |
|
|
427
|
+
| `resolution_chapter` | 冲突收束 |
|
|
428
|
+
| `info_gaps[].created` / `resolved` | 信息差 |
|
|
429
|
+
| `key_nodes[].chapter` | 主线节点 |
|
|
430
|
+
| `interweaves[].chapter` | 支线交织 |
|
|
431
|
+
| `foreshadow_recovery[].chapter` | 结局回收 |
|
|
432
|
+
| `arc_stages[].chapter` | 弧光阶段 |
|
|
433
|
+
| `appearance_chapters` | 出现区间(容器) |
|
|
434
|
+
| `chapter_range` | 章节范围(容器) |
|
|
435
|
+
| `chapter_count` | 章节计数(非章节号) |
|
|
436
|
+
|
|
437
|
+
**例外**:`chapter_ratio` 和 `volume_ratio` 是"比例"不是"章节号",允许在骨架。
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
## 九、脚本调用速查
|
|
442
|
+
|
|
443
|
+
### 9.0 所有脚本的返回格式(先读这一节)
|
|
444
|
+
|
|
445
|
+
7 个 CLI 脚本的 stdout 都是 **JSON**(多数是单行,`check-guide-compliance.js` 是多行)。
|
|
446
|
+
判定字段是 `status`,**没有 `ok` 字段**:
|
|
447
|
+
|
|
448
|
+
```json
|
|
449
|
+
{"status":0,"file":"实体","errors":[],"warnings":[]}
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
| status | 含义 | 怎么判 |
|
|
453
|
+
|---|---|---|
|
|
454
|
+
| `0` | 通过 | `errors` 是空数组 |
|
|
455
|
+
| `1` | 内容有问题 | `errors` 里有条目(**`warnings` 不算失败**) |
|
|
456
|
+
| `2` | **脚本自己没跑完** | 不是你的产物有问题 —— 参数错 / 文件读不到 / 上游缺失 / glossary 读不出来 |
|
|
457
|
+
|
|
458
|
+
**退出码 = status**(脚本里是 `process.exitCode = status`),
|
|
459
|
+
所以 `echo $?` 的 0 / 1 / 2 与 JSON 里的 `status` 是一致的。
|
|
460
|
+
|
|
461
|
+
**三个例外,必须分开看**:
|
|
462
|
+
|
|
463
|
+
- `upstream-query.js`:`status:1` = **没查到**,不是失败。
|
|
464
|
+
它是查询工具,"查不到"本来就是合法答案(`items` 是空数组)。
|
|
465
|
+
`status:2` 才是真出错(参数错 / 上游文件不存在 / JSON 解析失败)。
|
|
466
|
+
- `deslop-validate.js`:**不加 `--fail-on-blocking` 时 `status` 恒为 0**,
|
|
467
|
+
哪怕命中了很多 blocking 模式。而 `errors[]` 里既装了 blocking 命中,
|
|
468
|
+
也装了 advisory 命中(`AI_PATTERN_ADVISORY`)——
|
|
469
|
+
所以**「`errors[]` 非空」不等于失败**。
|
|
470
|
+
要让 blocking 命中导致失败,命令里必须带 `--fail-on-blocking`。
|
|
471
|
+
- `check-guide-compliance.js`:输出的是**汇总**结构
|
|
472
|
+
`{"status":N,"total_files":…,"total_errors":…,"total_warnings":…,"results":[…]}`,
|
|
473
|
+
每个文件的错在 `results[].errors[]` 里,不是顶层的 `errors[]`。
|
|
474
|
+
|
|
475
|
+
**`status:2` 的原因在哪看**(这个坑最容易踩):
|
|
476
|
+
|
|
477
|
+
| 脚本 | `status:2` 时 stdout | `status:2` 时 stderr |
|
|
478
|
+
|---|---|---|
|
|
479
|
+
| `skeleton-validate.js` / `flesh-validate.js` / `rhythm-validate.js` / `writing-validate.js` | **有** JSON,`errors[0].message` 是原因 | **空的** |
|
|
480
|
+
| `upstream-query.js` | **有** JSON,`error` 字段是原因 | 空 |
|
|
481
|
+
| `deslop-validate.js` | 有 JSON | 空 |
|
|
482
|
+
| `check-guide-compliance.js` | **空的** | **有**原因(`需要 --dir 或 --file` / `目录不存在: …` / `glossary.md 解析失败: …`) |
|
|
483
|
+
|
|
484
|
+
**看到 `status:2` 怎么办**:
|
|
485
|
+
|
|
486
|
+
1. 按上表找到原因(4 个校验器看 stdout 的 `errors[0].message`;
|
|
487
|
+
`check-guide-compliance.js` 看 stderr)。
|
|
488
|
+
2. 原因多半是**命令参数写错**(少了 `--upstream`、路径拼错、目录不存在)。
|
|
489
|
+
**改命令,不要改产物** —— 产物没错,改它只会把对的改错。
|
|
490
|
+
3. 改完**重跑同一条命令**。
|
|
491
|
+
|
|
492
|
+
### 9.1 骨架脚本
|
|
493
|
+
|
|
494
|
+
```bash
|
|
495
|
+
# 单文件(带 --upstream)
|
|
496
|
+
node references/skeleton-validate.js --input=<json> --template=<模板> --file=<类型> --upstream=<骨架目录>
|
|
497
|
+
|
|
498
|
+
# 全量
|
|
499
|
+
node references/skeleton-validate.js --stage-dir=<骨架目录> --template-dir=<模板/骨架> --all
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
**单文件模式必须带 `--upstream=<骨架目录>`**:不带的话,
|
|
503
|
+
`关系.json` 的引用完整性、支线挂主线的覆盖度、`层级.json` 的卷数/引用三项跨文件检查
|
|
504
|
+
会被**静默跳过**(`relationRefCheck` / `checkBranchMainLineCoverage` / `hierarchyRefCheck`
|
|
505
|
+
拿到空的上游就直接 `return`),而脚本**照样报 `status:0`** ——
|
|
506
|
+
这是一次**假通过**。全量模式(`--all`)自己会读同目录的文件,不受这个影响。
|
|
507
|
+
|
|
508
|
+
### 9.2 血肉脚本
|
|
509
|
+
|
|
510
|
+
```bash
|
|
511
|
+
# 单文件(必须带 --upstream)
|
|
512
|
+
node references/flesh-validate.js --input=<json> --template=<模板> --file=<类型> --upstream=<骨架目录>
|
|
513
|
+
|
|
514
|
+
# 全量
|
|
515
|
+
node references/flesh-validate.js --stage-dir=<血肉目录> --template-dir=<模板/血肉> --upstream=<骨架目录> --all
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
### 9.3 节奏脚本
|
|
519
|
+
|
|
520
|
+
```bash
|
|
521
|
+
# 单文件(必须带双上游,v1.2 起强制)
|
|
522
|
+
node references/rhythm-validate.js --input=<json> --template=<模板> --file=<类型> --upstream=<骨架目录>,<血肉目录>
|
|
523
|
+
|
|
524
|
+
# 全量
|
|
525
|
+
node references/rhythm-validate.js --stage-dir=<节奏目录> --template-dir=<模板/节奏> --upstream=<骨架目录>,<血肉目录> --all
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### 9.4 写作脚本
|
|
529
|
+
|
|
530
|
+
```bash
|
|
531
|
+
# 单章(必须带章号和三上游)
|
|
532
|
+
node references/writing-validate.js --input=<第NNN章.md> --chapter=<N> --upstream=<骨架目录>,<血肉目录>,<节奏目录>
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
### 9.5 合规检查脚本
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
node references/check-guide-compliance.js --dir=<指导目录>
|
|
539
|
+
node references/check-guide-compliance.js --file=<单个指导文件>
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
**退出码统一**:0=通过、1=内容错误、2=脚本异常。
|
|
543
|
+
|
|
544
|
+
### 9.6 去味脚本
|
|
545
|
+
|
|
546
|
+
```bash
|
|
547
|
+
# 单章(要让 blocking 命中导致失败,必须带 --fail-on-blocking)
|
|
548
|
+
node references/deslop-validate.js --input=<第NNN章.md> --fail-on-blocking
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
**不带 `--fail-on-blocking` 时 `status` 恒为 0**,
|
|
552
|
+
而且 `errors[]` 里混着 advisory 命中(`AI_PATTERN_ADVISORY`)——
|
|
553
|
+
判定只看 `status` 和 `blockingCount`,**不要拿 `errors[]` 非空当失败**。
|
|
554
|
+
|
|
555
|
+
### 9.7 上游查询脚本
|
|
556
|
+
|
|
557
|
+
```bash
|
|
558
|
+
# 查单个
|
|
559
|
+
node references/upstream-query.js --stage=骨架 --file=实体 --id=C001
|
|
560
|
+
|
|
561
|
+
# 查某个文件里有哪些记录(先列再查)
|
|
562
|
+
node references/upstream-query.js --stage=骨架 --file=关系 --list
|
|
563
|
+
|
|
564
|
+
# 查某一章 / 一批 id
|
|
565
|
+
node references/upstream-query.js --stage=节奏 --file=章节细纲 --ch=12
|
|
566
|
+
node references/upstream-query.js --stage=骨架 --file=实体 --ids=FS042,FS043
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
`status:0` = 命中(`items` 是查到的记录);`status:1` = **没查到**(不是失败,
|
|
570
|
+
`items` 是空数组,用 `--list` 看可用记录);`status:2` = 参数错或上游文件读不到。
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
## 十、版本记录
|
|
575
|
+
|
|
576
|
+
| 版本 | 变更 |
|
|
577
|
+
|---|---|
|
|
578
|
+
| v1.0 | 初建。总索引:体系概览、文件分类、全部文件清单、依赖关系、常见任务导航(10 个场景)、ID 前缀速查、字段归属速查、章节号归属速查、脚本调用速查 |
|
|
579
|
+
| v1.1 | 修正文件数(61 → 58);补全各文件的版本号(反映 P0-1 到 P3-1 的所有变更);§3.1 补 formulas-skeleton 30 条说明、formulas-rhythm 10 节说明;§3.2 补 skeleton-validate v2.2 新增 6 项检查;§3.3 补 flesh-validate v1.1 扩展;§3.4 补 rhythm-validate v1.1 修订;§3.5 补 writing-validate v1.1 修订;§八 章节号清单补 `ch` / `turning` / `resolution`;§五 5.5 加 `QUOTA_MISMATCH` 提示 |
|
|
580
|
+
| v1.2 | 修正节奏阶段文件数(13 → 14);总数(57/58 → 59/60);写作阶段补 `00-index.md`(10 → 11 个);§3.2 skeleton-validate 版本更新 v2.4 并补"关系组合重复检查(7 类)"表述;§3.3 flesh-validate 更新 v1.2;§3.4 rhythm-validate 更新 v1.2(强制双上游);§3.5 writing-validate 更新 v1.2;§3.6 公共工具版本更新(graph-utils v1.4 / check-guide-compliance v1.2);§5.10 补 v1.2 的 audit / 写作指导豁免说明 |
|
|
581
|
+
| v1.3 | §9.0 新增「所有脚本的返回格式」总则:`status` 0/1/2 的含义与判定依据、退出码与 status 一致、三个例外(upstream-query 的 status:1 是"没查到"、deslop-validate 不加 `--fail-on-blocking` 时 status 恒 0 且 errors[] 混着 advisory、check-guide-compliance 是汇总结构)、`status:2` 的原因在 stdout 还是 stderr 的对照表;§9.1 单文件模式补 `--upstream`(不带会静默跳过三类跨文件检查仍报 status:0 假通过);§9.6 补去味脚本、§9.7 补上游查询脚本(原来速查表里没有这两个);§5.9.2 修正"读 stderr"的说法(4 个校验器的 stderr 是空的,原因在 stdout 的 `errors[0].message`) |
|