skills/data-analysis/SKILL.md
Decision-first data analysis with statistical rigor gates.
npx skillsauth add notque/claude-code-toolkit data-analysisInstall 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.
Every analysis begins with the decision being supported, works backward to the evidence required, and only then touches the data. This prevents the common failure mode where analysis produces impressive summaries that answer the wrong question. Analysis without a decision is just arithmetic.
| Signal | Load These Files | Why |
|---|---|---|
| implementation patterns | preferred-patterns.md | Loads detailed guidance from preferred-patterns.md. |
| example-driven tasks | compute-examples.md | Loads detailed guidance from compute-examples.md. |
| errors, error handling | error-handling.md | Loads detailed guidance from error-handling.md. |
| tasks related to this reference | output-templates.md | Loads detailed guidance from output-templates.md. |
| tasks related to this reference | rigor-gates.md | Loads detailed guidance from rigor-gates.md. |
| example-driven tasks | worked-examples.md | Loads detailed guidance from worked-examples.md. |
Goal: Establish what decision this analysis supports and what evidence would change it.
Starting with data before establishing the decision context is the single most common analytical failure. The analyst finds interesting patterns and presents them, but the decision-maker cannot act because the patterns do not map to their options. Complete framing even when the user says they "just want numbers" -- numbers without decision context are not actionable.
Step 1: Identify the decision
If the user does not articulate a decision, ask: "What will you do differently based on this analysis?" If the answer is "nothing" or "I just want to see the data," switch to Exploratory Mode and label all output as exploratory. Exploratory Mode still applies rigor gates but makes no causal claims.
Step 2: Define evidence requirements
Step 3: Save the frame artifact
Save analysis-frame.md using the template from references/output-templates.md (Phase Artifact Templates § analysis-frame.md).
GATE: Decision identified, options enumerated, evidence requirements written to file. If the user cannot articulate a decision, explicitly switch to Exploratory Mode and document this in the frame. Proceed only when gate passes.
Goal: Define exactly what will be measured, how, and over what population. Write definitions to file before any data is loaded.
Defining metrics after seeing data enables (consciously or not) choosing definitions that produce favorable results. Locking definitions first makes the analysis auditable. Verify every metric definition is exact -- a slight change in numerator or denominator can flip a conclusion.
Step 1: Define metrics
For each metric:
Step 2: Define comparison groups (if applicable)
For each comparison:
Step 3: Define success criteria
Step 4: Save definitions artifact
Save metric-definitions.md using the template from references/output-templates.md (Phase Artifact Templates § metric-definitions.md).
GATE: All metrics defined with formulas and populations. Definitions saved to file. If this is a comparison analysis, fairness checks documented. Proceed only when gate passes.
Immutability rule: Once Phase 3 begins, these definitions are locked. If the data reveals that a definition is unworkable, return to Phase 2, update the definition, and document the change and its reason in the artifact. Document every adjustment -- silent definition changes are p-hacking by another name.
Goal: Load the data, profile its quality, and determine whether it is adequate for the planned analysis. Keep interpretation out of this phase.
Combining loading and interpretation causes confirmation bias. Extracting first forces you to confront data quality issues (missing values, unexpected distributions, date gaps) before they silently distort your conclusions.
Step 1: Detect available tools
See references/compute-examples.md for tool detection code. If pandas is unavailable, fall back to csv.DictReader + statistics module.
Step 2: Load and inspect data
Profile the dataset:
Step 3: Assess data quality
Apply the Sample Adequacy gate (see references/rigor-gates.md Gate 1). Check actual numbers against these minimums:
| Check | Minimum | Action if Failed | |-------|---------|------------------| | Row count vs. population | Report sample fraction | State "N of M" and warn if <5% coverage | | Time window completeness | No gaps >10% of window | Identify gaps, adjust window or note limitation | | Segment minimums | 30+ observations per segment | Merge small segments or exclude with disclosure | | Missing value rate | <20% per critical column | Impute with disclosure or exclude column |
Step 4: Save quality report
Save data-quality-report.md using the template from references/output-templates.md (Phase Artifact Templates § data-quality-report.md).
GATE: Data loaded, quality report saved, all four adequacy checks assessed. If data quality fails, document which analyses are affected and whether remediation is possible. Proceed only when gate passes or failures are documented as limitations.
Goal: Compute metrics per the locked definitions from Phase 2, applying statistical rigor gates at every step. Report confidence intervals, not point estimates -- "3-7% lift" is useful; "5% lift" is misleading because it implies false precision.
Step 1: Compute primary metrics
Calculate each metric defined in Phase 2 using the exact formula specified. See references/compute-examples.md for stdlib and pandas computation patterns including Wilson score confidence intervals.
Step 2: Apply Comparison Fairness gate (if comparing groups)
Before interpreting any group comparison, verify (see references/rigor-gates.md Gate 2):
Step 3: Apply Multiple Testing Correction (if testing multiple hypotheses)
See references/rigor-gates.md Gate 3 and references/compute-examples.md for the correction table. Report all segments tested -- if you test 10 segments, one will likely show significance by chance.
Step 4: Apply Practical Significance gate
See references/rigor-gates.md Gate 4:
Step 5: Save analysis results
Save analysis-results.md using the template from references/output-templates.md (Phase Artifact Templates § analysis-results.md).
GATE: All defined metrics computed. Rigor gates applied and results documented. Violations either remediated or recorded as limitations. Proceed only when gate passes.
Goal: Translate analytical results into a decision-oriented report. Lead with what the data says about the decision, not how you computed it -- the decision-maker reads Phase 5; the auditor reads Phases 2-4. Methodology belongs in the appendix.
Step 1: State the headline finding
One sentence that directly addresses the decision from Phase 1:
Step 2: Present supporting evidence
Summarize the key metrics that support the headline, in order of importance:
Step 3: State limitations explicitly
If confidence intervals are wide, that IS the finding (the data is insufficient to support a decision), not a formatting problem to hide by reporting only the point estimate.
Step 4: Return to the decision
Explicitly map findings back to the decision frame:
Step 5: Save final report
Save analysis-report.md using the template from references/output-templates.md (Phase Artifact Templates § analysis-report.md).
GATE: Report saved with headline finding, limitations, and explicit recommendation tied back to the decision. All artifact files referenced. Analysis complete.
| Signal | Load |
|--------|------|
| Phase 3 or 4 -- computing metrics, applying gates | references/rigor-gates.md |
| Phase 3 or 4 -- Python code for tool detection, CI computation | references/compute-examples.md |
| Any phase -- saving an artifact file | references/output-templates.md |
| Working examples of the full 5-phase flow | references/worked-examples.md |
| Data parse failure, segment size issue, definition revision | references/error-handling.md |
| Anti-pattern recognition (p-hacking, survivorship bias, etc.) | references/preferred-patterns.md |
references/rigor-gates.md - Detailed statistical gate documentation with examplesreferences/output-templates.md - Phase artifact templates and analysis type templates (A/B test, trend, distribution, cohort)references/compute-examples.md - Python computation patterns for extraction and analysisreferences/worked-examples.md - Three end-to-end examples (A/B test, trend, distribution)references/error-handling.md - Error recovery procedures and blocker criteriareferences/preferred-patterns.md - Extended pattern catalog with code examplesdocumentation
Document translation: quick/normal/refined modes with chunked parallel subagents and glossary support.
development
AI image generation: Gemini and Nano Banana backends; single/series/batch workflows with prompt-to-disk.
testing
Unified voice content generation pipeline with mandatory validation and joy-check. 13-phase pipeline: LOAD, GROUND, STATS-CHECKPOINT, GENERATE, HOOK-GATE, VALIDATE, REFINE, VARIETY-GATE, JOY-CHECK, ANTI-AI, CLOSE-GATE, OUTPUT, CLEANUP. Use when writing articles, blog posts, or any content that uses a voice profile. Use for "write article", "blog post", "write in voice", "generate content", "draft article", "write about".
documentation
Critique-and-rewrite loop for voice fidelity validation.