Novel Logic logo

Novel Logic

Community
Wooooooooood
novel-logic

小说逻辑预防工具。在写作过程中通过场景微逻辑卡、动作前四问、时间-地点双轴标注、信息边界追踪、冻结状态等机制,硬阻塞式预防时间矛盾、空间瞬移、信息穿帮、行为越界、因果断裂。当用户需要预防逻辑漏洞、检查前后一致性、管理角色知情边界、冻结前文章节状态时使用。触发词:逻辑、逻辑预防、微逻辑卡、四问、知情边界、时间地点、一致性、前后矛盾、信息边界、冻结状态、逻辑矩阵。

Overview

PublisherWooooooooood
Repositoryai-fiction-writer
Skill namenovel-logic
Stars
67
Forks
11
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Wooooooooood on GitHub. Read the source before you install it.

Installation

Install the Novel Logic AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Wooooooooood/ai-fiction-writer/tree/main/纯净版skill/novel-logic
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Novel Logic in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Novel Logic on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Novel Logic is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Novel Logic — 逻辑预防

专门在写作过程中预防逻辑漏洞:时间矛盾、空间瞬移、信息穿帮、行为越界、因果断裂。

核心原则:逻辑问题要在写下第一段正文之前就被拦住,而不是写完整章后再找补。

硬阻塞原则:不填场景微逻辑卡,不能写正文;不过动作前四问,不能写下一段。


一、工作区规范

.novel/
├── tracking/
│   ├── 上下文.md
│   ├── 角色状态.md
│   ├── 伏笔.md
│   ├── 时间线.md
│   ├── 修改记录.md
│   ├── 知情边界.md              # 谁不知道什么
│   ├── 逻辑矩阵.md              # 时间-地点-人物矩阵
│   └── logic-state.json         # 冻结状态数据
└── logic/                       # 逻辑预防工作目录
    ├── scene-cards/             # 场景微逻辑卡
    │   └── ch{NN}-scene{M}.md
    ├── paragraph-checks/        # 段落四问记录
    │   └── ch{NN}-paragraphs.md
    └── reports/                 # 逻辑检查报告
        └── ch{NN}-logic-report.md

二、核心机制

2.1 场景微逻辑卡(Scene Micro Logic Card)

每个场景动笔前必须填写。它是正文的直接依据,也是硬阻塞的第一道门。

为什么不沿用原来的逻辑骨架?

原逻辑骨架只到场景级,回答的是「场景之间怎么衔接」。但前后文不一致、细节逻辑不一致的问题,往往发生在场景内部的对话、动作、信息传递中。微逻辑卡把镜头推到每个动作链和每段对话。

微逻辑卡模板:

markdown
---
scene: {场景编号,如 scene-01}
chapter: {章节号}
location: {精确地点,如"东海城·海天楼三楼雅间"}
start_time: {起始时刻,如"09:15"}
end_time: {结束时刻,如"09:40"}
characters_present:
  - {角色A}: {位置},{状态},{知道什么},{想要什么}
  - {角色B}: {位置},{状态},{知道什么},{想要什么}
---

## 进入状态

- 时间:{时刻}
- 地点:{精确位置}
- 上一场景结束状态:{简述}
- 每个人此刻知道什么:
  - {角色A}:{信息列表}
  - {角色B}:{信息列表}
- 每个人此刻不知道什么:
  - {角色A}:{信息列表}
  - {角色B}:{信息列表}

## 动作链

1. **触发**:{谁 + 做什么}
   - 时间过了:{多久}
   - 地点变化:{无 / 从A到B}
   - 信息变化:{谁知道了什么}
   - 动作前四问:{通过/不通过 + 简述}

2. **反应**:{谁 + 反应}
   - 时间过了:{多久}
   - 地点变化:{无 / 从A到B}
   - 信息变化:{谁知道了什么}
   - 动作前四问:{通过/不通过 + 简述}

3. **结果**:{谁 + 决定}
   - 时间过了:{多久}
   - 地点变化:{无 / 从A到B}
   - 信息变化:{谁知道了什么}
   - 动作前四问:{通过/不通过 + 简述}

## 退出状态

- 时间:{时刻}
- 地点:{是否变化}
- 在场人物及位置
- 每个人知道什么 / 不知道什么(更新后)
- 留下的悬念/钩子
- 下一场景衔接点

填写要求:

  • 不写完整句子,用短语/列表即可
  • 每个动作链必须标注时间、地点、信息变化
  • 动作前四问必须逐条判定
  • 与上一场景、下一场景的衔接必须明确

2.2 动作前四问(Paragraph Four Questions)

每写一段正文前,必须回答四个问题。四问全部通过,才能写下一段。

问题作用不通过的后果
谁在场?明确这段中出现的人物及位置人物凭空出现或消失
他们刚在哪?与上一段/上一章的时间和空间衔接瞬移、时间跳跃
他们为什么要这么做?动机符合身份、关系、情绪、目标行为突兀、OOC
这个信息/道具/称呼从哪来的?前文有铺垫,符合知情边界信息穿帮、设定吃书

四问记录格式:

markdown
## 第 {N} 章段落四问记录

### 段落 1

**正文**:主角推门进来,李总已经在会议室坐了十分钟。

- 谁在场?主角、李总(秘书在门外等候)
- 他们刚在哪?主角从办公室过来,李总从家中直接到会议室
- 为什么要这么做?主角按约来汇报,李总要听方案
- 信息/道具来源?会议室是昨天秘书预订的(ch04)
- **判定**:通过

### 段落 2

...

2.3 时间-地点双轴标注

正文初稿阶段,每个段落前加 HTML 注释。定稿前清理。

markdown
<!-- LOGIC: time=09:15 | loc=公司会议室 | present=主角,李总 | info=主角知道B,李总不知道C -->

主角推门进来,李总已经在会议室坐了十分钟。

注释字段:

  • time:当前时间
  • loc:当前精确地点
  • present:在场人物
  • info:关键信息状态
  • pov:当前视角

作用:

  • 一眼看出时间是否跳跃
  • 一眼看出地点是否合理
  • 一眼看出人物是否在场
  • 便于后续生成逻辑矩阵

2.4 信息边界追踪(知情边界)

.novel/tracking/知情边界.md 是防止信息穿帮的核心工具。

markdown
## 当前各角色知情状态

| 角色 | 知道 | 不知道 | 信息来源 |
|------|------|--------|---------|
| 主角 | A、B、C | D、E | ch01 知道 A,ch03 知道 B,ch04 知道 C |
| 李总 | A、D | B、C、E | ch02 知道 A,ch04 知道 D |
| 秘书 | A | B、C、D、E | 仅知道公开场合信息 |

## 本章信息变化

- ch05-scene01:主角告诉了李总 B → 李总知道 B
- ch05-scene02:秘书偷听到 C → 秘书知道 C(但主角和李总不知道秘书知道)

## 潜在信息冲突预警

- 李总知道 B 后,按他的性格应该立刻行动,不能装作不知道
- 秘书知道 C 是秘密知情,后续不能让她在公开场合"自然"提到 C

## 下章必须交代

- 李总知道 B 后会做什么?
- 秘书知道 C 是否会产生影响?

更新时机:

  • 每个场景写完后更新
  • 任何信息传递场景必须立即更新
  • 任何偷听/误解场景必须标注"错误知情"或"部分知情"

2.5 冻结状态(Frozen State)

写本章前,从切片、角色状态、知情边界、时间线中提取关键状态,生成本章写作对照表。

logic-state.json:

json
{
  "chapter": 5,
  "frozen_at": "ch04-ending",
  "story_date": "1998-03-20",
  "anchor_time": "23:30",
  "characters": {
    "主角": {
      "location": "公司宿舍",
      "time": "23:30",
      "emotion": "焦虑",
      "knows": ["A", "B"],
      "doesnt_know": ["C", "D"],
      "goals": ["解决项目危机"],
      "stress_level": 7
    },
    "李总": {
      "location": "家中",
      "time": "23:00",
      "emotion": "平静",
      "knows": ["A"],
      "doesnt_know": ["B", "C", "D"],
      "goals": ["观察主角能力"],
      "stress_level": 3
    }
  },
  "active_hooks": ["hook-001", "hook-002"],
  "pending_questions": [
    "主角怎么知道 C 的?",
    "李总为何信任主角?"
  ],
  "recent_key_details": [
    "ch04-scene03:主角收到匿名信",
    "ch04-scene05:李总在酒局上试探主角"
  ]
}

使用规则:

  • 写作时任何与冻结状态冲突的内容必须报告
  • 本章内人物状态可以变化,但变化必须有明确触发事件
  • 冻结状态在下一章开始时重新生成

2.6 逻辑矩阵(时间-地点-人物矩阵)

每章写完后生成 .novel/tracking/逻辑矩阵.md:

markdown
## 第 5 章逻辑矩阵

| 时间段 | 地点 | 在场人物 | 核心事件 | 信息变化 |
|--------|------|---------|---------|---------|
| 08:00 | 家 | 主角 | 起床 | 无 |
| 09:15 | 公司会议室 | 主角、李总、秘书 | 开会 | 李总知道 B |
| 12:00 | 公司食堂 | 主角、同事 | 闲聊 | 无 |
| 14:30 | 黑礁巷 | 主角、神秘人 | 秘密交易 | 主角知道 C |
| 18:00 | 家 | 主角 | 复盘 | 决定告诉李总 B |

## 时间线检查

- 08:00 → 09:15:合理
- 09:15 → 12:00:合理
- 12:00 → 14:30:合理
- 14:30 → 18:00:合理

## 地理移动检查

- 家 → 公司:地铁 30 分钟,合理
- 公司 → 黑礁巷:打车 20 分钟,合理
- 黑礁巷 → 家:地铁 40 分钟,合理

## 信息边界检查

- 李总知道 B 后,本章未再与他人接触,无信息泄露风险
- 神秘人身份未暴露,符合 "pending" 状态

三、硬阻塞流程

开始写第 N 章
  ↓
读取冻结状态 logic-state.json
  ↓
写场景 1 微逻辑卡
  ↓
是否完整填写?
  ↓ 否 → 返回填写
  ↓ 是
写段落 1
  ↓
动作前四问是否全部通过?
  ↓ 否 → 修改或向作者说明
  ↓ 是
添加 HTML 注释,更新知情边界
  ↓
写段落 2
  ↓
...
场景 1 写完
  ↓
生成本场景即时逻辑报告
  ↓
通过?
  ↓ 否 → 修改
  ↓ 是
写场景 2 微逻辑卡
  ↓
...
第 N 章写完
  ↓
生成本章逻辑矩阵
  ↓
更新 logic-state.json 为下一章冻结状态

四、与现有 Skill 的协作

4.1 novel-writing

  • 写正文前:必须完成场景微逻辑卡
  • 写正文中:每段必须过动作前四问,加 HTML 注释
  • 写正文后:生成本章逻辑矩阵,更新知情边界
  • 上下文注入:新增「逻辑状态上下文」

4.2 novel-worldbuilding

  • 地理移动校验依赖 worldbuilding/map/*.json
  • 地点一致性校验依赖 worldbuilding/map/*.md
  • 角色在某地出现的合理性由两者交叉校验

4.3 novel-character

  • 角色档案新增 known_info / unknown_info 字段
  • 角色行为逻辑校验依赖角色状态、关系、所属势力

4.4 novel-humanizer

  • 新增 logic_mismatch 问题类型
  • 逻辑性检测细化:时间、地点、人物、信息、因果

4.5 novel-review

  • 作者视角新增「细节逻辑一致性」检查项

五、AI 上下文注入

写作/审稿时注入:

markdown
[逻辑状态上下文]
本章冻结时间:{时间}
本章冻结地点:{地点}
各角色冻结状态:
- {角色A}:{地点},{情绪},知道{信息},不知道{信息}
- {角色B}:{地点},{情绪},知道{信息},不知道{信息}

信息边界:
- {角色A}不知道{信息X},因此不能让他表现出知道
- {角色B}知道{信息Y},必须按他的性格做出反应

待解决问题:
- {问题1}
- {问题2}

本场景必须交代:
- {衔接点1}
- {衔接点2}

六、修改模式下的逻辑同步

当用户进入修改模式(如"改一下""调整""替换")时,novel-logic 不重新走完整写作流程,只执行最小化逻辑同步。

修改模式判定

触发词:改、调整、替换、删除、润色、修、补、删。

修改模式执行清单

markdown
- [ ] 确认用户修改范围(段落/句子/词)
- [ ] 执行修改
- [ ] 验证修改已生效
- [ ] 判断逻辑信息是否变化:
  - 时间变了?→ 同步 逻辑矩阵.md
  - 地点变了?→ 同步 逻辑矩阵.md + 检查 worldbuilding 地图
  - 人物在场状态变了?→ 同步 逻辑矩阵.md + 知情边界.md
  - 信息传递/知情边界变了?→ 同步 知情边界.md
  - 新增信息/道具/称呼?→ 检查来源 + 同步知情边界
- [ ] 若逻辑信息变化,调用脚本更新逻辑矩阵:
  ```bash
  python3 .novel/scripts/generate_logic_matrix.py \
    chapters/vol{N}-{卷名}/ch{NN}-{标题}.md \
    -o .novel/tracking/逻辑矩阵.md
  • 在 .novel/tracking/修改记录.md 中记录
  • 若用户未要求质检,不主动跑 humanizer/review

### 修改模式禁止行为

- ❌ 重写场景微逻辑卡
- ❌ 重新过动作前四问
- ❌ 擅自修改细纲/大纲
- ❌ 信息变化后不更新知情边界
- ❌ 主动触发完整质检

---

## 七、脚本调用职责

- **逻辑矩阵生成**:novel-logic 负责在以下时机调用 `generate_logic_matrix.py`:
  1. 每章写作完成后
  2. 修改涉及时间/地点/人物/信息变化后
  3. 用户主动要求时
- **知情边界更新**:任何信息变化场景,由 novel-logic 即时更新 `.novel/tracking/知情边界.md`
- **冻结状态生成**:写新章节前,由 novel-logic 生成 `.novel/tracking/logic-state.json`

---

## 八、使用方法

### 初始化本章逻辑状态

用户:开始写第 5 章 → 读取前 5 章切片 + 角色状态 + 知情边界 + 时间线 → 生成 logic-state.json → 展示冻结状态


### 写场景前

用户:写第 5 章第 1 个场景 → 检查是否已填 scene-cards/ch05-scene01.md → 未填则引导填写 → 填写完成后允许写正文


### 写段落时

用户:写下一段 → 必须回答动作前四问 → 通过后在段落前加 HTML 注释 → 更新知情边界


### 章末

用户:第 5 章写完了 → 生成本章逻辑矩阵(调用 generate_logic_matrix.py) → 更新 知情边界.md → 生成下章冻结状态


### 修改时

用户:把第 5 章会议室那段改一下,让李总先开口 → 确认修改范围 → 执行修改 → 判断:涉及人物在场状态和信息传递 → 更新 知情边界.md → 调用 generate_logic_matrix.py 重新生成本章逻辑矩阵 → 记录修改事实 → 用户未要求质检,不跑 humanizer/review


---

## 九、写作纪律

1. **不填微逻辑卡不写正文**。
2. **不过四问不下一段**。
3. **不加 HTML 注释不继续**(初稿阶段)。
4. **信息变化必须立即更新知情边界**。
5. **与冻结状态冲突必须报告**。
6. **新增信息、道具、称呼必须有来源**。
7. **定稿前必须清理所有 HTML 注释**。

---

## 十、配置项

`.novel/skills/skill-logic.json`:

```json
{
  "hard_block": {
    "require_scene_card": true,
    "require_four_questions": true,
    "require_html_annotation": true
  },
  "check_items": {
    "time_continuity": true,
    "location_reasonableness": true,
    "character_presence": true,
    "info_boundary": true,
    "motivation_consistency": true,
    "causal_chain": true
  },
  "tolerance": {
    "time_gap": "5分钟",
    "location_jump": "同一场景内"
  }
}

十一、禁止行为

  • ❌ 不填微逻辑卡直接写正文
  • ❌ 不过四问直接写下一段
  • ❌ 不加 HTML 注释继续写(初稿阶段)
  • ❌ 信息变化后不更新知情边界
  • ❌ 角色做出与他所知信息不符的行为
  • ❌ 同一人物同一时间出现在两个地点
  • ❌ 新增信息/道具/称呼无前文铺垫
  • ❌ 专业人员越界指导专业人员
  • ❌ 情绪转折无铺垫
  • ❌ 定稿前不清理 HTML 注释
  • ❌ 只给文字建议不执行工具操作

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Novel Logic AI skill do?

小说逻辑预防工具。在写作过程中通过场景微逻辑卡、动作前四问、时间-地点双轴标注、信息边界追踪、冻结状态等机制,硬阻塞式预防时间矛盾、空间瞬移、信息穿帮、行为越界、因果断裂。当用户需要预防逻辑漏洞、检查前后一致性、管理角色知情边界、冻结前文章节状态时使用。触发词:逻辑、逻辑预防、微逻辑卡、四问、知情边界、时间地点、一致性、前后矛盾、信息边界、冻结状态、逻辑矩阵。

Why use Novel Logic on TypingMind?

Because you install it once and use it with any model. Novel Logic is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Novel Logic in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Wooooooooood/ai-fiction-writer/tree/main/纯净版skill/novel-logic. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Novel Logic?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Novel Logic?

As many as you like. As long as a model supports skills, you can use Novel Logic with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Novel Logic AI skill free?

Yes. It is published on GitHub by Wooooooooood under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇