paper-wiki
Claude Code + Codex · MIT License
📰 v2.1.0 新特性:Guidance 引导层 →New in v2.1.0: the Guidance overlay →

把论文编译成知识图谱

Claude Code 或 Codex 把论文与课件逐页真读完,编译成结构化、双向链接的知识库;再把整个文件夹交给 /wiki-auto——睡一觉,醒来收获带四档评级的 idea 卡。不是 RAG,是 LLM Wiki。

Compile Papers into a Knowledge Graph

A Claude Code and Codex plugin that actually reads every page of your PDFs and slides, compiles cited notes, and synthesizes cross-source concepts. Then hand /wiki-auto a whole folder of papers — come back to idea cards rated on a four-tier scale, fully unattended. Not RAG — an LLM Wiki.

> /plugin marketplace add Spark-To-Paper-Skills/paper-wiki > /plugin install paper-wiki@paper-wiki
7
核心 Action(含 AUTO)
4
Sub-agent
2
变体(科研 / 课程)
GPU
OCR(本地 / 远程)
7
Core actions (incl. AUTO)
4
Sub-agents
2
Variants (research / course)
GPU
OCR (local / remote)
sub-agent:wiki-searcher · wiki-critic · wiki-ideator · wiki-cartographer
sub-agents: wiki-searcher · wiki-critic · wiki-ideator · wiki-cartographer
核心理念 Core Concept

LLM Wiki,不是 RAG

LLM Wiki, not RAG

RAG 每次提问都临时检索文本片段再拼答案,质量取决于切分和召回;paper-wiki 反过来——Claude 事先把每篇源文献从头读到尾,写成带引用的结构化笔记,再跨源综合出概念条目和研究空白。编译好的 wiki 本身就是产出,用 Obsidian 打开就是一张知识图谱。

RAG retrieves text chunks at query time and stitches an answer on the fly. paper-wiki takes the opposite approach: Claude reads every source page-by-page upfront, writes structured notes with citations, then synthesizes cross-source concepts and research gaps. The compiled wiki is the product — it opens as a knowledge graph in Obsidian.

🔍 RAG(检索再生成)

🔍 RAG (Retrieve & Generate)

  • 入库时切分文档
  • 每次提问临时检索片段
  • 质量取决于切分和召回
  • 没有持久化的知识结构
  • Chunks documents at ingest time
  • Retrieves fragments per query
  • Quality depends on chunking & recall
  • No persistent knowledge structure

📖 LLM Wiki(先编译,后查询)

📖 LLM Wiki (Compile & Query)

  • 逐页通读每篇源文献
  • 写带引用的结构化笔记
  • 跨源综合概念条目
  • 持久化、双向链接的图谱
  • Reads every page end-to-end
  • Writes cited, structured notes
  • Cross-source concept synthesis
  • Persistent, reverse-linked graph
自动流水线 Auto Pipeline

/wiki-auto:文件夹进,带评级的 idea 卡出

/wiki-auto: a folder in, rated idea cards out

把一个装满源论文的文件夹交给 /wiki-auto,链条无人值守地跑完:入库 → 批量 GPU OCR → 分批编译 → 目标采纳(problems.md)→ 方向卡 → P0 纯 prompt 探针 → 四档评级的 idea 卡 → 查新审查。它只做编排,不定义任何新的 schema 或判断规则。

Hand /wiki-auto a folder of source papers and the chain runs unattended: ingest → mass GPU OCR → batched compile → goal adoption (problems.md) → direction cards → P0 prompt-only probes → idea cards with four-tier ratings → novelty critique. It orchestrates only — it defines no new schema or judgment rule of its own.

/wiki-auto 环节链
文件夹(源论文)
  → 入库 raw/  → 批量 GPU OCR  → 分批 /wiki-compile
  → 目标采纳(field/problems.md)  → 方向卡
  → P0 探针(仅 prompt)  → idea 卡(四档评级)  → 查新审查
  ■ STOP 止于评级:不越过 SCORED,不跑 P1/P2 实验,不导出论文
/wiki-auto stage chain
folder of source papers
  → ingest raw/  → mass GPU OCR  → batched /wiki-compile
  → goal adoption (field/problems.md)  → direction cards
  → P0 prompt-only probes  → idea cards (four-tier rating)  → novelty critique
  ■ STOP stops at ratings: never past SCORED, no P1/P2 runs, no paper export
一个文件夹进

指着装满 PDF 的目录跑一条命令,其余交给链条,逐环节留痕。

无人值守

OCR、编译、目标采纳、方向卡、探针、评级、查新,一路自动接力。

止于评级

绝不把卡片推过 SCORED,绝不跑 P1/P2 实验,绝不导出论文。

Fail closed

前置不满足就干净地停:实例未初始化、scope fence 未开 expansion_mode: auto、GPU 忙或缺,都不硬跑,绝无 CPU 兜底。

One folder in

Point one command at a directory of PDFs; the chain does the rest, leaving a trace at every stage.

Unattended

OCR, compile, goal adoption, direction cards, probes, ratings, novelty critique — one automatic relay.

Stops at ratings

Never advances a card past SCORED, never runs P1/P2 experiments, never exports papers.

Fail closed

Unmet preconditions mean a clean stop: uninitialized instance, scope fence without expansion_mode: auto, busy or missing GPU — no forcing, never a CPU fallback.

想看整条链子长什么样?流程架构图把外层知识回路和内层想法回路摊在一张图上,标出每个环节由谁执行、哪几处由人拍板 —— 打开流程架构图 →
Want to see the whole chain? The workflow diagram lays the outer knowledge loop and the inner idea loop on one page, marking who runs each stage and where a human decides — open the workflow diagram →
外部引导 Guidance Overlay

GUIDANCE.md:方向先于语料时,注入引导而不接管流程

GUIDANCE.md: inject guidance when directions arrive before the corpus

v2.1 新增。有时方向比语料先到——你自己的想法、GPT 分析出的热点清单、外部知识图谱的产出,或「这轮只有一台 V100」的现实。把它们写进实例根一个可选的 GUIDANCE.md,检索与发想就会优先朝那边看。它是建议性上下文:星级评分一律无效,断言要被 wiki 引用必须经正常检索 → 入库 → 编译重新推导;立项、裁决、评级的标准一条不变。

New in v2.1. Sometimes directions arrive before the corpus — your own hunches, a GPT-generated list of hot topics, output from an external knowledge graph, or the plain fact that this round you only have one V100. Write them into an optional GUIDANCE.md at the instance root, and search & ideation lean that way. It is advisory context only: star ratings carry no weight, and any claim must re-enter through the normal search → import → compile path before the wiki will cite it. Adoption, adjudication, and rating standards do not move.

只买注意力,不买裁决

引导决定先看哪里、先检索什么、先备什么料;好不好、立不立项、评几档,仍由既有裁决与证据闸说了算。

零耦合

不放这个文件,一切照旧;删掉它,干净退出。协议、命令、schema、lint 对它零感知——注入物自带说明书。

auto 天然支持

/wiki-auto 各环节开工都读 research.md,一行指针就让整条无人值守链继承引导,不加任何新步骤。

强意图走正门

引导适合弱倾向;已经确定要做的方向,直接写成候选或发起立项——人签本身就是最高级别的倾斜。

Buys attention, not verdicts

Guidance decides where to look first — what to search, what to stock. Whether a direction is good, adopted, or highly rated stays with the existing gates and evidence.

Zero coupling

No file, no change. Delete it and you exit cleanly. The protocol, commands, schemas, and lint know nothing about it — the injection carries its own contract.

Auto-native

Every /wiki-auto stage already reads research.md at the start, so one pointer line makes the whole unattended chain inherit the guidance — no new steps.

Strong intent takes the front door

Guidance is for leanings. A direction you are sure about goes straight into the candidate list or goal adoption — a human signature is the strongest tilt there is.

怎么启用?复制模板到实例根、在 research.md 加一行指针,两步完成——规范与模板见 docs/GUIDANCE.md →
How to enable: copy the template to the instance root and add one pointer line to research.md — spec and template at docs/GUIDANCE.md →
机器决策 Machine Decisions

每个机器决策落一行,人保留事后否决

Every machine decision lands one row. The human keeps post-hoc veto.

自动运行不靠「等人审批」推进,靠「全量留痕 + 事后翻案」兜底:信任是显式给出的,监督从事前审批移到事后否决。

Auto runs do not advance by waiting for approval. They are backstopped by full traces plus after-the-fact reversal: trust is explicit, and oversight moves from pre-approval to post-hoc veto.

📥 INBOX 机器决策收件箱

📥 The INBOX of machine decisions

wiki/INBOX.md 是一张只追加的表:| 日期 | 环节 | 对象 | 事项 | 状态 |。每个机器决策——包括终局性的:判死、豁免、查新裁定、生命周期裁定——都落一行,外加原有台账字段,签名 auto+日期,如实标注「机采标注」。

状态取 待人 / 已阅 / 翻案 三值;翻案配翻案回执。人否决一个决策不需要任何新机制——正常编辑文件即可。

wiki/INBOX.md is an append-only table: | 日期 | 环节 | 对象 | 事项 | 状态 | (date / stage / object / matter / status). Every machine decision — including final ones: kills, waivers, novelty verdicts, lifecycle rulings — lands one row plus its existing ledger fields, signed auto+date and honestly marked as machine-annotated.

Status is pending / seen / reversed; reversals get receipts. Vetoing a decision needs no new mechanism — the human simply edits the file.

✍️ 全量机签 + 事后否决

✍️ Machine signing with post-hoc veto

原先五类只许人签的不可逆决定,在 auto 运行下获得例外:机器自签,但留痕是硬性要求——INBOX 行 + 既有台账字段 + auto+日期签名,缺一不可。

值守模式的语义不变。信任放出去了,但每一笔都能翻案。

The former five human-only irreversibles gain an auto-run exception: the machine signs them itself, with trace as the one hard requirement — INBOX row + existing ledger fields + auto+date signature, all mandatory.

Attended-mode semantics are unchanged. Trust is granted — and every single call remains reversible.

投入闸门 Investment Gate

查新·实据闸 与 Fresh-eyes 双检查点

The novelty-check & hard-evidence gate, plus fresh-eyes checkpoints

越终局的决定,越值得一双没看过前情的眼睛。投入实验前有一道硬闸;评级与判死各配一个必须换上下文才有效的工件。

The more final the decision, the more it deserves a fresh pair of eyes. A hard gate guards experiment investment; ratings and kill rulings each require an artifact that is only valid when produced in a fresh context.

🚧 查新·实据闸

🚧 Novelty-check & hard-evidence gate

投入实验前必须过两道:① 查新已裁定——wiki/novelty/ledger.md 里有六值裁定记录,证明裁定跑过(不要求特定结论);② 问题实据在手——卡片带 [p] 探针锚点,或有一条已签署的豁免。

/wiki-auto 明确停在闸前:闸守的是实验投入,不在它的命令范围内。

Two checks before experiment investment: ① adjudication ran — a six-value ledger entry exists in wiki/novelty/ledger.md (proof the adjudication happened, not a required verdict); ② problem evidence in hand — the card carries a [p] probe anchor, or a signed waiver line exists.

/wiki-auto stops before this gate: it guards experiment investment, outside the command's range.

👀 Fresh-eyes 双检查点

👀 Two fresh-eyes checkpoints

评级在只喂卡片文件的全新上下文里跑,落盘 wiki/ideas/<id>.tiering.md;缺这份工件的 SCORED 卡视同未评级。判死需要全新上下文的反方复核,落盘 <id>.counter.md

与主流程同一 commit 提交的工件一律无效——git 时间线可机械核查。

Tiering runs in a fresh context fed only the card file, landing wiki/ideas/<id>.tiering.md; a SCORED card without it counts as unrated. Retirement requires a fresh-context counter-review landing <id>.counter.md.

Artifacts committed together with main-flow output are void — the git timeline makes this mechanically checkable.

既有机制不变:六值查新裁定、「没有判死型 verdict」、goal → direction → probe → idea 螺旋都是原有机制;闸门只是把它们变成投入实验前的硬性前置。
Pre-existing machinery unchanged: six-value novelty verdicts, "there is no kill verdict", and the goal → direction → probe → idea spiral all predate this gate — the gate simply makes them hard preconditions for experiment investment.
可观测性 Observability

八行对账,缺一行就不算收束

Eight-row reconciliation — a missing row means the run is not closed

每次 auto 运行以固定的八行对账块收尾:每个声称的数字旁边都放一条可重跑的 grep/ls,任何人随手验证。缺任何一行、或数字对不上又没有解释,这次运行就不算收束。运行开场还会扫描 INBOX 里新出现的「翻案」行,逐条补翻案回执——只记录,绝不自动改回。

Every auto run closes with a fixed eight-row reconciliation block: each claimed number sits next to a re-runnable grep/ls anyone can verify on the spot. A missing row — or a mismatched number without an explanation — means the run does not count as closed. Each run also opens by scanning the INBOX for new reversal rows and appending a receipt per reversal: record only, never auto-correct.

  1. 机签数 vs INBOX 行数
  2. SCORED 卡 vs 查新条目
  3. 豁免 / 探针比例
  4. fence_zone 盖章率
  5. 遗留 blocked / 待 OCR
  6. IMPORT-LOG 比例
  7. 弃稿比例
  8. 异常统计(翻案 / 对账不平 / 引文 MISS / 弃稿 / 挂起超龄 / 盖章缺失)
  9. Machine signatures vs INBOX rows
  10. SCORED cards vs novelty entries
  11. Waiver / probe ratio
  12. fence_zone stamp rate
  13. Leftover blocked / needs-OCR
  14. IMPORT-LOG ratio
  15. Discard ratio
  16. Anomaly stats (reversals / mismatches / citation MISS / discards / over-age suspensions / missing stamps)
机械核查 Mechanical Checks

模型负责判断,脚本负责挑错

The model judges. The scripts catch.

两个纯标准库脚本给卡片和裁定兜底:一个查结构与措辞,一个逐字查引文。它们不替模型思考,只让造假和越级无处遁形。

Two stdlib-only scripts backstop the cards and verdicts: one lints structure and language, one verifies quotes verbatim. They do not think for the model — they make fabrication and tier-inflation impossible to hide.

idea_lint.py

对 idea / direction / goal 卡的机械 linter:结构、语言、证据上限(含拒收自写 [e] 锚点)、疑问句伪装、目标卡规则,外加两条新规则——T1:「顶会大工程」档的 important_problem 必须锚定真实的 field 层记录;F1:引文规则。

auto 运行下机器可对违规行修一次并重新 lint;仍不过则弃稿,lint 输出原样贴进 INBOX 弃稿行。

A mechanical linter over idea / direction / goal cards: structural, language, evidence-ceiling (including rejecting self-written [e] anchors), interrogative-disguise, and goal-card rules — plus two new ones: T1, a top-venue-tier claim must anchor important_problem to a real field-layer record; F1, citations.

In auto runs the machine may fix violating lines exactly once and re-lint; still failing means the draft is discarded with the lint output pasted verbatim into the INBOX discard row.

quote_check.py

对 critique 指控引用的每段引文做逐字核查:必须在 wiki/papers/ 下逐字出现,抽样用确定性哈希。凭空捏造的「原文结论」在裁定建立之前就被抓住;MISS 的指控一律降级为证据不足

诚实的 v0 范围:子串匹配抓伪造,不抓张冠李戴;参照文本是编译后的笔记,不是 raw/ 原件。

Verbatim verification of every quoted span a critique charge cites: it must occur verbatim under wiki/papers/, with deterministic hash sampling. A critic that hallucinates a source sentence is caught before any verdict is built on it; a MISS downgrades the charge to insufficient-evidence.

Honestly scoped v0: substring matching catches fabrication, not misattribution; the reference text is the compiled note, not the raw/ original.

两种变体 Two Variants

科研或课程——选你的工作流

Research or course — pick your workflow

两种变体共享同一套「先编译、后查询」的流程,针对不同场景做了定制。

Both variants share the same compile-then-query pipeline, tailored for different use cases.

research

文献调研和 novelty gap 分析

Literature survey & novelty gap analysis

源材料论文(arXiv / 网页)
主笔记wiki/papers/
综合层wiki/concepts/
特色wiki/gaps/ 新颖性分析
外部检索/wiki-search-latest/wiki-ideate
SourcesPapers (arXiv / web)
Noteswiki/papers/
Synthesiswiki/concepts/
Uniquewiki/gaps/ novelty analysis
Search/wiki-search-latest + /wiki-ideate

course

复习备考,讲义压缩成可查知识库

Exam revision & lecture compression

源材料讲义 / 实验 / 作业
主笔记wiki/lectures/ + wiki/practice/
综合层wiki/topics/
特色wiki/exam-scope.md 考试大纲骨架
外部检索
SourcesSlides / labs / assignments
Noteswiki/lectures/ + wiki/practice/
Synthesiswiki/topics/
Uniquewiki/exam-scope.md spine
Searchnone
安装 Install

Claude Code 与 Codex 双端可用

Works in Claude Code and Codex

两端都能从本仓库 marketplace 安装;bootstrap 项目自带两套入口。

Both runtimes install from this repository marketplace; bootstrapped projects carry both entry points.

Claude Code
> /plugin marketplace add Spark-To-Paper-Skills/paper-wiki
> /plugin install paper-wiki@paper-wiki
Codex
codex plugin marketplace add Spark-To-Paper-Skills/paper-wiki
codex plugin add paper-wiki@paper-wiki
同一 workspace 只能有一个写入者。切换 Claude Code / Codex 前先结束当前任务并检查工作树。项目规则只认 WIKI.md
One writer per workspace. Finish the active task and inspect the working tree before switching between Claude Code and Codex. WIKI.md is canonical.

后续更新:Claude Code 使用 /plugin marketplace update paper-wiki;Codex 使用 codex plugin marketplace upgrade paper-wiki。若 Git 主机校验失败,请先对照 GitHub 官方公布的 SSH fingerprint,切勿把未经核验的 ssh-keyscan 输出直接写进 known_hosts

不想装 plugin 也行——直接 git clone 本仓库,用 bootstrap 脚本创建项目。

Update with /plugin marketplace update paper-wiki in Claude Code or codex plugin marketplace upgrade paper-wiki in Codex. If Git host verification fails, compare the key with GitHub's officially published SSH fingerprints; do not persist unverified ssh-keyscan output.

Don't want a plugin? git clone this repo and run the bootstrap below — bootstrapped projects are self-contained.

创建 wiki 项目

Bootstrap a wiki project

Windows PowerShell
PS> .\scripts\bootstrap_new_wiki.ps1 -NewPath D:\my-wiki -Topic my-topic `
     -ProjectName "My Wiki" -Variant research
macOS / Linux
$ bash scripts/bootstrap_new_wiki.sh --path ~/my-wiki --topic my-topic \
     --name "My Wiki" --variant research

创建后任选一端:Claude Code 运行 /wiki-init;Codex 运行 $paper-wiki-project wiki-init

Choose one runtime: Claude Code runs /wiki-init; Codex runs $paper-wiki-project wiki-init.

命令 Commands

7 个 action,双端速查

Seven actions, dual-runtime reference

Claude Code 用 /wiki-*;Codex 用 $paper-wiki-project wiki-* 或自然语言点名 action。

Claude Code uses /wiki-*; Codex uses $paper-wiki-project wiki-* or a natural-language request naming the action.

命令功能
/wiki-init初始化(仅首次):填写主题和种子论文 / 解包并清点材料
/wiki-compile读取 raw/ 中的新材料,编译笔记,综合概念或主题
/wiki-search-latest <主题>搜索最新相关论文 research
/wiki-critique <文件>对抗性审查:找漏洞、过度声明、公式错误
/wiki-ideate <gap>发现未试过的组合 research
/wiki-teach <问题>内置查询与教学;wiki 里没有的内容会明确告知
/wiki-auto <文件夹>全自动流水线:论文文件夹进,带评级的 idea 卡出;止于评级 auto
CommandWhat it does
/wiki-initOne-time setup: fill topic + seeds (research) / unpack + inventory (course)
/wiki-compileRead new raw/ material, write notes, synthesize concepts
/wiki-search-latest <topic>Find recent papers to import research
/wiki-critique <file>Adversarial review: holes, overclaims, wrong formulas
/wiki-ideate <gap>Discover untried combinations research
/wiki-teach <question>Built-in query and teaching; absent content is explicitly flagged
/wiki-auto <folder>Unattended pipeline: a folder of papers in, rated idea cards out; stops at ratings auto
查询 wiki 用内置 wiki-teach action。旧的 /wiki-ask 已退役为 wiki-teach 的兼容别名,不计入 7 个 action。
To query the wiki, use the built-in wiki-teach action. The old /wiki-ask is a retired compatibility alias for wiki-teach and is not counted among the seven.
场景走读 Walkthroughs

三个研究者的完整使用故事

Three researchers, three complete journeys

从创建 wiki 到投稿,每个场景展示具体命令、预期输出和决策点。

From wiki creation to paper submission — concrete commands, expected outputs, and decision points.

场景 A

PhD 生,新方向,8 周

重点scope fence 延迟填写、ideate 发现方向、reviewer 反馈后重开 wiki

场景 B

资深研究者,4 周快速验证

重点Day 1 即 ideate、精准补充、teach 出对比表写 related work

场景 C

长期维护者,6 周跨论文复用

重点重开冻结 wiki、更新 scope fence、--Update 更新命令

Scenario A

PhD student, new direction, 8 weeks

FocusDeferred scope fence, ideate discovers direction, reviewer feedback reopens wiki

Scenario B

Senior researcher, 4-week fast validation

FocusDay-1 ideate, precise expansion, teach generates comparison tables for writing

Scenario C

Long-term maintainer, 6-week cross-paper reuse

FocusReopen frozen wiki, update scope fence, --Update for stale commands

📖 查看完整走读 → 📖 Read full walkthroughs →

项目结构 Project Layout

仓库里有什么

What's inside

.claude-plugin/— Claude Code plugin 元数据
.codex-plugin/— Codex plugin manifest
.agents/plugins/— Codex marketplace 元数据
skills/paper-wiki/— 双端共用 skill 与 action 合约
commands/— 各 action 正文(含 wiki-auto 自动流水线)
agents/— sub-agent(searcher / critic / ideator / cartographer)
scripts/— bootstrap + OCR + PPTX 提取 + idea_lint / quote_check
hooks/— SessionStart 更新检查
templates/— 各变体的模板文件
templates/memory/— 不含 secret 的本地说明模板
docs/— 命令教程、场景走读、OCR 配置指南、方法论、踩坑记录
examples/— 无 GPU 快速上手 + 示例 wiki
docs/llm-wiki.protocol.yaml— 机器可读的行为规约
.claude-plugin/— Claude Code plugin metadata
.codex-plugin/— Codex plugin manifest
.agents/plugins/— Codex marketplace metadata
skills/paper-wiki/— shared skill and action contracts
commands/— action bodies (incl. the wiki-auto pipeline)
agents/— sub-agents (searcher / critic / ideator / cartographer)
scripts/— bootstrap + OCR + PPTX + idea_lint / quote_check
hooks/— SessionStart update check
templates/— {research, course} template files
templates/memory/— non-secret local note templates
docs/— tutorial, walkthroughs, OCR setup, methodology, gotchas
examples/— no-GPU quickstart + sample wiki
docs/llm-wiki.protocol.yaml— machine-readable behavior contract