duckdb-profilelisted
Install: claude install-skill srimon12/duckdb-2-skills
# Query and file diagnostics
Diagnosis follows a six-stage loop: frame the symptom, capture a plan, localize the dominant cost, classify the cause, change one thing, and prove the change. Treat plan operators as evidence, not diagnoses.
Execute DuckDB with `duckdb`. For query semantics, consult `duckdb-sql`; for reader and writer parameters, consult `duckdb-files`; when time is spent outside SQL in host code, consult `duckdb-python`. For the diagnosis protocol and cost model, read [references/diagnosis.md](references/diagnosis.md). For operator specifications and JSON structures, read [references/plans.md](references/plans.md).
## Start with the symptom
| Symptom | First move | Proof |
| --- | --- | --- |
| Slow, correct result | Run `EXPLAIN`, then `EXPLAIN ANALYZE` | Dominant operator rows and elapsed timings fall |
| Out of memory | Locate blocking operator holding peak intermediate rows | `system.peak_temp_dir_size` and memory drop |
| Filter reads every row group | Inspect filter expression and physical column ordering | `Row Groups Scanned` drops below total groups |
| Join multiplies input rows | Check join key uniqueness and input cardinalities | Join output matches expected cardinality |
| Schema changed or columns missing | Check schema drift across files in `duckdb-files` | Every file matches expected schema |
| Wrong value returned without error | Inspect SQL semantics in `duckdb-sql` result traps | Result is proven correct before optimizing |
A wrong answer