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.development
Conduct rigorous thematic analysis (TA) of qualitative data following Braun and Clarke's (2006) six-phase framework. Use whenever the user mentions 'thematic analysis', 'TA', 'Braun and Clarke', 'qualitative coding', 'identifying themes', or asks for help analysing interviews, focus groups, open-ended survey responses, or transcripts to identify patterns. Also trigger for questions about inductive vs theoretical coding, semantic vs latent themes, essentialist vs constructionist epistemology, building a thematic map, or writing up a qualitative findings section. Covers all six phases, the four upfront analytic decisions, the 15-point quality checklist, and the five common pitfalls. Produces a Word document write-up and an annotated thematic map. Does NOT cover IPA, grounded theory, discourse analysis, conversation analysis, or narrative analysis — use a different method for those.
development
Guide users through writing a systematic literature review (SLR) following the PRISMA 2020 framework. Use this skill whenever the user mentions 'systematic review', 'systematic literature review', 'SLR', 'PRISMA', 'PRISMA 2020', 'PRISMA flow diagram', 'PRISMA checklist', or asks for help writing, structuring, or auditing a literature review that follows reporting guidelines. Also trigger when the user asks about inclusion/exclusion criteria for a review, search strategies for databases like Scopus/WoS/PubMed, study selection processes, risk of bias assessment, or narrative synthesis for a review paper. This skill covers the full PRISMA 2020 checklist (27 items), produces a Word document manuscript in strict journal article format, generates an annotated PRISMA flow diagram, and enforces APA 7th Edition referencing throughout. It does NOT cover meta-analysis or statistical pooling. By Chuah Kee Man.
testing
Performs placebo-in-time sensitivity analysis with hierarchical null model and optional Bayesian assurance. Use when checking model robustness, verifying lack of pre-intervention effects, or estimating study power.
data-ai
Fit, summarize, plot, and interpret a chosen CausalPy experiment. Use after the causal method has been selected, including when configuring PyMC/sklearn models and scale-aware custom priors.