empiricalwiki: Skill for Claude Code

.claude/skills/stata-plan/SKILL.md

stata-plan is a skill for Claude Code from Lambenthan/empiricalwiki. It costs 37 tokens per session (695 once invoked), scanned A, original, MIT.

A research-design tool that turns empirical-study notes into a Stata execution plan or, when requested, a starter do-file. Stata is software commonly used for statistical analysis and econometrics.

In plain words
What is it for?
Use it to plan data preparation, descriptive statistics, correlations, baseline models, mechanism and subgroup tests, robustness checks, and table export in Stata.
Why use it?
It puts data merges, variable construction, regressions, and robustness checks into a clear order. It flags uncertain variable names instead of silently inventing them.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

This is Lambenthan/empiricalwiki's own configuration. It tells Claude Code how to work on empiricalwiki itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything empiricalwiki configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 tools/research_wiki.py log wiki "stata-plan | <topic> | output: outputs/<file>".

Reuse

Borrowing it

Nothing to install: this file belongs to Lambenthan/empiricalwiki. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Lambenthan/empiricalwiki/main/.claude/skills/stata-plan/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Lambenthan/empiricalwiki

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for stata-plan

README.md
[![agentmods](https://agentmods.dev/badge/skills/lambenthan/empiricalwiki/stata-plan/github.svg)](https://agentmods.dev/skills/lambenthan/empiricalwiki/stata-plan)
Your own site
<a href="https://agentmods.dev/skills/lambenthan/empiricalwiki/stata-plan"><img src="https://agentmods.dev/badge/skills/lambenthan/empiricalwiki/stata-plan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for stata-plan

Your own site · 80×15
<a href="https://agentmods.dev/skills/lambenthan/empiricalwiki/stata-plan"><img src="https://agentmods.dev/badge/skills/lambenthan/empiricalwiki/stata-plan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 695 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.00695
Opus 5 $0.00018 $0.00347
Sonnet 5 $0.00007 $0.00139
Haiku 4.5 $0.00004 $0.00069

Measured 10d ago against content hash b5d25f3869b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

stata-plan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/stata-plan/SKILL.md · 76 lines

What it actually says

/stata-plan

把 wiki 中的变量、数据和模型信息转成 Stata 层面的执行顺序。默认生成计划;只有用户传 --write-do 时才创建 .do 骨架。

Workflow

Step 1: Read Design and Data Context

读取:

  • 指定的 wiki/outputs/empirical-design-*.md,或按 topic 匹配最近设计文档
  • wiki/variables/*.md
  • wiki/datasets/*.md
  • wiki/models/*.md
  • wiki/robustness/*.md
  • wiki/heterogeneity/*.md
  • wiki/identification/*.md(设计涉及 DID / PSM / IV / RDD / TWFE 时优先读对应预置策略卡)
  • tools/stata-templates/*.do(预置模板:twfe / did_staggered / psm / iv_2sls / rdd;--write-do 时以匹配的模板为骨架起点,按设计文档改写变量与参数)
  • 项目中的 .do.dta.xlsx、变量字典和 README

Step 2: Produce Stata Execution Plan

输出结构:

# Stata 执行计划

## 1. 输入数据
## 2. 主键与合并顺序
## 3. 样本筛选
## 4. 变量构造
## 5. 缩尾与缺失值处理
## 6. 描述性统计
## 7. 相关性分析
## 8. 基准回归
## 9. 机制检验
## 10. 异质性检验
## 11. 稳健性检验
## 12. 表格导出
## 13. 复核清单

每一步尽量写成 Stata 伪代码或代码块,但不要假造不存在的变量名。变量名不确定时用占位符并标记“需确认”。

Step 3: Optional Do File

只有用户传 --write-do 时,创建:

wiki/outputs/stata-plan-{slug}-{YYYY-MM-DD}.do

默认只写:

wiki/outputs/stata-plan-{slug}-{YYYY-MM-DD}.md

Step 4: Log

python3 tools/research_wiki.py log wiki "stata-plan | <topic> | output: outputs/<file>"

Constraints

  • 不覆盖用户已有 .do 文件。
  • 不假设 Stata 包已经安装;需要 reghdfeesttab 等时在计划里列出安装命令。
  • 代码骨架必须保留复核点,如样本量检查、merge 结果检查、变量分布检查。
  • 对中文路径和空格路径使用引号。
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 76 lines · 37 tokens per session scan A b5d25f3869b8

Subscribe to this mod's changes

stata-plan is a skill published in the GitHub repository Lambenthan/empiricalwiki (82 stars, last pushed 2mo ago), licensed MIT. It adds 37 tokens to every session and 695 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

review-paper

Comprehensive manuscript review with three modes: single-pass (default), --adversarial critic-fixer loop, and --peer [journal] simulated peer-review pipeline (editor + 2 dispositioned referees + editorial decision, calibrated to a target journal). R&R continuation via --peer --r2/--r3; hostile-editor stress test via…

pedrohcgs/claude-code-my-workflow · 114 tokens

audit-reproducibility

Enforce the replication-protocol.md rule by cross-checking numeric claims in a manuscript against the actual R / Stata / Python outputs. Report PASS/FAIL per claim against tolerance thresholds. Use before submission and before releasing a replication package.

pedrohcgs/claude-code-my-workflow · 54 tokens

capture-environment

Snapshot the computational environment for a replication package — detects the analysis stack (R / Stata / Python) and emits the right lockfiles (renv.lock + sessionInfo.txt, requirements.txt / environment.yml / uv.lock, Stata version + ado package list), records seeds and RNG kind, optionally writes a pinning…

pedrohcgs/claude-code-my-workflow · 139 tokens

data-management-plan

Draft a funder-compliant Data Management Plan (NSF DMP, NIH DMS Policy 2023, ERC, Horizon Europe) by composing the confidential-data and environment-capture primitives. Sections cover data description, formats/metadata, storage/backup, access/sharing, preservation/archiving, and roles. Use when user says "data…

pedrohcgs/claude-code-my-workflow · 143 tokens

grant-proposal

Scaffold a research grant proposal (NSF, NIH, ERC, or foundation) by composing existing primitives — pulls identification strategy from an /interview-me spec, delegates the data-management plan to /data-management-plan and the facilities statement to /capture-environment, and emits a funder-requirements checklist. Use…

pedrohcgs/claude-code-my-workflow · 131 tokens

power-analysis

Compute statistical power, required sample size, and minimum detectable effect (MDE) for a study design, then write a registry-ready power section. Handles two-arm RCTs (with clustering / ICC and unequal allocation), multiple-arm corrections, and a simulation-based power option for non-standard designs…

pedrohcgs/claude-code-my-workflow · 150 tokens