ingest
Skill1.7k starsChanged 34 days agoMITView on GitHub
Ingest a paper into the wiki — creates pages (papers + concepts + methods + people) and builds all cross-references and graph edges. Trigger whenever the user says "ingest", "add this paper", drops a `.pdf` / `.tex` / arXiv URL, or asks to fold a paper into the knowledge base.
- Reads credentials
We split this skill into the rules it gives an agent
17 rules. 0 are common, 4 are distinctive, and 13 are very specific to this project.
0
Common
Most of the 63 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use these local references on demand:
- Very specific: line 98
If /init passed a canonical_ingest_path, enter INIT MODE and consume that path verbatim.
- Very specific: line 100
If the source is a local .tex, use it directly.
- Very specific: line 101
If the source is a local .pdf, run the preprocessing pipeline in references/pdf-preprocessing.md to produce a prepared .tex under raw/tmp/ …
- Very specific: line 113
Stop-if-exists: if wiki/papers/{slug}.md already exists and the arXiv ID or title matches, report and exit.
- Distinctive: line 114
When an arXiv ID is available, query Semantic Scholar:
- Very specific: line 120
Use the result for venue, year, s2_id, citation count, and the evidence behind the importance score (1-5).
- Distinctive: line 141
Before writing, run a shape check on the frontmatter you are about to emit — no more than this:
- Distinctive: line 143
every required key is present and non-empty
- Very specific: line 159
Follow references/dedup-policy.md.
- Very specific: line 167
When creating or editing a wiki/methods/{slug}.md, populate realizes_concepts: [[c1], [c2], ...] for any concept this method instantiates …
- Very specific: line 179
Add a semantic paper-to-paper edge in graph/edges.jsonl only when the source text gives a clear cue.
- Very specific: line 188
if the paper directly addresses a listed open problem (under ## Open problems / ### Known gaps / ### Methodological gaps), annotate that …
- Very specific: line 189
Do not create new topic pages from /ingest — topic creation belongs to /init and /edit.
- Very specific: line 209
When active, regenerate Canvas + HTML (best-effort.
- Very specific: line 230
When active, invoke /discover with the just-ingested paper as the single anchor:
- Very specific: line 248
Every forward link writes its reverse link in the same turn — the wiki's bidirectional-link invariant.
“Common” is measured: kept by at least 6 in 10 of the 63 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/ingest
Turn one paper into a fully wired set of wiki pages. Emit well-formed entities and correct cross-references; leave semantic audits (backlink symmetry, dangling nodes, field-value policing) for /check.
Use these local references on demand:
references/pdf-preprocessing.md— arXiv-ID recovery, tex fetching, prepare-paper handoff for direct PDF dropsreferences/dedup-policy.md— merge-vs-create decision rule for concepts and methods, and the line that separates/ingestshape checks from/checksemantic auditsreferences/cross-references.md— forward/reverse link matrix and paper-to-paper edge-type selectionreferences/init-mode.md— manifest-driven handoff from/initand parallel-safety conventionsreferences/error-handling.md— source parse, API, and slug-collision fallbacks
Open runtime/schema/entities.yaml for frontmatter field definitions and runtime/templates/{kind}.md.tmpl for body section structure. For index.md, log.md, and graph/ shapes, see runtime/schema/conventions.yaml and runtime/schema/edges.yaml.
Inputs
source: one of — arXiv URL (e.g.https://arxiv.org/abs/2106.09685), local.tex, local.pdf, or acanonical_ingest_pathhanded off by/initvia.checkpoints/init-sources.json(seereferences/init-mode.md)--discover(optional, default off): after the final report, invoke/discover --anchor <this-paper's-arxiv-id>and append the shortlist to the report as "Related papers you may want to ingest next". Never auto-ingests the suggestions. Skipped automatically in INIT MODE. Treat this as a user-owned flag: do not set it based on repo state.--visualize(optional, default off): after Step 7 rebuild, regenerate Canvas visualization artifacts viatools/visualize.py generate-canvas. Skipped automatically in INIT MODE — the parent/inithandles visualization once at fan-in. Treat this as a user-owned flag: do not set it based on repo state. (The interactive web Graph view lives in the SPA atapp/modules/graph.js, served bytools/serve.py; it readswiki/graph/live and needs no per-ingest regeneration.)
Outputs
- One fully-wired paper page plus linked entities (concepts, methods, people)
- Graph edges and citations appended via
tools/research_wiki.py - Terminal summary with page counts and suggested follow-up ingests
Wiki Interaction
Reads
wiki/index.mdfor existing slugs and tagswiki/papers/*.mdto detect an already-ingested paperwiki/concepts/*.mdandwiki/foundations/*.mdfor dedup matcheswiki/methods/*.mdfor dedup matches against existing reusable methodswiki/people/*.mdfor existing authorswiki/topics/*.mdto place the paper under existing topicswiki/graph/open_questions.mdto notice when the paper addresses a known gap
Writes
wiki/papers/{slug}.md— CREATEwiki/concepts/{slug}.md— CREATE (new) or EDIT (appendkey_papers, aliases, variants)wiki/methods/{slug}.md— CREATE (new, only when the method is named, reusable, and citable across papers) or EDIT (appendsource_papers)wiki/people/{slug}.md— CREATE (importance ≥ 4 only) or EDIT (append into## Recent work)wiki/topics/{slug}.md— EDIT only (no CREATE from/ingest)wiki/graph/edges.jsonl— APPEND via toolwiki/graph/citations.jsonl— APPEND via toolwiki/graph/context_brief.md— REBUILD (skipped in INIT MODE)wiki/graph/open_questions.md— REBUILD (skipped in INIT MODE)wiki/index.md— APPENDwiki/log.md— APPEND via toolwiki/canvases/*.canvas— CREATE/OVERWRITE (only when--visualizeis set and not in INIT MODE)
Graph edges created
paper → concept:introduces_concept/uses_concept/extends_concept/critiques_conceptwithconfidencepaper → foundation:derived_from(foundation is terminal; no reverse link)paper → paper:same_problem_as/similar_method_to/builds_on/challengeswithconfidence- bibliographic
paper → paper:citesingraph/citations.jsonl
tools/research_wiki.py add-edge rejects missing confidence/evidence for
paper-paper and paper-concept semantic edges, and rejects legacy
paper-to-concept or paper-to-paper types on new writes.
Workflow
Pre-condition: working directory contains wiki/, raw/, and tools/. Resolve the Python interpreter once and reuse it:
# Find the project root via git so worktree subagents can still locate .venv.
# .venv is gitignored, so a subagent whose cwd is ../.worktrees/<branch>/
# doesn't have one — without this lookup it falls back to system python3 and
# misses the .env-loaded API keys plus the installed deps (deepxiv-sdk etc.).
# git rev-parse --git-common-dir returns the main repo's .git regardless of
# which worktree the shell is in; its parent is the project root.
GIT_COMMON_DIR=$(git rev-parse --git-common-dir 2>/dev/null || true)
PROJECT_ROOT=""
if [ -n "$GIT_COMMON_DIR" ]; then
PROJECT_ROOT=$(cd "$(dirname "$GIT_COMMON_DIR")" 2>/dev/null && pwd)
fi
if [ -x "$PROJECT_ROOT/.venv/bin/python" ]; then PYTHON_BIN="$PROJECT_ROOT/.venv/bin/python"
elif [ -x "$PROJECT_ROOT/.venv/Scripts/python.exe" ]; then PYTHON_BIN="$PROJECT_ROOT/.venv/Scripts/python.exe"
elif [ -x .venv/bin/python ]; then PYTHON_BIN=.venv/bin/python
elif [ -x .venv/Scripts/python.exe ]; then PYTHON_BIN=.venv/Scripts/python.exe
else PYTHON_BIN=python3
fi
export PYTHON_BINStep 1: Resolve the source
- If
/initpassed acanonical_ingest_path, enter INIT MODE and consume that path verbatim. Do not rescanraw/. Seereferences/init-mode.md. - If the source is an arXiv URL, extract the arXiv ID, use
"$PYTHON_BIN" tools/fetch_s2.py paper <arxiv-id>to recover the title when possible, then run"$PYTHON_BIN" tools/init_discovery.py download --raw-root raw --arxiv-id <arxiv-id> --title "<title-or-arxiv-id>". Continue from the returnedcanonical_ingest_path. The helper tries arXiv source first and falls back to PDF; do not callfetch_arxiv.pyfor a single paper because it is RSS-only. - If the source is a local
.tex, use it directly. - If the source is a local
.pdf, run the preprocessing pipeline inreferences/pdf-preprocessing.mdto produce a prepared.texunderraw/tmp/before continuing.
Raw persistence rule: never copy or duplicate a file already under raw/discovered/, raw/tmp/, or raw/papers/ into a different raw subtree.
Step 2: Paper identity and enrichment
Generate the paper slug:
"$PYTHON_BIN" tools/research_wiki.py slug "<paper-title>"- Stop-if-exists: if
wiki/papers/{slug}.mdalready exists and the arXiv ID or title matches, report and exit. If they differ, resolve the collision perreferences/error-handling.md. When an arXiv ID is available, query Semantic Scholar:
"$PYTHON_BIN" tools/fetch_s2.py paper <arxiv-id>Use the result for
venue,year,s2_id, citation count, and the evidence behind theimportancescore (1-5).Optional DeepXiv enrichment, when available. Skip silently if it fails:
"$PYTHON_BIN" tools/fetch_deepxiv.py brief <arxiv-id> "$PYTHON_BIN" tools/fetch_deepxiv.py head <arxiv-id> "$PYTHON_BIN" tools/fetch_deepxiv.py social <arxiv-id>briefseeds the Key-idea section AND the newtldrfrontmatter field;headsanity-checks your tex parsing against the section structure;socialis an auxiliary importance signal.
Step 3: Write the paper page
Open runtime/schema/entities.yaml (papers section) for the field set and runtime/templates/papers.md.tmpl for body section order. Fill every required frontmatter field; leave cited_by empty for now (step 5 backfills it).
Three frontmatter fields the new schema requires you to populate even though they are not lint-required (so existing pages do not break, but new ingests must:):
tldr— one-sentence summary of the paper, suitable as a search/preview line. NOT a multi-paragraph abstract; one sentence.contribution_type— list of contribution kinds drawn from the closed set[method, theory, benchmark, analysis, application, system, position, survey]. A paper may have several (e.g. method + benchmark). Do not invent new values.datasets— list of dataset / benchmark names the paper uses or introduces (e.g.MMLU,BFCL,AppWorld). Use[]when the paper introduces no concrete dataset; do not fabricate.
Before writing, run a shape check on the frontmatter you are about to emit — no more than this:
- every required key is present and non-empty
importance∈ {1,2,3,4,5};maturityon concepts ∈ the documented set;typeon methods ∈ the documented setcontribution_typeitems all come from the enum above- YAML parses
The shape check is intentionally narrow. Backlink symmetry, dangling-node detection, and cross-entity consistency are /check's job, not this skill's.
Body sections to populate, in this order: Problem & Context, Key idea, Method, Experiment & Results, Limitations, Open questions, My take, Related.
Section semantics:
- Problem & Context — what the paper attacks AND where the field stood before this paper. Two-in-one section.
- Experiment & Results — setup, primary metrics, and results in one place. Do not stop at "they beat the baseline"; cite the numbers and their conditions.
Step 4: Concepts, methods, people
Follow references/dedup-policy.md. In short:
- For each candidate concept, call
find-similar-conceptfirst. - For each candidate method (named, reusable technique that other papers could cite), check
wiki/methods/for an existing entry by name + tags. There is nofind-similar-methodtool — do a directory scan and a manual title/alias compare againstruntime/schema/entities.yaml'smethods.namefield. - Prefer merging into the top result. Create a new page only when no acceptable candidate exists and the paper's importance justifies it. The
## Methodbody section on the paper page is always filled (it is this paper's own method narrative); a separatewiki/methods/{slug}.mdis only created when the technique is namable, reusable, and likely to be referenced by other papers. - For each entity you write or edit, write the reverse link in the same turn. The obligation matrix lives in
references/cross-references.md. - Create a
wiki/people/{slug}.mdonly for papers with importance ≥ 4. Otherwise append the paper's[[paper-slug]]to existing author pages'## Recent workonly. People entities useresearch_areas(list_str) and atype.kindenum (researcher/team/organization); only assigntype.kind = teamororganizationwhen the byline itself names the team or organization (do not infer it from a researcher's affiliation). - When creating a
wiki/concepts/{slug}.mdand the concept clearly belongs under an existing topic (e.g. all "self-improving coding agents" subtopics), setparent_topic: <topic-slug>(bare slug, NOT[[wikilink]]—parent_topicislink-typed, notlist_link). The reverse## Conceptsbody section on the topic page must be appended in the same turn. - When creating or editing a
wiki/methods/{slug}.md, populaterealizes_concepts: [[c1], [c2], ...]for any concept this method instantiates (typically the concept(s) introduced by the same paper). The reverse## Realized bybody section on each concept page must be appended in the same turn.
Step 5: Paper-to-paper edges and cited_by
Skip this whole step in INIT MODE — the parent /init handles it at fan-in.
"$PYTHON_BIN" tools/fetch_s2.py references <arxiv-id>
"$PYTHON_BIN" tools/fetch_s2.py citations <arxiv-id>- For each reference whose arXiv ID or title resolves to an existing
wiki/papers/{slug}.md, add a bibliographiccitesrow tograph/citations.jsonl. - Add a semantic paper-to-paper edge in
graph/edges.jsonlonly when the source text gives a clear cue. Edge-type selection is inreferences/cross-references.md. If no semantic relation cleanly fits, keep only thecitesrow. - For each citation already in the wiki, append the citer's slug to this paper's
cited_by. - Surface unmatched high-citation references in the final report so the user can decide whether to follow up with another
/ingest.
Step 6: Topics and index
- Match the paper's tags against existing
wiki/topics/*.md. For each match:- importance ≥ 4 → append to the topic's
## Seminal worksAND append[[paper-slug]]to the topic'skey_papersfrontmatter list - importance < 4 → append under
## SOTA trackeror## Recent workby year (no frontmatter update) - if the paper directly addresses a listed open problem (under
## Open problems/### Known gaps/### Methodological gaps), annotate that line on the topic page
- importance ≥ 4 → append to the topic's
- Do not create new topic pages from
/ingest— topic creation belongs to/initand/edit. - Append new or edited page entries to
wiki/index.mdunder their category headings. Format: each entity kind is a top-level YAML key (matchingruntime/schema/entities.yaml), with- slug: <slug>entries beneath.
Step 7: Log and rebuild
"$PYTHON_BIN" tools/research_wiki.py log wiki/ "ingest | added papers/<slug> | updated: <list>"Unless in INIT MODE:
"$PYTHON_BIN" tools/research_wiki.py rebuild-context-brief wiki/
"$PYTHON_BIN" tools/research_wiki.py rebuild-open-questions wiki/Step 7.5: Optional visualization (only if --visualize is set)
Skip this step unless the user explicitly passed --visualize. Also skip it in INIT MODE — /init's parent process regenerates Canvas + HTML once at fan-in, so individual subagents must not duplicate the work and risk concurrent writes.
When active, regenerate Canvas + HTML (best-effort; visualize failure must not fail /ingest):
"$PYTHON_BIN" tools/visualize.py generate-canvas wiki/ \
|| echo "WARN: visualize generate-canvas failed; run /visualize manually" >&2--obsidian is not regenerated here — wiki/.obsidian/graph.json is project-level static config that only changes when config/visualize.json palette changes; run /visualize --obsidian manually for that case.
Step 8: Report
Emit one compact summary covering: pages created, pages updated, graph edges added, contradictions surfaced (if any), and high-citation references not yet in the wiki (suggested follow-up ingests). Close with:
Wiki: +1 paper, +{N} methods, +{M} concepts, +{K} edgesStep 9: Optional discovery (only if --discover is set)
Skip this step unless the user explicitly passed --discover. Also skip it in INIT MODE — /init's parent process decides whether to run discovery at fan-in, not individual subagents.
When active, invoke /discover with the just-ingested paper as the single anchor:
"$PYTHON_BIN" tools/discover.py from-anchors \
--id <arxiv-id-of-this-paper> \
--wiki-root wiki \
--limit 10 \
--output-checkpoint .checkpoints/ \
--markdownAppend the markdown output to the report under a heading like "Related papers you may want to ingest next". Do not auto-ingest anything from the shortlist — the user picks. If discovery fails (S2 outage, all channels empty), note the failure in one line and continue — a failed /discover must not fail an otherwise successful /ingest.
Constraints
raw/papers/,raw/notes/,raw/web/are user-owned and read-only. Direct local/ingestmay add prepared sidecars underraw/tmp/; direct arXiv ingests may write fetched source artifacts underraw/discovered/. INIT MODE treats all ofraw/as read-only.wiki/graph/is tool-owned. Edit only throughtools/research_wiki.py.- Slugs always come from
tools/research_wiki.py slug. Never hand-craft. - Every forward link writes its reverse link in the same turn — the wiki's bidirectional-link invariant. The only exception is links to
wiki/foundations/, which are terminal. - In INIT MODE, do not write reverse links into pages that already exist (created by a sibling worktree or scaffold). Record the relationship via
tools/research_wiki.py add-edgeonly; the parent/initbackfills reverse links during fan-in. - Source priority:
.tex>.pdf> vision API fallback. Never ingest from a PDF when a usable.texis available. - Ingest is conservative about new entities:
- importance < 4: at most 1 new concept and 1 new method per paper
- importance ≥ 4: at most 3 new concepts and 2 new methods per paper
- Any further candidates must be merged into their nearest existing entry, or left out for
/checkto flag. Rationale and matching rules:references/dedup-policy.md.
- A
methods/page is only justified when the technique is named, reusable, and citable by a future paper. The paper page's own## Methodbody section captures this paper's method narrative; do not duplicate it as a methods entity unless the method earns reuse. /ingestruns a shape check on its own output (required keys, enum ranges, YAML parses) and stops there. Backlink symmetry, dangling nodes, and full semantic audits belong to/check. Do not re-implement them here.- Assume another
/ingestmay run concurrently in a sibling worktree. All shared-file writes (graph/edges.jsonl,graph/citations.jsonl,index.md,log.md) must go throughtools/research_wiki.pyor use append-only semantics. Seereferences/init-mode.md. - In INIT MODE, skip
fetch_s2.py citations,fetch_s2.py references, and therebuild-*commands — the parent/initruns them once after fan-in. - In INIT MODE, also skip Step 7.5 visualization regardless of whether
--visualizewas set; the parent/initregenerates Canvas + HTML once at fan-in to avoid concurrent writes from sibling worktrees.
Error Handling
See references/error-handling.md. Highlights: source parse failures cascade tex → PDF → vision API → user handoff; S2 outages default importance to 3 and skip citation backfill; DeepXiv outages skip enrichment silently; slug collisions append a numeric suffix.
Dependencies
Tools (via Bash)
"$PYTHON_BIN" tools/research_wiki.py slug "<title>""$PYTHON_BIN" tools/research_wiki.py find-similar-concept wiki/ "<title>" --aliases "<a,b,c>""$PYTHON_BIN" tools/research_wiki.py add-edge wiki/ --from <id> --to <id> --type <type> --evidence "<text>" [--confidence high|medium|low]--confidence high|medium|lowis required for paper-paper and paper-concept semantic edges.
"$PYTHON_BIN" tools/research_wiki.py add-citation wiki/ --from papers/<citing> --to papers/<cited> --source semantic_scholar"$PYTHON_BIN" tools/research_wiki.py log wiki/ "<message>""$PYTHON_BIN" tools/research_wiki.py rebuild-context-brief wiki/"$PYTHON_BIN" tools/research_wiki.py rebuild-open-questions wiki/"$PYTHON_BIN" tools/prepare_paper_source.py --raw-root raw --source <local-path> [--title "<recovered-title>"] [--arxiv-id "<recovered-arxiv-id>"]"$PYTHON_BIN" tools/init_discovery.py download --raw-root raw --arxiv-id <id> --title "<title-or-id>"— single-paper arXiv source/PDF download intoraw/discovered/"$PYTHON_BIN" tools/fetch_s2.py paper|citations|references <arxiv-id>"$PYTHON_BIN" tools/fetch_deepxiv.py brief|head|social <arxiv-id>"$PYTHON_BIN" tools/discover.py from-anchors --id <arxiv-id> --wiki-root wiki --limit 10 --output-checkpoint .checkpoints/ --markdown— only when--discoveris set"$PYTHON_BIN" tools/visualize.py generate-canvas wiki/— only when--visualizeis set and not in INIT MODE
Shared References
.claude/skills/shared-references/citation-verification.md
Skills
/init— calls/ingestin parallel subagents via INIT MODE/check— audits wiki state after/ingestcompletes; owns every semantic check/ingestintentionally does not perform/discover— optional follow-up when--discoveris set; produces a shortlist of related papers the user may want to ingest next/visualize— Step 7.5 (when--visualizeis set and not in INIT MODE) regenerates Canvas + HTML by callingtools/visualize.pydirectly (best-effort)
External APIs
- Semantic Scholar (via
tools/fetch_s2.py) - DeepXiv (via
tools/fetch_deepxiv.py, optional; graceful fallback) - arXiv (source download)
Trending
More talk lately.thin dataabout the whole repository
Who's talking about PKU-DAIR/AutoSci
The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.
Other versions81 projects use a version of this.
Word for word · 3
- DAIR-AutoResearch/AutoSci★ 1.7k100% same
- skyllwt/AutoSci★ 1.7k100% same
- skyllwt/OmegaWiki★ 1.7k100% same
Edited · 1
- Lambenthan/empiricalwiki★ 8522% same
Wrote their own version · 77
- garrytan/gbrain★ 31ksame name
- suboss87/FDEOps★ 940same name
- coreyhaines31/makerskills★ 873same name
- jason-effi-lab/karpathy-llm-wiki-vault★ 718same name
- ZimoLiao/scholaraio★ 577same name
- egregore-labs/egregore★ 293same name
- HurricaHjz/SecondSelf★ 156same name
- romarayt/raytsystem-public-os★ 140same name
- HurricaHjz/second-yourself★ 105same name
- buriedsignals/spotlight★ 58same name
67 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- runtime/CLAUDE.mdCLAUDE.md
- askSkill
- checkSkill
- daily-arxivSkill
- discoverSkill
- editSkill
- exp-designSkill
- exp-evalSkill
- exp-pilot-evalSkill
- exp-pilot-runSkill
- exp-runSkill
- exp-statusSkill
- hiera-experimentSkill
- ideateSkill
- initSkill
- noveltySkill
- paper-compileSkill
- paper-draftSkill
- paper-planSkill
- posterSkill
- prefillSkill
- rebuttalSkill
- refineSkill
- researchSkill
- resetSkill
- reviewSkill
- setupSkill
- surveySkill
- visualizeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

