6# DeepPaperNote
7
8Use this skill when the user wants one outcome:
9- read one paper carefully
10- generate a high-quality Markdown note
11- save the note into an Obsidian-style vault when configured, or into the current workspace when no vault is configured
12
13Chinese trigger examples:
14- 给这篇论文生成深度笔记
15- 写一篇高质量论文精读笔记
16- 把这篇文章整理成 obsidian 笔记
17- 读这篇论文并生成 md 笔记
18
19This skill is intentionally narrow:
20- it handles one paper at a time
21- it does not update daily reading lists
22- it does not treat a shallow abstract rewrite as a successful output
23- it does not split the public entrypoint into separate setup, troubleshooting, or start commands
24
25## Core Standard
26
27The finished note must be more than a summary. It should reconstruct the paper's argument:
28- what problem it solves
29- how the task is defined
30- what data or materials it uses
31- how the method or analysis actually works
32- what results matter most
33- what the paper does not prove
34- why the paper is worth keeping
35
36Default writer persona:
37- a top-tier researcher or algorithm engineer
38- writing a replication-oriented lab note
39- not writing a popular-science explanation
40- assuming the reader can follow Python, PyTorch, training loops, and evaluation logic
41
42The note must adapt to the paper type. Use the same base structure, but shift emphasis for AI methods, benchmarks, clinical studies, and humanities or social-science papers.
43
44## Workflow
45
46Follow this order:
471. resolve the paper identity
482. collect metadata
493. acquire the best available PDF
504. extract canonical raw source text: *_raw_sections.jsonl, *_source_manifest.json, and optional derived *_full_text.md
515. extract structural indexes and PDF assets
526. plan figure placement
537. build the full figure/table decision table
548. build the manifest synthesis bundle
559. have the model read the bundle plus raw sections and create a short JSON note_plan that satisfies the generated bundle contract
5610. draft from the plan only after the grounding gate passes
5711. have the model write the note
5812. lint the final note against the same note_plan — this stage completes only when the lint artifact exists and every reported passes_* gate is true; otherwise revise and rerun lint. If the lint output contains passes_style_gate: false, apply the Style Gate Enforcement rule before advancing to step 13, 14, or 15
5913. perform final_quality_review after lint passes
6014. perform final_readability_review after the quality review passes
6115. write into Obsidian
62
63This is the required workflow for a normal single-paper note request, not a loose suggestion.
64Unless this skill explicitly marks a stage as optional, required stages must not be silently skipped, reordered into a shortcut, or treated as complete just because a partial artifact already exists.
65
66Global no-short-circuit rule:
67- do not stop after only the early stages and present the workflow as finished
68- do not treat slowness, inconvenience, or temporary uncertainty as permission to bypass a required stage
69- do not replace the declared workflow with an improvised shortcut
70- if a required stage fails, only do one of three things:
71 - retry that stage
72 - enter a fallback that is explicitly allowed by this skill
73 - stop and report which stage is blocked and which downstream required stages remain incomplete
74- do not describe the whole task as complete while required downstream stages are still pending
75
76Completion-language rule:
77- say 笔记已完成 only when the required workflow is actually complete
78- say 已生成草稿 when drafting is done but lint, final readability review, or save is still pending
79- say 已通过校验 only when lint has actually been run and passed
80- say 已保存到 Obsidian only when the write step has actually succeeded
81- do not treat lint 已通过 as equivalent to 整篇笔记已经润色完成
82- if final readability review is still pending, explicitly say the draft passed script lint but has not finished final language review
83- if the workflow stopped early, name the current stage and the still-missing required stages instead of using completion language
84- lint is a floor, not the writing objective
85
86## Core Execution Contract
87
88SKILL.md plus the generated synthesis_bundle.json must be enough to complete a normal note-generation run.
89Files under references/ are optional stage-specific deep dives, not a default reading checklist.
90
91Non-negotiable rules:
92- evidence-first: draft from the synthesis bundle, source_manifest, raw sections, coverage metadata, explicit note_plan, and inspected paper evidence; never finish from title/abstract/headings alone
93- raw-source authority: for ordinary PDFs, *_raw_sections.jsonl and *_source_manifest.json are the canonical reading material; old top-N evidence buckets, truncated section_texts, and candidate_chunks are not model-facing writing inputs
94- fail-closed: if a usable PDF or sufficient evidence cannot be obtained after supported acquisition paths, stop and ask for better source material rather than producing a finished degraded note
95- model-first: scripts structure evidence, but the model must decide emphasis, contribution, mechanism, limitations, and final Chinese prose
96- required structure: include the canonical required sections, with 原文摘要翻译 before 一句话总结 and a dedicated 创新点 section immediately after 原文摘要翻译
97- abstract translation: when abstract metadata exists, 原文摘要翻译 is a faithful Chinese translation of the original abstract, not a bilingual block and not the model's own summary
98- mechanism depth: method, framework, and system papers should include ### 机制流程 under 方法主线, normally as a 3 to 4 step numbered flow with input, operation, and output destination
99- placeholder-first figures: plan major figure/table placeholders first; replace one only when identity match and visual usability are both strong; otherwise keep the placeholder
100- final quality gates: lint is a floor; after lint passes, first run final_quality_review for analytical depth, then run final_readability_review for language polish, and rerun lint if either review edits the note
101
102Reference usage policy:
103- do not load every reference file by default
104- consult references/evidence-first.md, references/deep-analysis.md, or references/final-writing.md only when the paper is complex or the draft is too shallow
105- consult references/figure-placement.md only for ambiguous figure/table placement or image replacement decisions
106- consult references/obsidian-format.md only for Markdown, vault, frontmatter, or reference-link formatting details
107- consult references/note-quality.md or references/paper-types.md only for final review or domain adaptation
108- consult references/metadata-sources.md only when metadata is incomplete, and references/architecture.md only for repository maintenance decisions
109
110## Tool and Source Priority
111
112Prefer the strongest available source in this order:
1131. local PDF path given by the user
1142. local Zotero item and local Zotero attachment if available
1153. DOI and publisher metadata
1164. arXiv or open-access PDF sources
1175. Semantic Scholar or OpenAlex for metadata backfill
118
119Before web resolution, use the bundled scripts/resolve_paper.py Zotero Local API path to check the desktop library. Its default --zotero-mode auto prefers a unique local match and falls back to the existing providers when Zotero is unavailable or has no match. An explicit Zotero key has no safe web fallback and must be verified locally. Use off to make no Local API request, or required when the reference must resolve through Zotero. A trusted JSON artifact or explicit local PDF remains authoritative and bypasses this lookup. A compatible session-scoped Zotero/MCP integration may still provide a trusted input artifact when available, but it is not required for the built-in path.
120
121Local-library-first rule:
122- search the local Zotero library first using the paper title, DOI, arXiv id, or exact Zotero item key
123- If Zotero finds the paper, treat that result as the canonical identity resolution step.
124- Prefer the safe local attachment path returned by the built-in Local API. If another compatible integration exposes only an attachment key and filename, use scripts/locate_zotero_attachment.py to find the PDF under the user's Zotero storage.
125- If a local attachment path is available, pass it forward as the preferred PDF source.
126- If no local attachment is found, still use the library-resolved metadata to avoid title ambiguity, then fall back to network PDF acquisition only for the file itself.
127- If multiple local items are equally plausible, fail closed and request a DOI, arXiv id, or exact Zotero key rather than selecting one arbitrarily.
128- Do not let a weaker title-only internet match override a confident local-library hit.
129
130## Output Rules
131
132Formal Save states:
133
134| Save Target state | Required action |
135|---|---|
136| Vault configured or provided and usable | Perform the Formal Save to that vault. |
137| Vault configured or provided, but the Formal Save fails | Keep the current Save Target and attempt an in-scope recovery. If it still cannot complete, report blocked; do not switch to workspace. |
138| No vault configured or provided | Ask whether the user wants to provide one. Use workspace only after the user explicitly chooses not to use a vault. |
139
140- A normal note-generation request should complete in one pass: note text, figure placeholder decisions, image materialization when confident, and final save.
141- Do not stop after a text-only draft just to ask whether the user wants figures inserted. Finish the figure replacement decision inside the same task unless the user explicitly asked for text only.
142- The note must use real heading levels: #, ##, and ###.
143- Every final note must start with an Obsidian YAML properties block above the # title heading. Include at least a tags field with a papers/<domain> value and useful aliases; include date, doi, or arxiv_id when known, and omit unavailable fields rather than inventing placeholders.
144- ## 核心信息 must be a fixed metadata block only. Use only these fields, in this order, as - 字段名: 值 bullets: 标题, 标题翻译, 作者, 机构, 发表时间, 发表渠道, DOI, arXiv, 论文链接, 代码 / 项目, 数据 / 资源, 论文类型. Omit unavailable fields; put any guide sentence, takeaway, or analysis in 一句话总结 or a later section instead.
145- The note should include 原文摘要翻译 near the beginning when abstract metadata is available, before 一句话总结.
146- When abstract metadata is available, 原文摘要翻译 should directly translate the original paper abstract into Chinese rather than restating it as your own summary.
147- The 原文摘要翻译 section itself should be Chinese-only; do not place English abstract sentences or English paragraph excerpts in that section.
148- Do not mix later judgments, innovation summaries, or hindsight explanations into 原文摘要翻译; keep it as the original abstract translated into Chinese.
149- The note should include a dedicated 创新点 section immediately after 原文摘要翻译 and before 一句话总结.
150- The 创新点 section should not be empty praise. It should enumerate the paper's actual innovations and briefly explain why each one matters.
151- High-quality notes should usually contain multiple meaningful ### subheadings in the technical sections when the paper is non-trivial.
152- Generate the complete figure/table decision table and satisfy the generated writing_contract.figure_table_contract before drafting or saving.
153- After the synthesis bundle is built, complete the model-led Visual Review Gate and Figure/Table Decision Freeze before creating note_plan; no review_pending item may cross that boundary.
154- Pass the grounding and final-note figure gates before advancing; revise any failed decision coverage, insertion, structure, or status check.
155- An insert decision is complete only after Formal Save materializes the selected image into the paper-local images/ directory and the write succeeds.
156- The note must pass a style gate: no mixed Chinese-English prose lines except stable proper nouns or citation metadata.
157- The style gate also rejects mechanical term-replacement artifacts such as KV缓存 of, 批量ing, In相关 Researcher, or Single 序列 generation; rewrite the sentence naturally instead of preserving a partially translated phrase.
158- Style gate enforcement: when lint_note.py output contains passes_style_gate: false, fix the reported issues and re-run lint. Keep fixing and re-running until lint passes — multiple rounds are normal and expected. Do not decide that any failure is an acceptable exception — proper nouns, math formulas, and citation metadata are not automatic exemptions. Only escalate to the user if the same failures appear unchanged across multiple rounds with no reduction, indicating the model is unable to make further progress independently.
159- If PDF or evidence quality is insufficient for a real deep note, fail closed: stop, report the blocked stage, and ask for the better PDF, OCR/source material, or other input needed to continue.
160
161Model-first rule:
162- scripts may gather and structure evidence
163- scripts must not be the primary mechanism for understanding the paper
164- final paper understanding and note writing belong to the model
165- use the generated bundle contract to choose the paper type, section semantics, evidence-backed claims, boundaries, comparisons, and reusable follow-up questions; script suggestions remain hints rather than writing authority
166- do not require or expose a long free-form <thinking> block
167- for technical papers, prefer replication-grade explanation over high-level summary
168- if formulas, objectives, or complexity expressions are central, include the key ones in the final note
169- render math as $...$ or $$...$$, not as inline code or fenced code blocks
170- before final save, explicitly self-review whether the note contains enough technical detail, key numbers, and any necessary formulas
171- during final_quality_review, check the full note against seven questions: whether the central evidence chain is complete, whether key settings and numbers are present, whether mechanisms or protocols are mapped to the result pattern they explain, whether the paper is positioned against strong baselines or alternative routes, whether Discussion/Limitations conclusions are explained mechanistically, whether proven claims are separated from unproven claims, and whether the research, engineering, replication, or validity takeaways are specific enough to reuse
172- central quantitative comparisons with three or more systems, settings, tasks, datasets, metrics, or ablation rows should normally be written as compact Markdown tables, followed by interpretation; do not leave the main result table as a loose bullet list when a table would be clearer
173- short papers still need a complete deep note: use the saved space to explain protocol details, ablations, limitations, and deployment or replication implications rather than compressing the note into a terse summary
174- after final_quality_review passes, reread the full note once more for readability; do not stop at formal compliance only
175- in final_readability_review, ordinary English phrase leftovers should usually be rewritten into natural Chinese, while stable proper nouns may remain in English
176- do not use final_readability_review to invent new facts, empty filler text, or shallower but safer wording just to satisfy lint
177
178The topic references above can improve difficult runs, but the normal execution path should not depend on reading all of them.
179
180## Scripts
181
182Use these bundled scripts rather than rebuilding the workflow from scratch:
183- scripts/check_environment.py
184- scripts/create_input_record.py
185- scripts/locate_zotero_attachment.py
186- scripts/resolve_paper.py
187- scripts/run_pipeline.py
188- scripts/collect_metadata.py
189- scripts/fetch_pdf.py
190- scripts/extract_source_text.py
191- scripts/extract_evidence.py
192- scripts/extract_pdf_assets.py
193- scripts/plan_figures.py
194- scripts/plan_figure_table_decisions.py
195- scripts/build_synthesis_bundle.py
196- scripts/lint_grounding.py
197- scripts/lint_note.py
198- scripts/materialize_figure_asset.py
199- scripts/write_obsidian_note.py
200
201Python interpreter rule:
202- DeepPaperNote requires Python >=3.10.
203- Before running repository scripts, check the interpreter version instead of assuming the current shell default is compatible.
204- If the default python3 is below 3.10, automatically look for another available interpreter that satisfies the requirement, such as python3.12, python3.11, python3.10, /opt/anaconda3/bin/python3, /opt/homebrew/bin/python3, or /usr/local/bin/python3.
205- Use the first compatible interpreter you find and continue with that interpreter for the repository scripts in the current task.
206- If no compatible interpreter is available, stop and clearly tell the user which interpreter was found, which version it reported, and that DeepPaperNote requires Python >=3.10.
207
208Troubleshooting rule:
209- use scripts/check_environment.py only when a concrete dependency or integration question is blocking execution
210- explain required dependencies, optional enhancements, and downgrade behavior directly rather than redirecting the skill into a separate troubleshooting workflow
211- do not feature environment inspection as a public pseudo-command surface
212
213Current status:
214- the single-paper deterministic core pipeline is implemented as an MVP
215- scripts/run_pipeline.py now defaults to building a model-facing synthesis bundle
216- scripts/write_obsidian_note.py can write the final note into a target vault
217- patch the scripts rather than replacing the workflow ad hoc
218
219## Limits
220
221- If the paper identity is ambiguous, confirm before writing.
222- If the PDF is unavailable after all supported acquisition paths have been tried, stop and report what input is needed; do not produce a degraded, provisional, or abstract-only note as the finished output. Supported acquisition paths include local PDF, Zotero attachment, metadata pdf_url, direct PDF URL, arXiv/open-access sources, publisher PDF if accessible, DOI enrichment, and any other current fetch path implemented by the workflow.
223- Placeholder-first figure planning is required; image extraction is optional and must never reduce textual coverage.
224