skills/16-hsantanna88-clo-author/dot-claude/skills/analyze/SKILL.md
End-to-end data analysis dispatching Coder and Data-engineer for implementation, coder-critic for review. Supports R, Stata, Python, Julia. Replaces /data-analysis.
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research analyzeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run end-to-end data analysis by dispatching the Coder (analysis), Data-engineer (cleaning + figures), and coder-critic (code review).
Input: $ARGUMENTS — dataset path or description of analysis goal.
quality_reports/ if it existsscripts/ for project patternsIf raw data provided, dispatch Data-engineer first:
Dispatch Coder agent:
paper/tables/, figures to paper/figures/)results_summary.md with all estimates, SEs, and key statistics (MANDATORY)scripts/R/ (or appropriate language directory)The Coder follows these principles:
fixest for panel data, modelsummary for tables, ggplot2 for figures.tex tables for LaTeX, .pdf/.png figures, .rds for intermediate objects.rds for downstream use by the writer and other agents.Dispatch coder-critic agent — run the full 12-category checklist:
Strategic (categories 1-3):
Code Quality (categories 4-12):
4. Structure — Does the script follow the standard template? Clear section headers, logical flow from setup to export?
5. Console hygiene — No spurious print() statements polluting output. Intentional output only.
6. Reproducibility — set.seed() at top if any stochastic elements. No absolute paths. All packages loaded at top. Directory creation with showWarnings = FALSE.
7. Functions — Repeated logic extracted into functions. No copy-paste code blocks with minor variations.
8. Figure quality — Publication-ready: proper axis labels, titles, legends, font sizes. Consistent theme across all figures.
9. RDS pattern — Every computed object (models, data frames, summary stats) saved via saveRDS() for downstream use. Not just final outputs — intermediate objects too.
10. Comments — Section headers present. Non-obvious code commented. No commented-out dead code left behind.
11. Error handling — Graceful handling of missing files, empty data subsets, convergence failures. Informative error messages.
12. Polish — Consistent naming conventions. No magic numbers. Clean whitespace. Professional quality ready for replication package.
If strategy memo exists, cross-reference code against stated design.
Save report to quality_reports/[script]_code_review.md.
If coder-critic finds Critical or Major issues:
results_summary.md)paper/tables/, figures in paper/figures/# ============================================================
# [Descriptive Title]
# Author: [from project context]
# Purpose: [What this script does]
# Inputs: [Data files]
# Outputs: [Figures, tables, RDS files]
# ============================================================
# 0. Setup ----
library(tidyverse)
library(fixest)
library(modelsummary)
set.seed(42)
dir.create("paper/tables", recursive = TRUE, showWarnings = FALSE)
dir.create("paper/figures", recursive = TRUE, showWarnings = FALSE)
# 1. Data Loading ----
# 2. Exploratory Analysis ----
# 3. Main Analysis ----
# 4. Tables and Figures ----
# 5. Export ----
# saveRDS(model_fit, "scripts/R/output/model_fit.rds")
# saveRDS(main_results, "scripts/R/output/main_results.rds")
Every analysis run MUST produce results_summary.md containing:
This file is the primary handoff artifact to the writer agent. Without it, the writer cannot draft the results section.
--dual r,python)When --dual [lang1,lang2] is provided (e.g., --dual r,python, --dual r,stata):
data/cleaned/.claude/references/domain-profile.md tolerances:
quality_reports/cross_language_comparison.mdInspired by Scott Cunningham's replication methodology: if two independent implementations agree, neither has a bug. This is the core rationale for dual-language mode.
Tolerance thresholds:
domain-profile.mdWhen results diverge beyond tolerance:
saveRDS() for downstream use — model fits, cleaned data frames, summary statistics, not just final tables.--dual is used, divergence is a bug until proven otherwise.tools
Recommend AND run open-source AI tools, agents, Claude Code / Codex skills, and MCP servers for any stage of a literature review — searching, reading, extracting, synthesizing, screening, citation-checking, and paper writing. Use when the user asks "what tool should I use to..." OR "install/run/use <tool> to ..." for research/lit-review work: automating a survey or related-work section, PDF→Markdown extraction for LLMs (MinerU/marker/docling), PRISMA / systematic review (ASReview), citation-backed Q&A over PDFs (PaperQA2), wiring papers into Claude/Cursor via MCP (arxiv/paper-search/zotero servers), or chatting with a Zotero library. Ships a launcher (scripts/litrun.py) that installs each tool in an isolated venv and runs it. Curated catalog of 70+ vetted projects. 支持中英文(用于「文献综述工具选型」与「一键安装/运行」)。
development
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
documentation
Use when the project collects primary data or runs a field, lab, or survey experiment, before the intervention begins — write the pre-analysis plan, size the sample from a power calculation, and register with the AEA RCT Registry. Apply after the design is chosen in aer-identification and before any outcome data are seen.
tools
Guide economists to authoritative data sources with explicit, confirmed data specifications before retrieval; interfaces with Playwright MCP to navigate portals and extract real data, not articles about data.