| name | escalation-ladder |
| description | Cheapest technique first, LLM last. Use before designing any feature that classifies, matches, routes, dedups, ranks, scores, or extracts, anything where the first instinct is "call the LLM per item". Forces enumeration of deterministic and classical-stats options, with costs and a measurement plan, before a model is allowed in. |
Escalation Ladder
The user is not ML-trained and does not need to be. The gate is a question, not knowledge: the model knows the techniques; this skill forces it to put them on the table before reaching for per-item LLM calls. An LLM call per item is the most expensive, least auditable, least debuggable tool in the box; it must be earned, not defaulted to.
The ladder
Before proposing a design, walk every rung and say explicitly why each is or isn't enough. Name real techniques, explain each in one plain-English sentence (no unexplained jargon), and give per-item cost:
- Lookup. Is the answer already keyed in the data? (IDs, thread keys, foreign keys, container membership.) O(1), free, exact.
- Rule. Does structural metadata decide it? (Headers, flags, sender type, counts, date arithmetic.) Deterministic, explainable in one sentence.
- String. Exact match, normalized match, fuzzy similarity (Jaro-Winkler, trigrams; Postgres pg_trgm counts), regex on bounded vocabularies.
- Statistics. Counting with thresholds: set overlap, IDF weighting, decay formulas, quantile cutoffs, calibration against observed outcomes. Decades-old, tiny code, no training.
- Embedding. Rented vectors + cosine similarity. Cheap per item, fuzzy, needs an index. (Signal already has pgvector.)
- Small LLM. Haiku-class, forced JSON, only on the residual the rungs above couldn't decide: near-ties, genuinely ambiguous cases.
- Big LLM. Last, on the residual of the residual.
The output shape to aim for is a cascade: most traffic dies on rungs 1–4, a minority reaches 5, a sliver reaches 6–7. If the proposal sends 100% of items to rung 6+, that needs a stated justification, not a shrug.