pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy +…
Execute research implementation plans efficiently while maintaining estimation quality and finishing features
Claude Code
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill workflows-work --agent claude-code
Codex
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill workflows-work -a codex -y
Cursor
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill workflows-work -a cursor -y
Gemini CLI
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill workflows-work -a gemini-cli -y
GitHub Copilot
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill workflows-work -a github-copilot -y
OpenCode
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill workflows-work -a opencode -y
Windsurf
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill workflows-work -a windsurf -y
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**
## 🔥 力荐 · StatsPAI — Stata 与 R 的 Python 平替,为 AI Agent 而生 🔁 Stata / R 平替:reghdfe、csdid、rdrobust、synth、fixest、did 等常用命令在 Python 中一站式替代,一个 import statspai as sp 搞定 DID / RD / IV / SCM / DML / matching 🤖 面向 Agent 设计:结构化结果对象 + 内置 MCP Server,Claude / Codex
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy +…
Use when the user asks to run a full empirical / causal analysis in Python — by default in the style of an applied economics…
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy +…
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid +…
Classical end-to-end empirical analysis workflow in the modern tidyverse + econometrics R ecosystem — dplyr + tidyr + haven +…
Systematic writing framework for philosophy and interdisciplinary academic papers from optimized outline to submission-ready…
Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…