---
name: apgar-score-compute
source: https://app.decimal.ai/s/apgar-score-compute@1/SKILL.md
source_sha256: ff5596420425
---

# Compute the newborn Apgar score by the five-sign rubric

Handed a description of a newborn a minute after delivery, the base model tends to eyeball a number. Two failures dominate: it treats **blue hands and feet on an otherwise pink baby** as full color credit (it is not), and it rounds a **heart rate in the 90s** up to full credit (it is not). It also silently drops a sign it was not sure how to score, so a five-sign total comes back built from four. The score is not a gestalt impression — it is a **sum of five fixed sub-scores**, and each one has a hard rule.

## What this computes

The Apgar score rates a newborn's condition as an integer from **0 to 10**. You score **five signs**, each **0, 1, or 2**, and **add them**. The signs are Appearance (color), Pulse (heart rate), Grimace (reflex irritability), Activity (muscle tone), and Respiration (breathing effort). Source: Apgar V. (1953), *A proposal for a new method of evaluation of the newborn infant*, Curr Res Anesth Analg 32:260. This is the standard clinical rubric, US/international, as of 2026-07; it has been stable since introduction.

## The complete rubric — score every sign, then sum

Score all five. A missing or unmentioned sign is scored **0**, not skipped.

**Appearance (skin color)**
- **0** — blue or pale over the whole body.
- **1** — body pink but the extremities (hands and feet) are blue. This is **acrocyanosis**, and it is worth exactly 1, never 2.
- **2** — pink everywhere, extremities included.

**Pulse (heart rate)**
- **0** — no heartbeat detectable.
- **1** — a heart rate **below 100** beats per minute (anything from 1 up to 99).
- **2** — a heart rate of **100 or more** beats per minute (100 itself scores 2).

**Grimace (reflex irritability to stimulation)**
- **0** — no response to a flick of the sole or to suctioning.
- **1** — a grimace, a facial move, or a feeble cry only.
- **2** — a vigorous cry, cough, sneeze, or active pull-away.

**Activity (muscle tone)**
- **0** — limp, flaccid, no tone.
- **1** — some flexion of the arms or legs.
- **2** — active motion, limbs well flexed and resisting.

**Respiration (breathing effort)**
- **0** — not breathing; apneic.
- **1** — slow, irregular, gasping, or a weak cry.
- **2** — a strong, regular, lusty cry.

Total = Appearance + Pulse + Grimace + Activity + Respiration. Report the integer only.

## The two rules the base model breaks

1. **Acrocyanosis is a 1, not a 2.** A newborn whose trunk is pink but whose hands and feet stay blue has scored **1 point** for color, even when everything else is perfect. A baby cannot reach 10 while its extremities are still blue — the ceiling with acrocyanosis is 9.
2. **The pulse cutoff is a hard 100.** Below 100 is 1 point; 100 or above is 2. A rate of 98 or 99 does **not** round up. Only "absent" scores 0 — a slow-but-present pulse is always at least 1.

## Worked examples (BEFORE the fix -> AFTER)

**Acrocyanosis ceiling.** Trunk pink, hands and feet still dusky; rate 132; screams when the foot is flicked; limbs well flexed and thrashing; a loud cry.
- BEFORE: "looks great -> 10."
- AFTER: color = 1 (extremities blue), pulse = 2, grimace = 2, tone = 2, respiration = 2 -> **9**.

**Heart rate in the 90s.** Pink all over; rate charted at 94; vigorous cry to suction; active motion; strong cry.
- BEFORE: "94 is basically fine -> 2 for pulse -> 10."
- AFTER: pulse = 1 (below 100); all others = 2 -> **9**.

**A dropped sign.** Pale throughout; no heartbeat found; a weak grimace to the sole flick; some flexion of the legs; feeble irregular gasps.
- BEFORE: scores four signs, forgets pulse -> "4."
- AFTER: color = 0, pulse = 0 (absent), grimace = 1, tone = 1, respiration = 1 -> **3**. The absent pulse is a scored 0, not an omission.

**One sign absent, the rest strong.** Fully pink; rate 158; coughs and cries hard; active and well flexed; but not breathing at all.
- BEFORE: "healthy pink active baby -> 9 or 10."
- AFTER: respiration = 0 (apneic) drags an otherwise-8 total down; color 2 + pulse 2 + grimace 2 + tone 2 + respiration 0 -> **8**.

## Edge cases

- **Exactly 100 bpm** scores 2 for pulse — the cutoff is inclusive at 100.
- **Present but very slow pulse** (e.g. 55 bpm) scores 1, never 0. Zero is reserved for a truly absent heartbeat.
- **"Cyanotic" or "dusky all over"** means the whole body is blue -> color 0. Reserve color 1 for the specific pattern of a pink trunk with blue extremities only.
- **A weak/feeble cry** is ambiguous by design: it earns **1 for grimace** (a feeble cry, not vigorous) and **1 for respiration** (a weak cry, not a strong one). Score both signs from the same weak cry.
- **A strong cry** simultaneously supports grimace = 2 (vigorous vocal response) and respiration = 2 (lusty breathing) — do not double-count it as extra points, but do credit each of the two distinct signs.
- **Some flexion vs. active motion:** "some flexion of the extremities" is tone 1; "active motion" or "resisting extension" is tone 2. Flaccid/limp is 0.

## Do / Don't

- **Do** score all five signs even when the report is terse; an unmentioned sign is 0, and say so.
- **Don't** give color 2 whenever the word "pink" appears — check whether the hands and feet are still blue first.
- **Do** treat 100 bpm as the inclusive boundary (>= 100 -> 2).
- **Don't** round a heart rate in the 90s up to 2; below 100 is always 1.
- **Do** return a single integer in [0, 10].
- **Don't** invent a "half point" or report a sub-score breakdown unless asked — the deliverable is the total.

## Common mistakes

- Counting acrocyanosis (pink body, blue extremities) as full color credit -> inflates the total by 1.
- Rounding a heart rate of 92-99 up to 2 -> inflates by 1.
- Scoring a present-but-slow pulse as 0 instead of 1 -> deflates by 1.
- Silently omitting a sign the reporter did not mention, so the sum is built from four signs -> usually deflates.
- Reading "not breathing" or "apneic" as anything but respiration 0.

## Output

Return the total as a JSON object keyed `apgar` with an integer value, e.g. `{"apgar": 9}`. No sub-scores, no prose, unless the caller asks for the breakdown.

## Deterministic grading

`scripts/grading_spec.json` holds the correct integer for each benchmark newborn, and `scripts/grade.py` parses the answered `apgar` value and compares it exactly. See the eval suite.
