中文 →
standard library only·deterministic·no network·no model calls·same input, same output·an estimate, not a conclusion·standard library only·deterministic·no network·no model calls·same input, same output·an estimate, not a conclusion·
ENDPOINTS

clinical-research · clinical study design Skill

endpoints · statistics · protocol

The hard part of a protocol is not thinking it through.
It is doing the math.

This Skill works out endpoints, sample size and feasibility in one pass. Endpoints get picked from literature and meeting rooms, Sample sizes wait on a biostatistician's calendar. Feasibility rests on "we should be able to enrol". Every number looks precise, none of them says where it came from, and nobody has signed for it.

  • InputCandidate endpoints: name, surrogate flag, validated flag, five dimension scores
  • InputStatistical parameters: design type, effect size or rates or hazard ratio, alpha, power, dropout
  • InputProtocol parameters: eligible population, planned n, sites, duration, budget, phase
  • OutputEndpoint classification, a dropout-inflated sample size, and a feasibility verdict with a blocker list
  • OutputThe named people who have to sign each conclusion
standard library only deterministic an estimate, not a conclusion no network · no model calls
One run · three scripts
01 ENDPOINTS endpoint_selector.py GAD-7 responder rate w8 78.2 PRIMARY CGI-Improvement w8 66.6 KEY-SECONDARY In-app engagement w8 38.2 EXPLORATORY ! UNVALIDATED SURROGATE 02 SAMPLE SIZE sample_size_estimator.py proportions p1 .35 -> p2 .55 dropout .20 n/arm 96 -> 120 with dropout total 240 03 PHASE GATE phase_gate_scorer.py composite 74.6 / 100 verdict NO-GO ! planned n 200 < 90% of required 240 ! planned budget < 75% of benchmark named owners x5

The values above come from one synthetic-input walkthrough run on this machine, shown to illustrate the output shape. The same input always returns the same output, and every line can be recomputed against the script that produced it.

How to read this page

Sections 02 to 06 cover what the Skill does: three shifts, the three numbers that stall a protocol, how it works, and what its three outputs actually look like. Sections 07 to 09 cover what it saves and where to get it.

Its limits are written into its own output

Every output carries an ESTIMATE banner stating that this is a first-pass estimate. A verdict is not an authorization: it is a blocker list plus the roles that must sign it. Final sample size must be confirmed by a biostatistician.

02 · Before / After

Three shifts: the basis for an endpoint, the source of a sample size, the gap behind a recruitment plan

The same design move, taken from "this looks reasonable" to "we know where it will be challenged".

01

Endpoints: from "this looks reasonable" to "we know where it will be challenged"

Before

The candidate endpoints are listed and the primary is chosen on instinct and precedent. An unvalidated surrogate looks like a good fit, and nobody can say whether it can hold the primary endpoint position with regulators.

After

Every candidate is scored across five weighted dimensions (clinical relevance, measurability, regulatory acceptance, sensitivity to change, patient burden) and classified as PRIMARY, KEY-SECONDARY or EXPLORATORY. An unvalidated surrogate is flagged and demoted, and cannot become the primary endpoint.

From "this endpoint looks reasonable" to "here is where it will be challenged, and why".

02

Sample size: from "an effect size we can reach" to "an effect size we can trace"

Before

Sample size is often worked backwards: see how many patients can be enrolled, then choose the effect size that makes that number work. Dropout is written into the assumptions but never enters the calculation, so n comes out too small.

After

A closed-form solution per design: Cohen's d for means, a normal approximation for proportions, Schoenfeld event counts for survival. The sample size is inflated by the expected dropout rate, and the printed assumption block asks you to trace the effect size back to a published or anchor source.

From "the number adds up" to "the number can be traced".

03

Feasibility: from "we should be able to enrol" to "the gap is on this line"

Before

The enrolment plan comes from optimistic site estimates. A dozen sites, a dozen months, a couple of hundred patients: nobody separated "is the eligible population big enough" from "how many patients can each site enrol per month".

After

Feasibility is scored 0 to 100 across five dimensions (recruitment, endpoint readiness, statistical power, operational complexity, budget fit). Anything below threshold becomes a named blocker and decides the verdict directly: GO, GO-WITH-CONDITIONS, REDESIGN or NO-GO.

From "we should be able to enrol" to "the gap is on this line, and this person has to sign".

03 · Pain point and use case

What stalls a protocol is rarely the science. It is three numbers nobody actually ran.

They live in different places, and the work of joining them up stays with people.

Number 01The endpoint has to hold the primary positionThe evidence is scattered across literature, precedent and regulatory tables, and the choice is made on instinct.
Number 02The sample size has to hold the powerIt lives on a biostatistician's schedule. Dropout is written into the assumptions but never enters the calculation.
Number 03Recruitment has to land inside time and budgetIt comes from optimistic site estimates, and nobody separated eligible population from patients per site per month.

The problem is not a lack of tools. Statistics software computes sample sizes, regulatory guidance documents endpoint precedent, and a spreadsheet assembles a feasibility table. The problem is that each tool answers one segment of the question.

Worse, what comes out the other end looks a lot like a conclusion. A standard-looking sample size, a plausible enrolment window, a workable site count: none of them is marked as an assumption when it is written into the protocol.

These are the numbers that cause trouble at the phase gate. The committee rarely asks whether you ran the calculation. It asks where the effect size came from, why dropout was set at 15%, and who verified the eligible population. When nobody can answer, the protocol is sent back for what looks like a design flaw. Underneath, it is that nobody can say where the basis sits.

One risk is quieter still: an unvalidated surrogate treated as the primary endpoint. It looks sensitive, cheap and easy to measure early on, right up to the point where regulators say it cannot hold the primary position. By then, the whole design has to be redone.

04 · Transition

What is missing is not a fourth tool. It is a layer that keeps the basis attached.

Every estimate should arrive together with its assumptions, its source and its limits. Every decision should know whose signature makes it stand.

That is what this Skill does. It adds no authority to the judgement. It leaves a trace of it.

05 · Solution

Bring three sets of parameters. Get an estimate with its basis, its limits and its sign-off chain.

STEP 01 · INPUTThree sets of parametersEndpoint list, statistical parameters, protocol parameters.
STEP 02 · PROCESSThree deterministic scriptsEndpoint scoring and classification, sample size and power, five-dimension feasibility.
STEP 03 · OUTPUTBlockers and a sign-off chainAn ESTIMATE banner, a blocker list, and named owners.
endpoint_selector.py
Endpoint scoring and classificationA composite across five weighted dimensions, sorted into PRIMARY, KEY-SECONDARY and EXPLORATORY. An unvalidated surrogate is flagged and demoted, and cannot take the primary position.
sample_size_estimator.py
Sample size and powerCohen's d for means, a normal approximation for proportions, Schoenfeld event counts for survival. Inflated by dropout, with an assumption block to paste into the statistics section.
phase_gate_scorer.py
Feasibility verdict and sign-off chainA five-dimension composite out of 100, a blocker list, a verdict of GO, GO-WITH-CONDITIONS, REDESIGN or NO-GO, and the named owners who must sign.
onboard.py
One-time setup on first useSeven questions that write the development area, default alpha, power, dropout and three named owners into config. Every script picks those defaults up afterwards.

All four scripts are pure standard library. No network calls, no model calls. The same input always returns the same output, so any conclusion can be recomputed and challenged. The development area genuinely changes the result: drug, device, biologic, diagnostic and digital-therapeutic each carry their own per-patient cost benchmark and recruitment difficulty coefficient.

06 · Real outputs

What the three outputs look like

The three sets of values below come from one synthetic-input walkthrough run on this machine, and every one of them can be recomputed against the script that produced it.

Output 01 · Endpoint scoring and classificationendpoint_selector.py
EndpointClassCompositeClinical relevanceMeasurabilityRegulatory acceptanceSensitivityBurden
GAD-7 responder rate at week 8PRIMARY78.2888060*8285
CGI-Improvement at week 8KEY-SECONDARY66.6806852*6070
In-app engagement sessions per weekEXPLORATORY38.2359220*7890

* Regulatory acceptance is shown after the digital-therapeutic profile multiplier (x0.80) is applied.

The engagement metric has one of the better raw measurability (92) and sensitivity (78) readings in this set, but it carries the unvalidated-surrogate flag and cannot anchor a primary endpoint.

Output 02 · Sample size and powersample_size_estimator.py
n per arm · raw96two-arm proportions design
n per arm · w/ dropout120inflated by 20% expected dropout
total · w/ dropout240a recruitment target that can go into the protocol

Formula n = [za*sqrt(2*pbar*qbar) + zb*sqrt(p1q1+p2q2)]^2 / (p1-p2)^2, at alpha 0.05 and power 0.80.

One flag is kept on purpose: the 35% to 55% anchor is supplied by the requester and is not yet cited to a published MCID. The tool still returns a number; the assumption block asks you to trace it to a source.

Output 03 · Feasibility verdict and sign-off chainphase_gate_scorer.py
Verdict
NO-GO
Composite
74.6 / 100
! power: planned n (200) < 90% of required n (240)! budget: planned budget < 75% of benchmark cost
Recruitment84.0
Endpoint readiness60.0
Statistical power76.7
Operational complexity94.0
Budget fit55.6
A composite of 74.6 would read as GO-WITH-CONDITIONS on its own, but two blockers force NO-GO. A high score cannot override a blocker: that is the tool design, not a scoring bug.
MM
MEDICAL MONITORMedical Monitorplaceholder · onboarding writes the real name
BS
BIOSTATISTICIANBiostatisticianplaceholder · onboarding writes the real name
RO
REGULATORY OWNERRegulatory Ownerplaceholder · onboarding writes the real name
SD
STUDY DIRECTORStudy Directorplaceholder · onboarding writes the real name
RH
R&D HEADR&D Headplaceholder · onboarding writes the real name
[PRE-LAUNCH REQUIREMENT] The values in this section come from one synthetic-input walkthrough run, shown to illustrate the output shape. Replace or supplement them with real project inputs, outputs and screenshots before publishing. If no real material exists, do not describe these values as a solved clinical problem, and do not present them as a real project that changed course because of them.
07 · Core advantages

Five differences that reach the user

01

Deterministic output you can recompute and audit

No model calls, no network, standard library only. The same input always returns the same result, and anyone can take the parameters and recompute a conclusion line by line. Where a protocol has to pass a gate, reproducibility matters more than looking clever.

02

Every output carries its limits, not just a conclusion

All outputs carry an ESTIMATE banner stating that this is a first-pass estimate and that the final sample size must be confirmed by a biostatistician using simulation, an adaptive design or an exact method. It deliberately avoids the tone of a conclusion.

03

The decision stays with named people

A verdict is not an authorization. It is a recommendation with a blocker list, followed by the roles that must sign: Principal Investigator, Medical Monitor, Biostatistician, Regulatory Owner, Study Director, depending on the verdict tier. Onboarding replaces those roles with real names and prints them into the output.

04

An unvalidated surrogate cannot take the primary position

A surrogate endpoint with no validation evidence is flagged and demoted, and cannot become the primary endpoint. That rule moves one of the most expensive kinds of late rework back into the design stage.

05

The development area actually changes the result

drug, device, biologic, diagnostic and digital-therapeutic each adjust the per-patient cost benchmark and the recruitment difficulty coefficient. This is not a relabelled dropdown: budget fit and recruitment feasibility move with it.

08 · Why it matters

Giving a design decision its first paper trail

What this Skill reduces is not a few calculations. It is the same thing that keeps happening in clinical design: a number is produced, written into a protocol, questioned in review, and then nobody can say where it came from.

When every estimate arrives with its assumptions, its source and its limits, and when every verdict knows whose signature makes it stand, the design process moves from "that is what we decided at the time" to "here is the basis, recompute it". The first set of parameters can carry into the next revision, the first blocker can be tracked to closure, and the first named owner can keep the same thread.

For a clinical team, what is saved is not time. It is rework.

09 · Get started

clinical-research

Bring your candidate endpoints, statistical parameters and protocol parameters, and run the seven-question onboarding once to pin down the development area, default alpha, power and three named owners.

What you get back is a first-pass estimate with its basis, its limits and its sign-off chain, ready to put in front of a phase-gate discussion.

clinical-research → standard library · zero dependencies · no network