Theory ingest

From Lambenthan/empiricalwiki · View interactive version

Theory ingest is an AI agent skill from the GitHub repository Lambenthan/empiricalwiki. Ingest a theory-modeling paper into the wiki: paper card plus assumptions/primitives, propositions/theorems, solution concept, and testable implications, bridged to the empirical layer on one shared graph

How to use this skill

Skill file

/theory-ingest

Convert one theory-modeling paper into reusable research assets. Extract along the 6 fixed slots of the theory-modeling skeleton: environment/primitives, solution concept, results, proofs, comparative statics, testable implications. Quote formal statements verbatim; never paraphrase.

Inputs

Outputs

Workflow

Step 1: Resolve Source

Confirm the cwd is the project root containing wiki/, raw/, and tools/.

Prefer .venv:

if [ -x .venv/bin/python ]; then PYTHON_BIN=.venv/bin/python; else PYTHON_BIN=python3; fi

Theory papers are formula-dense, so .tex is strongly preferred: use the source when available so equations survive. With a PDF only, read the first page for the title:

"$PYTHON_BIN" - "<source>" <<'PY'
import sys, fitz
doc = fitz.open(sys.argv[1])
print(doc[0].get_text("text")[:2000])
PY

Then run:

"$PYTHON_BIN" tools/prepare_paper_source.py --raw-root raw --source <source> --title "<confident-title>"

Use the returned prepared_path as the reading entrypoint.

Step 2: Extract Along the 6-Slot Skeleton

Open docs/runtime-theory-skeleton.en.md first and extract against the 6 fixed slots. Write "未报告" (not reported) when there is no explicit evidence; do not guess:

  1. Environment / primitives: players, action/strategy spaces, preferences/payoffs, information structure, timing, technology/constraints
  2. Solution concept: equilibrium notion (Nash / subgame perfect / perfect Bayesian / competitive equilibrium ...)
  3. Results: the formal statement and conditions of each proposition/theorem/lemma
  4. Proofs: the proof technique behind each result
  5. Comparative statics: how endogenous variables move with parameters
  6. Testable implications: sign predictions the model yields that can be taken to data

Theory papers have no variables/datasets/identification/robustness — those blocks do not exist, they are not "未报告". This is the fundamental fork from /empirical-ingest.

Step 3: Write Pages

Open docs/runtime-page-templates.en.md and write pages by the templates.

Set paper_kind: theory on papers/{slug}.md, fill the theory block, and use the theory body sections:

## Research Question
## Model Environment
## Core Assumptions
## Solution Concept
## Propositions and Proofs
## Comparative Statics
## Testable Implications
## Implications for Empirics
## Related

Dedup before creating anything:

"$PYTHON_BIN" tools/research_wiki.py slug "<title>"

Step 4: Add Graph Edges

Use the tool; never hand-edit wiki/graph/edges.jsonl:

"$PYTHON_BIN" tools/research_wiki.py add-edge wiki --from papers/<paper> --to assumptions/<a> --type assumes --evidence "<location in text>"
"$PYTHON_BIN" tools/research_wiki.py add-edge wiki --from papers/<paper> --to propositions/<p> --type proves --evidence "<proposition number>"
"$PYTHON_BIN" tools/research_wiki.py add-edge wiki --from papers/<paper> --to mechanisms/<m> --type formalizes_mechanism --confidence high --evidence "<evidence>"
"$PYTHON_BIN" tools/research_wiki.py add-edge wiki --from propositions/<p> --to hypotheses/<h> --type predicts --confidence high --evidence "<evidence>"

Step 5: Rebuild and Report

"$PYTHON_BIN" tools/research_wiki.py rebuild-index wiki
"$PYTHON_BIN" tools/research_wiki.py rebuild-context-brief wiki
"$PYTHON_BIN" tools/research_wiki.py rebuild-open-questions wiki
"$PYTHON_BIN" tools/lint.py --wiki-dir wiki

Then report:

Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.