[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74G9618Q1BYWTSJWXFCJCQ0":3,"skill-same:01M74G9618Q1BYWTSJWXFCJCQ0":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M74G9618Q1BYWTSJWXFCJCQ0","run-experiment",null,"Plan an A\u002FB (or A\u002FB\u002Fn) experiment — hypothesis, primary + guardrail metrics, MDE + sample size + duration, randomization, stop conditions.","MohammadBafkar\u002Fpolymath","MohammadBafkar","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F34940462?v=4","01M74G540TQFZWK6KVAPKFVGNR","Mohammad Bafkar","01M74G541HG19QP9V5DQCJVKYE",0,"MIT","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-data\u002Fskills\u002Frun-experiment\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: run-experiment\ndescription: Plan an A\u002FB (or A\u002FB\u002Fn) experiment — hypothesis, primary + guardrail metrics, MDE + sample size + duration, randomization, stop conditions.\n---\n\n# run-experiment\n\n> Pin an experiment's design before launching. Output: a doc the on-call analyst can read in 90 seconds and the launch reviewer can approve without re-asking.\n\n**Mode:** analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked `[TBD]` or `[VERIFY]`, never filled in.\n\n## When to use\n\n- A new feature is going behind an experiment (flag at 0\u002F50\u002F0 split).\n- An existing experiment's plan has gaps (no MDE, no guardrail, no stop rule).\n- Pre-`experimentToGA` workflow.\n\n## Inputs\n\n- Hypothesis (required) — testable, one variable, one direction.\n- Primary metric (required) — what success looks like.\n- Guardrail metrics (required) — what *can't* regress.\n- Baseline values + traffic (required) — current metric mean + standard deviation (or the baseline rate for a proportion), daily eligible units. Missing: the sizing line reads `[TBD: …]` and the plan is not launch-ready — never invent a baseline.\n- Acceptable MDE (optional) — the smallest effect worth detecting; absent, ask the owner (unattended: propose one, marked `[VERIFY: MDE]`).\n\n## Procedure\n\n1. **Hypothesis** — write it as: \"Changing X will move primary-metric by ≥ MDE without regressing guardrails by > tolerance.\"\n2. **Primary metric.** One metric. If you need two, you have two experiments. Make it:\n   - Observable in your analytics within experiment duration.\n   - Tied to the North Star (see `metrics-tree`).\n   - Not the same as the variable under test (you'd be measuring tautology).\n3. **Guardrails** — 2-3 max. Latency, error rate, key downstream conversions. State the regression tolerance per guardrail.\n4. **MDE + sample size + duration — run the bundled script, never compute by hand.** Defaults: power 0.8, α = 0.05 two-sided; with more than two variants it applies Bonferroni (α \u002F (k − 1) per comparison vs control):\n\n   ```bash\n   python3 \"${POLYMATH_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}\u002Fskills\u002Frun-experiment\u002Fscripts\u002Fsample-size.py\" \\\n     --metric mean --sigma 2000 --mde 100 --daily-eligible 80000 --allocation 1.0\n   # proportion: --metric proportion --baseline 0.12 --mde 0.01   (or --mde-relative 5)\n   ```\n\n   It uses the exact normal-approximation formulas (Lehr's `16σ²\u002FMDE²` is the α = 0.05 \u002F power 0.8 shortcut of the mean case), converts to days of traffic, rounds the run **up to whole weeks with a 7-day floor** (weekday vs weekend behavior), and marks the plan **UNDERPOWERED** past the 4-week cap — printing the MDE that is detectable in 28 days so the owner can pick a bigger MDE or a larger allocation. Paste its block verbatim.\n   - These formulas assume the metric is a mean or proportion **per randomization unit**. Percentiles (p99 latency) and ratios with a different denominator (per-request metrics under user randomization) need the delta method or a bootstrap — and usually far more samples.\n5. **Do not launch an UNDERPOWERED plan** without the owner explicitly accepting the longer run or the larger MDE in writing (in the plan file).\n6. **Randomization unit.** User-level for product changes; session-level for content \u002F UX experiments where multi-device matters; cluster-level (org \u002F org-pair) for B2B to avoid contamination.\n7. **Allocation.** 50\u002F50 once tooling supports it; 90\u002F10 (ramp) only when risk is high and you accept lower power. Document.\n8. **Stop conditions.**\n   - **Success** — at the planned sample size, the primary effect is statistically significant in the hypothesized direction and guardrails are clean. (The MDE sizes the test; the observed effect doesn't have to exceed it.)\n   - **Failure** — primary regresses with confidence; or guardrail breach.\n   - **Inconclusive** — at duration cap, primary effect is within noise.\n   - **Emergency** — incident, ethics issue, regulatory; immediate halt independent of stats.\n   - **No peeking:** don't stop early because a daily look shows significance — repeated looks inflate false positives. Analyze at the planned sample size, or pre-register a sequential method (group-sequential bounds, always-valid p-values) that allows early stopping.\n   - **Sample-ratio mismatch:** before reading any metric, check the observed split against the plan — `python3 \"${POLYMATH_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}\u002Fskills\u002Frun-experiment\u002Fscripts\u002Fsample-size.py\" --srm 50421,49579 --split 50,50`. p \u003C 0.001 means the assignment is broken and the results are void.\n9. **Pre-registration.** Write the plan before launch and freeze. Post-hoc metric switching (\"oh, let's check this other one\") inflates false-positive rate.\n\n## Output\n\n```text\nrun-experiment: refund-async-writes\n\nHypothesis\n  Changing the refund pipeline to async writes will reduce refund p99\n  latency by ≥ 100ms without regressing refund-completion-rate by > 0.3%.\n\nVariants\n  A (control)   — current sync write path\n  B (treatment) — async write to refund-worker\n\nAllocation\n  50\u002F50, user-level randomization.\n\nPrimary metric\n  mean refund latency per user, ms (lower-is-better). Baseline 1,200 ms;\n  σ = 2,000 ms (heavy tail); MDE 100 ms.\n  (p99 latency is tracked as a guardrail, analyzed by bootstrap.)\n\nGuardrails\n  refund_completion_rate              tolerance: > -0.3 percentage points\n  refund_5xx_rate                     tolerance: \u003C +0.2 percentage points\n\nSample size + duration (sample-size.py, verbatim)\n  Experiment sizing (two-sided, α = 0.05, power = 0.8, 2 variants)\n  Metric:   mean, σ = 2,000, MDE = 100 (absolute)\n  z:        z(1−α\u002F2) = 1.960, z(power) = 0.842\n  n per variant: 6,280   (total 12,560)\n  Traffic:  80,000 eligible\u002Fday × 100% in experiment\n  Duration: 0.16 days of traffic → run 7 days (whole weeks, 7-day floor)\n  Verdict:  OK — within the 28-day cap\n  SRM check: sample-size.py --srm \u003CA>,\u003CB> before reading any metric.\n\nStop conditions (evaluated once, at day 7 — no early stop on significance)\n  Success:     treatment mean lower than control, p \u003C 0.05, guardrails clean.\n  Failure:     significant regression on primary OR any guardrail breach.\n  Inconclusive: not significant at day 7.\n  Emergency:   incident or guardrail breach → halt immediately.\n\nPre-registration\n  Frozen 2026-05-23. Plan file: docs\u002Fexperiments\u002Frefund-async-writes.md\n```\n\n## Quality bar\n\n- One primary, ≤ 3 guardrails — never \"we'll look at everything\".\n- MDE + sample size + duration all named, and every number came from the script.\n- Stop conditions cover success \u002F failure \u002F inconclusive \u002F emergency.\n- Pre-registration with a frozen plan file before launch.\n\n## Anti-patterns to avoid\n\n- Picking the primary metric after the experiment ran. Inflates false positives.\n- Multiple primary metrics. Statistical correction needed; usually skipped, results overstated.\n- Duration \u003C one week. Day-of-week confounds.\n- Stopping the first day the dashboard shows p \u003C 0.05.\n- No guardrails. The single number that \"won\" was bought by a drop somewhere else.\n","# run-experiment\n\n> Pin an experiment's design before launching. Output: a doc the on-call analyst can read in 90 seconds and the launch reviewer can approve without re-asking.\n\n**Mode:** analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked `[TBD]` or `[VERIFY]`, never filled in.\n\n## When to use\n\n- A new feature is going behind an experiment (flag at 0\u002F50\u002F0 split).\n- An existing experiment's plan has gaps (no MDE, no guardrail, no stop rule).\n- Pre-`experimentToGA` workflow.\n\n## Inputs\n\n- Hypothesis (required) — testable, one variable, one direction.\n- Primary metric (required) — what success looks like.\n- Guardrail metrics (required) — what *can't* regress.\n- Baseline values + traffic (required) — current metric mean + standard deviation (or the baseline rate for a proportion), daily eligible units. Missing: the sizing line reads `[TBD: …]` and the plan is not launch-ready — never invent a baseline.\n- Acceptable MDE (optional) — the smallest effect worth detecting; absent, ask the owner (unattended: propose one, marked `[VERIFY: MDE]`).\n\n## Procedure\n\n1. **Hypothesis** — write it as: \"Changing X will move primary-metric by ≥ MDE without regressing guardrails by > tolerance.\"\n2. **Primary metric.** One metric. If you need two, you have two experiments. Make it:\n   - Observable in your analytics within experiment duration.\n   - Tied to the North Star (see `metrics-tree`).\n   - Not the same as the variable under test (you'd be measuring tautology).\n3. **Guardrails** — 2-3 max. Latency, error rate, key downstream conversions. State the regression tolerance per guardrail.\n4. **MDE + sample size + duration — run the bundled script, never compute by hand.** Defaults: power 0.8, α = 0.05 two-sided; with more than two variants it applies Bonferroni (α \u002F (k − 1) per comparison vs control):\n\n   ```bash\n   python3 \"${POLYMATH_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}\u002Fskills\u002Frun-experiment\u002Fscripts\u002Fsample-size.py\" \\\n     --metric mean --sigma 2000 --mde 100 --daily-eligible 80000 --allocation 1.0\n   # proportion: --metric proportion --baseline 0.12 --mde 0.01   (or --mde-relative 5)\n   ```\n\n   It uses the exact normal-approximation formulas (Lehr's `16σ²\u002FMDE²` is the α = 0.05 \u002F power 0.8 shortcut of the mean case), converts to days of traffic, rounds the run **up to whole weeks with a 7-day floor** (weekday vs weekend behavior), and marks the plan **UNDERPOWERED** past the 4-week cap — printing the MDE that is detectable in 28 days so the owner can pick a bigger MDE or a larger allocation. Paste its block verbatim.\n   - These formulas assume the metric is a mean or proportion **per randomization unit**. Percentiles (p99 latency) and ratios with a different denominator (per-request metrics under user randomization) need the delta method or a bootstrap — and usually far more samples.\n5. **Do not launch an UNDERPOWERED plan** without the owner explicitly accepting the longer run or the larger MDE in writing (in the plan file).\n6. **Randomization unit.** User-level for product changes; session-level for content \u002F UX experiments where multi-device matters; cluster-level (org \u002F org-pair) for B2B to avoid contamination.\n7. **Allocation.** 50\u002F50 once tooling supports it; 90\u002F10 (ramp) only when risk is high and you accept lower power. Document.\n8. **Stop conditions.**\n   - **Success** — at the planned sample size, the primary effect is statistically significant in the hypothesized direction and guardrails are clean. (The MDE sizes the test; the observed effect doesn't have to exceed it.)\n   - **Failure** — primary regresses with confidence; or guardrail breach.\n   - **Inconclusive** — at duration cap, primary effect is within noise.\n   - **Emergency** — incident, ethics issue, regulatory; immediate halt independent of stats.\n   - **No peeking:** don't stop early because a daily look shows significance — repeated looks inflate false positives. Analyze at the planned sample size, or pre-register a sequential method (group-sequential bounds, always-valid p-values) that allows early stopping.\n   - **Sample-ratio mismatch:** before reading any metric, check the observed split against the plan — `python3 \"${POLYMATH_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}\u002Fskills\u002Frun-experiment\u002Fscripts\u002Fsample-size.py\" --srm 50421,49579 --split 50,50`. p \u003C 0.001 means the assignment is broken and the results are void.\n9. **Pre-registration.** Write the plan before launch and freeze. Post-hoc metric switching (\"oh, let's check this other one\") inflates false-positive rate.\n\n## Output\n\n```text\nrun-experiment: refund-async-writes\n\nHypothesis\n  Changing the refund pipeline to async writes will reduce refund p99\n  latency by ≥ 100ms without regressing refund-completion-rate by > 0.3%.\n\nVariants\n  A (control)   — current sync write path\n  B (treatment) — async write to refund-worker\n\nAllocation\n  50\u002F50, user-level randomization.\n\nPrimary metric\n  mean refund latency per user, ms (lower-is-better). Baseline 1,200 ms;\n  σ = 2,000 ms (heavy tail); MDE 100 ms.\n  (p99 latency is tracked as a guardrail, analyzed by bootstrap.)\n\nGuardrails\n  refund_completion_rate              tolerance: > -0.3 percentage points\n  refund_5xx_rate                     tolerance: \u003C +0.2 percentage points\n\nSample size + duration (sample-size.py, verbatim)\n  Experiment sizing (two-sided, α = 0.05, power = 0.8, 2 variants)\n  Metric:   mean, σ = 2,000, MDE = 100 (absolute)\n  z:        z(1−α\u002F2) = 1.960, z(power) = 0.842\n  n per variant: 6,280   (total 12,560)\n  Traffic:  80,000 eligible\u002Fday × 100% in experiment\n  Duration: 0.16 days of traffic → run 7 days (whole weeks, 7-day floor)\n  Verdict:  OK — within the 28-day cap\n  SRM check: sample-size.py --srm \u003CA>,\u003CB> before reading any metric.\n\nStop conditions (evaluated once, at day 7 — no early stop on significance)\n  Success:     treatment mean lower than control, p \u003C 0.05, guardrails clean.\n  Failure:     significant regression on primary OR any guardrail breach.\n  Inconclusive: not significant at day 7.\n  Emergency:   incident or guardrail breach → halt immediately.\n\nPre-registration\n  Frozen 2026-05-23. Plan file: docs\u002Fexperiments\u002Frefund-async-writes.md\n```\n\n## Quality bar\n\n- One primary, ≤ 3 guardrails — never \"we'll look at everything\".\n- MDE + sample size + duration all named, and every number came from the script.\n- Stop conditions cover success \u002F failure \u002F inconclusive \u002F emergency.\n- Pre-registration with a frozen plan file before launch.\n\n## Anti-patterns to avoid\n\n- Picking the primary metric after the experiment ran. Inflates false positives.\n- Multiple primary metrics. Statistical correction needed; usually skipped, results overstated.\n- Duration \u003C one week. Day-of-week confounds.\n- Stopping the first day the dashboard shows p \u003C 0.05.\n- No guardrails. The single number that \"won\" was bought by a drop somewhere else.\n",{"name":5,"description":7},"main","23f6e21841a39580c9da2b5ec941f39dda17cd86","plugins\u002Fpolymath-data\u002Fskills\u002Frun-experiment","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath","https:\u002F\u002Fgithub.com\u002FMohammadBafkar","2026-10-29 18:34:59",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add MohammadBafkar\u002Fpolymath --skill run-experiment",{"tool":36,"command":37},"bunx","bunx skills add MohammadBafkar\u002Fpolymath --skill run-experiment",{"tool":39,"command":40},"pnpm","pnpm dlx skills add MohammadBafkar\u002Fpolymath --skill run-experiment","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-data\u002Fskills\u002Frun-experiment\u002FSKILL.md",true,[44,50],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"routing.yaml","REFERENCE","参考文档",359,"https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-data\u002Fskills\u002Frun-experiment\u002Frouting.yaml",{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"scripts\u002Fsample-size.py","SCRIPT","脚本",9422,"https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-data\u002Fskills\u002Frun-experiment\u002Fscripts\u002Fsample-size.py",[57,64,71,78,85,92],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M74GN87EBRHM9N87M7AP1HDD","runbook","Write or refresh an operational runbook for an alert\u002Fsymptom; structured as TL;DR + Pre-checks + Steps + Verification + Rollback + Escalation.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Frunbook\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M74GN5GPKEC1JEKP2DFQNEQJ","rfc","Draft a lightweight design RFC to docs\u002Frfcs\u002F\u003Cslug>.md; Summary, Motivation, Detailed design, Drawbacks, Alternatives, Unresolved questions. A proposal to debate, not a recorded decision (adr).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Frfc\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M74GN2F4CWPMV4X09TG4E304","editorial-pass","Review and tighten prose in a Markdown artifact for a target tone (terse, formal, friendly) without dropping information; preserve quotations and load-bearing constraints.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Feditorial-pass\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M74GMZWGYMZ37C4DYGT6P23G","architecture-review-facilitation","Run an architecture review as a process — entry criteria, reviewer checklist, decision log, and follow-up actions — pairing the design artifact with a red-team pass.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Farchitecture-review-facilitation\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M74GMXVX0YX3ETDXS527XDGM","architecture-doc","Write a C4-style architecture document; System Context + Containers (+ Components when interesting) with mermaid diagrams. Describes structure, not a decision (adr) or proposal (rfc).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Farchitecture-doc\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M74GMVG1WSMCK066S3KE6V5K","adr","Write an Architecture Decision Record (Michael Nygard format) to docs\u002Fadrs\u002FNNNN-\u003Cslug>.md; frontmatter validated by the ADR artifact schema. Records a made decision, not a proposal to debate (rfc).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Fadr\u002FSKILL.md",[],[]]