Quellcode durchsuchen

docs: avoid naming nonexistent writing dna files

lingfengQAQ vor 1 Monat
Ursprung
Commit
c95d2f4c19

+ 2 - 2
webnovel-writer/agents/context-agent.md

@@ -75,7 +75,7 @@ python -X utf8 "${SCRIPTS_DIR}/webnovel.py" --project-root "{project_root}" extr
 1. `load-context --chapter {NNNN}` 获取基础包
 2. `Read` 章纲原文(load-context 的 outline 可能截断)
 3. 确定卷号(优先 runtime contracts / latest commit;必要时兼容读取 state.json 投影)
-4. 读取项目级写作 DNA(若存在):`{project_root}/P20_WRITING_DNA.md`、`{project_root}/WRITING_DNA.md`、`{project_root}/.claude/rules/P20_*.md`。只消费规则,不在任务书暴露文件名。
+4. 若用户明确提供额外的项目级文风/反 AI 味规则文件,读取并只消费规则,不在任务书暴露文件名。
 
 ### B:按需深查(只查基础包不足的)
 
@@ -94,7 +94,7 @@ python -X utf8 "${SCRIPTS_DIR}/webnovel.py" --project-root "{project_root}" extr
 ### D:组装
 
 1. 推断:动机 = 目标+处境+钩子压力;情绪底色 = 上章结尾+走向;可用能力 = 境界+设定禁用
-2. 从 `story_contracts` 取 `reasoning`(style_priority/pacing_strategy)+ `anti_patterns`,并合并项目级写作 DNA
+2. 从 `story_contracts` 取 `reasoning`(style_priority/pacing_strategy)+ `anti_patterns`,并合并用户明确提供的项目级文风规则
 3. 组装五段任务书
 4. 红线校验
 

+ 1 - 1
webnovel-writer/agents/reviewer.md

@@ -19,7 +19,7 @@ model: inherit
 - `Grep`:在正文中搜索关键词
 - `Bash`:调用记忆模块查询
 
-若项目存在 `{project_root}/P20_WRITING_DNA.md`、`{project_root}/WRITING_DNA.md`、`{project_root}/.claude/rules/P20_*.md`,必须先读取并把其中的私有文风/反 AI 味规则纳入检查;输出 issue 时不暴露文件路径。
+若用户明确提供或指定项目级文风/反 AI 味规则文件,必须先读取并把其中的私有规则纳入检查;输出 issue 时不暴露文件路径。
 
 ```bash
 # 查询角色当前状态

+ 8 - 0
webnovel-writer/scripts/data_modules/tests/test_prompt_integrity.py

@@ -326,6 +326,14 @@ def test_context_agent_loads_fixed_guides_and_outputs_writer_brief():
     assert "Context Contract" not in text
 
 
+def test_agents_do_not_name_nonexistent_writing_dna_files():
+    for filename in ("context-agent.md", "reviewer.md"):
+        text = (AGENTS_DIR / filename).read_text(encoding="utf-8")
+        assert "P20_WRITING_DNA" not in text
+        assert "WRITING_DNA.md" not in text
+        assert ".claude/rules/P20_" not in text
+
+
 def test_data_agent_is_described_as_extraction_only_not_direct_write_mainline():
     text = (AGENTS_DIR / "data-agent.md").read_text(encoding="utf-8")
     assert "chapter-commit" in text