pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest +…
Execute research implementation plans efficiently while maintaining estimation quality and finishing features
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill workflows-work --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/workflows-workContext preview
The summary Claude sees to decide when to auto-load this skill.
Execute research implementation plans efficiently while maintaining estimation quality and finishing features
name: workflows:work description: Execute research implementation plans efficiently while maintaining estimation quality and finishing features argument-hint: "<plan file, estimation specification, or task description>" allowed-tools: Read, Glob, Edit, Write, Bash
**Pipeline mode:** This command operates fully autonomously. All decisions are made automatically.
Execute a research implementation plan systematically. The focus is on **shipping complete, reproducible research code** by understanding requirements quickly, following existing patterns, and maintaining estimation quality throughout.
<input_document> #$ARGUMENTS </input_document>
**If no input document is provided:** Look for the most recent plan in `docs/plans/` and use it. If no plans exist, state "No plan found. Run `/workflows:plan` first." and stop.
1. **Read Plan**
2. **Setup Environment**
First, detect the project environment:
# Detect estimation language
if [ -f "requirements.txt" ] || [ -f "setup.py" ] || [ -f "pyproject.toml" ]; then
echo "LANG=python"
elif [ -f "DESCRIPTION" ] || [ -f "renv.lock" ] || [ -f ".Rprofile" ]; then
echo "LANG=R"
elif [ -f "Project.toml" ]; then
echo "LANG=julia"
elif ls *.do >/dev/null 2>&1; then
echo "LANG=stata"
fi
# Detect pipeline tools
ls Makefile Snakefile dvc.yaml 2>/dev/nullThen check the current branch:
current_branch=$(git branch --show-current)
default_branch=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
if [ -z "$default_branch" ]; then
default_branch=$(git rev-parse --verify origin/main >/dev/null 2>&1 && echo "main" || echo "master")
fi**If already on a feature branch** (not the default branch):
**If on the default branch:**
**Option A: Create a new branch (default)**
git pull origin $default_branch git checkout -b <branch-name-from-plan>
Use a meaningful name derived from the plan (e.g., `feat/callaway-santanna-did`, `fix/blp-convergence`).
**Option B: Use a worktree (for parallel estimation runs)** See `references/worktree-patterns.md` if the plan involves parallel workstreams or the user has multiple active branches.
Automatically choose Option A unless the plan explicitly mentions parallel workstreams.
3. **Activate Research Environment**
Read `compound-science.local.md` for environment configuration. Then activate:
**Python:**
# Activate virtual environment
if [ -d ".venv" ]; then source .venv/bin/activate
elif [ -d "venv" ]; then source venv/bin/activate
elif command -v conda &>/dev/null; then conda activate $(basename $PWD)
fi
# Verify key packages
python -c "import numpy, scipy, pandas; print('Core packages OK')"**R:**
# Check renv status
Rscript -e "if (file.exists('renv.lock')) renv::status()"**Verify data paths:**
# Check that referenced data files exist ls data/ 2>/dev/null | head -5
4. **Create Task List**
1. **Task Execution Loop**
For each task in priority order:
while (tasks remain):
- Mark task as in_progress in TodoWrite
- Read any referenced files from the plan
- Look for similar patterns in codebase
- Implement following existing conventions
- Write tests for new functionality
- Run Estimation Quality Check (see below)
- Run tests after changes
- Mark task as completed in TodoWrite
- Mark off the corresponding checkbox in the plan file ([ ] → [x])
- Evaluate for incremental commit (see below)**Estimation Quality Check** — Before marking an estimation task done:
| Check | What to verify | |-------|---------------| | **Convergence** | Did the optimizer converge? Check exit flag, gradient norm, iteration count. Multiple starting values yield consistent results? | | **Sensible estimates** | Are parameter signs correct? Magnitudes economically reasonable? No values at boundary constraints? | | **Standard errors** | Computed with appropriate method (robust, clustered, bootstrap)? Positive definite Hessian? No suspiciously small or large SEs? | | **Diagnostics** | First-stage F > 10 (if IV)? Overidentification test (if overidentified)? Hausman or specification tests where relevant? | | **Numerical stability** | Log-likelihood (not likelihood) used? Condition number of key matrices acceptable? No NaN/Inf in outputs? | | **Reproducibility** | Random seeds set? Results identical across runs? Dependencies pinned? |
**When to skip:** Pure data cleaning, documentation updates, or pipeline configuration changes that don't involve estimation. If the task is purely additive (new utility function, data loading), the check takes 10 seconds and the answer is "no estimation, skip."
**When this matters most:** Any change that touches estimation routines, moment conditions, likelihood functions, or simulation code.
**IMPORTANT**
📌 文档结构(2026-07-22 起): 本文件是中文默认入口 —— banner + badges + 信任面 + 9 阶段流水线速览 + 76 行合集总表。 每个合集的完整描述、按用途分组、精确数字、验证方法在 docs/CONTENT_ZH.md(扩展正文,总表行内的 → 直接跳转到对应锚点)。 English version: README-en.md · 中文扩展正文:docs/CONTENT_ZH.md · README-zh-CN.md 已弃用(重定向占位) 🌐 语言: English |
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest +…
Use when the user asks to run a full empirical / causal analysis in Python — by default in the style of an applied economics paper (AER / QJE / JPE / ReStud /…
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest +…
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation +…
Classical end-to-end empirical analysis workflow in the modern tidyverse + econometrics R ecosystem — dplyr + tidyr + haven + fixest + sandwich + lmtest +…
Systematic writing framework for philosophy and interdisciplinary academic papers from optimized outline to submission-ready manuscript. Use when users want…