# Encode Structured Data in TOON

JSON can consume excessive prompt tokens when records repeat the same keys. This skill converts suitable structures into compact TOON and validates format rules.

## Install

```bash
npx skillstore add consiliency/toon-format
```

## Metadata

- Status: approved
- Slug: consiliency-toon-format
- Skillstore revision: r1
- Version status: missing
- Tree hash: 1bc746f4d12da85a0c8e507ce2aeacceed08710d74388bb68efb318505358831
- Author: Consiliency
- GitHub username: Consiliency
- License: MIT
- Repository: https://github.com/Consiliency/treesitter-chunker/tree/main/.ai-dev-kit/skills/toon-format
- Ref: 635f69fb8d2f4e6330ba47a4e5a0fb239c04d110
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: network, filesystem, external\_commands
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/consiliency-toon-format
- Manifest: https://skillstore.pages.dev/api/skills/consiliency-toon-format/manifest

## Capabilities

- Encodes key-value objects, arrays, and uniform records using TOON syntax.
- Designs compact tabular layouts with explicit row counts and column names.
- Applies indentation, delimiter, quoting, and array-termination rules.
- Compares TOON with JSON to determine whether conversion is appropriate.
- Provides CLI and repair workflows for validating TOON files.

## Use Cases

- Compact Prompt Records: Convert repeated business records into a tabular TOON representation for lower prompt overhead.
- Build Documentation Indexes: Create compact indexes containing paths, summaries, priorities, and search terms for LLM retrieval.
- Validate Data Exports: Review generated TOON files for counts, indentation, delimiters, and termination before pipeline use.

## Prompt Templates

### Convert Simple Records

```
Convert these uniform records to TOON. Include explicit array counts, two-space row indentation, and a blank line after each table: [paste records]
```

### Choose TOON or JSON

```
Review this data structure and choose TOON or JSON. Explain the choice, then encode it when TOON is suitable: [paste structure]
```

### Repair Invalid TOON

```
Inspect this TOON text for count, indentation, comment, delimiter, multiline, and termination errors. Return corrected TOON and summarize each correction: [paste text]
```

### Optimize a Prompt Dataset

```
Redesign this dataset for compact TOON transport. Preserve every value, minimize repeated keys, identify lossy choices, and provide a validation checklist: [paste dataset]
```

## Limitations

- TOON is less suitable for deeply nested or irregular data.
- The skill does not provide the referenced repair scripts.
- Validation requires an external npm CLI that may need installation.
- Token savings vary with data shape and should not be treated as guaranteed.

## Best Practices

- Keep JSON as the canonical source and use TOON for LLM transport.
- Prefer tabular encoding for records that share a stable schema.
- Validate counts, indentation, delimiters, and blank-line termination before use.

## Anti Patterns

- Do not force deeply nested or irregular structures into TOON.
- Do not place commas inside tabular cells when they represent nested values.
- Do not run unpinned validators or repair scripts without reviewing and confirming execution.

## Security Audit

- Audited at: 2026-07-13T17:39:44.7\+00:00
- Summary: Most static findings are Markdown notation, data examples, documentation links, or harmless output redirection. Three findings confirm instructions to execute an unpinned npm CLI and local repair scripts, creating supply-chain and file-modification risks.

## Stats

- Views: 327
- Downloads: 10
- Favorites: 0
- Popularity score: 0
