Agent skill

Power Analysis

by pedrohcgs in pedrohcgs/claude-code-my-workflow

Compute statistical power, required sample size, and minimum detectable effect (MDE) for a study design, then write a registry-ready power section.

MITAuto-check: notesResearch & Science

Install Power Analysis

skills CLI
$ npx skills add pedrohcgs/claude-code-my-workflow --skill power-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pedrohcgs/claude-code-my-workflow power-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pedrohcgs/claude-code-my-workflow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/power-analysis .claude/skills/power-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
power-analysis
GitHub stars
1.7k
Token cost
~2.7k tokens
SKILL.md length
1,193 words
Files
1
Skills in repo
59
Repo updated
First seen
Licence
MIT

At a glance

Compute statistical power, required sample size, and minimum detectable effect (MDE) for a study design, then write a registry-ready power section.

  • Works in 5 steps: Elicit the design → Analytical power (standard designs) → Simulation-based power (non-standard… → …
  • User says power analysis
  • SKILL.md covers When to use, Inputs, Workflow and Exit behavior, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Power Analysis is an agent skill from pedrohcgs/claude-code-my-workflow. Compute statistical power, required sample size, and minimum detectable effect (MDE) for a study design, then write a registry-ready power section. Handles two-arm RCTs (with clustering / ICC and unequal allocation), multiple-arm corrections, and a simulation-based power option for non-standard designs (DiD/event-study, IV, panel). Use when user says "power analysis", "power calculation", "MDE", "minimum detectable effect", "how big a sample do I need", "is my study powered", "power for an RCT", or when…

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Research & Science, covering Experimental design. The repository describes itself as: A ready-to-fork Claude Code template for academics using LaTeX/Beamer + R. Multi-agent review, quality gates, adversarial QA, and replication protocols. The licence is MIT.

When your agent uses it

  • User says power analysis
  • Power calculation
  • Minimum detectable effect
  • How big a sample do I need

Example prompts

  • “power analysis”
  • “power calculation”
  • “minimum detectable effect”
  • “/power-analysis”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Agent, Task

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Elicit the design
  2. Analytical power (standard designs)
  3. Simulation-based power (non-standard designs)
  4. Write the power section
  5. Handoff

What it can do on your machine

Read from SKILL.md and the folder at commit ae72617. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Agent
    • Task

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Power Analysis loads about 2.7k tokens when it runs. Until then it costs about 169 tokens; SKILL.md has 1,193 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~169
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Agent, Task

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pedrohcgs/claude-code-my-workflow at commit ae72617, republished under its MIT licence (© pedrohcgs). 1,193 words, ~2,728 tokens.

Download SKILL.mdSave it as .claude/skills/power-analysis/SKILL.md (or your agent's skills folder).
name
power-analysis
description
Compute statistical power, required sample size, and minimum detectable effect (MDE) for a study design, then write a registry-ready power section. Handles two-arm RCTs (with clustering / ICC and unequal allocation), multiple-arm corrections, and a simulation-based power option for non-standard designs (DiD/event-study, IV, panel). Use when user says "power analysis", "power calculation", "MDE", "minimum detectable effect", "how big a sample do I need", "is my study powered", "power for an RCT", or when /preregister needs a power section for an experiment. Produces a power/MDE table, power curves, and a methods paragraph to paste into a preregistration.
allowed-tools
Read, Write, Edit, Bash, Agent, Task
argument-hint
[--mode mde|n|power] [--design rct|cluster|multiarm|sim] [--input <spec-or-description>]
disable-model-invocation
true
effort
high
metadata.author
Claude Code Academic Workflow
metadata.version
1.0.0

/power-analysis — Power / MDE for study design

Compute the three interlocking quantities of an ex-ante design calculation — power, required N, and minimum detectable effect (MDE) — and emit a power section the user can paste straight into a preregistration. Analytical for standard designs; simulation-based (reusing the /simulation-study harness pattern) for non-standard ones.

Core principle: a power calculation is a design-time commitment made before the data exist. Fix any two of {effect size, N, power} and solve for the third; never back out a "power" number from a realised estimate (that is post-hoc power, and it is uninformative — see "What this skill does NOT do").

When to use

  • Before launching an RCT / field / survey experiment — to choose N (or clusters) for a target MDE at 80–90% power.
  • Invoked by /preregister for RCTs — the AEA RCT Registry and most IRBs require a power/MDE justification; /preregister's aea-rct style follows this skill's phases to fill that section (this skill is user-invoked only, so it is read and followed, not called).
  • During R&R — when a referee asks "was this study adequately powered to detect the effect you claim?"
  • Designing a Monte Carlo — to set R and sample sizes before handing off to /simulation-study.

Inputs

$ARGUMENTS may carry flags; missing pieces are elicited in Phase 0.

  • --mode mde|n|power — solve for MDE given N+power, N given MDE+power, or power given N+MDE. Default mde.
  • --design rct|cluster|multiarm|sim — two-arm RCT, clustered RCT (ICC), multiple arms, or simulation-based. Default inferred from the elicited design.
  • --input <path> — a spec from /interview-me (under quality_reports/specs/) to pull the RQ, outcome, and design from.

Workflow

Phase 0 — Elicit the design

Gather the design parameters; ask once for anything missing rather than fabricating. Required:

  • Estimand & test: primary outcome, one- vs two-sided test, alpha (default 0.05), and whether the target is a difference in means, a proportion, or a regression coefficient.
  • Two of {effect size, N, power}: the effect as a raw difference and in standardized units (Cohen's d = effect / SD) — record both; power default 0.80.
  • Baseline mean and SD (or baseline proportion for a binary outcome) — needed to translate raw ↔ standardized effects.
  • Allocation: treated:control ratio (default 1:1; unequal allocation costs power — note it).
  • Clustering: if randomization is at a group level (village, school, clinic), the ICC (ρ), the average cluster size (m), and number of clusters. Compute the design effect DEFF = 1 + (m − 1)·ρ and the effective N.
  • Multiplicity: number of arms / primary outcomes; the correction (Bonferroni, Holm, or none) and whether power is per-comparison or familywise.

Echo a Pre-Flight Report (design, the two fixed quantities, the one being solved for, alpha, power, allocation, ICC/clusters, multiplicity) before computing. If the estimand or the SD source is ambiguous, stop and ask.

Phase 1 — Analytical power (standard designs)

For two-arm RCTs, clustered RCTs, and multi-arm comparisons, compute analytically. Prefer R pwr / WebPower (or a closed-form power.t.test / power.prop.test); for clustered designs inflate variance by DEFF, or use pwr on the effective N. Stata users: power twomeans / power twoproportions / power, cluster; Python: statsmodels.stats.power. Emit a short script to scripts/R/power_<slug>.R (or .do / .py) so the calc is reproducible, not a one-off console number.

  • MDE mode: MDE = (z_{1−α/2} + z_{1−β}) · SE(effect), where SE is built from the SD, N, allocation, and DEFF. Report MDE in raw and standardized units.
  • N mode: invert the above for total N (and #clusters when clustered) given the target MDE.
  • Power mode: given N and a hypothesized effect, return achieved power.
  • Multi-arm: divide alpha by the number of comparisons in the family m (Bonferroni alpha/m): m = K−1 for all-vs-control, m = K(K−1)/2 for all-pairwise. Report per-comparison and familywise power.

Sweep a grid (N or #clusters × effect size) so Phase 3 can draw a power curve and an MDE-vs-N curve.

Phase 2 — Simulation-based power (non-standard designs)

When the design is not a clean two-arm comparison — DiD / staggered event-study, IV / 2SLS, panel with serial correlation, a non-normal or censored outcome, or any estimator with no closed-form SE — switch to simulation. Reuse the /simulation-study harness exactly (see simulation-study and .claude/rules/simulation-conventions.md):

  1. Seeded, parameterized DGP that embeds the hypothesized effect (and the null DGP for size). set.seed(YYYYMMDD) once; L'Ecuyer streams if parallel.
  2. Estimator = the one you will actually use on the real data (e.g. fixest::feols two-way FE, did::att_gt, AER::ivreg), returning est, se, ci, p, reject.
  3. Power = share of reps rejecting H0 at alpha; size = rejection rate under the null DGP (verify it is near nominal before trusting power). Report each with its Monte Carlo SE = sqrt(p(1−p)/R).
  4. Sweep N (or #clusters / #periods) to trace the power curve; save the raw per-rep tibble via saveRDS() to output/.

A simulated power number without an MCSE, or without a verified size check, is not yet an answer.

Show full SKILL.md (422 more words)Show less
Phase 3 — Write the power section

Produce the deliverables under quality_reports/power/:

  • power_<slug>.md — a table and a methods paragraph (below).
  • power_curve_<slug>.png — power vs N (and/or MDE vs N), with reference lines at the target power and the design's planned N.
  • The reproducible script under scripts/R/ (or .do / .py).
markdown
# Power Analysis: <study title>
**Date:** YYYY-MM-DD · **Design:** <rct|cluster|multiarm|sim> · **Method:** <analytical|simulation, R/Stata/Python>

| Quantity | Value |
|---|---|
| alpha (sided) | 0.05 (two-sided) |
| Target power | 0.80 |
| Baseline mean (SD) | <m0> (<sd>) |
| Allocation (T:C) | 1:1 |
| ICC / cluster size / #clusters | <ρ> / <m> / <J>  (DEFF = <…>) |
| Total N (analysis sample) | <N> |
| **MDE (raw / standardized)** | **<Δ> / <d>** |
| Achieved power at planned N | <…>  (± MCSE <…> if simulated) |

## Methods paragraph (paste into preregistration)
> Assuming a baseline outcome mean of <m0> (SD <sd>), 1:1 allocation, and a two-sided
> test at α = 0.05, a total sample of <N> [<J> clusters of <m>, ICC = <ρ>] yields 80%
> power to detect a minimum effect of <Δ> (<d> SD). [Simulation: under the hypothesized
> DGP, <P>% of <R> replications rejected H0 (MCSE <…>); size under the null was <…>.]
Phase 4 — Handoff

If invoked by /preregister, return the methods paragraph + MDE row for the preregistration's power section. If standalone, print the save paths and remind the user the MDE is a design commitment to record before data collection.

Exit behavior

  • Computation succeeds: exit 0; print the MDE / N / power result, the save paths, and (for simulation mode) the size-check value next to power.
  • Under-identified design (only one of {effect, N, power} supplied) or ambiguous SD source: halt in Phase 0 with a single specific question — never guess the SD or the ICC.
  • Simulation size check fails (empirical size far from nominal under the null DGP): report power as UNRELIABLE and surface the size value; the estimator/DGP must be fixed before the power number is trustworthy.

Flags

  • --mode <mde|n|power> — What to solve for: minimum detectable effect, required N, or achieved power.
  • --design <rct|cluster|multiarm|sim> — Design family — two-arm RCT, clustered/ICC, multi-arm with corrections, or simulation-based for non-standard designs.
  • --input <spec> — Path to an /interview-me spec or preregistration draft to read design parameters from.

Cross-references

What this skill does NOT do

  • Post-hoc / observed power. It refuses to compute "the power we had to detect our estimate" from a realised result — that is a deterministic function of the p-value and tells you nothing. Power is ex-ante only.
  • Pick your effect size for you. The MDE is your design commitment; the skill computes consequences of an assumed effect (from theory, a pilot, or a meta-analysis), it does not invent a plausible one.
  • Submit to a registry. Like /preregister, it writes a document; the user uploads it.
  • Replace /simulation-study. Phase 2 borrows the harness for a single power question; a full bias/RMSE/coverage study is /simulation-study's job.

© pedrohcgs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/power-analysis of pedrohcgs/claude-code-my-workflow.

Open the folder on GitHubat commit ae72617

Compare with similar skills

Power Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Power Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Power Analysis this skillpedrohcgs/claude-code-my-workflow1.7k—~2.7kAutomated safety check: NotesMIT
Scientific Critical Thinkingweapp-tailwindcss/weapp-tailwindcss1.9k22 repos~5.9kAutomated safety check: NotesMIT
Benchmark Paper TemplateHKUSTDial/Supervisor-Skills8.7k—~2.8kAutomated safety check: PassCC-BY-4.0
Claim-Driven Experiment PlannerzjYao36/Auto-Research-Refine1286 repos~2.3kAutomated safety check: NotesNone
Research Refine PipelinezjYao36/Auto-Research-Refine1285 repos~1.4kAutomated safety check: NotesNone
Metabolic Study Planneraiming-lab/AutoResearchClaw15k—~1.9kAutomated safety check: PassMIT

Similar skills

  • Scientific Critical Thinking

    weapp-tailwindcss/weapp-tailwindcss

    Evaluate research rigor. An agent skill from weapp-tailwindcss/weapp-tailwindcss.

    1.9k GitHub starsUsed in 22 repos~5.9k tokens
    Research & ScienceAuto-check: notes
  • Benchmark Paper Template

    HKUSTDial/Supervisor-Skills

    Structures benchmark and evaluation papers around five pillars, with a completeness audit, an Introduction logic chain, a section skeleton and a pre-submission checklist.

    8.7k GitHub stars~2.8k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Claim-Driven Experiment Planner

    zjYao36/Auto-Research-Refine

    Turns a refined research proposal into a claim-to-evidence-to-run-order roadmap instead of a sprawling benchmark wishlist.

    128 GitHub starsUsed in 6 repos~2.3k tokens
    Research & ScienceAuto-check: notes
  • Research Refine Pipeline

    zjYao36/Auto-Research-Refine

    Chains research-refine and experiment-plan to turn a vague research direction into a focused proposal and a claim-driven experiment roadmap.

    128 GitHub starsUsed in 5 repos~1.4k tokens
    Research & ScienceAuto-check: notes
  • Metabolic Study Planner

    aiming-lab/AutoResearchClaw

    Turns a broad metabolic modelling topic into a concrete, paper-shaped plan with organism, model, perturbations, metrics and figures before any FBA code is written.

    15k GitHub stars~1.9k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Analytical Method Validation Planner

    K-Dense-AI/scientific-agent-skills

    Plans, runs, and documents analytical method validation, verification, or transfer studies under ICH Q2(R2)/Q14, USP, ICH M10, CLSI EP, or ISO/IEC 17025.

    48k GitHub starsUsed in 1 repo~4.9k tokens
    Research & ScienceAuto-check: notes

More from pedrohcgs/claude-code-my-workflow

All 59 skills in this repo
  • Devils Advocate

    pedrohcgs/claude-code-my-workflow

    Adversarial 5-7 question challenge to a deck's pedagogical choices — ordering, prerequisites, cognitive load, motivation.

    1.7k GitHub starsUsed in 2 repos~641 tokens
    Auto-check passed
  • Vaccinate

    pedrohcgs/claude-code-my-workflow

    Qualify a check before it is allowed to clear anything — prove it can detect the failure it is meant to catch.

    1.7k GitHub stars~2.1k tokensUpdated 11 days ago
    Auto-check: notes
  • Compile Latex

    pedrohcgs/claude-code-my-workflow

    Compile a Beamer LaTeX slide deck with XeLaTeX (3 passes + bibtex).

    1.7k GitHub starsUsed in 1 repo~492 tokens
    Auto-check: notes
  • Context Status

    pedrohcgs/claude-code-my-workflow

    Show current context status and session health. An agent skill from pedrohcgs/claude-code-my-workflow.

    1.7k GitHub starsUsed in 1 repo~613 tokens
    Auto-check: notes
  • Capture Environment

    pedrohcgs/claude-code-my-workflow

    Snapshot the computational environment for a replication package — detects the analysis stack (R / Stata / Python) and emits the right lockfiles (renv.lock + sessionInfo.txt, requirements.txt /…

    1.7k GitHub stars~2.8k tokensUpdated 11 days ago
    Auto-check: notes
  • Checkpoint

    pedrohcgs/claude-code-my-workflow

    Save a structured state snapshot before stopping or handing off.

    1.7k GitHub stars~2.8k tokensUpdated 11 days ago
    Auto-check: notes

Questions about Power Analysis

What does Power Analysis do?

Compute statistical power, required sample size, and minimum detectable effect (MDE) for a study design, then write a registry-ready power section. Power Analysis is an agent skill from pedrohcgs/claude-code-my-workflow. Compute statistical power, required sample size, and minimum detectable effect (MDE) for a study design, then write a registry-ready power section.

When should I use Power Analysis?

Power Analysis fits situations like: user says power analysis; power calculation; minimum detectable effect; how big a sample do I need.

How do I install Power Analysis in Claude Code?

Run `npx skills add pedrohcgs/claude-code-my-workflow --skill power-analysis -a claude-code`. Or copy the skill folder (.claude/skills/power-analysis in pedrohcgs/claude-code-my-workflow) into .claude/skills/power-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Power Analysis in Codex?

Run `npx skills add pedrohcgs/claude-code-my-workflow --skill power-analysis -a codex`. Or copy the skill folder (.claude/skills/power-analysis in pedrohcgs/claude-code-my-workflow) into .agents/skills/power-analysis in your project. Codex loads it when a task matches its description.

Can I use Power Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pedrohcgs/claude-code-my-workflow --skill power-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/power-analysis, .gemini/skills/power-analysis, .github/skills/power-analysis and .opencode/skills/power-analysis in your project.

What does Power Analysis need to run?

SKILL.md names no scripts, command-line tools or credentials: Power Analysis is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Agent, Task.

Does Power Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Power Analysis safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Power Analysis use?

Power Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Power Analysis use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Power Analysis?

Skills that share tags, products or a category with Power Analysis: Scientific Critical Thinking (weapp-tailwindcss/weapp-tailwindcss, 1.9k stars), Benchmark Paper Template (HKUSTDial/Supervisor-Skills, 8.7k stars), Claim-Driven Experiment Planner (zjYao36/Auto-Research-Refine, 128 stars) and Research Refine Pipeline (zjYao36/Auto-Research-Refine, 128 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Power Analysis?

pedrohcgs (a GitHub user) maintains it in pedrohcgs/claude-code-my-workflow, which has 1,653 GitHub stars. The repository holds 59 skills in this directory. The repository was last updated on September 27, 2026.

Source: pedrohcgs/claude-code-my-workflow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.