agentleFS
Felpix-StudiosFelpix-Studios/social-science-research/skills/data-analysis/SKILL.md

data-analysis

Skill8 starsChanged 4 months agoMITView on GitHub

End-to-end data analysis in R or Python — exploration through regression to publication-ready tables and figures. Use when running empirical analysis, writing analysis code, or producing output from data.

76 other projects use a version of this, 3 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use algorithm-design, deepl and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • lingzhi227Skill

    algorithm-design

    Design algorithms with LaTeX pseudocode and UML diagrams. Generate algorithmic environments, Mermaid class/sequence diagrams, and ensure consistency between pseudocode and implementation. Use when formalizing methods for a paper.

    Also in 5 projects that use this

  • zephyrwang6Skill

    deepl

    Übersetzt Texte, Dokumente und XLIFF-Dateien via DeepL API. Verwende für Übersetzungen mit /deepl translate, /deepl file oder /deepl xliff.

    Also in 4 projects that use this

  • zephyrwang6Skill

    imagemagick-conversion

    Convert and manipulate images with ImageMagick. Covers format conversion, resizing, batch processing, quality adjustment, and image transformations. Use when user mentions image conversion, resizing images, ImageMagick, magick command, batch image processing, or thumbnail generation.

    Also in 4 projects that use this

  • lingzhi227Skill

    latex-formatting

    Handle LaTeX formatting, templates, and styling for academic papers. Set up conference templates (ICML, ICLR, NeurIPS, AAAI, ACL), fix formatting issues, manage packages, and ensure venue-specific compliance. Use when the user needs to set up a paper template, fix LaTeX formatting, or prepare for submission.

    Also in 4 projects that use this

  • stophobiaSkill

    surprise-me

    Create a delightful, unexpected "wow" experience for the user by dynamically discovering and creatively combining other enabled skills. Triggers when the user says "surprise me" or any request expressing a desire for an unexpected creative showcase. Also triggers when the user is bored, wants inspiration, or asks for "something interesting".

    Also in 4 projects that use this

  • HK-hubSkill

    consulting-analysis

    Use this skill when the user requests to generate, create, or write professional research reports including but not limited to market analysis, consumer insights, brand analysis, financial analysis, industry research, competitive intelligence, investment due diligence, or any consulting-grade analytical report. This skill operates in two phases — (1) generating a structured analysis framework with chapter skeleton, data query requirements, and analysis logic, and (2) after data collection by other skills, producing the final consulting-grade report with structured narratives, embedded charts, and strategic insights.

    Also in 5 projects that use this

  • +3 more from zephyrwang6
  • +2 more from lingzhi227

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. 0 are common, 7 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 53 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run an end-to-end data analysis in R or Python: load, explore, analyze, and produce publication-ready output.

    line 11
  2. Very specific:

    Before making analysis changes, read ${CLAUDE_PLUGIN_ROOT}/rules/orchestrator-protocol.md, …

    line 15
  3. Very specific:

    If $ARGUMENTS points to a PDF, HTML page, government portal URL, or other non-tabular source, Read …

    line 25
  4. Very specific:

    Follow ${CLAUDE_PLUGIN_ROOT}/rules/r-code-conventions.md for all standards

    line 31
  5. Very specific:

    Use saveRDS() for every computed object

    line 34
  6. Very specific:

    Run r-reviewer on the generated script before presenting results

    line 35
  7. Very specific:

    Create R script with proper header (title, author, purpose, inputs, outputs) — Read …

    line 38
  8. Very specific:

    Create output directories: dir.create("output/analysis", recursive = TRUE, showWarnings = FALSE)

    line 41
  9. Very specific:

    Use joblib.dump() for model objects.

    line 81
  10. Very specific:

    Use pathlib.Path for all file paths — never hardcode absolute paths

    line 82
  11. Very specific:

    Create Python script with header — Read ${CLAUDE_PLUGIN_ROOT}/skills/data-analysis/assets/analysis-script.py and adapt

    line 86
  12. Distinctive:

    Import all packages at the top of the file

    line 87
  13. Distinctive:

    Document SE choice with a comment

    line 103
  14. Distinctive:

    Reproduce, don't guess: If the user specifies a regression, run exactly that.

    line 133
  15. Distinctive:

    Check for issues: Look for multicollinearity, outliers, perfect prediction, missing data.

    line 135
  16. Distinctive:

    Use relative paths: All paths relative to repository root.

    line 136
  17. Distinctive:

    No hardcoded values: Use variables for sample restrictions, date ranges, thresholds.

    line 137

“Common” is measured: kept by at least 6 in 10 of the 53 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Data Analysis Workflow

Run an end-to-end data analysis in R or Python: load, explore, analyze, and produce publication-ready output.

Input: $ARGUMENTS — a dataset path (e.g., data/county_panel.csv) or a description of the analysis goal (e.g., "regress wages on education with state fixed effects using CPS data").

Before making analysis changes, read ${CLAUDE_PLUGIN_ROOT}/rules/orchestrator-protocol.md, ${CLAUDE_PLUGIN_ROOT}/rules/analysis-verification.md, and ${CLAUDE_PLUGIN_ROOT}/rules/quality-gates.md; for replication or extension requests, also read ${CLAUDE_PLUGIN_ROOT}/rules/replication-protocol.md.

Phase 0: Choose Language

R is the default. If ambiguous, use AskUserQuestion to pick R (Recommended — tidyverse/fixest/ggplot2, full plugin support including r-reviewer) or Python (pandas/statsmodels). Pick R when the project has existing .R code; Python when it has existing .py or .ipynb.

Phase 0.5: Ingest Non-Tabular Inputs

If $ARGUMENTS points to a PDF, HTML page, government portal URL, or other non-tabular source, Read ${CLAUDE_PLUGIN_ROOT}/skills/data-analysis/references/ingest-recipes.md and follow it before Phase 1. Skip this phase for flat files (.csv, .parquet, .dta, .rds, .feather, .json).

R Track

Constraints

  • Follow ${CLAUDE_PLUGIN_ROOT}/rules/r-code-conventions.md for all standards
  • Save scripts to scripts/R/ with descriptive names
  • Save all outputs (figures, tables, RDS) to output/
  • Use saveRDS() for every computed object
  • Run r-reviewer on the generated script before presenting results

Phase 1: Setup and Data Loading

  1. Create R script with proper header (title, author, purpose, inputs, outputs) — Read ${CLAUDE_PLUGIN_ROOT}/skills/data-analysis/assets/analysis-script.R and adapt
  2. Load required packages at top (library(), never require())
  3. Set seed once at top: set.seed(42)
  4. Create output directories: dir.create("output/analysis", recursive = TRUE, showWarnings = FALSE)
  5. Load and inspect the dataset

Phase 2: Exploratory Data Analysis

  • summary(), missingness rates, variable types
  • Histograms for key continuous variables
  • Scatter plots, correlation matrices
  • Panel trends, pre-treatment comparisons if applicable
  • Save all diagnostic figures to output/diagnostics/

Phase 3: Main Analysis

  • Panel data: use fixest; cross-section: use lm/glm
  • Cluster SEs at the appropriate level (document why)
  • Multiple specifications: start simple, progressively add controls
  • Report standardized effects alongside raw coefficients

Phase 3.5: Identification Diagnostics

Mandatory for any analysis with a causal interpretation. Detect the design from the analysis goal and the model call (feols(... | id + t) with treatment-timing → DiD; rdrobust → RDD; feols(y ~ ... | 0 | endog ~ instr) → IV; tidysynth → synthetic control; random assignment → RCT; MatchIt/cobalt → matching). Read ${CLAUDE_PLUGIN_ROOT}/skills/data-analysis/references/identification-r.md and run the block matching the detected design. Ask once with AskUserQuestion only if the design is genuinely ambiguous. Skip this phase for purely descriptive analyses.

Phase 4: Publication-Ready Output

Tables: modelsummary (preferred) or stargazer — export .tex and .html Figures: ggplot2 with project theme; explicit ggsave(width = X, height = Y); save as .pdf and .png; add bg = "transparent" only if output is for Beamer slides

Phase 5: Save and Review

  1. saveRDS() for all key objects
  2. Dispatch the r-reviewer agent via Task:
    Task prompt: "Review the R script at scripts/R/[script_name].R against
    ${CLAUDE_PLUGIN_ROOT}/rules/r-code-conventions.md. Save your report to
    quality_reports/[script_name]_r_review.md. Follow the r-reviewer agent instructions."
  3. Address Critical and High issues before presenting results

Python Track

Constraints

  • Save scripts to scripts/python/ with descriptive names
  • Save all outputs (figures, tables, pickles) to output/
  • Use joblib.dump() for model objects; .to_parquet() for DataFrames
  • Use pathlib.Path for all file paths — never hardcode absolute paths
  • Set random seeds at the top of the script

Phase 1: Setup and Data Loading

  1. Create Python script with header — Read ${CLAUDE_PLUGIN_ROOT}/skills/data-analysis/assets/analysis-script.py and adapt
  2. Import all packages at the top of the file
  3. Set seeds: np.random.seed(42) and random.seed(42)
  4. Create output directories: Path("output/analysis").mkdir(parents=True, exist_ok=True)
  5. Load and inspect the dataset with pandas

Phase 2: Exploratory Data Analysis

  • df.describe(), df.isnull().sum(), df.dtypes
  • Histograms and distributions with matplotlib/seaborn
  • Scatter plots and correlation matrices
  • Save diagnostic figures to output/diagnostics/
  • Save summary stats: df.describe().to_csv("output/diagnostics/summary_stats.csv")

Phase 3: Main Analysis

  • Cross-section OLS: smf.ols("y ~ x", data=df).fit(cov_type="HC3")
  • Panel data: PanelOLS from linearmodels with cluster-robust SEs
  • Multiple specifications: build incrementally
  • Document SE choice with a comment

Phase 3.5: Identification Diagnostics

Mandatory for any analysis with a causal interpretation. Detect the design from the analysis goal and the model call (PanelOLS(..., entity_effects=True, time_effects=True) with treatment timing → DiD; rdrobust port → RDD; IV2SLS → IV; pysyncon → synthetic control; experiment → RCT; causalinference → matching). Read ${CLAUDE_PLUGIN_ROOT}/skills/data-analysis/references/identification-py.md and run the block matching the detected design. Skip this phase for purely descriptive analyses.

Phase 4: Publication-Ready Output

Tables: Format with pandas and export via .to_latex() or stargazer (Python port) Figures: matplotlib/seaborn; explicit fig.savefig(path, dpi=300, bbox_inches="tight"); save as .pdf and .png

Phase 5: Save and Review

  1. joblib.dump(model, "output/model.pkl") for fitted models
  2. df_results.to_parquet("output/results.parquet") for DataFrames
  3. Review manually against the checklist below before presenting

Python Quality Checklist

[ ] All imports at top
[ ] Random seeds set (numpy + stdlib)
[ ] All paths use pathlib.Path — no hardcoded strings
[ ] Output directories created with mkdir(exist_ok=True)
[ ] Figures saved with explicit dpi=300, bbox_inches="tight"
[ ] Model objects saved with joblib.dump()
[ ] DataFrames saved as parquet
[ ] Comments explain WHY, not WHAT

Shared Principles

  • Reproduce, don't guess. If the user specifies a regression, run exactly that.
  • Show your work. Compute summary statistics before jumping to regression.
  • Check for issues. Look for multicollinearity, outliers, perfect prediction, missing data.
  • Use relative paths. All paths relative to repository root.
  • No hardcoded values. Use variables for sample restrictions, date ranges, thresholds.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.