| name | export-formats |
| description | Use when you need to export a generated taxonomy to a non-database format — CSV, TSV, JSON, NDJSON, SQL seed file, or YAML. |
Export Taxonomy to Multiple Formats
Export a generated taxonomy to CSV, TSV, JSON, NDJSON, SQL, or YAML. Preserve all columns and metadata.
When to use
- "Export this as JSON for my app"
- "I need a SQL seed file with INSERT statements"
- "Give me NDJSON for BigQuery"
- "Convert to YAML format"
Inputs to gather
- Taxonomy file path: Absolute path to generated CSV or JSON (auto-discover from
data/<name>/ if not given).
- Format: CSV, TSV, JSON, NDJSON, SQL, YAML.
- For SQL format: Table name (inferred from filename if not given).
Procedure
- Read the taxonomy file (CSV or JSON).
- Normalize to in-memory structure (list of dicts, one per row).
- Write to
data/<name>/exports/ in the requested format:
- CSV: Standard
csv module; preserve headers.
- TSV:
csv with delimiter='\t'.
- JSON: Pretty-printed array of objects; include schema hint in a
_schema field if needed.
- NDJSON: One JSON object per line (no array wrapper); good for streaming/BigQuery.
- SQL: Generate
CREATE TABLE DDL + INSERT statements. Include the same DDL as load-to-postgres skill (infer types from data); wrap in a transaction (BEGIN; ... COMMIT;).
- YAML: Array of objects in YAML syntax (each entry as a dict with key-value pairs).
- Log the export: write filename and format to
state/exports/<timestamp>-<name>-<format>.log.
- Report to user: file size, row count, format name, full output path.
Output / side effects
- Exported file in
data/<name>/exports/<name>.<ext> where ext is csv, tsv, json, ndjson, sql, yaml.
- Export logged to
state/exports/<timestamp>-<name>-<format>.log.
Safety / constraints
- No credentials in SQL: SQL seed files should not include connection strings or credentials.
- Reversible: Export does not modify the original taxonomy; purely additive.