SuperAPI AI Directory

China-CF-Study

Writing & research

View repository

Updated 10-15 17:30

About this skill

China Corporate Finance Empirical Study (china-cf-study)

1. Positioning and Scope of Application

This skill guidesempirical corporate finance research based on China's institutional environmentcomplete workflow. Covers:

  • Main samples: A-share listed companies, Chinese city/provincial panels
  • Identification strategies: DID (including staggered/CS-DID/Sun-Abraham), Panel FE + IV/2SLS, PSM-DID, DML / DML-IV, synthetic control, RDD
  • Research topics: investment and financing, governance, ownership structure, institutional investors, credit, innovation, disclosure, auditing, analysts, ESG, etc.
  • Code language: Python(pandas / numpy / statsmodels / linearmodels / pyfixest / econml / doubleml / scikit-learn / matplotlib)
  • Table output: LaTeX(strictly follow template/ format and rule/ specifications)

This skill does not replace the researcher's judgment on research design, but provides the researcher with thestandard workflow, code skeleton, and table/figure templatesfor each stage, ensuring that the output quality meets the writing and methodological requirements of China-context top English-language journals(JF, JFE, RFS, JFQA, RCFS, JCF, JBF; JAR, JAE, TAR, CAR, RAST; MS, SMJ, JIBS; AER, QJE, JPubE, JEEM; as well as China-friendly mainstream journals such as China Economic Review, Pacific-Basin Finance Journal, Emerging Markets Review, China Journal of Accounting Research).The target journal is recommended by the skill and locked in by the researcher at the second step after startup(see §3.4); subsequently, the bibliographystyle, Section skeleton, Introduction style, and table note specifications in main.tex all follow this.

2. Working Directory Structure (the project root is the working directory)

China-CF-study/                 ← working directory
├── asset/                      ← 中国常见数据集与政策集索引(研究者提供检索关键词)
│   ├── macrodatas_list.csv           # 马克数据网数据集清单(宏观/上市公司/城市层)
│   ├── ppmandata_trade_list.csv      # 皮皮慢数据(政策/贸易/金融等)清单
│   ├── 全网首发计量方法+政策数据库.pdf # 原始政策冲击数据库 PDF(975 页,含 800+ 实证研究的方法-政策详尽案例)
│   ├── 计量方法+政策数据库.md       # ★ 上面 PDF 的 50 页 markdown 精简版(按"方法 × 政策 × 数据"三维交叉重组;首选入口)
│   └── MCP.docx                      # MCP 服务器清单(如 CSMAR-MCP),含安装网址
├── rule/                       ← 强制性写作与方法论规范(AI 必须逐项遵循)
│   ├── 通用实证研究逻辑与规范总结.docx
│   └── 回归表写作规范总结.docx
├── template/                   ← LaTeX 表格与图片模板(格式模仿对象)
│   ├── main.tex                      # ★ 正文 .tex 模板——新项目 main.tex 的 Preamble / References / Appendix 块均以此为底
│   ├── sum_stat.tex                  # 描述性统计
│   ├── variables.tex                 # 变量定义
│   ├── baseline.tex                  # 基准回归(渐进式加控制 + 渐进式加 FE)
│   ├── addctr.tex                    # 加入附加控制变量
│   ├── measures.tex                  # 替换因变量度量
│   ├── specification.tex             # 高维交互固定效应
│   ├── iv.tex                        # 2SLS 工具变量
│   ├── psm_ddml.tex                  # PSM + DML(Panel A / Panel B)
│   ├── bunching-did.tex              # Bunching-DID
│   ├── channel1.tex, channel2.tex, channel3.tex   # 机制分析(按渠道分组)
│   ├── heterogeneity1.tex, heterogeneity2.tex, heterogeneity3.tex # 异质性(bdiff)
│   ├── sampling.tex                  # 样本筛选稳健性
│   ├── further.tex                   # 进一步分析
│   ├── parallel.pdf                  # 平行趋势图
│   ├── csdid-figure.pdf              # Callaway-Sant'Anna DID 动态效应
│   ├── estimator.pdf                 # 不同 DID 估计量对比
│   ├── psm-pre-post.pdf              # PSM 平衡检验前后
│   └── specurve.pdf                  # 规格曲线(specification curve)
└── 研究项目输出/                  ← 每个实证项目的产出目录(按本 skill 建议结构创建)
    └── {项目名}/
        ├── main.tex                   # ★ 正文入口(preamble 照抄 template/main.tex),\input{results/xxx.tex}
        ├── data/{raw,cleaned}/
        ├── code/                      # Python 脚本
        └── results/                   # 表格 (.tex) 与图像 (.pdf/.png) 统一存放

3. Trigger Conditions and Startup Workflow

3.1 Sole Trigger Condition: The Researcher Submits a Research Proposal

This skill onlytriggers when the researcher provides a **Research Proposal**. The proposal may be submitted in any of the following forms:

  • A plain-text description
  • .docx / .pdf / .md / .tex File path
  • Bullet points in the conversation

3.2 Fields That the Proposal Should Contain (if items are missing, automatically follow up and complete them in one go)

CONTRACT — 研究计划书最小字段清单
────────────────────────────────────────────────────────
(1) 研究题目 (Title)
(2) X → Y 因果假设 (Hypothesis):主假设 H1 + 最多 2 条子假设
(3) 预期结果 (Expected Findings):X 对 Y 的预期符号与显著性、预期机制
    渠道、预期异质性方向(此项至关重要——是后续"备选方案"的触发判据)
(4) 识别策略 (Identification):DID / Staggered DID / Panel FE + IV /
    PSM-DID / RDD / 合成控制 / DML 中择一
(5) 样本范围 (Sample):层级(公司-年/城市-年/省-年)、时间窗、排除条款
(6) 政策冲击 (Shock):【DID/RDD 必填】政策名称、公布/实施年份、处理组定义
(7) 数据需求 (Data):关键词清单(数据集 + 政策集)。来源优先级:
    asset/ 清单 → asset/MCP.docx 登记的 MCP 服务器(如 CSMAR-MCP)
    → CSMAR / WIND / RESSET / 统计年鉴 / 政府公开 / 手工整理 等外部来源
(8) 机制假说 (Mechanism):预期作用渠道 M1 / M2 / M3
(9) 异质性维度 (Heterogeneity):预期分组维度 + 预期组间差异方向

3.3 After Startup, the Skill Immediately Performs the Following Actions

  1. Parse the proposal → Extract the nine CONTRACT fields, and uniformly follow up once to complete missing items.
  2. 🆕 Recommend the 5 most suitable English-language target journals (see §3.4): Based on the proposal's research topic (Topic), identification strategy (Method), contribution margin (Novelty), and sample scope (Sample / China context), select the top 5 from the China-context English-language top journal pool (§3.4.1) by weighted score (§3.4.2), presented as [J1]–[J5] number + 4-dimension star rating + "Why it fits" in one or two sentences (including one example of a China paper on the same topic published in this journal in the past 3 years) + "Editorial preference" + bib style (output format see §3.4.3).After presenting, stop and explicitly ask the researcher which one is selected(the user is also allowed to propose a journal outside the list). Before receiving the choice,do not proceed to Step 3。
  3. Solidify as 00_proposal.md: Write to the project root {项目名}/00_proposal.md,At the top, append as a YAML block target_journal / bibliography_style / writing_preferences three groups of fields(see the example at the end of §3.4.3), serving as the baseline file for all subsequent judgments and main.tex rendering.
  4. Generate the research project skeleton: according to the directory structure in Section 9, establish {项目名}/ all subdirectories and placeholder scripts under it;main.tex in the header, according to the table in §3.4.4, replace \bibliographystyle{} and the Section skeleton with the version for the target journal (the preamble still copies template/main.tex other parts).
  5. Advance step by step: strictly follow the order in Section 4; as soon as each step is completed, compare it item by item with (3) expected results in the proposalitem-by-item comparison。

3.4 Journal Targeting — the basis for the second step after launch

3.4.1 Candidate Journal Pool (common English submission pool for China CF papers)

The realistic submission map for China-data CF papers differs from that for U.S./cross-national data—the three major general-interest journals (AER/QJE/JPE) rarely take purely China CF topics (unless the policy has global impact, such as the China Shock series); JF/JFE/RFS have clearly increased their China paper output in the past 5 years, but require "globally transferable mechanisms + transparent identification"; JCF/JBF/PBFJ/CER/EMR/CJAR and others are mainstream journals for China CF.

Tier Journal Full name China-context preference characteristics bib style
T1 General AER American Economic Review Only accepts China Shock-type globally impactful policies; CF topics are rare aer
T1 General QJE Quarterly Journal of Economics High-threshold natural experiments; China CF extremely rare qje
T1 General JPE Journal of Political Economy Favors theoretical structural estimation; occasional China governance/contract topics jpe
T1 General REStud Review of Economic Studies Structure + methods; China CF rare restud
T1 Finance JF Journal of Finance Complete story + large-sample China mechanism innovation (split-share, QFII, HK Connect, registration-based system) jf
T1 Finance JFE Journal of Financial Economics Most active acceptance journal for China topics; transparent identification + item-by-item display of control variables jfe
T1 Finance RFS Review of Financial Studies Theoretical embedding + China-specific mechanisms rfs
T2 Finance JFQA Journal of Financial and Quantitative Analysis Rigorous empirical work; medium-contribution China topics with clear identification jfqa
T2 Finance RCFS Review of Corporate Finance Studies CF-specialized OA journal; proportion of China papers rising rcfs
T2 Finance RAPS Review of Asset Pricing Studies A-share asset pricing; not purely CF raps
T2 Finance JCF Journal of Corporate Finance Mainstream acceptance journal for China CF; high share of China topics elsarticle-num
T2 Finance JBF Journal of Banking and Finance Mainstream journal for China banking/credit; high acceptance of China topics elsarticle-num
T2 Finance JFI Journal of Financial Intermediation China banking / credit / intermediation jfi
T2 Finance JFM Journal of Financial Markets A-share market microstructure / liquidity elsarticle-num
T2 Finance FM Financial Management CF application-oriented apa
T1 Accounting JAR Journal of Accounting Research China disclosure / analysts / auditing / information environment jar
T1 Accounting JAE Journal of Accounting and Economics China contracts / executive compensation / economic consequences jae
T1 Accounting TAR The Accounting Review Large number of China-data acceptances in recent years (governance, disclosure, auditing) tar
T2 Accounting RAST Review of Accounting Studies China valuation / disclosure / information environment rast
T2 Accounting CAR Contemporary Accounting Research High acceptance of China data; platform similar to TAR car
Management MS Management Science China data friendly; causal identification + interdisciplinary innovation informs
Management SMJ Strategic Management Journal Chinese governance / cross-border M&A / corporate strategy smj
Management OS Organization Science Chinese governance + organization + CF intersection orsc
International JIBS Journal of International Business Studies Multinational / institutional differences / Chinese MNEs / cross-border M&A jibs
Public JPubE Journal of Public Economics CF consequences of Chinese taxation / regulation (VAT reform, Golden Tax Project) elsarticle-num
Environmental JEEM Journal of Environmental Economics and Management Environmental protection tax / dual carbon / emission rights × CF elsarticle-num
China-friendly CER China Economic Review China-themed special issue; moderate threshold; high CF acceptance volume elsarticle-num
China-friendly PBFJ Pacific-Basin Finance Journal Asia-Pacific/China CF mid- to lower-tier mainstream journal elsarticle-num
China-friendly EMR Emerging Markets Review China/emerging market CF; institutional difference comparisons elsarticle-num
China-friendly CJAR China Journal of Accounting Research Leading journal for Chinese accounting empirical research(Peking University & Elsevier) elsarticle-num
China-friendly CFRI China Finance Review International China CF application-oriented OA journal apa
China-friendly CAFR China Accounting and Finance Review China CF / accounting; bilingual Chinese abstract apa
Interdisciplinary JBE Journal of Business Ethics ESG / governance / culture × China apa
International finance JIFMA Journal of International Financial Markets, Institutions and Money Cross-border / institutions / capital flows × China elsarticle-num

If the researcher names a journal outside the list (such as British Accounting Review、Asia-Pacific Journal of Accounting and Economics、International Review of Economics and Finance、Finance Research Letters、Journal of International Money and Finance etc.), simply select it as specified, and apply the bib style and Section skeleton by analogy with journals of the same tier.

3.4.2 Matching score (internal to skill)

Score each candidate on a 4-dimension 1–5 scale:

T = topic_fit       # CF 主题与期刊偏好对齐
M = method_fit      # 识别策略与期刊门槛对齐
N = novelty_fit     # 贡献边际能否打动该刊编辑(中国机制能否对国际读者讲得通)
S = sample_fit      # 中国样本与期刊地理偏好(China-friendly 加分,纯美国偏好刊扣分)
score = 0.35 T + 0.30 M + 0.25 N + 0.10 S

Matching examples (for internal skill reference only; not output to the researcher):

  • "Golden Tax Phase III × corporate tax avoidance and investment" → JFE / JAE / JPubE / TAR / JCF
  • "Sci-Tech Innovation Board registration system × IPO pricing efficiency" → JFE / RFS / JFQA / JCF / PBFJ
  • "Shanghai-Hong Kong Stock Connect × corporate governance and information environment" → JF / RFS / JAR / JFE / MS
  • "Shanghai-Hong Kong Stock Connect × analyst coverage and earnings quality" → JAR / JAE / TAR / CAR / JFE
  • "Green Credit Guidelines × investment by heavily polluting firms" → JFE / JEEM / JCF / CER / JBF
  • "VAT reform (B2V) × corporate organizational restructuring" → JPubE / JAE / JFE / JCF / CER
  • "QFII shareholding × corporate governance and earnings management" → JFE / JAR / RFS / MS / JCF
  • "Digital economy pilot / Broadband China × financing constraints" → JFE / MS / JCF / CER / PBFJ
  • "Land finance × corporate investment behavior" → JF / JFE / JPubE / MS / CER
  • "Chinese private/state-owned differences × credit availability" → JFE / JCF / JBF / CER / PBFJ
  • "Auditor legal liability reform × audit quality" → JAR / JAE / TAR / CAR / RAST
  • "ESG rating divergence × financing costs of Chinese firms" → JFE / RFS / JCF / JBE / CER

3.4.3 Recommended output format (the 5 journals must be presented in this format)

[J1] JFE — Journal of Financial Economics
     Topic ★★★★★  Method ★★★★★  Novelty ★★★★☆  Sample ★★★★★   Score 4.70
     Why it fits: {2 句话——对齐研究主题与识别方法;指本刊近 3 年发表的相近中国
                   主题论文(举 1 篇,作者-年份-标题缩写)}
     Editorial preference: 偏好识别透明 + 表格规范严 + 控制变量逐项展示
     Bibliography style: jfe

[J2] JCF — Journal of Corporate Finance
     ...

After presenting the 5 journals,you must explicitly stop and ask(do not select automatically):

Please select one from [J1]–[J5] as the target journal; if none is satisfactory, please directly name any China-context English CF top journal (such as JF / TAR / MS / China Economic Review, etc.). Your choice will determine main.tex 's \bibliographystyle{}, Section skeleton, Introduction style, and minimum table note length.

After the researcher has selected, at the 00_proposal.md top add (example is JFE):

---
target_journal: JFE
bibliography_style: jfe
writing_preferences:
  identification_emphasis: high
  table_format_strict: yes
  introduction_style: "5 paragraphs, identification details surface early"
  notes_paragraph_length: ">= 6 lines"
  section_skeleton:
    - Introduction
    - Background (China's institutional setting)
    - Data
    - Empirical Strategy
    - Results
    - Robustness
    - Conclusion
---

3.4.4 Writing differences triggered by different journals

Journal bib style Section skeleton Intro style Table notes minimum China-context special requirements
JF jf Intro / Setting / Hypotheses / Data and Methodology / Results / Mechanism / Conclusion 5–6 paragraphs, puzzle-driven ≥ 8 lines The Setting paragraph must explain China's institutions for international readers; concise column headers preferred
JFE jfe Intro / Background / Data / Empirical Strategy / Results / Robustness / Conclusion 5 paragraphs, identification details appear early ≥ 6 lines The Background paragraph must detail China's policies; table conventions are the strictest; control variables shown item by item
RFS rfs Intro / Theoretical Motivation / Data / Identification / Empirical Findings / Conclusion 4–5 paragraphs, theoretical motivation prominent ≥ 6 lines Prefer embedded theory; China mechanisms need model micro-foundations; main text 25–30 pages
JFQA jfqa JFE-like JFE-like ≥ 5 lines Clear China identification is sufficient; table conventions strict
JCF elsarticle-num Intro / Background / Data / Methodology / Results / Conclusion 4–5 paragraphs, more China institutional background ≥ 5 lines Mainstream China CF journal; may have a narrower topic; Chinese readers also read it, institutional terms may be retained with pinyin annotations
JBF elsarticle-num JCF-like 4 paragraphs ≥ 5 lines Prefer China banking/credit/regulation topics
JAR jar Intro / Hypothesis Development / Sample and Data / Research Design / Results / Conclusion 6 paragraphs, hypothesis in a standalone §2 ≥ 6 lines The Hypothesis section must be standalone; predictive H1/H2/H3; China institutions introduced at the end of §2 or the beginning of §3
JAE jae JAR-like 6 paragraphs ≥ 6 lines Economic consequences oriented; China contracting/governance topics must have testable opposing predictions
TAR tar JAR-like JAR-like ≥ 5 lines JAR-like; prefers new measures; China data widely accepted in recent years
CAR car JAR-like JAR-like ≥ 5 lines Similar to the TAR platform; high acceptance of China accounting
RAST rast JAR-like 5 paragraphs ≥ 5 lines Prefer valuation / information environment; China disclosure reform is possible
AER aer Intro / Background / Data / Empirical Strategy / Results / Mechanism / External Validity / Conclusion 4 paragraphs, broad impact ≥ 5 lines Must have a discussion of external validity; China topics must have global impact (e.g., China Shock)
QJE / JPE / REStud qje / jpe / restud AER-like (more compact structure) 4 paragraphs, puzzle + economic significance ≥ 5 lines Readability across subdisciplines; China CF must have significant methodological/conceptual innovation
MS informs Intro / Background / Hypotheses / Data and Methods / Results / Discussion / Conclusion 4–5 paragraphs, interdisciplinary motivation ≥ 5 lines Must include managerial implication;China data friendly; emphasize causal identification
SMJ smj MS-like 4–5 paragraphs ≥ 5 lines China governance / cross-border M&A / strategic choice
JIBS jibs Intro / Theory and Hypotheses / Methods / Results / Discussion / Conclusion 5 paragraphs, cross-country comparative perspective ≥ 5 lines Must include an international business contribution; prefers Chinese MNEs / institutional differences
JPubE / JEEM elsarticle-num JFE-like 4 paragraphs ≥ 5 lines CF consequences favoring Chinese tax/environmental policy
CER elsarticle-num Intro / Background / Data / Methodology / Results / Conclusion 3–4 paragraphs; Chinese institutions may be covered in more detail ≥ 4 lines China-themed special issue; Chinese institutional terminology may be denser; may adopt a Chinese reader perspective
PBFJ elsarticle-num CER-like 3–4 paragraphs ≥ 4 lines Asia-Pacific/China CF; threshold lower than JCF
EMR elsarticle-num CER-like 3–4 paragraphs ≥ 4 lines China/emerging market comparison; institutional differences are the selling point
CJAR / CAFR / CFRI elsarticle-num / apa / apa JAR / JCF-like 3–4 paragraphs ≥ 4 lines High acceptance in mainstream China; bilingual Chinese abstract possible; institutional terminology need not be explained in excessive detail

render_main_tex() when generating main.tex reads 00_proposal.md 's target_journal / bibliography_style / section_skeleton, and automatically replaces \bibliographystyle{} and Section naming; at the same time, passes the target journal's notes_paragraph_length threshold to each render_*_tex() function to ensure that table note length reaches the target journal threshold.

3.A Adaptive mechanism (Plan-B): switching logic when results fall short of expectations

The core capability of this skill—when the empirical results of any stage do not match the "(3) Expected results" in 00_proposal.md , the skill does not require researcher intervention, and autonomously selects and executes from the following alternative plan tree until the research project is closed-loop.

3.A.1 Failure criteria (triggered immediately after each stage is completed)

Stage Expected result Failure criterion (triggers Plan-B)
Parallel trends test All pre-period coefficients are insignificant Any pre-period |t|>1.96
Baseline regression X coefficient sign is consistent with expectation and p<0.1 Sign reversed / all insignificant / coefficient jumps substantially with the addition of control variables/FE
Robust DID estimator CS-DID / Sun-Abraham conclusion direction is consistent with TWFE Sign reversed or p-value magnitude completely mismatched
IV first stage F statistic > 10, IV significant F < 10 or IV insignificant
IV second stage LATE direction is consistent with OLS and interpretable Sign reversed and magnitude abnormal
Mechanism analysis Expected channels M1/M2/M3 are significant All channels are insignificant
Heterogeneity Expected between-group differences across dimensions are significant bdiff p > 0.1
Robustness X coefficient sign/significance is stable across most columns More than 1/3 of columns flip
Placebo (executed only for DID / Staggered DID / PSM-DID projects; pure Panel FE+IV / RDD / DML / synthetic control projects skip this stage) True coefficient lies outside the placebo distribution True coefficient falls within the placebo distribution's [5%,95%]

3.A.2 Plan-B decision tree (try in order; each step may be stacked)

失败环节 → 依次尝试:

【基准回归】系数不显著 / 符号反向
  ├─ B1. 替换 Y 度量(从 template/measures.tex 思路:Ln(...)、子维度拆分、行业调整)
  ├─ B2. 替换 X 度量(连续 vs 虚拟 / 强度 vs 0-1)
  ├─ B3. 替换 FE 规格(加 Industry×Year、Province×Year,高维交互)
  ├─ B4. 替换聚类层级(firm → city → province×year 双向)
  ├─ B5. 样本细化(剔除金融业、ST、IPO 当年;仅保留主要政策实施前已上市样本)
  ├─ B6. 换时间窗(缩短到政策前后 ±5 年)
  └─ B7. 若仍不显著 → 考虑反向假设(Y→X 或 U 型/门槛),在 proposal 中注明假设修正

【平行趋势】pre 期显著
  ├─ B1. 重新定义政策时点(公布年 vs 实施年 vs 试点年)
  ├─ B2. 用 Sun-Abraham / CS-DID 替代 TWFE
  ├─ B3. 限制政策前窗口(仅保留 pre_3 到 las_K)
  ├─ B4. 加入 Group × linear trend 控制差异化趋势
  └─ B5. 改为 PSM-DID 缓解选择偏差后重测

【IV 第一阶段弱】F < 10
  ├─ B1. 尝试 asset/计量方法+政策数据库.md §6.2 "X→IV 配对清单"中相同 X 的备选 IV,或 §12 政策大全中同维度的其他外生冲击(如 Broadband/TechFin/Court)
  ├─ B2. 构造 Bartik / Shift-Share IV(行业份额×全国冲击)
  ├─ B3. 用滞后变量 / 同伴平均 (peer mean) 作为 IV
  ├─ B4. 改为 DML-Partial(弱化 IV 依赖,用 ML 处理高维混淆)
  └─ B5. 改用断点/匹配的自然实验替代 IV

【机制不显著】所有 M 均无效应
  ├─ B1. 换中介变量度量(同一渠道的不同代理)
  ├─ B2. 换渠道组合(从供给→需求→制度三维替换)
  ├─ B3. 拆分样本(分组后分别做机制,寻找条件性渠道)
  ├─ B4. 改用交互项检验(X × M → Y 是否有调节)
  └─ B5. 若仍无渠道显著 → 在"进一步分析"中承认黑箱,改做异质性深挖

【异质性不显著】bdiff p > 0.1
  ├─ B1. 换分组切点(median → tertile/quartile)
  ├─ B2. 换分组变量(同维度其他代理)
  ├─ B3. 连续调节变量做交互项(企业级)
  ├─ B4. 换分组维度(经济→制度→文化→政策四大簇切换)
  └─ B5. 保留为"null heterogeneity"——在论文正文中作为结论的边界条件陈述

【稳健性大面积翻转】
  ├─ B1. 回溯样本构造(检查缺失/极端值/行业代码)
  ├─ B2. 检查是否遗漏同期政策 → 加入 co-shock dummy
  ├─ B3. 重算处理组/对照组的定义口径
  └─ B4. 若仍不稳健 → 核心结论弱化为"条件性证据",在正文强调边界

【安慰剂失败】真实系数落在虚假分布内
  ├─ B1. 增加 reps(500 → 1000 → 2000)
  ├─ B2. 换安慰剂设计(空间 → 时间 → 空间+时间双维度)
  ├─ B3. 回溯基准 → 基准本身可能有 confounder,返回【基准回归】的 B1-B7

3.A.3 Mandatory record when switching

Each time Plan-B is triggered, one entry must be appended to {项目名}/DECISION_LOG.md :

## YYYY-MM-DD HH:MM — 环节 {X} Plan-B
- **预期**(引自 proposal 第 3 条):...
- **实测**:系数 = ..., t = ..., p = ...
- **触发判据**:...
- **选择分支**:B{n} — {方案名}
- **后续调整**:...
- **再测结果**:...

3.A.4 Termination conditions

  • Success: baseline regression + mechanism + heterogeneity + robustness all pass; DID projects additionally require the placebo to pass (or to be partly interpretable in the form of "boundary conditions"). Non-DID projects do not require a placebo: Benchmark regression + mechanism + heterogeneity + robustness all pass; DID projects additionally require the placebo test to pass (or to be partly interpretable in the form of "boundary conditions"). Non-DID projects do not require a placebo test
  • Downgrade loop: When Plan-B depth exceeds 3 levels and still fails to converge, downgrade the study to a "null-effect identification report" or "conditional evidence report"; the output remains complete: all .tex / figures / code are delivered as usual, and the concluding paragraph of the main text is rewritten as a null-result narrative
  • Never: abandon the project or "surrender" to the researcher; the skill must produce a complete deliverable research output

4. Main research logic sequence (strictly in order, not to be reversed)

The order comes from rule/通用实证研究逻辑与规范总结.docx Section 7.2. Each step is accompanied by the Python code skeleton below and the corresponding LaTeX template in template/.

# Step Required? Corresponding Python artifact Corresponding LaTeX template
1 Descriptive statistics + variable definitions + sample construction Required 01_clean.py → sample.tex;02_sumstat.py → sum_stat.tex + variables.tex template/sum_stat.tex + variables.tex(+ sample table handwritten in the Panel A/B style of psm_ddml.tex )
2 Parallel trends test DID Required; others skipped 02_parallel.py → results/parallel.pdf template/parallel.pdf
3 Heterogeneity-robust DID estimator staggered DID Required 03_csdid.py(CS-DID / Sun-Abraham / Stacked) template/csdid-figure.pdf + estimator.pdf
4 Benchmark regression Required (the anchor) 04_baseline.py → baseline.tex template/baseline.tex
5 Endogeneity test Panel FE Required; DID recommended 05_iv.py + 05_dml.py template/iv.tex + psm_ddml.tex Panel B
6 Dependent variable decomposition / alternative measures Recommended 06_measures.py template/measures.tex
7 Mechanism analysis Required 07_channel1.py, 07_channel2.py, 07_channel3.py template/channel1/2/3.tex
8 Heterogeneity analysis Required 08_hetero1.py, 08_hetero2.py, 08_hetero3.py template/heterogeneity1/2/3.tex
9 Robustness checks Required 09_addctr.py, 09_spec.py, 09_sampling.py, 09_bunching.py template/addctr/specification/sampling/bunching-did.tex
10 PSM-DID DID Recommended 10_psm.py → psm_ddml.tex Panel A template/psm_ddml.tex + psm-pre-post.pdf
11 Placebo test Required for DID; skipped for non-DID projects 11_placebo.py → results/placebo.pdf Refer to rule Section 5.2 for the placebo distribution plot specification
12 Further analysis / specification curve Optional 12_further.py, 12_specurve.py template/further.tex + specurve.pdf

5. Python code skeleton (all in Python, no Stata)

Iron rule: This skill always uses Python to implement econometrics.rule/ The Stata code in (esttab, etc.) serves only as a formatting reference; the final .tex is rendered directly by Python functions following the handwritten table shell format in template/.

5.1 Dependencies and standard imports

# 所有脚本统一导入
import numpy as np
import pandas as pd
import statsmodels.api as sm
from linearmodels.panel import PanelOLS
from linearmodels.iv import IV2SLS
import pyfixest as pf                  # 高维固定效应 + reghdfe 等价
from doubleml import DoubleMLPLR, DoubleMLPLIV, DoubleMLData
from sklearn.linear_model import LassoCV, RidgeCV
from sklearn.ensemble import RandomForestRegressor
import lightgbm as lgb
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['font.family'] = 'Times New Roman'
mpl.rcParams['axes.facecolor'] = 'white'
mpl.rcParams['figure.facecolor'] = 'white'
mpl.rcParams['axes.edgecolor'] = 'black'

5.2 Standard regression with fixed effects + clustered standard errors

def reg_hdfe(df, y, x, controls, fe, cluster):
    """
    y: 因变量名 (str)
    x: 核心解释变量名 (str)
    controls: 控制变量名列表
    fe: 固定效应列表, e.g. ['firm_id','year']
    cluster: 聚类层级, e.g. 'firm_id'
    返回 pyfixest.Feols 对象
    """
    rhs = x + ' + ' + ' + '.join(controls)
    fe_str = ' + '.join(fe)
    formula = f"{y} ~ {rhs} | {fe_str}"
    return pf.feols(formula, data=df, vcov={'CRV1': cluster})

5.3 Instrumental variables / 2SLS

def iv_2sls(df, y, x_endog, instruments, controls, fe, cluster):
    """
    先做 within 变换(去掉 fe),再 IV2SLS,
    报告 Kleibergen-Paap rk Wald F。
    instruments: IV 列表(每列单独一列 + 合并一列交叉验证)
    """
    # pyfixest 原生支持 IV:
    rhs = ' + '.join(controls)
    fe_str = ' + '.join(fe)
    iv_str = f"({x_endog} ~ {' + '.join(instruments)})"
    formula = f"{y} ~ {rhs} | {fe_str} | {iv_str}"
    return pf.feols(formula, data=df, vcov={'CRV1': cluster})

5.4 Double Machine Learning(DML / DML-IV)

def dml_plr(df, y, d, controls, learner='lasso', n_folds=5, n_reps=10):
    learners = {
        'lasso': LassoCV(cv=5),
        'ridge': RidgeCV(),
        'rf':    RandomForestRegressor(n_estimators=500, max_depth=8, n_jobs=-1),
        'lgbm':  lgb.LGBMRegressor(n_estimators=500, num_leaves=31),
    }
    dml_data = DoubleMLData(df, y_col=y, d_cols=d, x_cols=controls)
    model = DoubleMLPLR(dml_data,
                        ml_l=learners[learner],
                        ml_m=learners[learner],
                        n_folds=n_folds, n_rep=n_reps)
    model.fit()
    return model   # .coef, .se, .t_stat, .pval, .confint()

5.5 Staggered DID:Callaway-Sant'Anna / Sun-Abraham

# CS-DID:用 differences 包或手写 group-time ATT 聚合
# Sun-Abraham:interaction-weighted estimator,用 pyfixest 的 sunab() 便捷函数
def csdid_event_study(df, y, cohort, time, controls, cluster):
    """
    cohort: 处理开始年份(未处理组为 NaN/Inf)
    返回:{e: att, se, ci} 的字典,用于画动态效应图(event_study plot)
    """
    # 实现 Callaway & Sant'Anna (2021) 做法
    # 或直接调用 pyfixest.feols 配合 i(time, treat, ref=-1) 画事件研究
    ...

5.6 PSM / Entropy Balancing

def psm_match(df, treat, covariates, k=4, caliper=0.002):
    """最近邻 1:k 匹配 + caliper。返回带权重的新 DataFrame。"""
    from sklearn.linear_model import LogisticRegression
    from sklearn.neighbors import NearestNeighbors
    # 估计倾向得分 → 最近邻匹配 → 返回匹配后样本
    ...

def entropy_balance(df, treat, covariates):
    """使用 ebalance / cvxpy 实现熵平衡重加权。"""
    ...

5.7 Bootstrap Fisher permutation test (between-group heterogeneity differences)

def bdiff_bootstrap(df, y, x, controls, fe, cluster, group_var, reps=500, seed=42):
    """
    对异质性分析的两组(High/Low)做 bootstrap Fisher 置换检验。
    rule/ 回归表写作规范总结.docx 第 4.5 节要求 500 reps。
    返回:p-value for (b_high - b_low)
    """
    rng = np.random.default_rng(seed)
    ...

6. LaTeX output: strictly follow template/ + rule/

All .tex are handwritten and generated by Python functions, and the goal is to make the output and template/ the corresponding file invisually consistent: the same \toprule / \midrule / \bottomrule, the same \sym{} macros, the same column header structure (&\multicolumn{1}{c}{(1)}…), and the same table-note justifying paragraph.

6.1 Iron rules (from the two documents in rule/)

  1. No vertical lines (|), do not add extra \hline. Three-line table:\toprule / \midrule / \bottomrule once each.
  2. Control variables must display coefficients and t-values one by one,Prohibited "Controls: Yes/No" omitted.
  3. Variable order is fixed: core X → (interaction term) → control variables → Constant (usually omitted).
  4. t-values in parentheses(not standard errors), the first line of the table note is fixed as t statistics in parentheses(if changed to SE, update the table note accordingly).
  5. Significance symbolsfixed as *** p<0.01, ** p<0.05, * p<0.1, asterisks embedded in the \sym{} macro.
  6. Numeric format: coefficients %.4f, t-values (%.2f), number of observations %,.0f,R² %.2f。
  7. fixed effects rows at the bottom:Firm FE / Year FE / City FE / Ind × Year FE …, Yes/No explicitly indicated.
  8. Clustering level matching: the clustering standard error level must match the variation level of the core explanatory variable; state clearly in the table note "robust t-statistics clustered by the firm/city/...".
  9. The table note (noindent + justifying paragraph) must be complete: sample scope ("Chinese A-share listed firms from YYYY to YYYY"), dependent variable definition, core X definition, control variables listed one by one, FE combination, clustering level,cross-reference Table \ref{definition}, significance symbol explanation.
  10. Heterogeneity tablemust include \cmidrule(lr){i-j} grouping column headers, and add at the bottom of the table p-value for Diff. (High-Low) one row (bootstrap Fisher permutation test, reps=500).

6.2 Python rendering functions (skeleton)

def render_baseline_tex(models, labels_cols, var_order, var_labels,
                        fe_rows, nobs, r2, caption, label, note,
                        out_path):
    """
    按 template/baseline.tex 的结构写出 .tex。
    models: 列表,每个元素是 (coef_dict, t_dict);coef_dict 的 key 与 var_order 一致。
    fe_rows: [('Firm FE', ['Yes','Yes',...]), ('Year FE', [...]), ...]
    """
    lines = [r'\begin{table}[htbp]\centering\scriptsize',
             r'\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}',
             rf'\caption{{\textbf{{{caption}}}}}',
             rf'\label{{{label}}}',
             '',
             rf'\noindent{{\justifying{{{note}\par}}}}',
             r'\bigskip',
             '',
             rf'\begin{{tabularx}}{{\textwidth}}{{l{"Y"*len(models)}@{{}}}}',
             r'\toprule', '']

    # 列序号行
    header1 = '                ' + ''.join([rf'&\multicolumn{{1}}{{c}}{{({i+1})}}'
                                            for i in range(len(models))]) + r'\\'
    lines.append(header1)
    # 可选:第二行列头(因变量名 / 分组名)
    if labels_cols:
        header2 = '                ' + ''.join([rf'&\multicolumn{{1}}{{c}}{{{c}}}'
                                                for c in labels_cols]) + r'\\'
        lines.append(header2)
    lines.append(r'\hline\\')

    # 系数与 t 值:每个变量两行
    for v in var_order:
        vlab = var_labels.get(v, v)
        coef_line = f'{vlab:<16}' + ''.join(
            [rf'& {fmt_coef(m[0][v], m[2][v]):>17}' for m in models]) + r'\\'
        t_line = ' ' * 16 + ''.join(
            [rf'& {fmt_t(m[1][v]):>17}' for m in models]) + r'\\'
        lines += [coef_line, t_line]

    lines.append(r'\hline')
    # FE 行 + Obs + Adj R²
    lines.append(f'Obs             ' + ''.join([rf'&{n:>10,}        ' for n in nobs]) + r'\\')
    for name, vals in fe_rows:
        lines.append(f'{name:<16}' + ''.join([rf'&{v:>10}        ' for v in vals]) + r'\\')
    lines.append(f'Adjusted $ R^2$ ' + ''.join([rf'&{r:>10.2f}        ' for r in r2]) + r'\\')
    lines += [r'\bottomrule', r'\end{tabularx}', r'\end{table}']

    with open(out_path, 'w', encoding='utf-8') as f:
        f.write('\n'.join(lines))

def fmt_coef(b, stars):
    s = {3:r'\sym{***}', 2:r'\sym{**}', 1:r'\sym{*}'}.get(stars, '')
    sign = '  ' if b >= 0 else ' '
    return f'{sign}{abs(b):>7.4f}{s}'  # 与 template/baseline.tex 的对齐一致

def fmt_t(t):
    return f'({t:>5.2f})'

render_sumstat_tex、render_iv_tex(including First Stage/Second Stage grouping column headers + \cmidrule)、render_channel_tex(dependent variable row in the second-level column header),render_heterogeneity_tex(including p-value for Diff. row),render_psm_ddml_tex(Panel A + Panel B composite table),render_variables_tex(p{2.0cm}p{13.5cm} two-column definition table),render_sample_tex(for appendix,Panel A + Panel B two-column style) implemented one-to-one corresponding to the respective files in template/.

render_sample_tex Structural requirements (appendix sample.tex):

  • Panel A: Sample Construction —— three-column table:Filtering Step | # Firm-Year Observations | # Unique Firms
    • Example row:All CSMAR A-share firm-years (2003-2023) / Drop financial & insurance (CSRC=J) / Drop ST or *ST / Drop IPO year / Drop firm-years with missing controls / Final sample
    • Each step gives the number excluded and the number remaining, and the final row is the final sample size
  • Panel B: Sample Distribution —— two sub-tables side by side or stacked vertically:
    • B1. By Year:year / N / % of total
    • B2. By Industry (CSRC 2012 one-digit code) or By Region (East/Central/West or province): group / N / %
  • Format: follow template/psm_ddml.tex 's Panel A / Panel B two tabularx side-by-side style; three-line table; column headers centered; sample size %,.0f format
  • Table note (\noindent{\justifying{...}}): explain the sample start and end years, exclusion criteria, winsorization percentiles; give the CSRC 2012 industry code standard and the basis for the East/Central/West division

6.3 Image plotting (matplotlib)

Follow rule/回归表写作规范总结.docx Part 5 image specifications: white background, black frame, Times New Roman,.pdf + .png dual output.

  • Event study plot:errorbar(rcap 样式) + axhline(0) + axvline(基准期, linestyle='--')
  • Specification curve: coefficient values sorted scatter plot + variable selection matrix below
  • Placebo distribution:hist + kde, true coefficient axvline(color='red')
  • Forest plot: horizontal errorbar, grouped by "economic/institutional/cultural/policy", one subplot per group
  • PSM balance: before/after matching |% bias| scatter or bar chart
  • Binscatter:seaborn.regplot or after handwritten residualization, bin it; scatter in navy, fitted line in maroon

7. Data Sources and Retrieval Workflow (asset/ takes priority, but is not limited to asset/)

7.1 Data Source Priority

Data sources are not limited to the two lists in asset/ two lists in——asset/ is onlyprioritizeentry point. In actual research, researchers may (and should) supplement other sources according to the following priority:

  1. asset/Econometric Methods + Policy Database.md (50-page condensed version) + two CSV lists(Mark Data Network + Pipiman Data) — highest priority; the md provides a three-dimensional cross-reference of "method × policy × data", and the CSV provides dataset name matching 1.5. asset/First Release on the Entire Web: Econometric Methods + Policy Database.pdf — open only when the condensed md version is insufficient (975-page full version; locate the PDF page number according to the md §14 index)
  2. MCP servers registered in asset/MCP.docx(such as CSMAR-MCP:https://lobehub.com/zh/mcp/yourusername-csmar-mcp-server) — second priority. MCP servers can pull data directly through Claude Code, eliminating manual downloads
  3. Commercial databases: CSMAR (Guotai'an), WIND, RESSET, CNRDS, BvD Osiris, Thomson Reuters
  4. Official statistics: National Bureau of Statistics / People's Bank of China / China Banking and Insurance Regulatory Commission / China Securities Regulatory Commission / General Administration of Customs / local statistical bureau yearbooks at all levels
  5. Government information disclosure: Ministry of Ecology and Environment Data Center, Development Research Center of the State Council, bulletins of various ministries and commissions, China Judgments Online
  6. Academic mirrors: Peking University Open Research Data Platform, CEIC, WGI, CGSS / CFPS / CHIP micro surveys
  7. Self-built/manually compiled: policy text tokenization, announcement parsing, corporate annual report text, patent application text, social media
  8. Third-party open source: crawler interfaces such as JoinQuant / Tushare / AkShare / BaoStock
  9. Overseas comparators: Compustat / CRSP (international comparators in the same industry), Worldscope (overseas subsidiaries)

MCP Server Usage Instructions:asset/MCP.docx Each MCP server registered in asset/MCP.docx has an accompanying lobehub page URL;follow the installation instructions on the page(usually the npx / uvx command to configure it into ~/.claude.json or settings.json the mcpServers field) to complete installation; after installation, call tools through the mcp__<server-name>__<tool> prefix. The installation steps are completed by the researcher or skill with the assistance of the update-config skill.

7.2 Retrieval Workflow (priority → fallback)

  1. The researcher first provides data keywords(such as "prefecture-level city digital economy", "equity pledge", "green patents", "environmental protection tax", "Golden Tax Project", "Shanghai-Hong Kong Stock Connect", "registration-based IPO system", "replacing business tax with VAT", ...) or a policy name.
  2. First round: check the asset/ lists。
    • Three-dimensional retrieval by method / policy / data: first use Read / Grep in asset/计量方法+政策数据库.md(50-page condensed version,preferred entry point) to cross-locate along the three dimensions of "method (§2–§11) / policy (§12) / data (§13)";
    • Dataset name query: use pandas in asset/macrodatas_list.csv、asset/ppmandata_trade_list.csv to search the title / keyword / data_intro / data_indicators columns and return the top 5 candidates;
    • PDF fallback: only open asset/全网首发计量方法+政策数据库.pdf to consult the full pages of the original 800+ empirical studies when the concise description in the md is insufficient for judgment (locate the specific PDF page number according to the index in Chapter 14 of the md).
  3. Second round: check asset/MCP.docx. If there is no match in the asset/ list, check whether the MCP servers registered in asset/MCP.docx can cover the variable (e.g., CSMAR-MCP covers listed company fundamentals + governance variables). After confirmation, complete the MCP installation according to the URL guidance in the docx, and call the MCP tools to retrieve data.
  4. Third round: external supplementation. When neither the list nor MCP covers it, prompt the researcher to supplement from the other sources in items 3–9 of 7.1. It is recommended to give the researcher a checklist format for checking:
    • "Do you need me to search whether CSMAR has this variable?"
    • "This policy may require manually organizing policy texts + LLM extraction of key fields. Continue?"
    • "If neither asset/ nor MCP has this city panel, statistical yearbooks can be used to splice it year by year. Please ask the researcher to download it and place it in data/raw/。"
  5. Fourth round: when it still cannot be obtained, enter Plan-B (§3.A):
    • Replace the dependent variable/independent variable measure with an approximate proxy already covered by asset/ or MCP
    • Downgrade the research scope (e.g., firm level → industry level, nationwide → Yangtze River Delta/Pearl River Delta)
    • Or switch to a synthetic / secondary data splicing scheme

7.3 Data source transparency (mandatory)

Regardless of whether the data comes from asset/, an MCP server, or an external source, in sample.tex and the paper's Data subsectionthe original source of each variable must be indicated(database name + access year + whether manually organized):

  • asset/ list: specify the specific dataset entry id (e.g., macrodatas_list.csv line 1776761040)
  • MCP: specify the server name and the tool called (e.g., CSMAR-MCP / mcp__csmar__get_financials) and the access date
  • Commercial database/external: specify the full database name + field table name + download date
def search_asset(keyword, top=5):
    """三维检索:先扫精简 md,再扫两份 CSV。md hits 用于方法 / 政策 / 数据三维定位;
    CSV hits 用于具体数据集名匹配。"""
    md_path = 'asset/计量方法+政策数据库.md'
    md_lines = open(md_path, encoding='utf-8').read().splitlines()
    md_hits = [(i + 1, ln) for i, ln in enumerate(md_lines) if keyword in ln][:top]
    if md_hits:
        print(f"[md] 在 {md_path} 命中 {len(md_hits)} 行(行号+片段):")
        for ln_no, ln in md_hits:
            print(f"  L{ln_no}: {ln.strip()[:120]}")

    cols = ['title','data_source','keyword','data_intro','data_indicators','article_url']
    csv_results = []
    for csv in ['asset/macrodatas_list.csv','asset/ppmandata_trade_list.csv']:
        df = pd.read_csv(csv, usecols=cols, encoding='utf-8', errors='ignore')
        hit = df[df.apply(lambda r: keyword in str(r.to_dict()), axis=1)]
        csv_results.append(hit.head(top))
    out = pd.concat(csv_results)
    if len(out) == 0 and not md_hits:
        print(f"[!] asset/ 无匹配 '{keyword}'。建议来源:CSMAR / WIND / 统计年鉴 / 手工整理。")
    return out

8. Common pitfalls in Chinese corporate finance research (must-check)

Pitfall Practice
The sample has not excluded the financial industry (CSRC industry code J) Exclude by default
ST / *ST / IPO year not excluded Exclude by default
Extreme values of control variables Continuous variables 1% / 99% winsorize(winsor), and explain in the table notes
Industry classification standard Prefer CSRC 2012 (2-digit manufacturing codes), and replace with SIC in robustness checks
Province/city merger issues Chaohu before 2011, administrative division adjustments after 2020, etc., need to be uniformly merged
Clustering level Cluster at the basic unit (firm/city), and replace with province × year two-way clustering in robustness checks
staggered DID Must be paired with CS-DID or Sun-Abraham cross-validation to avoid TWFE negative weights
Policy announcement vs implementation Distinguish "announcement year" and "implementation year", and replace in robustness checks
Confounding by contemporaneous policies Search asset/计量方法+政策数据库.md Section §12 "中国政策大全" by thematic domain to screen for contemporaneous policies; add dummy controls for contemporaneous policies in the baseline regression

9. Output project directory (automatically suggested when running the skill)

After the nine CONTRACT fields are confirmed, automatically generate the following skeleton (all Python scripts are pre-embedded with the template/ comparison render_*_tex calls):

{项目名}/
├── 00_proposal.md                          # 计划书固化版(**顶部 YAML:target_journal / bibliography_style / writing_preferences**;下接 CONTRACT 九字段)
├── DECISION_LOG.md                         # Plan-B 切换记录(3.A.3)
├── data/raw/                               # 研究者放入原始数据
├── data/cleaned/sample.parquet             # 清洗后样本
├── code/
│   ├── 00_config.py                        # 全局变量(样本年份、控制变量列表、FE 配置)
│   ├── 01_clean.py                         # → results/sample.tex(样本构造 Panel A + 样本分布 Panel B)
│   ├── 02_sumstat.py                       # → results/sum_stat.tex + results/variables.tex
│   ├── 03_parallel.py                      # → results/parallel.pdf   [DID 专用]
│   ├── 04_baseline.py                      # → results/baseline.tex
│   ├── 05_iv.py                            # → results/iv.tex
│   ├── 05b_dml.py                          # → results/psm_ddml.tex Panel B
│   ├── 06_measures.py                      # → results/measures.tex
│   ├── 07_channel.py                       # → results/channel{1,2,3}.tex
│   ├── 08_hetero.py                        # → results/heterogeneity{1,2,3}.tex
│   ├── 09_robust.py                        # → results/{addctr,specification,sampling,bunching-did}.tex
│   ├── 10_psm.py                           # → results/psm_ddml.tex Panel A + results/psm-pre-post.pdf
│   ├── 11_placebo.py                       # → results/placebo.pdf   [DID 专用,非 DID 项目不生成此脚本]
│   └── 12_further.py                       # → results/further.tex (+ results/specurve.pdf)
├── results/                                # 最终交付物:.tex 表格 + .pdf/.png 图像 全部放此处
└── main.tex                                # 正文入口,preamble 照抄 template/main.tex;\input{results/xxx.tex}

main.tex generation rules:

When creating the project, copy the three types of blocks from template/main.tex to {项目名}/main.tex:

  1. Preamble: documentclass / usepackage / custom macros / page setup / \def\sym{...}
  2. References block: bibliography style (\bibliographystyle{...} + \bibliography{...} or thebibliography environment).\bibliographystyle{} Do not copy the template; instead, according to 00_proposal.md in the YAML of bibliography_style fill in(e.g., JFE → \bibliographystyle{jfe}、JCF → \bibliographystyle{elsarticle-num}、CER → \bibliographystyle{elsarticle-num}、JAR → \bibliographystyle{jar}, see §3.4.4 for details).
  3. Appendix block:\appendix start command, appendix title style, appendix table/figure numbering reset \setcounter{table}{0}\renewcommand{\thetable}{A\arabic{table}} , etc.

In addition,Section skeleton (\section{...} naming and order) is rendered according to 00_proposal.md in the YAML of section_skeleton field(different journals have different skeletons, see §3.4.4), and no longer mechanically copy the five-part "Introduction / Literature Review / Research Design / Empirical Results / Conclusion" structure below.

Overall structure of main.tex (strictly in this order):

<Preamble>                                 % 来自 template/main.tex
\begin{document}
\maketitle
\begin{abstract}\end{abstract}              % 摘要 body 留空

% ★ 以下 \section / \subsection 顺序与命名按 §3.4.4 的 section_skeleton 替换;
%   每个 \section / \subsection 下 body 一律留空(不写 prose)。
%   这是默认 JFE-style 骨架,其他期刊(JAR / JF / MS / CER…)按 §3.4.4 替换。

\section{Introduction}

\section{Background and Hypothesis Development}
\subsection{China's Institutional Setting}
\subsection{Hypothesis Development}

\section{Data and Sample}
\subsection{Sample Construction}
\subsection{Variable Definitions}
\subsection{Summary Statistics}

\section{Empirical Strategy}
\subsection{Baseline Specification}
\subsection{Identification Strategy}                 % 含 IV / DID / RDD / DML 等

\section{Empirical Results}
\subsection{Baseline Results}
\subsection{Parallel Trends and Dynamic Effects}     % ★ 仅 DID 项目保留;非 DID 删除
\subsection{Endogeneity Concerns}                    % IV / DML / Heckman
\subsection{Mechanism Analysis}
\subsection{Heterogeneity Analysis}
\subsection{Further Analysis}

\section{Robustness Checks}                          % 正文只点题;完整稳健性表放附录
\subsection{Alternative Measures}
\subsection{Alternative Specifications}
\subsection{Subsample Analyses}
\subsection{Placebo Tests}                           % ★ 仅 DID 项目保留;非 DID 删除

\section{Conclusion}

%—— References(照抄 template/main.tex 的参考文献块格式)——
\bibliographystyle{...}
\bibliography{references}

%================================================================
%  正文图(Main-text Figures:图在前)
%================================================================
\clearpage
\begin{figure}[htbp]\centering
  \includegraphics[width=0.9\textwidth]{results/parallel.pdf}
  \caption{Parallel Trends}\label{fig:parallel}
\end{figure}
% 正文图依次(★ 仅 DID 项目):parallel / csdid-figure / estimator / placebo
% 非 DID 项目:本节不出现 parallel / csdid-figure / estimator / placebo,仅保留 §4 主线第 12 步可选图

%================================================================
%  正文表(Main-text Tables:表在后;内生性紧跟 baseline)
%================================================================
\clearpage
\input{results/sum_stat.tex}           % 描述性统计
\input{results/baseline.tex}           % 基准回归(定海神针)
\input{results/iv.tex}                 % ★ 内生性 —— 紧跟 baseline
\input{results/heterogeneity1.tex}     % 异质性 1(异质性 先于 机制)
\input{results/heterogeneity2.tex}     % 异质性 2
\input{results/heterogeneity3.tex}     % 异质性 3
\input{results/channel1.tex}           % 机制 1
\input{results/channel2.tex}           % 机制 2
\input{results/channel3.tex}           % 机制 3
\input{results/further.tex}            % 进一步分析

%================================================================
%  Appendix(附录;稳健性表格 + 附加图;格式照抄 template/main.tex)
%================================================================
\appendix
\section{Robustness Checks}

%—— 附录图 ——
\begin{figure}[htbp]\centering
  \includegraphics[width=0.9\textwidth]{results/psm-pre-post.pdf}
  \caption{PSM Balance: Pre vs. Post}\label{fig:psm-balance}
\end{figure}
\begin{figure}[htbp]\centering
  \includegraphics[width=0.9\textwidth]{results/specurve.pdf}
  \caption{Specification Curve}\label{fig:specurve}
\end{figure}

%—— 附录表(变量定义 + 样本构造 + 稳健性)——
\input{results/variables.tex}          % ★ 变量定义表(附录首张)
\input{results/sample.tex}             % ★ 样本构造与分布(Panel A 构造 / Panel B 分布)
\input{results/measures.tex}           % 替换因变量度量
\input{results/addctr.tex}             % 附加控制变量
\input{results/specification.tex}      % 高维交互 FE
\input{results/sampling.tex}           % 样本筛选稳健性
\input{results/bunching-did.tex}       % Bunching-DID 稳健
\input{results/psm_ddml.tex}           % PSM + DML(Panel A / Panel B)

\end{document}

Mandatory rules:

  1. Main-text sections (Introduction ~ Conclusion) do not embed actual tables or figures, only use \ref{tab:baseline} / \ref{fig:parallel} references.
  2. References Afterplace in order:main-text Figures → main-text Tables → Appendix。
  3. Main-text Figures come first, main-text Tables come after(the order cannot be reversed).
  4. Order of main-text tables(fixed):
    sum_stat → baseline → iv(内生性)
      → heterogeneity1/2/3 → channel1/2/3 → further
    
    The endogeneity table (iv.tex) immediately follows baseline.tex; if there are multiple endogeneity tables (such as additional IV / natural experiment), they are also placed consecutively between baseline and heterogeneity.Heterogeneity comes before mechanism。
  5. Order of appendix tables(fixed):
    variables(变量定义) → sample(样本构造与分布)
      → measures → addctr → specification → sampling → bunching-did → psm_ddml
    
    The first appendix table is variables.tex(variable definitions), immediately followed by sample.tex(sample construction Panel A + sample distribution Panel B), and then all robustness test tables.
  6. Appendix figures(such as psm-pre-post.pdf、specurve.pdf) are placed together with appendix tables after \appendix ; main-text figures retain only parallel / csdid-figure / estimator / placebo such figures that support the main conclusions (these four figures appear only in DID projects; non-DID projects do not place figures in the main-text area)。
  7. Appendix numbering format (Table A1 / Figure A1) is controlled by template/main.tex defined in the appendix block, such as \setcounter + \renewcommand{\thetable}{A\arabic{table}} macros,strictly copy without inventing your own。
  8. The References block format is likewisestrictly copy template/main.tex。
  9. do not create the paper/ subdirectory; all \input / \includegraphics paths start with results/xxx (relative to the directory where main.tex is located).
  10. The main-text body is always left empty:main.tex In the main-text section area, only fill in \section{...} and \subsection{...} Title (rename according to §3.4.4 section_skeleton adjustments),do not write any prose under each \section / \subsection—the body prose will be written later by the researcher.\begin{abstract}\end{abstract} Also leave blank.
  11. Do not create a separate .tex file for any chapter: all \section / \subsection titles are written directly in main.tex ,it is forbiddento create introduction.tex / data.tex / results.tex / conclusion.tex and other "chapter-style" sub-files.\input{} is only used for results/*.tex(tables).
  12. Placebo-related chapters / figures / tables appear conditionally:\subsection{Placebo Tests}、results/placebo.pdf、\subsection{Parallel Trends and Dynamic Effects}、results/parallel.pdf / csdid-figure.pdf / estimator.pdf these five itemsappear only in DID / Staggered DID / PSM-DID projects; for pure Panel FE+IV / RDD / DML / synthetic control projects, delete the above chapter/figure references from main.tex.

Final deliverables (only two types):

  1. Python code:code/ all .py scripts under the directory, which can be run from raw data to all tables and figures in one click.
  2. Figures and tables:results/ the .texunder (LaTeX tables, conforming to the template/ format) + .pdf and .png(images exported in duplicate).Tables and images are uniformly placed in results/, and no separate figures/ directory is created。

Additionally attach {项目名}/main.tex(preamble copied from template/main.tex, body in order \input{results/xxx.tex} and \includegraphics{results/xxx.pdf}), placed alongside code/ at the project root, not embedded in the paper/ subdirectory.

Do not deliver Word / Markdown reports; do not deliver Stata .do files; do not deliver intermediate datasets.

10. AI behavioral guidelines under this skill

  1. Proposal-driven: do not start without a proposal; the proposal is the contract. When encountering any judgment fork during execution, first check back with 00_proposal.md。 1.5. 🆕 After startup, the second step is target journal recommendation (§3.4), which cannot be skipped or chosen on behalf: after the nine CONTRACT fields are completed, [J1]–[J5] 5 English target journals must be presented according to the §3.4.3 output format (including 4-dimensional star ratings + Why it fits + Editorial preference + bib style),explicitly stop and ask the researcher; do not proceed to project skeleton generation before receiving a choice. Once the researcher has chosen, immediately write the target_journal / bibliography_style / writing_preferences YAML block into the top of 00_proposal.md , and subsequently render_main_tex() and each render_*_tex() shall be based on this.
  2. Autonomous closed loop, no stalling: when results do not meet expectations, follow the Plan-B decision tree in Section 3.Ato switch and continue execution on your own, without stopping to wait for the researcher to decide. Record the switch as DECISION_LOG.md。
  3. Small steps, quick iterations: complete only one link in the research chain at a time; after completion, show the .tex summary (first 10 lines + last 10 lines) compared with the proposal expectations (✅/⚠️/❌), then proceed to the next link.
  4. Format consistency check: before writing .tex each time, first Read the corresponding template/*.tex, compare the number of columns, column headers, FE rows, and Notes paragraph, then render.
  5. Do not change rules on your own:rule/ The rules in are mandatory; if the researcher requests a deviation, the researcher must provide an explicit written explanation (e.g., "the reviewer requested changing the reported standard errors").
  6. Do not run Stata: all regressions, PSM, DML, CS-DID, and bdiff are implemented in Python.rule/ The Stata code in serves only as an "output format reference".
  7. Protect the working directory:asset/ rule/ template/ : the three folders are read-only; do not write, modify, or rename them. All research outputs go only into the {项目名}/ subdirectory.
  8. Self-check after generating tables: check item by item against the rule/回归表写作规范总结.docx "AI Writing Checklist" in Part 9 (three-line tables, all control variables displayed, t-values in parentheses,\sym{} asterisks, FE rows, clustering level, complete table notes).
  9. Deliver only code and figures/tables: the final deliverables are limited to code/*.py + results/*.tex + results/*.pdf|png(tables and figures together in results/); do not produce additional reports, abstracts, PPTs, or Word documents.
  10. Chinese-English conventions: variable names, table titles, column headers, and FE rows in English; table notes (\noindent{\justifying{...}}) in English; in mixed Chinese-English text, put one space between Chinese and English, and use full-width Chinese punctuation.
  11. 🆕 Placebo only when DID: when 00_proposal.md item (4) identification strategy is DID / Staggered DID / PSM-DID , execute the placebo test in §4 Step 11 (11_placebo.py + results/placebo.pdf + \subsection{Placebo Tests} + placebo figure reference in the main text); when the identification strategy is Panel FE+IV / RDD / DML / synthetic control , thenskip entirelythe placebo——code/ do not generate 11_placebo.py,results/ do not include placebo.pdf,main.tex do not include \subsection{Placebo Tests} and the corresponding figure block. The parallel trends / CS-DID / estimator three figures likewise appear only in DID projects.
  12. 🆕 main.tex body contains only titles, body left empty:\section{...} and \subsection{...} names filled in according to the target journal section_skeleton , belowdo not write any prose(one blank line is sufficient);\begin{abstract}\end{abstract} also left empty. The researcher will write the main text themselves later. After the skill completes, display main.tex the number of lines should be comparable to the §9 template example (section title hierarchy + \input{results/*} + figure blocks,no paragraph prose)。
  13. 🆕 Do not create separate .tex files for sections: it is forbidden to generate introduction.tex / background.tex / data.tex / methodology.tex / results.tex / conclusion.tex and similar section-body sub-files. All main-text Section / Subsection titleswritten directly in main.tex inside;\input{...} used only for results/*.tex(tables).

11. Startup example

Minimal proposal (text form)

Research proposal Title: Digital Economy and Corporate Financing Constraints Hypothesis: Urban digital economy development (X = DigiEcon) reduces local corporate financing constraints (Y = SA/KZ index) Expectation: The coefficient of X on Y is significantly negative (p<0.05), with channels being "decline in information asymmetry + increase in credit availability"; heterogeneity: effects are stronger for non-state-owned enterprises and small and medium-sized enterprises Identification: Panel FE + IV (IV: historical stock of optical cable ports × time / Broadband China pilot) Sample: A-share non-financial listed companies, 2011–2023 Data: Prioritize searching for "digital economy index", "Broadband China", "financing constraints" in asset/; for items not covered in asset/ (such as SA/KZ index, corporate fundamentals), first check whether asset/MCP.docx's CSMAR-MCP can retrieve them directly; for those still not covered (such as historical stock of optical cable ports), supplement from statistical yearbooks / manual compilation Mechanisms: M1 = information asymmetry (analyst coverage/earnings synchronicity); M2 = credit availability (new growth loans/short-term loan ratio) Heterogeneity: ownership type (SOE/non-SOE); size (large/medium/small); region (east/central/west)

After submission, the skill immediately:

  1. parses the nine CONTRACT fields; if any are missing, asks follow-up questions all at once to complete them
  2. 🆕 recommends the 5 most suitable English target journals(e.g., in this case Broadband China IV → JFE / MS / JCF / RFS / China Economic Review), presented in the §3.4.3 format as [J1]–[J5] (including the 4-dimension star rating + Why it fits + bib style),stops and asks the researcher
  3. The researcher selects one (e.g., JFE) → generates 数字经济_融资约束/00_proposal.md(the nine CONTRACT fields + at the top target_journal: JFE YAML block)
  4. According to §3.4.4, writes the target journal's \bibliographystyle{jfe} and Section skeleton into {项目名}/main.tex
  5. searches asset/ and returns candidate datasets, waiting for the researcher to select
  6. executes according to the main line in Section 4; if the sign of the baseline X coefficient is reversed, automatically enters 3.A.2 [Baseline Regression] Plan-B B1→B7
  7. Final deliverables:code/ full set of Python + results/*.tex full set of tables + results/*.pdf|png full set of figures (tables and figures together in results/)+ DECISION_LOG.md traceability records