Data Analysis
End-to-end R data analysis pipeline, exploration → cleaning → regression →...
Install
npx skills add pedrohcgs/claude-code-my-workflow --skill data-analysis -g -a claude-code -y- Repository
- pedrohcgs/claude-code-my-workflow1.7k
- Category
- Data and ML
- Updated
- 1mo ago
- License
- MIT
- Context cost
- Mediumabout 2,111 tokens
- Runs scripts
- No, instructions only
What it does
End-to-end R data analysis pipeline, exploration → cleaning → regression → publication-ready tables and figures. Use when user says "analyze this dataset", "run a regression on X", "explore this CSV", "full analysis workflow", "get me summary stats and a regression", or points at a `.csv`/`.rds`/`.dta` and asks for empirical results. Produces numbered R scripts in `scripts/R/` and outputs to `output/`.
Data Analysis Workflow
Run an end-to-end data analysis in R: 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").
Constraints
- Follow R code conventions in
.claude/rules/r-code-conventions.md - Save all scripts to
scripts/R/with descriptive names - Save all outputs (figures, tables, RDS) to
output/ - Use
saveRDS()for every computed object, Quarto slides may need them - Use project theme for all figures (check for custom theme in
.claude/rules/) - Run r-reviewer on the generated script before presenting results
Workflow Phases
Phase 0: Pre-Flight Report
Before writing any analysis code, produce a Pre-Flight Report showing you read the inputs. This prevents the common failure mode where the agent hallucinates variable names or skips project conventions.
Output block (in your response to the user, before Phase 1):
## Pre-Flight Report
**Dataset:** [path]
- Variables found: [list from head()/names()]
- Rows: [count]
- Key types: [e.g., "outcome=numeric, treatment=binary, state=factor"]
- Missing-data summary: [% missing per key var]
**Project conventions read:**
- `.claude/rules/r-code-conventions.md`, [one-line summary of most relevant rule]
- `.claude/rules/content-invariants.md`, [INV-9, INV-10, INV-11, INV-12 applicable]
**Task interpretation:** [one sentence restating what the user asked for]
**Plan:** [3-5 bullet outline of the R script structure]
If any input cannot be read (missing file, unreadable format), stop and ask the user before proceeding.
