/quote — 史记引文补全
SkillFiles & storageLets your agent find classic text quotations in a knowledge base wiki and add them to the right pages.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the /quote — 史记引文补全 skill
About this capability
Fills in the '史记引文' (Shiji quotations) section for shiji-kb wiki pages. Searches entity annotation files for genuine references to the page's entity (rather than bare string matches), expands full passages for known PNs, filters out already-cited ones, and outputs new candidates. Triggered when the
What this skill tells your AI
The instructions your AI receives, as published by baojie/shiji-kb in .claude/skills/quote/SKILL.md and read by ahel’s review.
用法
/quote PAGE → 查找并补全该页面的史记引文
执行步骤
第一步:运行脚本(获取候选引文)
从仓库根运行:
python3 .claude/skills/quote/scripts/quote_page.py PAGE
# 限制输出条数(高频词地名可能有上百条)
python3 .claude/skills/quote/scripts/quote_page.py PAGE --max 30
脚本逻辑:
- 读页面 frontmatter:
type、label、pn、aliases - 按
type生成实体搜索正则(地名用〖=NAME〗,人名用〖@NAME〗或〖@DISPLAY|NAME〗,国名用〖◆NAME〗) - 扫描所有
chapter_md/*.tagged.md,找实体标注出现的段落号 - 已有
pn:字段中的 PN 也一并展开(即使尚无对应引文) - 过滤页面已引用的 PN,输出新增候选
第二步:评估候选、取舍
候选列表可能很长(高频地名有几十条),需要按以下标准取舍:
| 保留 | 跳过 |
|---|---|
| 该实体是段落叙述的主角/核心 | 仅路过性提及("经过X"、"至X而还") |
| 有具体历史事件 | 年表流水账(仅时间+事件列举,无叙述) |
| 与页面主题直接相关 | 同名异地/同名异人(注意辨别) |
| 引文简短、完整(<150字为佳) | 超长段落(>300字)且核心内容少 |
第三步:读取页面,更新史记引文节
读页面现有 ## 史记引文 节,append-only:
- 若已有引文(以
> 出自开头),只在最后追加新条目 - 若无引文节,新建该节并添加
- 引文格式:
> 出自 [[NNN_章节名|章节名]] (NNN-N):原文……(150字以内,超长可截断加"……")
- 同一章节多条引文,相邻排列(不重复写章节头)
- 引文按章节号升序排列
第四步(可选):更新 pn 字段
如果脚本发现的重要 PN 不在 frontmatter pn: 里,可追加到 pn: 字段。
第五步:记录修订(必须)
python3 wiki/scripts/butler/record_revision.py PAGE \
--summary "quote: 补引文N条(章节名/章节名...)" \
--author quote
只要实际向页面写入了新引文,此步骤不得省略。
实体类型与搜索模式
| page type | 搜索正则 | 示例 |
|---|---|---|
| place | 〖=NAME〗 | 〖=邯郸〗 |
| person | 〖@NAME〗 或 〖@.*|NAME〗 | 〖@蔺相如〗 〖@相如|蔺相如〗 |
| state | 〖◆NAME〗 | 〖◆赵〗 |
| role/title | 〖;NAME〗 | 〖;丞相〗 |
| story/event | 不做实体扫描,仅展开已知 pn | — |
注意事项
- 同名异义:如"邯郸"既是地名也是人名(侯),脚本按 page type 过滤,但仍需目视确认
- 年表行:
r型 PN(如019-r85)是表格行,不在句子索引,脚本跳过,无需手动追加 - 已有引文格式多样:页面可能有
### 章节 (chap-N) [PN:[N]]格式(kg/events 导入风格)或> 出自风格,两种都算"已引",不重复添加 - 引文内容:使用句子索引重建的原文(已去标注符号),非 tagged 原始标注文本
Signals
- GitHub stars
- 3k
- Forks
- 425
- Last commit
- Aug 2026
Advanced
- Catalog kind
- skill
- Gateway key
quote- Source
- github.com/baojie/shiji-kb