# toon-format

Encodes JSON data into compact TOON syntax to trim prompt tokens by roughly 40%. Helps agents format inputs efficiently for language models.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1300 installs · ★ 88
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/toon-format/SKILL.md
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/skills/toon-format

## What it does

TOON transforms standard JSON structures into a lighter textual representation. Nested maps use spacing similar to YAML, while arrays of matching records collapse into comma-separated rows under a single header. Repetitive keys disappear. Stripping repetitive field names and bracket syntax lowers token consumption by around 40%.

The skill guides your agent on using the `@toon-format/toon` package. Run `toon encode input.json` in the terminal to process files. The `--stats` flag outputs token savings. In TypeScript, scripts import `encode` and `decode` functions directly.

Language models need a brief explanation of TOON conventions in their system instructions. Without that primer, models misread tabular rows.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill toon-format -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/toon-format/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/toon-format/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill toon-format -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/toon-format/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill toon-format -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/toon-format/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/trending-skills toon-format
```

2. **Manually: put the files in place**
- File: `.github/skills/toon-format/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill toon-format -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/trending-skills --path skills/toon-format
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/toon-format/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill toon-format -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/toon-format/SKILL.md

## When to use it
- shrink token overhead when feeding large JSON datasets into LLM prompts
- serialize uniform object collections into tabular rows with shared headers
- convert JSON files to TOON via CLI using `toon encode`
- parse TOON strings back to JavaScript objects using `decode`

## Example prompts
- Convert users.json into TOON format and print token savings using --stats.
- Serialize this list of recent transactions into TOON notation for the prompt.
- Use encode from @toon-format/toon to structure the customer dataset.

## Similar
- [setup-matt-pocock-skills](https://affpapa.org/en/nevibecode/skills/setup-matt-pocock-skills.md) — skill · 1052851 installs
- [ask-matt](https://affpapa.org/en/nevibecode/skills/ask-matt.md) — skill · 766587 installs
- [to-tickets](https://affpapa.org/en/nevibecode/skills/to-tickets.md) — skill · 711230 installs
- [writing-plans](https://affpapa.org/en/nevibecode/skills/writing-plans.md) — skill · 282859 installs
- [caveman-review](https://affpapa.org/en/nevibecode/skills/caveman-review.md) — skill · 411800 installs
- [caveman-compress](https://affpapa.org/en/nevibecode/skills/caveman-compress.md) — skill · 411500 installs

From the same set: [reason-machines/trending-skills](https://affpapa.org/en/nevibecode/by/reason-machines/trending-skills.md) — 186 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
