data-convertlisted
Install: claude install-skill moonlight-lupin/data-toolkit
# Data Convert
Take a **clean-enough** source and re-express it in the **structure or contract a downstream
system requires**. The interoperability counterpart to `data-tidy`: **tidy = quality** (messy →
clean, same-ish shape); **convert = interoperability** (clean → a *different* structure/contract).
If the source is messy, convert **delegates the cleaning to `data-tidy` first**, then converts the
clean result.
> **Two jobs, often combined:**
> 1. **Contract mapping** — map a source onto *another system's* import contract (columns, order,
> types, required fields). Unmapped sources are reported; required-but-missing rows follow
> `rules.on_missing_required` (`flag` / `exclude` / `error`) — never invent values.
> 2. **Structural reshape** — `unpivot` (wide→long), `pivot` (long→wide), `flatten`/`nest`
> (JSON↔table), `split` (one file→many by a key), `union` (many→one with column alignment).
## Workflow
```python
import sys; sys.path.insert(0, "scripts")
from convert import (load_spec, render_card, convert_file, convert_rows,
sense_check, render_report)
```
> **Run from the skill directory** (`skills/data-convert/`). The `scripts` path resolves
> to this skill's `scripts/` subdirectory where `convert.py` lives.
### 1. Intent first — what's the target, and why?
Establish the **source**, the **target contract** (another system's import spec — its columns,
order, required fields, formats) and the **purpose**. Once you understand the purpose you