Cycle estimate phase
cycle_estimate_phaseAnalyze period start dates to estimate current phase, cycle day, next period, and confidence. Supports irregular cycles with low confidence and late-luteal warnings.
Instructions
Given a list of recent period start dates (from any source), returns the current phase, cycle day, estimated cycle length, next-period date, and confidence. v0.3.2 adds a late_luteal sub-phase (triggered when the cycle is past its expected end + grace day) plus days_past_due and delay_flag (raised when ≥2 days late vs prediction from 3+ historical cycles). v0.3.3 adds cycle_irregular (PCOS / irregular-cycle mode): when true, accepts cycles 21-90 days, caps confidence at 'low', returns luteal_extended + irregular_window: true past 35 days since last period, and adds a clinician-defer warning.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| today | No | Optional reference date; defaults to system today. | |
| history | Yes | Array of {start_date: 'YYYY-MM-DD', length_days?: number}. Sorted automatically. | |
| cycle_irregular | No | v0.3.3 — PCOS / irregular-cycle mode. When true: accepts cycles 21-90 days, caps confidence at 'low', returns `luteal_extended` when days_since_last > 35, and adds a clinician-defer warning string. Default false. |