Community研究与数据分析github.com

LWWalker2202/econ-research-kit

经济学实证研究的动作库——把一次研究拆成八道可执行工序(可行性、识别、数据、估计、表图、报告、写作、审稿),每道工序都有输入、步骤、产出文件与验收标准。Use for any empirical economics research task: feasibility checks, identification design, data cleaning, regression tables, publication-quality figures, reproducible reports, paper writing, and referee responses. Triggers: 怎么做实证、识别策略、数据清洗、回归表、三线表、复现、写论文、回复审稿、研究流程、econ research workflow、empirical pipeline、applied micro.

econ-research-kit 是什么?

econ-research-kit is a Claude Code agent skill that 经济学实证研究的动作库——把一次研究拆成八道可执行工序(可行性、识别、数据、估计、表图、报告、写作、审稿),每道工序都有输入、步骤、产出文件与验收标准。Use for any empirical economics research task: feasibility checks, identification design, data cleaning, regression tables, publication-quality figures, reproducible reports, paper writing, and referee responses. Triggers: 怎么做实证、识别策略、数据清洗、回归表、三线表、复现、写论文、回复审稿、研究流程、econ research workflow、empirical pipeline、applied micro.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/LWWalker2202/econ-research-kit/tree/HEAD

Installed? Explore more 研究与数据分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

econ-research-kit 是做什么的?

Economics research as a set of executable steps. Not a prompt collection — a workflow library where every skill declares its inputs, its artifacts, and its acceptance criteria.

What this is, and what it is not

This is a set of eight skills, each covering one stage of an empirical project. Each skill tells you when to enter it, what it needs, what to do, what files it must produce, and how to check the result.

This is not a prompt dump. A prompt produces text. A skill produces files that another person can re-run. If a stage ends with "the assistant wrote a nice paragraph", the stage was not completed.

Also not: a substitute for your judgement about identification. The skills here force you to state your assumptions and their threats. They cannot tell you whether the assumptions hold.

Companion book: book/ holds Prompt Engineering for Economists by LW Walker, with dear friends and lovely family, 208 pages and sixty templates. The book says why each stage is shaped this way; this repository says what to do in it. book/README.md maps chapters onto stages.

The eight stages

#StageSkillThe question it answers
0Feasibility gateskills/feasibility/Can this be done at all with the data and variation available?
1Problem and literatureskills/literature/Is the gap real, and is it worth a paper?
2Identification designskills/identification/What variation identifies the effect, and what would break it?
3Dataskills/data-prep/Are the variables defined the way I think they are?
4Estimationskills/estimation/Is the specification defensible, and what does each robustness check protect against?
5Tables and figuresskills/tables-figures/Do the outputs meet journal format?
6Reportskills/report/Can someone else reproduce this from my files?
7Writing and submissionskills/writing/Does the prose carry the identification story?
—Referee responseskills/review/How do I answer without conceding what I should not?

Stage 0 is a gate, not a step. If it fails, stop. Do not clean data for a project whose identification cannot work.

Routing: what the user says, which skill to enter

Before reading the table below, run python scripts/preflight.py "<the user's words>". It tells you which of the four slots are missing. Then run python scripts/spec.py "<the user's words>": it prints a task-spec draft — the four slots, the stage it reads, an editable prompt, and the three things to confirm — and that draft is what you show the user before doing any work. Edit it together, then start. Every "first move" in the table happens only after the four slots are filled; while a slot is open, the only move is to ask about it.

The user says something likeEnterFirst move
"Would this be doable?" / "Is there data?" / "this is probably infeasible"skills/feasibility/Enumerate the data and the variation before writing any code
"Has anyone done this?" / "novelty" / "gap in the literature"skills/literature/Write the search plan first, then build the matrix
"I use DiD / IV / RDD / event study" / "identification strategy" / "how do I identify this"skills/identification/Write the threat list before the regression
"Clean the data" / "variable construction" / "unable to merge" / "scope"skills/data-prep/Check variable definitions across years first
"Run a regression" / "add fixed effects" / "robustness" / "robustness"skills/estimation/Justify the clustering level and the FE set
"Make a table" / "three-line table" / "draw an event study figure" / "regression table"skills/tables-figures/Decide Stata or Python, then match the journal format
"Organize into a report" / "reproduce" / "replication package"skills/report/Make the report a script output, never a hand-edited file
"Write an abstract" / "write an introduction" / "submit" / "abstract"skills/writing/Draft the identification paragraph before the introduction
"How to respond to reviewer comments" / "referee report" / "rebuttal"skills/review/Classify each comment as must-do / arguable / rejectable

If two skills could both apply, go upstream. A table problem is usually a specification problem; a specification problem is usually an identification problem.

Before anything else: recall, then ask

Every session starts with files, not with memory:

python scripts/recall.py

It prints where the project stands, what the last step produced, and what is still open. A session that skips it will re-ask questions the repository already answers, or rebuild something that already exists. Run it first, then scripts/preflight.py, then answer.

Five hard rules

1. Ask before you answer: do not proceed until the four slots are filled. On any research request, the first action is python scripts/preflight.py "<the user's words in their own language>". It splits the question into four slots — unit of analysis, treatment variable, outcome, comparison — and tells you which ones are missing.

  • Missing slots: write at most three questions, ask them all at once, then stop and wait for the answer.
  • A slot you filled by inference must be marked "assuming X", and the user must confirm it.
  • Only when all four slots are filled — by the user, or by an assumption the user confirmed — may you enter step 2 of any skill. This is the only rule in the kit that requires stopping to wait for a human. Work produced past this gate is a guess wearing a document's clothes.

2. Read glossary.yaml before writing any method term. It has three levels: locked (use verbatim), pending (use the first candidate and parenthesise the alternative), fallback (keep the Chinese proper noun, give the English expansion once). Violating a locked translation is a defect, not a style choice.

3. Domain specifics live in domains/, not in the skills. Skills describe how to work. They do not describe what Central Environmental Protection Inspection is, how CFPS defines education, or what referees ask about pollution exposure. Every skill's last section says which domain file to open. Open it.

4. Every stage must leave a file, and every file must pass its acceptance list. ## Acceptance is a checklist, not a suggestion. An item you cannot answer yes/no to is a badly written item — rewrite it.

5. Say where you are before you do anything else. Every reply that enters a stage opens with three lines: which stage (number and name), what this step alone does (one sentence, never "analyse the data"), and which file it will produce plus whether the user must confirm before you continue. A reply without that header is a black box, and the user pays for it.

Every stage also ends by asking one question and waiting. See the table below.

Eight confirmation points

The gate at stage 0 is not the only one. Each stage closes with one question and stops. This is not politeness: a decision the user never saw is a decision the user cannot correct.

StageThe question to stop and askContinue without an answer
0 FeasibilityThe four slots are filled; can you settle the two I inferred?No
1 Problem and literatureWhich of these three candidate questions? Is the gap this one?No
2 Identification designTreatment group, comparison group, timing set this way: do you accept it?No
3 DataVariable definitions and sample boundaries drawn this way: do you accept it?No
4 EstimationMain specification and this robustness list: add or drop anything?No
5 Tables and figuresThis table layout and note style: is this what you want?No
6 ReportOne-page conclusion written this way: any change to how the numbers read?No
7 WritingWhich part of this draft goes back?No
8 Referee responseDo we revise this comment or push back, and is this the reason?No

python scripts/stage.py 3 prints the header and the question for any stage, so the wording does not drift between sessions. workflows/main.yaml is the same mainline written as a machine-readable handoff contract: each stage declares requires (what must already be on disk) and produces (what it must leave behind), and python scripts/workflow_check.py fails if a stage requires something no earlier stage produces. python scripts/gate.py status makes the gate mechanical rather than a convention: it keeps a per-project state file (.econ-kit/gate.json), refuses to advance until the stage's artifacts exist and a human answer of at least eight characters is recorded, and logs the answer with a timestamp. gate.py pass "<the answer>" is the only way forward; --force exists but writes the gap on the record. To see what the checks of any stage actually look for, run python scripts/explain.py 6 (--list shows all nine stages; for stages 3 and 4, which already have runnable scripts, it points at those scripts and at the skill's acceptance list instead).

When a term is uncertain

Never silently pick a translation. If the term is in pending, use the first candidate and append the alternative in parentheses. Mark at most three such places in one output; beyond that, use the first candidate silently and add one summary line at the end.

If the term is not in the glossary at all, keep the Chinese original and give an English expansion in parentheses. Then add it to pending in glossary.yaml so the next person does not have to decide again.

Domain lookup

DirectionDirectory
Energy and environmental economicsdomains/energy-env/
Labour economicsdomains/labor/
Economics of educationdomains/education/
Health economicsdomains/health/
Behavioural and experimental economicsdomains/behavioral/
Development and field experimentsdomains/development/
Public economics and policy evaluationdomains/public/
Industrial organization and regulationdomains/industrial-organization/
Trade and spatial economicsdomains/trade-spatial/
Macroeconomics and financedomains/macro-finance/
Economic history and textual sourcesdomains/economic-history/
Theoretical modelling and mechanism designdomains/theory/

Twelve directions are covered. The first three are the ones this kit was built around; labour, education and health are the three fields the book treats together under applied micro; the rest were added so that a reader outside applied micro still finds a shelf to stand on.

Each direction has five files: institutional.md (background and ready-to-cite paragraphs), measures.md (how the treatment variable is built), data.md (sources and variable names), pitfalls.md (what referees ask and how to answer), and route.md (how this direction walks the eight stages).

Data

data-dict/ holds Chinese micro-data sources: CFPS, CHARLS, the Chinese Industrial Enterprises Database, and pollution monitoring data. Check it before inventing a variable name — the dataset probably already has one. If your source is not there, read data-dict/README.md first: some sources get an entry and some deliberately do not, and a guessed variable name is worse than a marked one.

When the question is not "what is this variable called" but "does a source even exist for this", data-dict/_catalog.md and scripts/lookup_source.py search an external directory of over a thousand sources with access links and application papers. Those hits are leads, not entries: the numbered files here stay the only place where variable-level detail is written down.

What this kit will not do

  • It will not decide whether your identification is credible. It will make you write down the threats.
  • It will not replace reading the paper you are citing. Hallucinated references are the most common failure of AI-assisted writing; skills/writing/ includes a verification step.
  • It will not run on its own. The scripts in scripts/ check structure; the analysis is yours.

相关技能