Cohort Pattern Diagnostics — one noisy syndrome cloud separating into distinct colored cohorts
AI Diagnostic Skill

Cohort Pattern Diagnostics

Cohort Pattern Diagnostics is a portable AI-agent skill for repeated anomalies, impossible bugs, noisy evidence, rare failures, and conflicting research — it separates one suspicious syndrome into cohorts, per-cluster hypotheses, falsifiers, rate checks, observability upgrades, and residuals.

Agent-agnostic skill Debugging & research MIT

Before hunting one root cause, Cohort Pattern Diagnostics makes an agent ask the sharper question: are these cases one phenomenon — or several populations wearing the same mask?

It turns a repeated syndrome into a small diagnostic map, so counterexamples from one hidden group stop falsely disproving a good explanation for another.

Why it matters

Some bugs look impossible for years because they are not one bug. A crash signature, a flaky test, a rare race, a contradictory set of research results — each can be a mixed population: several distinct causes producing the same visible syndrome. Single-case deep dives then loop forever, because every promising hypothesis is "disproved" by a counterexample that actually belongs to a different cohort.

The pattern comes from epidemiology: study the population before the patient. Split cases by discriminating features first, and each cohort suddenly has a coherent, checkable cause — including the rare one hiding behind the common one.

What is inside

The skill walks an agent through a fixed pipeline: define the syndrome and population boundary, assess data quality, extract discriminating features, build a cohort map, then test same-cohort counterexamples so falsification stays honest within each group.

Each cohort gets its own hypothesis, a rate and plausibility check ("is this frequency even possible under that cause?"), a next decisive signal, and a fix path. The run ends with an observability upgrade — what to log or capture so the next occurrence classifies itself — and explicit residuals: cases that still fit no cohort.

Cohort Pattern Diagnostics pipeline A repeated syndrome flows through discriminating features into a cohort map, per-cohort causes, and a rate check; observability upgrades and residuals feed the next pass. Syndrome one visible mask Features discriminating signals Cohort map same-cohort falsifiers Per-cohort cause one hypothesis each Rate check is this rate possible? observability upgrade + residuals feed the next pass

How to use it

Cohort Pattern Diagnostics ships as a single SKILL.md plus manifest. In Codex-style skill environments, copy the folder into your skills directory and invoke it when a repeated anomaly smells like a mixed population. In any other agent setup, paste or reference SKILL.md as a reusable diagnostic instruction.

Reach for it when one repeated crash has no coherent cause, when logs are too noisy to classify, when a rare hardware fault or race seems impossible but keeps recurring, or when research evidence contradicts itself because source classes, methods, or datasets may be mixed. For a single well-behaved bug with one clean reproduction, ordinary root-cause analysis is still the right tool.

Works with your agent stack

The skill is deliberately portable: anything that can read a SKILL.md instruction can run the protocol. That includes agentic coding tools such as Claude Code, Cowork, OpenAI Codex CLI, Cursor, Cline, Roo Code, Windsurf, the GitHub Copilot coding agent, Gemini CLI, Aider, OpenHands, and Goose — and orchestration frameworks like LangGraph, CrewAI, and AutoGen, where it slots in as a reusable diagnostic prompt for a worker or reviewer agent.

No plugin API, no lock-in: the whole contract is a markdown file. If your harness supports skills natively, install it as one; if not, inject it into context when the anomaly pattern appears.

Lineage and honest limits

The skill was inspired by OpenAI's "Core dump epidemiology: fixing an 18-year-old bug", where population-level crash analysis separated one apparently impossible bug into distinct causes — including a bad physical host and an old GNU libunwind race. This repository is an independent generalization of that diagnostic pattern, not affiliated with OpenAI, released under MIT.

Honest limits: cohorting is a lens, not an oracle. Bad discriminating features produce confident nonsense, tiny populations resist meaningful splits, and residuals must stay visible rather than be forced into the nearest cluster. The skill's discipline — same-cohort counterexamples, rate checks, explicit residuals — exists precisely to keep those failure modes loud.