power-analysis
Skill1.6k starsChanged 2 months agoMITView on GitHub
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.
4 other projects use a version of this.
Trending
Quiet since October.thin dataabout the whole repository
Most recently taken up by
- chipweaver/veripowertheir own version, first seen Sep 20, 2026
- bybren-llc/story-systems-templatetheir own version, first seen Aug 4, 2026
- xjtulyc/awesome-rosetta-skillstheir own version, first seen Mar 17, 2026
- jmccardle/ai_scientisttheir own version, first seen Nov 5, 2025
Who's talking about pedrohcgs/claude-code-my-workflow
- @tom-doerr.bsky.social“https://github.com/pedrohcgs/claude-code-my-workflow”Bluesky · Apr 9, 2026 · 1 likes
- sudosubin/agents.nix“agent-skills.github.pedrohcgs.claude-code-my-workflow: init at 2.6.0”GitHub · Oct 3, 2026
- neverbiasu/awesome-research-skills“Dead links in README.md”GitHub · Sep 1, 2026
- neverbiasu/awesome-research-skills“Dead links in README.md”GitHub · Aug 31, 2026
- neverbiasu/awesome-research-skills“Dead links in README.md”GitHub · Aug 24, 2026
The biggest 5 of 11 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 11
Talked about on GitHub and Bluesky (11 times).
On GitHub · 9
- Oct 3, 2026agent-skills.github.pedrohcgs.claude-code-my-workflow: init at 2.6.0 — sudosubin/agents.nix0 reactions
- Sep 1, 2026Dead links in README.md — neverbiasu/awesome-research-skills0 reactions
- Aug 31, 2026Dead links in README.md — neverbiasu/awesome-research-skills0 reactions
- Aug 24, 2026Dead links in README.md — neverbiasu/awesome-research-skills0 reactions
- Jul 28, 2026Add resource: My Claude Code Setup — hesreallyhim/awesome-claude-code0 reactions
4 more on GitHub
- Jul 28, 2026[Resource]: My Claude Code Setup — hesreallyhim/awesome-claude-code0 reactions · 3 comments
- Jul 4, 2026Evolve memorize/ums toward a memory-promotion-gate model — Morrison-Lab/ai-config0 reactions · 1 comment
- Jul 4, 2026Add a checkpoint/compress-session context-continuity pair, distinct from handoff — Morrison-Lab/ai-config0 reactions · 1 comment
- Jul 4, 2026Add a permission-check skill: diagnose why Claude Code is/isn't prompting for permission — Morrison-Lab/ai-config0 reactions · 1 comment
On Bluesky · 2
- Apr 9, 2026https://github.com/pedrohcgs/claude-code-my-workflow — @tom-doerr.bsky.social1 likes and repost
- Apr 22, 2026What about lecture slides and peer review? 🥴 github.com/pedrohcgs/cl... — @jbenmenachem.com0 likes and reposts · 1 reply
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- bybren-llc/story-systems-template★ 68same name
- xjtulyc/awesome-rosetta-skills★ 34same name
- chipweaver/veripower★ 8same name
- jmccardle/ai_scientist★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository61 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adjudicate-reviewSkill
- audit-reproducibilitySkill
- blast-radiusSkill
- capture-environmentSkill
- challengeSkill
- checkpointSkill
- coauthor-briefSkill
- commitSkill
- compile-latexSkill
- compress-sessionSkill
- context-statusSkill
- create-lectureSkill
- credible-claimsSkill
- data-analysisSkill
- data-management-planSkill
- deep-auditSkill
- deploySkill
- devils-advocateSkill
- diagnoseSkill
- differential-auditSkill
- disclosure-checkSkill
- extract-tikzSkill
- grant-proposalSkill
- humanizeSkill
- interview-meSkill
- issuesSkill
- learnSkill
- lit-reviewSkill
- new-diagramSkill
- new-skillSkill
- oracle-reviewSkill
- pedagogy-reviewSkill
- permission-checkSkill
- preregisterSkill
- promote-memorySkill
- proofreadSkill
- qa-quartoSkill
- replication-packageSkill
- research-ideationSkill
- respond-to-evalSkill
- respond-to-refereesSkill
- review-paperSkill
- review-rSkill
- r-package-checkSkill
- scaffold-exercisesSkill
- seven-pass-reviewSkill
- simulation-studySkill
- slide-excellenceSkill
- stata-replicationSkill
- submission-disclosuresSkill
- syllabusSkill
- teach-from-paperSkill
- translate-to-quartoSkill
- triage-inboxSkill
- vaccinateSkill
- validate-bibSkill
- verify-artifactSkill
- verify-claimsSkill
- visual-auditSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Clustering: if randomization is at a group level (village, school, clinic), the ICC (ρ), the average cluster size (m), and number of …
- Distinctive: line 62
When the design is not a clean two-arm comparison — DiD / staggered event-study, IV / 2SLS, panel with serial correlation, a non-normal or …
- Very specific: line 103
If invoked by /preregister, return the methods paragraph + MDE row for the preregistration's power section.
“Common” is measured: kept by at least 6 in 10 of the 3 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.
Files
/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
/preregisterfor RCTs — the AEA RCT Registry and most IRBs require a power/MDE justification;/preregister'saea-rctstyle 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
Rand 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. Defaultmde.--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(underquality_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;
powerdefault 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), whereSEis built from the SD, N, allocation, andDEFF. 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
alphaby the number of comparisons in the familym(Bonferronialpha/m):m = K−1for all-vs-control,m = K(K−1)/2for 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):
- Seeded, parameterized DGP that embeds the hypothesized effect (and the null DGP for size).
set.seed(YYYYMMDD)once; L'Ecuyer streams if parallel. - Estimator = the one you will actually use on the real data (e.g.
fixest::feolstwo-way FE,did::att_gt,AER::ivreg), returningest, se, ci, p, reject. - 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). - Sweep N (or #clusters / #periods) to trace the power curve; save the raw per-rep tibble via
saveRDS()tooutput/.
A simulated power number without an MCSE, or without a verified size check, is not yet an answer.
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).
# 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-mespec or preregistration draft to read design parameters from.
Cross-references
.claude/skills/preregister/SKILL.md— follows this skill to fill the power/MDE section of anaea-rct(and OSF) preregistration; this skill returns the methods paragraph..claude/skills/simulation-study/SKILL.md— the Monte Carlo harness Phase 2 reuses (seeded DGP, estimator grid, % rejecting H0)..claude/rules/simulation-conventions.md— the simulation contract (truth from DGP, MCSE, size-under-the-null) that Phase 2 must honor..claude/skills/data-analysis/SKILL.md·.claude/skills/stata-replication/SKILL.md— where the realised analysis (and its actual estimator/SE) lives; the power calc should use the same estimator..claude/rules/confidential-data.md— when baseline mean/SD/ICC are taken from restricted-access data, disclosure-avoidance limits apply; cite published or pilot moments rather than embedding raw confidential statistics in the (externally-uploaded) preregistration.
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.
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
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.

