AgentSkillsCN

Clinical Scoring

临床评分

SKILL.md

Clinical Scoring Skill

Purpose

Score a biotech company's clinical development program to produce a normalized 0-100 clinical score. This skill encodes the exact rules, thresholds, and lookup tables from Wake Robin's pipeline (Module 4 + PoS Engine) so that any agent or analyst can reproduce the scoring deterministically.

Preconditions

  • All arithmetic MUST use Decimal (never float). Initialize from strings: Decimal("0.40").
  • All dates MUST be ISO 8601 (YYYY-MM-DD). Never call datetime.now().
  • PIT safety: only use data where source_date <= as_of_date - 1.
  • Rounding: ROUND_HALF_UP. Scores to 2 dp (0.01), rates to 4 dp (0.0001).

Step 1: Determine Lead Phase

Map each company's most advanced trial to a canonical phase. Use the highest phase across all PIT-admissible trials for that ticker.

Raw Phase StringCanonical Phase
"Phase 1", "PHASE1", "phase 1", "p1"phase_1
"Phase 1/Phase 2", "Phase 1/2"phase_1_2
"Phase 2", "PHASE2", "phase 2", "p2"phase_2
"Phase 2/Phase 3", "Phase 2/3"phase_2_3
"Phase 3", "PHASE3", "phase 3", "p3"phase_3
"New Drug Application", "NDA", "BLA"nda_bla
"Approved", "APPROVED"commercial
anything elsepreclinical

Phase ordering (lowest to highest): preclinical < phase_1 < phase_1_2 < phase_2 < phase_2_3 < phase_3 < nda_bla < commercial


Step 2: Look Up Base Stage Score

StageScore (0-100)
preclinical10
phase_120
phase_1_230
phase_240
phase_2_352
phase_365
nda_bla80
commercial90

Step 3: Compute Phase Score (Module 4, 0-30 pts raw)

PhasePhase Score
approved30
phase 325
phase 2/322
phase 218
phase 1/212
phase 18
preclinical3
unknown0

Phase Progress Bonus (0-5 pts)

PhaseBonus
approved5.0
phase 34.0
phase 2/33.5
phase 23.0
phase 1/22.0
phase 11.0
preclinical0.0

Step 4: Map Indication

Use indication_mapper.py (v2.0.0). Mapping precedence (highest to lowest):

  1. ticker_overrides_v3 (PIT-safe, has effective_from/effective_until) -> confidence 0.95
  2. ticker_overrides (legacy, no time-bounds) -> confidence 0.85
  3. condition_patterns (regex word-boundary matching, 2+ matches) -> confidence 0.80
  4. condition_patterns (single match) -> confidence 0.65
  5. ta_fallback (therapeutic area only) -> confidence 0.50
  6. phase_only (no condition data) -> confidence 0.30

Category Aliases

Mapper CategoryPoS Engine Category
cnsneurology
autoimmuneimmunology
gi_hepatologygastroenterology

Step 5: Look Up PoS Benchmarks (BIO 2011-2020)

Phase 1 LOA (Likelihood of Approval)

IndicationLOA
oncology0.057
rare_disease0.106
infectious_disease0.195
neurology0.084
cardiovascular0.071
immunology0.112
metabolic0.093
respiratory0.089
dermatology0.124
ophthalmology0.117
gastroenterology0.098
hematology0.102
urology0.095
all_indications0.079

Phase 2 LOA

IndicationLOA
oncology0.131
rare_disease0.273
infectious_disease0.196
neurology0.144
cardiovascular0.126
immunology0.218
metabolic0.167
respiratory0.155
dermatology0.234
ophthalmology0.212
gastroenterology0.178
hematology0.195
urology0.172
all_indications0.152

Phase 3 LOA

IndicationLOA
oncology0.439
rare_disease0.649
infectious_disease0.769
neurology0.510
cardiovascular0.545
immunology0.672
metabolic0.598
respiratory0.567
dermatology0.712
ophthalmology0.687
gastroenterology0.612
hematology0.634
urology0.589
all_indications0.579

NDA/BLA LOA

IndicationLOA
all_indications0.903

PoS Score Conversion

code
pos_score = LOA_probability * 100

Score range: 0.00 to 100.00.


Step 6: Apply Confidence Gating

Stage-Adjusted Base Confidence

StageConfidence
preclinical0.35
phase_10.45
phase_1_20.50
phase_20.58
phase_2_30.65
phase_30.75
nda_bla0.88
commercial0.92

Indication Confidence Modifiers (additive)

IndicationModifier
rare_disease+0.05
dermatology+0.04
infectious_disease+0.03
ophthalmology+0.03
immunology+0.02
hematology+0.02
metabolic0.00
gastroenterology0.00
urology0.00
respiratory-0.02
cardiovascular-0.03
all_indications-0.03
oncology-0.05
neurology-0.08

Data Quality Confidence Modifiers (additive)

Quality StateModifier
FULL+0.05
PARTIAL0.00
MINIMAL-0.05
NONE-0.15

Confidence Bounds

code
final_confidence = clamp(base + indication_modifier + quality_modifier, 0.20, 0.95)
  • CONFIDENCE_HIGH: >= 0.70
  • CONFIDENCE_MEDIUM: >= 0.55
  • CONFIDENCE_LOW: >= 0.30
  • GATING_THRESHOLD: 0.40 — Below this, PoS contributes 0 weight to composite.

Step 7: Apply Optional Multipliers

MultiplierClamp RangeSource
trial_design_quality0.70 - 1.30Module 4 design scoring
competitive_intensity0.70 - 1.00competitive_pressure_engine.py

Step 8: Recency Scoring (0-5 pts)

Based on days since last trial update (use PIT date field priority: first_posted > last_update_posted > source_date > collected_at).

Days Since UpdateScore
0-305.0
30-905.0 to 4.5 (linear)
90-1804.5 to 4.0 (linear)
180-3654.0 to 3.0 (linear)
365-7303.0 to 1.0 (linear)
>= 7301.0
  • RECENCY_STALE_THRESHOLD: 730 days (2 years). Triggers 20% penalty on score.
  • RECENCY_UNKNOWN_PENALTY: 2.5 (neutral score when date unknown).

Step 9: Trial Count Bonus (0-5 pts, piecewise linear)

Trial CountScore
00.0
10.5
21.0
52.0
103.5
204.5
>= 1005.0

Step 10: Indication Diversity Bonus (0-5 pts)

Based on count of unique condition tokens across all trials.

Unique TokensScore
00.0
20.7
51.5
103.0
204.0
>= 305.0

Step 11: Design Quality Scoring (0-25 pts)

  • Base: 12 pts
  • Randomized: +5 pts
  • Double-Blind: +4 pts
  • Single-Blind: +2 pts (mutually exclusive with double-blind)
  • Strong Endpoint: +4 pts
  • Weak Endpoint: -3 pts (mutually exclusive with strong)

Strong Endpoint Patterns

overall survival, OS, progression-free survival, PFS, complete response, CR, objective response rate, ORR, disease-free survival, DFS, event-free survival, EFS, major molecular response, MMR

Weak Endpoint Patterns

biomarker, pharmacokinetic, PK, safety, tolerability, dose-finding, maximum tolerated dose, MTD


Step 12: Execution Track Record (0-25 pts)

  • Base: 12 pts
  • Completion Rate Contribution: completion_rate * 10 pts
  • Termination Rate Penalty: termination_rate * 8 pts (subtracted)

Trial Status Quality Weights

StatusWeight
COMPLETED1.0
ACTIVE0.8
RECRUITING0.7
NOT_YET_RECRUITING0.6
ENROLLING_BY_INVITATION0.7
SUSPENDED0.2
TERMINATED0.0
WITHDRAWN0.0
UNKNOWN0.5

Step 13: Endpoint Strength (0-20 pts)

  • Base: 10 pts
  • Strong endpoint found: +2 pts per occurrence
  • Weak endpoint found: -1 pt per occurrence

Step 14: Compute Total Clinical Score

code
raw_total = phase_score + phase_progress + trial_count_bonus
          + diversity_bonus + recency_bonus + design_score
          + execution_score + endpoint_score

clinical_score = (raw_total / 120) * 100    # Normalize to 0-100
clinical_score = clamp(clinical_score, 0, 100)

Maximum raw total = 30 + 5 + 5 + 5 + 5 + 25 + 25 + 20 = 120.


Step 15: Commercial Stage Differentiation (PoS Engine)

For companies at commercial stage, apply additional adjustments:

Pipeline Tier Bonuses (LOA adjustment)

TierMin TrialsLOA Bonus
exceptional>= 1000.00
strong>= 30-0.02
moderate>= 10-0.05
limited>= 3-0.10
minimal0-2-0.15

Indication-Specific Commercial Risk (LOA adjustment)

IndicationRisk
rare_disease0.00
dermatology-0.02
ophthalmology-0.02
neurology-0.02
hematology-0.02
oncology-0.03
immunology-0.03
metabolic-0.04
respiratory-0.04
gastroenterology-0.04
urology-0.04
infectious_disease-0.05
cardiovascular-0.05
all_indications-0.05

Pipeline Diversity Bonus

+0.02 if >= 3 distinct phases represented in pipeline.

Commercial LOA Range

Clamp commercial LOA to [0.82, 1.00].


Severity Classification

ConditionSeverity
No trials foundSEV1 (10% penalty)
All trials stale (> 730 days)SEV1
No PIT-admissible dataSEV2 (50% penalty)
Lead phase = preclinical onlyNONE (scored normally)

Composite Integration

The clinical score enters Module 5 composite with these weights:

Weight SetClinical Weight
V3 Enhanced (all signals)26%
V3 Default (no enhancements)40%
V3 Partial (some enhancements)33%
Baker-Style Fundamental35%

PoS Delta Cap: Maximum PoS contribution to composite = 6.0 points.


Pre-Flight Checks

Before scoring, verify:

  1. Trial records are PIT-admissible (source_date <= as_of_date - 1)
  2. pos_benchmarks_bio_2011_2020_v1.json is loaded and contains all 14 indications
  3. Indication mapping covers the ticker (log confidence tier if < 0.65)
  4. At least 1 trial record exists for the ticker (otherwise assign SEV1)
  5. All score components use Decimal arithmetic
  6. Output includes _governance block with score_version, schema_version, pit_cutoff

Source Files

ComponentFile
PoS Enginepos_engine.py (v1.2.0)
Clinical Scoringmodule_4_clinical_dev_v2.py (v2.1.0)
Indication Mapperindication_mapper.py (v2.0.0)
PoS Benchmarksdata/pos_benchmarks_bio_2011_2020_v1.json
Catalyst Scoringmodule_3_scoring_v2.py (v2.0.0)