novelws 3.1.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +74 -0
- package/README.md +47 -49
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +35 -33
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +63 -6
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/core/config.d.ts +22 -15
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +28 -16
- package/dist/core/config.js.map +1 -1
- package/dist/utils/diagnostics.d.ts.map +1 -1
- package/dist/utils/diagnostics.js +6 -5
- package/dist/utils/diagnostics.js.map +1 -1
- package/package.json +1 -1
- package/templates/commands/analyze.md +10 -10
- package/templates/commands/character.md +10 -10
- package/templates/commands/checklist.md +27 -27
- package/templates/commands/clarify.md +2 -2
- package/templates/commands/constitution.md +8 -8
- package/templates/commands/expert.md +3 -3
- package/templates/commands/facts.md +9 -9
- package/templates/commands/guide.md +25 -25
- package/templates/commands/help-me.md +2 -2
- package/templates/commands/plan.md +26 -26
- package/templates/commands/recap.md +16 -16
- package/templates/commands/relations.md +13 -13
- package/templates/commands/revise.md +15 -15
- package/templates/commands/search.md +10 -10
- package/templates/commands/specify.md +4 -4
- package/templates/commands/tasks.md +9 -9
- package/templates/commands/timeline.md +13 -13
- package/templates/commands/track-init.md +8 -8
- package/templates/commands/track.md +22 -22
- package/templates/commands/volume-summary.md +6 -6
- package/templates/commands/write.md +125 -38
- package/templates/dot-claude/CLAUDE.md +5 -5
- package/templates/{config → resources/config}/keyword-mappings.json +19 -19
- package/templates/{scripts → resources/scripts}/README.md +8 -8
- package/templates/{scripts → resources/scripts}/bash/analyze-story.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/check-consistency.sh +7 -7
- package/templates/{scripts → resources/scripts}/bash/check-facts.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/check-plot.sh +2 -2
- package/templates/{scripts → resources/scripts}/bash/check-timeline.sh +3 -3
- package/templates/{scripts → resources/scripts}/bash/check-world.sh +5 -5
- package/templates/{scripts → resources/scripts}/bash/check-writing-state.sh +26 -26
- package/templates/{scripts → resources/scripts}/bash/common.sh +3 -3
- package/templates/{scripts → resources/scripts}/bash/constitution.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/init-tracking.sh +13 -13
- package/templates/{scripts → resources/scripts}/bash/manage-relations.sh +10 -10
- package/templates/{scripts → resources/scripts}/bash/migrate-tracking.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/plan-story.sh +2 -2
- package/templates/{scripts → resources/scripts}/bash/specify-story.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/tasks-story.sh +2 -2
- package/templates/{scripts → resources/scripts}/bash/tests/bench-preload-cache.sh +3 -3
- package/templates/{scripts → resources/scripts}/bash/tests/test-cross-platform.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/tests/test-preload-cache.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/tests/test-regex-precompile.sh +4 -4
- package/templates/{scripts → resources/scripts}/bash/text-audit.sh +3 -3
- package/templates/{scripts → resources/scripts}/bash/track-progress.sh +5 -5
- package/templates/{scripts → resources/scripts}/powershell/analyze-story.ps1 +1 -1
- package/templates/{scripts → resources/scripts}/powershell/check-consistency.ps1 +8 -8
- package/templates/{scripts → resources/scripts}/powershell/check-plot.ps1 +2 -2
- package/templates/{scripts → resources/scripts}/powershell/check-timeline.ps1 +2 -2
- package/templates/{scripts → resources/scripts}/powershell/check-writing-state.ps1 +31 -31
- package/templates/{scripts → resources/scripts}/powershell/common.ps1 +2 -2
- package/templates/{scripts → resources/scripts}/powershell/constitution.ps1 +1 -1
- package/templates/{scripts → resources/scripts}/powershell/init-tracking.ps1 +5 -5
- package/templates/{scripts → resources/scripts}/powershell/manage-relations.ps1 +6 -6
- package/templates/{scripts → resources/scripts}/powershell/migrate-tracking.ps1 +1 -1
- package/templates/{scripts → resources/scripts}/powershell/plan-story.ps1 +2 -2
- package/templates/{scripts → resources/scripts}/powershell/specify-story.ps1 +1 -1
- package/templates/{scripts → resources/scripts}/powershell/tests/bench-ps-cache.ps1 +10 -10
- package/templates/{scripts → resources/scripts}/powershell/tests/test-ps-cache.ps1 +4 -4
- package/templates/{scripts → resources/scripts}/powershell/text-audit.ps1 +2 -2
- package/templates/{scripts → resources/scripts}/powershell/track-progress.ps1 +2 -2
- package/templates/skills/analysis/character-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/foreshadow-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/hook-analysis/SKILL.md +2 -2
- package/templates/skills/analysis/logic-analysis/SKILL.md +2 -2
- package/templates/skills/analysis/opening-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/pacing-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/power-analysis/SKILL.md +3 -3
- package/templates/skills/analysis/reader-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/style-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/voice-analysis/SKILL.md +1 -1
- package/templates/skills/auto-tracking/SKILL.md +1 -1
- package/templates/skills/quality-assurance/consistency-checker/SKILL.md +1 -1
- package/templates/skills/quality-assurance/facts-checker/SKILL.md +2 -2
- package/templates/skills/quality-assurance/hook-checker/SKILL.md +2 -2
- package/templates/skills/quality-assurance/long-series-continuity/SKILL.md +7 -7
- package/templates/skills/quality-assurance/pre-write-checklist/SKILL.md +22 -22
- package/templates/skills/quality-assurance/setting-detector/SKILL.md +15 -15
- package/templates/skills/quality-assurance/voice-consistency-checker/SKILL.md +1 -1
- package/templates/skills/writing-techniques/character-arc/SKILL.md +1 -1
- package/templates/skills/writing-techniques/multi-thread-narrative/SKILL.md +1 -1
- package/templates/skills/writing-techniques/reader-expectation/SKILL.md +1 -1
- package/templates/skills/writing-techniques/revision-polish/SKILL.md +1 -1
- package/templates/skills/writing-techniques/style-learning/SKILL.md +2 -2
- package/templates/skills/writing-techniques/writing-balance/SKILL.md +1 -1
- package/templates/knowledge-base/README.md +0 -285
- /package/templates/{knowledge-base → resources}/character-archetypes/01-hero.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/02-mentor.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/03-shadow.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/04-ally.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/05-shapeshifter.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/06-trickster.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/07-threshold-guardian.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/08-herald.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/09-father.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/10-mother.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/11-child.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/12-sage.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/README.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/application-guide.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/archetype-combinations.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/config.yaml +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/examples-analysis.md +0 -0
- /package/templates/{specification-example.md → resources/config/specification-example.md} +0 -0
- /package/templates/{knowledge-base → resources}/craft/character-arc.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/dialogue.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/hook-design.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/pacing.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/power-system.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/scene-structure.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/show-not-tell.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/story-structures.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/tension-management.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/01-first-meeting.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/02-bonding-moment.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/03-declaration.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/04-triumph.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/05-reunion.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/06-forgiveness.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/07-betrayal.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/08-loss.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/09-rejection.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/10-failure.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/11-misunderstanding.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/12-farewell.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/13-revelation.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/14-point-of-no-return.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/15-dark-night.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/16-sacrifice.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/17-awakening.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/18-confrontation.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/19-bittersweet-goodbye.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/20-moral-dilemma.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/21-temptation.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/22-redemption.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/README.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/beat-sequences.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/config.yaml +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/pacing-guide.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/game-lit.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/historical.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/horror.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/military.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/mystery.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/rebirth.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/revenge.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/romance.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/sci-fi.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/sports.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/thriller.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/urban.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/workplace.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/wuxia.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/xuanhuan.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/youth.md +0 -0
- /package/templates/{memory → resources/memory}/constitution.md +0 -0
- /package/templates/{memory → resources/memory}/personal-voice.md +0 -0
- /package/templates/{knowledge-base → resources}/references/README.md +0 -0
- /package/templates/{knowledge-base → resources}/references/china-1920s/culture.md +0 -0
- /package/templates/{knowledge-base → resources}/references/china-1920s/daily-life.md +0 -0
- /package/templates/{knowledge-base → resources}/references/china-1920s/overview.md +0 -0
- /package/templates/{knowledge-base → resources}/references/china-1920s/society.md +0 -0
- /package/templates/{knowledge-base → resources}/references/china-1920s/warlords.md +0 -0
- /package/templates/{knowledge-base → resources}/references/cultivation-world/daily-life.md +0 -0
- /package/templates/{knowledge-base → resources}/references/cultivation-world/overview.md +0 -0
- /package/templates/{knowledge-base → resources}/references/cultivation-world/power-system.md +0 -0
- /package/templates/{knowledge-base → resources}/references/cultivation-world/sects.md +0 -0
- /package/templates/{knowledge-base → resources}/references/cultivation-world/world-setting.md +0 -0
- /package/templates/{knowledge-base → resources}/references/modern-workplace/corporate.md +0 -0
- /package/templates/{knowledge-base → resources}/references/modern-workplace/daily-life.md +0 -0
- /package/templates/{knowledge-base → resources}/references/modern-workplace/overview.md +0 -0
- /package/templates/{knowledge-base → resources}/references/modern-workplace/relationships.md +0 -0
- /package/templates/{knowledge-base → resources}/references/modern-workplace/tech-industry.md +0 -0
- /package/templates/{knowledge-base → resources}/references/tang-dynasty/culture.md +0 -0
- /package/templates/{knowledge-base → resources}/references/tang-dynasty/daily-life.md +0 -0
- /package/templates/{knowledge-base → resources}/references/tang-dynasty/overview.md +0 -0
- /package/templates/{knowledge-base → resources}/references/tang-dynasty/politics.md +0 -0
- /package/templates/{knowledge-base → resources}/references/tang-dynasty/society.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/README.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/anti-ai-v3.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/anti-ai-v4-deprecated.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/anti-ai-v5-balanced.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/concretization.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/fast-paced.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/no-poison.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/romance-angst.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/romance-sweet.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/serious-literature.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/strong-emotion.md +0 -0
- /package/templates/{scripts → resources/scripts}/bash/check-analyze-stage.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/clarify-story.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/generate-tasks.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/test-word-count.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/run-all-benchmarks.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/test-cache-semantics.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/test-edge-cases-bash.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/test-phase1-bash.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/test-regression-bash.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/test-task6-verification.sh +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/check-analyze-stage.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/check-facts.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/clarify-story.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/generate-tasks.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/tests/test-cross-platform.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/tests/test-edge-cases-ps.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/tests/test-phase1-ps.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/tests/test-regression-ps.ps1 +0 -0
- /package/templates/{knowledge-base → resources}/styles/README.md +0 -0
- /package/templates/{knowledge-base → resources}/styles/ancient-style.md +0 -0
- /package/templates/{knowledge-base → resources}/styles/literary.md +0 -0
- /package/templates/{knowledge-base → resources}/styles/minimal.md +0 -0
- /package/templates/{knowledge-base → resources}/styles/natural-voice.md +0 -0
- /package/templates/{knowledge-base → resources}/styles/web-novel.md +0 -0
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
name: timeline
|
|
3
3
|
description: 管理和验证故事时间线
|
|
4
4
|
argument-hint: [add | check | show | sync] [--volume vol-XX | --recent N]
|
|
5
|
-
allowed-tools: Read(//
|
|
5
|
+
allowed-tools: Read(//tracking/timeline.json), Read(//tracking/timeline.json), Write(//tracking/timeline.json), Write(//tracking/timeline.json), Read(//stories/**/content/**), Read(//stories/**/content/**), Bash(find:*), Bash(*)
|
|
6
6
|
scripts:
|
|
7
|
-
sh:
|
|
8
|
-
ps:
|
|
7
|
+
sh: resources/scripts/bash/check-timeline.sh
|
|
8
|
+
ps: resources/scripts/powershell/check-timeline.ps1
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# 时间线管理
|
|
@@ -53,8 +53,8 @@ const events = await mcp.call('novelws-mcp/query_timeline', {
|
|
|
53
53
|
### Layer 2: 分片 JSON(次优)
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
# 当
|
|
57
|
-
timeline_data=$(cat
|
|
56
|
+
# 当 tracking/volumes/ 存在时
|
|
57
|
+
timeline_data=$(cat tracking/volumes/vol-03/timeline.json)
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
**适用场景**:
|
|
@@ -66,7 +66,7 @@ timeline_data=$(cat spec/tracking/volumes/vol-03/timeline.json)
|
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
# 传统模式,加载完整文件
|
|
69
|
-
timeline_data=$(cat
|
|
69
|
+
timeline_data=$(cat tracking/timeline.json)
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
**向下兼容**:小型项目(< 300 章)继续使用单文件模式
|
|
@@ -109,7 +109,7 @@ timeline_data=$(cat spec/tracking/timeline.json)
|
|
|
109
109
|
|
|
110
110
|
## 时间线数据
|
|
111
111
|
|
|
112
|
-
时间线信息存储在 `
|
|
112
|
+
时间线信息存储在 `tracking/timeline.json` 中:
|
|
113
113
|
- 故事内时间(年/月/日)
|
|
114
114
|
- 章节对应关系
|
|
115
115
|
- 重要事件标记
|
|
@@ -136,7 +136,7 @@ timeline_data=$(cat spec/tracking/timeline.json)
|
|
|
136
136
|
|
|
137
137
|
时间线数据更新遵循以下协议:
|
|
138
138
|
|
|
139
|
-
### 分片模式(
|
|
139
|
+
### 分片模式(tracking/volumes/ 存在)
|
|
140
140
|
|
|
141
141
|
1. **确定目标卷**:
|
|
142
142
|
- 如果命令指定 `--volume vol-XX`,写入对应卷
|
|
@@ -150,13 +150,13 @@ timeline_data=$(cat spec/tracking/timeline.json)
|
|
|
150
150
|
2. **写入分片文件**:
|
|
151
151
|
```bash
|
|
152
152
|
# 写入指定卷的 timeline.json
|
|
153
|
-
Write(
|
|
153
|
+
Write(tracking/volumes/${target_volume}/timeline.json)
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
3. **更新全局摘要**(如果事件跨度影响摘要统计):
|
|
157
157
|
```bash
|
|
158
158
|
# 更新 timeline-summary.json 的统计信息
|
|
159
|
-
Write(
|
|
159
|
+
Write(tracking/summary/timeline-summary.json)
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
4. **触发 MCP 同步**(如果启用):
|
|
@@ -171,7 +171,7 @@ timeline_data=$(cat spec/tracking/timeline.json)
|
|
|
171
171
|
|
|
172
172
|
直接写入完整 `timeline.json`:
|
|
173
173
|
```bash
|
|
174
|
-
Write(
|
|
174
|
+
Write(tracking/timeline.json)
|
|
175
175
|
```
|
|
176
176
|
|
|
177
177
|
### 写入示例
|
|
@@ -184,8 +184,8 @@ const targetVolume = `vol-${String(volumeNum).padStart(2, '0')}`;
|
|
|
184
184
|
|
|
185
185
|
// 读取目标卷的 timeline 分片
|
|
186
186
|
const timelinePath = isSharded
|
|
187
|
-
? `
|
|
188
|
-
: '
|
|
187
|
+
? `tracking/volumes/${targetVolume}/timeline.json`
|
|
188
|
+
: 'tracking/timeline.json';
|
|
189
189
|
|
|
190
190
|
const timeline = JSON.parse(fs.readFileSync(timelinePath));
|
|
191
191
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: track-init
|
|
3
3
|
description: 初始化追踪系统,基于故事大纲设置追踪数据
|
|
4
|
-
allowed-tools: Read(//stories/**/specification.md), Read(//stories/**/specification.md), Read(//stories/**/creative-plan.md), Read(//stories/**/creative-plan.md), Write(//
|
|
4
|
+
allowed-tools: Read(//stories/**/specification.md), Read(//stories/**/specification.md), Read(//stories/**/creative-plan.md), Read(//stories/**/creative-plan.md), Write(//tracking/**), Write(//tracking/**), Bash(find:*), Bash(grep:*), Bash(wc:*), Bash(*)
|
|
5
5
|
scripts:
|
|
6
|
-
sh:
|
|
7
|
-
ps:
|
|
6
|
+
sh: resources/scripts/bash/init-tracking.sh
|
|
7
|
+
ps: resources/scripts/powershell/init-tracking.ps1
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# 初始化追踪系统
|
|
@@ -38,13 +38,13 @@ resource-loading:
|
|
|
38
38
|
1. **读取基础数据**
|
|
39
39
|
- 读取 `stories/*/specification.md` 获取故事设定
|
|
40
40
|
- 读取 `stories/*/creative-plan.md` 获取章节规划
|
|
41
|
-
- 读取
|
|
41
|
+
- 读取 `resources/config/config.json` 获取写作方法
|
|
42
42
|
|
|
43
43
|
2. **初始化追踪文件**
|
|
44
44
|
|
|
45
45
|
**重要**:优先从 `specification.md` 第五章读取线索管理规格,填充到追踪文件。
|
|
46
46
|
|
|
47
|
-
创建或更新 `
|
|
47
|
+
创建或更新 `tracking/plot-tracker.json`:
|
|
48
48
|
- 从 `specification.md 5.1节` 读取所有线索定义
|
|
49
49
|
- 从 `specification.md 5.3节` 读取所有交汇点
|
|
50
50
|
- 从 `specification.md 5.4节` 读取所有伏笔
|
|
@@ -111,15 +111,15 @@ resource-loading:
|
|
|
111
111
|
}
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
创建或更新 `
|
|
114
|
+
创建或更新 `tracking/timeline.json`:
|
|
115
115
|
- 根据章节规划设置时间节点
|
|
116
116
|
- 标记重要时间事件
|
|
117
117
|
|
|
118
|
-
创建或更新 `
|
|
118
|
+
创建或更新 `tracking/relationships.json`:
|
|
119
119
|
- 从角色设定提取初始关系
|
|
120
120
|
- 设置派系分组
|
|
121
121
|
|
|
122
|
-
创建或更新 `
|
|
122
|
+
创建或更新 `tracking/character-state.json`:
|
|
123
123
|
- 初始化角色状态
|
|
124
124
|
- 设置起始位置
|
|
125
125
|
|
|
@@ -3,10 +3,10 @@ name: track
|
|
|
3
3
|
description: 综合追踪小说创作进度和内容
|
|
4
4
|
argument-hint: [--brief | --plot | --stats | --check [--volume vol-XX] | --fix | --sync [--incremental] | --migrate [--auto | --volumes "1-100,101-200"] | --log]
|
|
5
5
|
recommended-model: claude-haiku-4-5-20251001 # --sync 数据更新速度优先;--check 深度检查可用 sonnet
|
|
6
|
-
allowed-tools: Read(//
|
|
6
|
+
allowed-tools: Read(//tracking/**), Read(//tracking/**), Read(//stories/**), Read(//stories/**), Bash(find:*), Bash(wc:*), Bash(grep:*), Bash(*)
|
|
7
7
|
scripts:
|
|
8
|
-
sh:
|
|
9
|
-
ps:
|
|
8
|
+
sh: resources/scripts/bash/track-progress.sh
|
|
9
|
+
ps: resources/scripts/powershell/track-progress.ps1
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# 综合进度追踪
|
|
@@ -53,12 +53,12 @@ resource-loading:
|
|
|
53
53
|
|
|
54
54
|
整合多个追踪文件的信息:
|
|
55
55
|
- `progress.json` - 写作进度
|
|
56
|
-
- `
|
|
57
|
-
- `
|
|
58
|
-
- `
|
|
59
|
-
- `
|
|
60
|
-
- `
|
|
61
|
-
- `
|
|
56
|
+
- `tracking/plot-tracker.json` - 情节追踪
|
|
57
|
+
- `tracking/timeline.json` - 时间线
|
|
58
|
+
- `tracking/relationships.json` - 关系网络
|
|
59
|
+
- `tracking/character-state.json` - 角色状态
|
|
60
|
+
- `tracking/narrative-threads.json` - **[新增]** 多线叙事追踪(POV调度、信息差、线程交汇)
|
|
61
|
+
- `tracking/validation-rules.json` - **[新增]** 验证规则(用于--check和--fix)
|
|
62
62
|
|
|
63
63
|
---
|
|
64
64
|
|
|
@@ -196,7 +196,7 @@ resource-loading:
|
|
|
196
196
|
|
|
197
197
|
### 实现逻辑
|
|
198
198
|
|
|
199
|
-
1. 读取 `
|
|
199
|
+
1. 读取 `tracking/tracking-log.md`,解析日志格式
|
|
200
200
|
2. 根据过滤条件筛选,按时间倒序排列
|
|
201
201
|
3. 默认仅加载摘要(轻量级),选择"查看详情"时加载完整 diff
|
|
202
202
|
4. 大型日志(>1000 条)分页显示
|
|
@@ -209,7 +209,7 @@ resource-loading:
|
|
|
209
209
|
|
|
210
210
|
```
|
|
211
211
|
ℹ️ 提示:tracking-log.md 不存在
|
|
212
|
-
- 位置:
|
|
212
|
+
- 位置:tracking/tracking-log.md
|
|
213
213
|
- 原因:尚未执行过任何 tracking 更新命令
|
|
214
214
|
- 建议:执行 /write 或 /plan 命令后会自动创建
|
|
215
215
|
```
|
|
@@ -335,7 +335,7 @@ resource-loading:
|
|
|
335
335
|
**数据收集**:
|
|
336
336
|
- 读取所有章节文件(`content/*.md`)
|
|
337
337
|
- 读取 `tasks.md`、`creative-plan.md`
|
|
338
|
-
- 读取 `
|
|
338
|
+
- 读取 `tracking/character-state.json`、`tracking/plot-tracker.json`
|
|
339
339
|
|
|
340
340
|
#### 总览面板
|
|
341
341
|
|
|
@@ -515,7 +515,7 @@ Phase 3: 生成综合报告
|
|
|
515
515
|
|
|
516
516
|
只处理上次同步后的新章节:
|
|
517
517
|
|
|
518
|
-
1. 读取 `
|
|
518
|
+
1. 读取 `tracking/tracking-log.md` 最后一条记录,获取 last_sync_chapter
|
|
519
519
|
2. 扫描 `stories/[current]/content/` 中编号 > last_sync_chapter 的章节
|
|
520
520
|
3. 只对这些新章节执行 tracking 更新
|
|
521
521
|
4. 更新 tracking-log.md 记录本次同步
|
|
@@ -591,17 +591,17 @@ Phase 3: 生成综合报告
|
|
|
591
591
|
|
|
592
592
|
读取 tracking 数据时按以下优先级:
|
|
593
593
|
1. **MCP 查询(优先)**:调用对应 MCP 工具获取精确数据
|
|
594
|
-
2. **分片 JSON(次优)**:读取 `
|
|
595
|
-
3. **单文件 JSON(兜底)**:读取 `
|
|
594
|
+
2. **分片 JSON(次优)**:读取 `tracking/volumes/[currentVolume]/` 下的分片文件
|
|
595
|
+
3. **单文件 JSON(兜底)**:读取 `tracking/` 下的单文件
|
|
596
596
|
|
|
597
597
|
**分片模式写入:**
|
|
598
598
|
1. 确定当前章节属于哪个卷(从 volume-summaries.json 的 chapters 范围判断)
|
|
599
|
-
2. 更新该卷的分片文件(如 `
|
|
599
|
+
2. 更新该卷的分片文件(如 `tracking/volumes/vol-03/character-state.json`)
|
|
600
600
|
3. 同步更新全局摘要文件(如 characters-summary.json 的 activeCount)
|
|
601
601
|
4. 如果 MCP 可用,调用 `sync_from_json` 同步到 SQLite
|
|
602
602
|
|
|
603
603
|
**单文件模式写入:**
|
|
604
|
-
- 直接更新 `
|
|
604
|
+
- 直接更新 `tracking/` 下的文件(现有逻辑)
|
|
605
605
|
|
|
606
606
|
---
|
|
607
607
|
|
|
@@ -646,7 +646,7 @@ powershell -File {SCRIPT_DIR}/migrate-tracking.ps1 -Mode auto -Json
|
|
|
646
646
|
|
|
647
647
|
按卷边界拆分 character-state / timeline / relationships / plot-tracker 四个文件:
|
|
648
648
|
- 拆分原则:按 chapter 分配数据到对应卷,跨卷数据保留引用
|
|
649
|
-
- 写入 `
|
|
649
|
+
- 写入 `tracking/volumes/vol-XX/`
|
|
650
650
|
|
|
651
651
|
拆分规则概要:
|
|
652
652
|
| 文件 | 拆分方式 |
|
|
@@ -657,7 +657,7 @@ powershell -File {SCRIPT_DIR}/migrate-tracking.ps1 -Mode auto -Json
|
|
|
657
657
|
| plot-tracker.json | foreshadowing 按 planted.chapter 分配(跨卷未解决伏笔保留引用);plotlines 每卷记录进展;checkpoints 按卷分配 |
|
|
658
658
|
|
|
659
659
|
**阶段 4:生成全局摘要**
|
|
660
|
-
- 生成 4 个摘要文件到 `
|
|
660
|
+
- 生成 4 个摘要文件到 `tracking/summary/`:
|
|
661
661
|
- characters-summary.json — 活跃/归档角色统计
|
|
662
662
|
- plot-summary.json — 未解决伏笔汇总、回收统计
|
|
663
663
|
- timeline-summary.json — 每卷关键里程碑、故事时间范围
|
|
@@ -678,15 +678,15 @@ powershell -File {SCRIPT_DIR}/migrate-tracking.ps1 -Mode auto -Json
|
|
|
678
678
|
━━━━━━━━━━━━━━━━━━━
|
|
679
679
|
迁移前:单文件模式,总大小 XXX KB
|
|
680
680
|
迁移后:N 卷分片,每卷平均 XX KB
|
|
681
|
-
备份位置:
|
|
681
|
+
备份位置:tracking/backup/YYYYMMDD-HHMMSS/
|
|
682
682
|
```
|
|
683
683
|
|
|
684
684
|
### 错误处理
|
|
685
685
|
|
|
686
686
|
任何步骤失败时,提示用户从备份恢复:
|
|
687
687
|
```
|
|
688
|
-
迁移失败。备份文件在
|
|
689
|
-
可以手动将备份文件复制回
|
|
688
|
+
迁移失败。备份文件在 tracking/backup/YYYYMMDD-HHMMSS/
|
|
689
|
+
可以手动将备份文件复制回 tracking/ 恢复原状。
|
|
690
690
|
```
|
|
691
691
|
不自动删除备份,由用户手动清理。
|
|
692
692
|
|
|
@@ -55,8 +55,8 @@ const timeline = await mcp.call('novelws-mcp/query_timeline', {
|
|
|
55
55
|
### Layer 2: 分片 JSON(次优)
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
# 当
|
|
59
|
-
VOLUME_DIR="
|
|
58
|
+
# 当 tracking/volumes/ 存在时
|
|
59
|
+
VOLUME_DIR="tracking/volumes/vol-03"
|
|
60
60
|
|
|
61
61
|
# 读取该卷所有 tracking 数据
|
|
62
62
|
cat "$VOLUME_DIR/character-state.json"
|
|
@@ -75,7 +75,7 @@ cat "$VOLUME_DIR/story-facts.json"
|
|
|
75
75
|
|
|
76
76
|
```bash
|
|
77
77
|
# 传统模式,加载完整文件后手动过滤卷
|
|
78
|
-
character_state=$(cat
|
|
78
|
+
character_state=$(cat tracking/character-state.json | jq ".characters | map(select(.volume == \"vol-03\"))")
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
**向下兼容**:小型项目(< 300 章)继续使用单文件模式,摘要覆盖全书
|
|
@@ -102,7 +102,7 @@ const shouldExport = args.export || false;
|
|
|
102
102
|
### Step 2: 检测数据模式
|
|
103
103
|
|
|
104
104
|
```javascript
|
|
105
|
-
const isSharded = fs.existsSync('
|
|
105
|
+
const isSharded = fs.existsSync('tracking/volumes/');
|
|
106
106
|
const hasMCP = fs.existsSync('mcp-servers.json');
|
|
107
107
|
|
|
108
108
|
// 选择数据源
|
|
@@ -129,7 +129,7 @@ const data = await loadVolumeDataFromMCP(volumeId);
|
|
|
129
129
|
#### 分片模式
|
|
130
130
|
|
|
131
131
|
```bash
|
|
132
|
-
VOLUME_DIR="
|
|
132
|
+
VOLUME_DIR="tracking/volumes/${volumeId}"
|
|
133
133
|
|
|
134
134
|
if [[ ! -d "$VOLUME_DIR" ]]; then
|
|
135
135
|
echo "错误:卷目录不存在:$VOLUME_DIR"
|
|
@@ -406,7 +406,7 @@ JSON 数据可用于:
|
|
|
406
406
|
用户:/volume-summary vol-05
|
|
407
407
|
助手:检测到分片模式...
|
|
408
408
|
|
|
409
|
-
数据来源:
|
|
409
|
+
数据来源:tracking/volumes/vol-05/
|
|
410
410
|
✓ character-state.json
|
|
411
411
|
✓ relationships.json
|
|
412
412
|
✓ plot-tracker.json
|
|
@@ -4,8 +4,8 @@ argument-hint: [章节编号或任务ID] [--fast] [--batch N] [--volume vol-XX]
|
|
|
4
4
|
recommended-model: claude-opus-4-6 # 创作质量最高;--fast 时可用 sonnet
|
|
5
5
|
allowed-tools: Read(//**), Write(//stories/**/content/**), Bash(ls:*), Bash(find:*), Bash(wc:*), Bash(grep:*), Bash(*)
|
|
6
6
|
scripts:
|
|
7
|
-
sh:
|
|
8
|
-
ps:
|
|
7
|
+
sh: resources/scripts/bash/check-writing-state.sh
|
|
8
|
+
ps: resources/scripts/powershell/check-writing-state.ps1
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
基于七步方法论流程执行章节写作。
|
|
@@ -77,26 +77,71 @@ powershell -File {SCRIPT} -Json
|
|
|
77
77
|
3. 按顺序加载 `resources.knowledge-base` 和 `resources.skills`
|
|
78
78
|
4. 跳过 `resources.disabled` 中的资源
|
|
79
79
|
|
|
80
|
+
### 增量缓存加载(性能优化核心)
|
|
81
|
+
|
|
82
|
+
⚠️ **此机制大幅减少重复加载,连续写作时跳过未变化的资源。**
|
|
83
|
+
|
|
84
|
+
**步骤 0: 检查缓存**
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
1. 读取 .claude/.cache/resource-digest.json
|
|
88
|
+
├─ 不存在 → 首次加载(全量),生成 digest + context
|
|
89
|
+
└─ 存在 → 进入增量检查
|
|
90
|
+
|
|
91
|
+
2. 对比每个已缓存文件的 mtime(用 Bash stat 命令)
|
|
92
|
+
├─ 全部未变 → 直接复用 .claude/.cache/write-context.json,跳到 L0 加载
|
|
93
|
+
└─ 有变化 → 只重新读取变化的文件
|
|
94
|
+
|
|
95
|
+
3. 更新 write-context.json 中变化的部分
|
|
96
|
+
├─ L1 文件变化 → 重新生成该文件的摘要(200-300字)
|
|
97
|
+
└─ L2 文件变化 → 重新缓存全文
|
|
98
|
+
|
|
99
|
+
4. 写回更新后的 resource-digest.json + write-context.json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**资源分级**:
|
|
103
|
+
|
|
104
|
+
| 级别 | 内容 | 策略 |
|
|
105
|
+
|------|------|------|
|
|
106
|
+
| L0 必读 | tasks.md、上一章最后500字、当前活跃角色 | 每次读取全文,不缓存 |
|
|
107
|
+
| L1 摘要 | constitution.md、specification.md、creative-plan.md、plot-tracker.json、relationships.json | 首次读全文生成摘要,后续只在 mtime 变化时重新生成 |
|
|
108
|
+
| L2 按需 | craft/、genres/、styles/、requirements/、skills/ | 仅在关键词触发或配置指定时加载,加载后缓存全文 |
|
|
109
|
+
|
|
110
|
+
**缓存复用判定**:
|
|
111
|
+
- 如果 `write-context.json` 存在且 `digest_version` 与 `resource-digest.json` 的 `version` 一致 → 复用 L1 摘要 + L2 缓存
|
|
112
|
+
- 如果 `digest_version` 不一致 → 全量重建
|
|
113
|
+
- 用户删除 `.claude/.cache/` → 下次全量重建
|
|
114
|
+
|
|
115
|
+
**首次加载(无缓存)**:按下方完整查询协议执行,完成后生成两个缓存文件。
|
|
116
|
+
|
|
117
|
+
**后续加载(有缓存且未过期)**:
|
|
118
|
+
1. 直接使用 `write-context.json` 中的 `l1_summaries` 作为 L1 上下文
|
|
119
|
+
2. 直接使用 `l2_loaded` 中的缓存资源
|
|
120
|
+
3. 仅实时加载 L0 资源(tasks.md、上一章、活跃角色)
|
|
121
|
+
4. 合并 L0 + L1 缓存 + L2 缓存 → 进入写作
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
80
125
|
### 查询协议(必读顺序 + 三层资源加载)
|
|
81
126
|
|
|
82
|
-
⚠️
|
|
127
|
+
⚠️ **严格按以下顺序查询文档**(首次加载或缓存失效时执行完整流程):
|
|
83
128
|
|
|
84
|
-
1.
|
|
129
|
+
1. **先查(最高优先级)**【L1 — 缓存摘要】:
|
|
85
130
|
- `memory/constitution.md`(创作宪法)
|
|
86
131
|
- `memory/personal-voice.md`(个人风格指南 - 如有)
|
|
87
132
|
- `memory/style-reference.md`(风格参考 - 如有)
|
|
88
133
|
|
|
89
|
-
2.
|
|
134
|
+
2. **再查(规格和计划)**【L1 — 缓存摘要】:
|
|
90
135
|
- `stories/*/specification.md`(故事规格)
|
|
91
136
|
- `stories/*/creative-plan.md`(创作计划)
|
|
92
|
-
- `stories/*/tasks.md
|
|
137
|
+
- `stories/*/tasks.md`(当前任务)【L0 — 每次必读】
|
|
93
138
|
|
|
94
139
|
2.1. **风格学习前置检查**:
|
|
95
140
|
- 如果 `memory/personal-voice.md` 不存在且已写 ≥ 3 章,提示用户执行 `/style-learning`
|
|
96
141
|
|
|
97
142
|
2.5. **自动加载写作风格和规范(基于配置)**:
|
|
98
143
|
- 读取 `specification.md` 的 YAML frontmatter
|
|
99
|
-
- 如配置了 `writing-style`,加载
|
|
144
|
+
- 如配置了 `writing-style`,加载 `resources/styles/[name].md`
|
|
100
145
|
- 如配置了 `writing-requirements`,加载对应规范文档
|
|
101
146
|
|
|
102
147
|
2.6. **第三层智能资源加载(三层机制)**
|
|
@@ -108,11 +153,11 @@ powershell -File {SCRIPT} -Json
|
|
|
108
153
|
如果 specification.md 未配置 `resource-loading`,自动加载:
|
|
109
154
|
|
|
110
155
|
**Knowledge-base (craft)**:
|
|
111
|
-
- `
|
|
112
|
-
- `
|
|
113
|
-
- `
|
|
114
|
-
- `
|
|
115
|
-
- `
|
|
156
|
+
- `resources/craft/dialogue.md`
|
|
157
|
+
- `resources/craft/scene-structure.md`
|
|
158
|
+
- `resources/craft/character-arc.md`
|
|
159
|
+
- `resources/craft/pacing.md`
|
|
160
|
+
- `resources/craft/show-not-tell.md`
|
|
116
161
|
|
|
117
162
|
**Skills (writing-techniques)**:
|
|
118
163
|
- `templates/skills/writing-techniques/dialogue-techniques/SKILL.md`
|
|
@@ -151,7 +196,7 @@ resource-loading:
|
|
|
151
196
|
|
|
152
197
|
**执行流程**:
|
|
153
198
|
1. 收集待扫描文本(命令参数 + 任务描述 + 用户输入)
|
|
154
|
-
2. 读取 `
|
|
199
|
+
2. 读取 `resources/config/keyword-mappings.json` 映射表
|
|
155
200
|
3. 合并 specification.md 中的自定义映射
|
|
156
201
|
4. 执行关键词匹配,跳过已加载资源
|
|
157
202
|
5. 如有匹配,提示用户确认加载:
|
|
@@ -169,28 +214,28 @@ resource-loading:
|
|
|
169
214
|
|
|
170
215
|
> **性能优化**:参见 CLAUDE.md 中的「会话级资源复用」章节。
|
|
171
216
|
|
|
172
|
-
3. **再查(状态和数据 — 三层 Fallback
|
|
217
|
+
3. **再查(状态和数据 — 三层 Fallback)**【L0/L1 混合】:
|
|
173
218
|
|
|
174
219
|
按以下优先级加载 tracking 数据:
|
|
175
220
|
|
|
176
|
-
**Layer 1: MCP
|
|
221
|
+
**Layer 1: MCP 查询(优先)**【L0 — 每次查询】
|
|
177
222
|
- `query_characters --status=active --limit=20` → 活跃角色
|
|
178
223
|
- `query_relationships --volume=[当前卷号]` → 当前卷关系
|
|
179
224
|
- `query_plot --status=active` → 活跃伏笔
|
|
180
225
|
- `query_facts` → 设定事实
|
|
181
226
|
- 如果指定了 `--volume vol-XX`,所有查询限定到该卷
|
|
182
227
|
|
|
183
|
-
**Layer 2: 分片 JSON(次优,检测
|
|
228
|
+
**Layer 2: 分片 JSON(次优,检测 tracking/volumes/ 是否存在)**【L1 — 缓存摘要】
|
|
184
229
|
- 确定当前章节属于哪个卷(从 volume-summaries.json 的 chapters 范围判断)
|
|
185
|
-
- 读取该卷的分片文件:`
|
|
186
|
-
- 读取全局摘要:`
|
|
230
|
+
- 读取该卷的分片文件:`tracking/volumes/[currentVolume]/character-state.json` 等
|
|
231
|
+
- 读取全局摘要:`tracking/summary/characters-summary.json`(活跃角色概览)
|
|
187
232
|
|
|
188
|
-
**Layer 3: 单文件 JSON
|
|
189
|
-
- `
|
|
190
|
-
- `
|
|
191
|
-
- `
|
|
192
|
-
- `
|
|
193
|
-
- `
|
|
233
|
+
**Layer 3: 单文件 JSON(兜底,现有逻辑)**【L1 — 缓存摘要】
|
|
234
|
+
- `tracking/character-state.json`(角色状态)
|
|
235
|
+
- `tracking/relationships.json`(关系网络)
|
|
236
|
+
- `tracking/plot-tracker.json`(情节追踪 - 如有)
|
|
237
|
+
- `tracking/validation-rules.json`(验证规则 - 如有)
|
|
238
|
+
- `tracking/story-facts.json`(设定事实 - 如有)
|
|
194
239
|
|
|
195
240
|
**📋 本章引用的设定事实**(如当前章节已有 `<!-- story-facts: ... -->` 注释):
|
|
196
241
|
|
|
@@ -210,17 +255,17 @@ resource-loading:
|
|
|
210
255
|
|
|
211
256
|
- **快写模式(--fast)**: 跳过详细展示,但保留数据加载
|
|
212
257
|
|
|
213
|
-
4.
|
|
214
|
-
- `
|
|
258
|
+
4. **再查(知识库)**【L2 — 按需缓存】:
|
|
259
|
+
- `resources/knowledge/` 相关文件(世界观、角色档案等)
|
|
215
260
|
- `stories/*/content/`(前文内容 - 了解前情)
|
|
216
261
|
|
|
217
|
-
5.
|
|
262
|
+
5. **再查(写作规范)**【L2 — 按需缓存】:
|
|
218
263
|
- `memory/personal-voice.md`(个人语料 - 如有)
|
|
219
|
-
- `
|
|
220
|
-
- **⚠️ 必须加载**:`
|
|
264
|
+
- `resources/knowledge/natural-expression.md`(自然化表达 - 如有)
|
|
265
|
+
- **⚠️ 必须加载**:`resources/requirements/anti-ai-v4.md`(禁用词与替换策略权威参考)
|
|
221
266
|
|
|
222
267
|
6. **条件查询(前三章专用)**:
|
|
223
|
-
- **如果章节编号 ≤ 3 或总字数 < 10000字**,额外查询 `
|
|
268
|
+
- **如果章节编号 ≤ 3 或总字数 < 10000字**,额外查询 `resources/presets/golden-opening.md`
|
|
224
269
|
|
|
225
270
|
### ⚠️ 强制完成确认
|
|
226
271
|
|
|
@@ -233,7 +278,7 @@ resource-loading:
|
|
|
233
278
|
✓ 2. stories/*/specification.md - 故事规格
|
|
234
279
|
✓ 3. stories/*/creative-plan.md - 创作计划
|
|
235
280
|
✓ 4. stories/*/tasks.md - 当前任务
|
|
236
|
-
✓ 5.
|
|
281
|
+
✓ 5. tracking/ - 角色状态、关系、情节
|
|
237
282
|
|
|
238
283
|
🆕 三层资源加载:
|
|
239
284
|
✓ Layer 1-3 加载完成
|
|
@@ -244,6 +289,48 @@ resource-loading:
|
|
|
244
289
|
|
|
245
290
|
⚠️ **禁止跳过此步骤**:这是防止AI在长篇创作中失焦的核心机制。
|
|
246
291
|
|
|
292
|
+
### 缓存写回
|
|
293
|
+
|
|
294
|
+
**首次加载或有文件变化时**,将加载结果写入缓存:
|
|
295
|
+
|
|
296
|
+
1. **生成 resource-digest.json**:记录所有已读文件的 mtime 和 size
|
|
297
|
+
```json
|
|
298
|
+
{
|
|
299
|
+
"version": 1,
|
|
300
|
+
"updated_at": "[ISO时间]",
|
|
301
|
+
"files": {
|
|
302
|
+
"resources/memory/constitution.md": { "mtime": [毫秒时间戳], "size": [字节] },
|
|
303
|
+
"tracking/character-state.json": { "mtime": [毫秒时间戳], "size": [字节] }
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
2. **生成 write-context.json**:保存 L1 摘要和 L2 缓存状态
|
|
309
|
+
```json
|
|
310
|
+
{
|
|
311
|
+
"version": 1,
|
|
312
|
+
"story": "[故事目录名]",
|
|
313
|
+
"last_chapter": [章节号],
|
|
314
|
+
"generated_at": "[ISO时间]",
|
|
315
|
+
"digest_version": 1,
|
|
316
|
+
"context": {
|
|
317
|
+
"l1_summaries": {
|
|
318
|
+
"constitution": "[200字摘要]",
|
|
319
|
+
"specification": "[300字摘要]",
|
|
320
|
+
"creative_plan": "[200字摘要]",
|
|
321
|
+
"active_plots": [{"id": "", "name": "", "status": "", "progress": ""}],
|
|
322
|
+
"active_relationships": [{"from": "", "to": "", "type": "", "tension": ""}]
|
|
323
|
+
},
|
|
324
|
+
"l2_loaded": {
|
|
325
|
+
"resources/craft/dialogue.md": "已缓存",
|
|
326
|
+
"resources/requirements/anti-ai-v5-balanced.md": "已缓存"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
3. 使用 `Write` 工具写入 `.claude/.cache/resource-digest.json` 和 `.claude/.cache/write-context.json`
|
|
333
|
+
|
|
247
334
|
<!-- PLUGIN_HOOK: genre-knowledge-write -->
|
|
248
335
|
|
|
249
336
|
---
|
|
@@ -259,7 +346,7 @@ resource-loading:
|
|
|
259
346
|
**仅加载以下 3 项**(跳过三层资源加载):
|
|
260
347
|
1. **当前任务**:`stories/*/tasks.md` 中 `pending` 或 `in_progress` 的任务
|
|
261
348
|
2. **上一章内容**:最近完成的章节文件(最后 500 字)
|
|
262
|
-
3. **角色状态**:`
|
|
349
|
+
3. **角色状态**:`tracking/character-state.json`(仅当前活跃角色)
|
|
263
350
|
|
|
264
351
|
### Fast-2. 极简写作提醒
|
|
265
352
|
|
|
@@ -290,7 +377,7 @@ resource-loading:
|
|
|
290
377
|
|
|
291
378
|
### 恢复检测
|
|
292
379
|
|
|
293
|
-
在开始写作前,检查 `
|
|
380
|
+
在开始写作前,检查 `tracking/write-checkpoint.json`:
|
|
294
381
|
- 如存在且 `status` 为 `in_progress` 且未过期(24小时内)→ 提示恢复
|
|
295
382
|
- 用户选择「继续写作」→ 从断点恢复
|
|
296
383
|
- 用户选择「重新开始」→ 删除 checkpoint,正常流程
|
|
@@ -380,7 +467,7 @@ resource-loading:
|
|
|
380
467
|
**📋 禁用词与替换策略**:
|
|
381
468
|
|
|
382
469
|
> **引用外部规范**:完整的禁用词黑名单(200+ 词)和替换策略表,请参阅:
|
|
383
|
-
> `
|
|
470
|
+
> `resources/requirements/anti-ai-v4.md`
|
|
384
471
|
>
|
|
385
472
|
> ⚠️ **写作时必须加载此文件**,作为禁用词和替换的权威参考。
|
|
386
473
|
|
|
@@ -415,7 +502,7 @@ resource-loading:
|
|
|
415
502
|
|
|
416
503
|
写完一段后,主动识别并替换抽象表达。
|
|
417
504
|
|
|
418
|
-
> **完整清单和示例**:首次写作时读取 `
|
|
505
|
+
> **完整清单和示例**:首次写作时读取 `resources/requirements/concretization.md`
|
|
419
506
|
>
|
|
420
507
|
> 核心要点:
|
|
421
508
|
> - 时间具体化(避免"最近"、"很久")
|
|
@@ -437,7 +524,7 @@ resource-loading:
|
|
|
437
524
|
|
|
438
525
|
**字数统计**:使用项目提供的脚本验证:
|
|
439
526
|
```bash
|
|
440
|
-
source
|
|
527
|
+
source resources/scripts/bash/common.sh
|
|
441
528
|
count_chinese_words "stories/*/content/第X章.md"
|
|
442
529
|
```
|
|
443
530
|
⚠️ 不要使用 `wc -w` 统计中文字数。
|
|
@@ -471,12 +558,12 @@ count_chinese_words "stories/*/content/第X章.md"
|
|
|
471
558
|
3. **合并更新**:将新内容增量合并到现有数据
|
|
472
559
|
4. **写入 tracking 数据**:
|
|
473
560
|
- **分片模式**:确定当前章节所属卷,更新该卷的分片文件,同步更新全局摘要
|
|
474
|
-
- **单文件模式**:直接更新 `
|
|
561
|
+
- **单文件模式**:直接更新 `tracking/` 下的文件
|
|
475
562
|
5. **MCP 同步**(如果可用):
|
|
476
563
|
- `log_writing_session` — 记录本次写作的章节号、字数
|
|
477
564
|
- `sync_from_json` — 将更新后的 tracking 数据同步到 SQLite
|
|
478
565
|
- 更新 FTS 索引 — 将新章节内容索引到全文检索
|
|
479
|
-
6. **记录日志**:追加到 `
|
|
566
|
+
6. **记录日志**:追加到 `tracking/tracking-log.md`
|
|
480
567
|
|
|
481
568
|
> **详细格式和示例**:参见 `.claude/skills/auto-tracking/SKILL.md`
|
|
482
569
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **句式**:短句优先(15-25 字),白话替代文绉绉
|
|
10
10
|
- **描写**:删除装饰性形容词,一个准确细节胜过三个堆砌
|
|
11
11
|
- **禁止**:「然而」「殊不知」「缓缓」「深邃」「仿佛...一般」等 AI 高频词
|
|
12
|
-
-
|
|
12
|
+
- **完整规范**:`resources/requirements/anti-ai-v4.md`
|
|
13
13
|
|
|
14
14
|
## 段落格式规范
|
|
15
15
|
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
**补充上下文来源**(不依赖前文全文):
|
|
45
45
|
- `creative-plan.md`:章节大纲和情节走向
|
|
46
46
|
- `tasks.md`:当前章节具体写作任务
|
|
47
|
-
- `
|
|
47
|
+
- `tracking/*.json`:角色状态、关系、情节线、时间线
|
|
48
48
|
|
|
49
49
|
## /compact 使用建议
|
|
50
50
|
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
### 目录结构(分片模式)
|
|
61
61
|
|
|
62
62
|
```
|
|
63
|
-
|
|
63
|
+
tracking/
|
|
64
64
|
├── story-facts.json # 全局事实库
|
|
65
65
|
├── tracking-log.md # 全局更新日志
|
|
66
66
|
├── summary/ # 全局摘要(跨卷查询入口)
|
|
@@ -108,7 +108,7 @@ spec/tracking/
|
|
|
108
108
|
|
|
109
109
|
**迁移流程**:
|
|
110
110
|
1. **检查模式**:分析当前 tracking 文件大小
|
|
111
|
-
2. **备份数据**:创建时间戳备份(`
|
|
111
|
+
2. **备份数据**:创建时间戳备份(`tracking-backup-YYYYMMDD/`)
|
|
112
112
|
3. **自动分片**:
|
|
113
113
|
- 创建 `summary/` 和 `volumes/` 目录
|
|
114
114
|
- 按卷拆分 tracking 数据(默认每卷 50 章)
|
|
@@ -149,7 +149,7 @@ spec/tracking/
|
|
|
149
149
|
novelws init my-novel --with-mcp
|
|
150
150
|
|
|
151
151
|
# 或在现有项目中配置
|
|
152
|
-
# 编辑
|
|
152
|
+
# 编辑 resources/config/config.json,添加:
|
|
153
153
|
{
|
|
154
154
|
"mcp": true
|
|
155
155
|
}
|