← Back to Skills Marketplace
yuzhihui886

Foreshadowing Tracker

by yuzhihui886 · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ⚠ suspicious
119
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install foreshadowing-tracker
Description
伏笔追踪器 - 识别章节中的伏笔并追踪回收状态。当需要管理伏笔、确保前后呼应时使用,支持新增伏笔识别、待回收伏笔提醒、已回收伏笔标记。
README (SKILL.md)

Foreshadowing Tracker - 伏笔追踪器

Overview

自动识别章节中的伏笔(暗示、铺垫、悬念),追踪伏笔的回收状态,生成详细的伏笔追踪报告,帮助保持故事前后呼应。

使用场景

  • 需要识别章节中的新伏笔
  • 需要追踪伏笔是否已回收
  • 需要避免遗忘重要伏笔
  • 需要确保故事前后呼应

伏笔类型

类型 说明 示例
暗示 隐晦提示未来事件 "他不知道,这将是最后一次见面"
铺垫 为后续情节做准备 "桌上放着一把古老的钥匙"
悬念 引发读者好奇 "门后传来奇怪的声音"
flag 角色说出的话 "等这件事结束,我就..."

CLI 使用

# 基本用法
python3 scripts/track_foreshadowing.py --book-dir projects/my-novel --chapter chapters/chapter-01.md

# 指定伏笔记录文件
python3 scripts/track_foreshadowing.py \
  --book-dir projects/my-novel \
  --chapter chapters/chapter-01.md \
  --record data/foreshadowing.json

# 输出报告到文件
python3 scripts/track_foreshadowing.py \
  --book-dir projects/my-novel \
  --chapter chapters/chapter-01.md \
  --output reports/chapter-01-foreshadowing.md

# 简写
python3 scripts/track_foreshadowing.py -d ./project -c chapter.md -o report.md

参数说明

参数 必填 说明
--book-dir / -d 小说项目目录路径
--chapter / -c 章节文件路径
--record / -r 伏笔记录文件(默认 data/foreshadowing.json)
--output / -o 输出报告文件路径

伏笔记录格式 (data/foreshadowing.json)

{
  "foreshadowings": [
    {
      "id": "FS001",
      "chapter": 1,
      "content": "桌上放着一把古老的钥匙",
      "type": "铺垫",
      "status": "pending",
      "note": "可能是打开密室的钥匙",
      "created_at": "2026-04-04"
    },
    {
      "id": "FS002",
      "chapter": 5,
      "content": "他用那把钥匙打开了密室的门",
      "type": "回收",
      "related_to": "FS001",
      "status": "resolved",
      "note": "伏笔已回收",
      "created_at": "2026-04-05"
    }
  ]
}

输出报告格式

# 伏笔追踪报告

**章节**: chapters/chapter-01.md
**检测时间**: 2026-04-04 23:58:00

## 检测概览

| 类型 | 数量 |
|------|------|
| 新增伏笔 | 3 |
| 待回收伏笔 | 5 |
| 已回收伏笔 | 2 |

## 新增伏笔

### FS003 (暗示)
**内容**: "他不知道,这将是最后一次见面"
**位置**: 第 3 段
**建议**: 后续需要安排再次见面的情节

### FS004 (铺垫)
**内容**: "桌上放着一把古老的钥匙"
**位置**: 第 7 段
**建议**: 后续需要说明钥匙的用途

## 待回收伏笔

| ID | 章节 | 内容 | 状态 |
|----|------|------|------|
| FS001 | 1 | 古老的钥匙 | pending |
| FS002 | 2 | 神秘电话 | pending |

## 已回收伏笔

| ID | 伏笔章节 | 回收章节 | 内容 |
|----|----------|----------|------|
| FS005 | 1 | 3 | 钥匙打开密室 |

依赖

  • Python 3.8+
  • rich (终端渲染)
  • PyYAML (配置文件解析)

安装依赖:

pip install -r scripts/requirements.txt

与其他技能集成

与 novel-writer 集成

# 1. 生成章节正文
python3 ../novel-writer/scripts/write_chapter.py \
  --book-dir projects/my-novel \
  --chapter 1 \
  --output chapters/chapter-01.md

# 2. 追踪伏笔
python3 scripts/track_foreshadowing.py \
  --book-dir projects/my-novel \
  --chapter chapters/chapter-01.md \
  --output reports/chapter-01-foreshadowing.md

与 quality-checker 集成

# 1. 质量检测
python3 ../quality-checker/scripts/check_quality.py \
  --input chapters/chapter-01.md

# 2. 伏笔追踪
python3 scripts/track_foreshadowing.py \
  --book-dir projects/my-novel \
  --chapter chapters/chapter-01.md

注意事项

  • 伏笔记录文件会自动创建(如不存在)
  • 支持 UTF-8 和 GBK 编码
  • 伏笔识别基于关键词匹配,可能需要人工审核
  • 建议每章完成后立即进行伏笔追踪
Usage Guidance
This skill's core, local pattern-based script matches the description and is low-risk. However, an included helper (scripts/track_foreshadowing_llm.py) will: (1) require the environment variable DASHSCOPE_API_KEY (the SKILL.md does not list this), and (2) POST the book text to https://coding.dashscope.aliyuncs.com/v1/chat/completions. Before installing or running: ensure you are comfortable sending your draft text to that external service or remove/disable the LLM script; verify the API host and model are ones you trust; set the API key in a separate, restricted environment variable if needed; review the LLM script source for any additional endpoints or secrets usage; run the tool in an isolated environment (or offline) if your manuscript must remain private. If you want only local processing, use scripts/track_foreshadowing.py and ignore or delete scripts/track_foreshadowing_llm.py. If you need a firmer safety verdict, provide the SKILL.md author/source or clarify whether remote LLM calls are intended.
Capability Analysis
Type: OpenClaw Skill Name: foreshadowing-tracker Version: 2.0.0 The foreshadowing-tracker skill bundle is designed to identify and track literary devices in novel chapters using both regex-based patterns and LLM analysis. The Python scripts (track_foreshadowing.py and track_foreshadowing_llm.py) implement the stated functionality transparently, using standard libraries and a legitimate API endpoint (DashScope) for text analysis. No evidence of malicious intent, data exfiltration, or prompt injection was found.
Capability Assessment
Purpose & Capability
The scripts and SKILL.md align with the stated purpose (identify and track foreshadowing in chapters). Having both a pattern-based script and an optional LLM-based script is plausible. However, the presence of an LLM caller introduces external network behavior that is not described in the SKILL.md's environment requirements.
Instruction Scope
SKILL.md documents CLI usage for the main script but does not mention the LLM helper's need to call an external API or require an API key. The LLM script will read local text files (expected) but also reads an environment variable and transmits the book text to a remote endpoint — behavior not disclosed in the runtime instructions.
Install Mechanism
There is no binary-level install spec (no downloads or archive extraction). Dependencies are standard Python packages listed in requirements.txt. This is a low-risk install footprint.
Credentials
SKILL.md lists no required environment variables, but scripts/track_foreshadowing_llm.py expects DASHSCOPE_API_KEY (and will exit if it is not set). Requiring a remote-service API key is proportionate only if users knowingly opt into remote LLM analysis; omission from the declared requirements is an inconsistency that could lead to unexpected data exfiltration (book text sent externally).
Persistence & Privilege
The skill does not request permanent inclusion (always:false) and does not modify other skills or system-wide configs. It creates/reads per-project record files (as documented) which is appropriate for its function.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install foreshadowing-tracker
  3. After installation, invoke the skill by name or use /foreshadowing-tracker
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.0.0
v2.0 LLM 版本:新增 track_foreshadowing_llm.py,通过 LLM 识别伏笔/暗示/铺垫,默认 qwen3-max-2026-01-23
v1.0.1
优化版本:扩展至 50+ 伏笔模式,添加置信度评分 (60%-95%),按置信度排序输出
v1.0.0
初始版本:opencode 生成脚本,伏笔识别/追踪/回收状态管理,支持暗示/铺垫/悬念/flag 四种类型
Metadata
Slug foreshadowing-tracker
Version 2.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Foreshadowing Tracker?

伏笔追踪器 - 识别章节中的伏笔并追踪回收状态。当需要管理伏笔、确保前后呼应时使用,支持新增伏笔识别、待回收伏笔提醒、已回收伏笔标记。 It is an AI Agent Skill for Claude Code / OpenClaw, with 119 downloads so far.

How do I install Foreshadowing Tracker?

Run "/install foreshadowing-tracker" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Foreshadowing Tracker free?

Yes, Foreshadowing Tracker is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Foreshadowing Tracker support?

Foreshadowing Tracker is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Foreshadowing Tracker?

It is built and maintained by yuzhihui886 (@yuzhihui886); the current version is v2.0.0.

💬 Comments