# Raintree Technology Claude Starter Toon Formatter

> TOON v2.0 Formatter

- Skill: `tuyv/raintree-technology-claude-starter-toon-formatter` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add tuyv/raintree-technology-claude-starter-toon-formatter`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tuyv/raintree-technology-claude-starter-toon-formatter/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tuyv (https://skillmd.com/u/tuyv)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tuyv/raintree-technology-claude-starter-toon-formatter

---


# TOON v2.0 Formatter

Use TOON when it materially reduces prompt size without making the payload harder to inspect or validate. It is strongest for large, mostly uniform arrays and weakest for small, nested, or irregular data.

## When to Use

**YES - Use automatically:**
- Arrays with ≥5 similar items
- Tables, logs, events, transactions, analytics
- API responses with ≥60% field uniformity
- Database results, metrics, benchmarks

**NO - Keep as JSON:**
- Small arrays (<5 items)
- Deeply nested or non-uniform data
- Narrative text, instructions

## Quick Reference

**Tabular** (uniform objects):
```
[3]{id,name,role}:
  1,Alice,admin
  2,Bob,user
  3,Carol,user
```

**Inline** (primitives ≤10):
```
tags[4]: js,react,node,api
```

**Delimiters:** comma (default), tab `[N\t]`, pipe `[N|]`

**Key folding** (nested objects):
```
server.host: localhost
server.port: 8080
```

## Runtime Options

```bash
# Claude installs include slash commands that call this wrapper:
node .claude/utils/toon/cli.mjs encode data.json

# With options:
node .claude/utils/toon/cli.mjs encode data.json --delimiter tab --no-key-folding

# Compare token savings:
node .claude/utils/toon/cli.mjs analyze data.json

# Decode TOON to JSON:
node .claude/utils/toon/cli.mjs decode data.toon
```

If the wrapper or slash commands are not installed in the target project, use an available `@toon-format/toon` CLI/library or convert manually from the spec and validate the result.

## Commands

- `/toon-encode <file>` - JSON to TOON
- `/toon-decode <file>` - TOON to JSON  
- `/toon-validate <file>` - Validate TOON
- `/analyze-tokens <file>` - Compare savings
- `/convert-to-toon <file>` - Full conversion workflow

## Documentation

- **Guide:** `references/toon-guide.md`
- **Spec:** https://github.com/toon-format/spec

