TOON Adoption Skill
Description
Efficiently parse, generate, and store data using Token-Oriented Object Notation (TOON). TOON is designed for LLMs as a lossless, drop-in representation of JSON data that reduces token usage by approximately 40% through indentation, minimal quoting, and tabular layouts.
TOON Syntax Rules
1. Indentation-based Nesting
- Use 2-space indentation to define hierarchy, similar to YAML.
- Avoid curly braces
{} and square brackets [] for nesting unless defining a tabular schema.
2. Minimal Quoting
- Keys and values do not require quotes unless they contain commas or significant leading/trailing whitespace.
3. Explicit Array Lengths
- Declare the number of items in an array using the
[N] notation (e.g., friends[3]).
4. Tabular Arrays (Arrays of Objects)
- For uniform arrays of objects, use the format:
key[N]{field1,field2,...}:.
- List the field names once in the header, followed by rows of values separated by commas.
5. Encoding
Guidelines for Agent Use
- Storage: Prioritize
.toon files for logs, schedules, and long-term data tracking.
- Context Compression: When summarizing history or notes, use TOON to fit more information into the context window.
- Parsing: Interpret indentation as nested object levels and CSV rows as objects matching the header schema.
Example Document
metadata:
name: Sample Configuration
format: TOON
efficiency_gain: 0.4
goals[3]{id,title,category}:
1,Lose weight,health
2,Increase self-esteem,personal
3,Get out of loneliness,social
1---
2name: toon-adoption
3description: Optimize token usage by adopting the compact TOON format for data storage and context.
4version: 1.0.0
5author: Agent Zero Community
6tags: [token-optimization, toon, format, efficiency]
7metadata:
8 source: https://skillmd.com/skills/modbender/toon-adoption
9---
10
11# TOON Adoption Skill
12
13## Description
14Efficiently parse, generate, and store data using Token-Oriented Object Notation (TOON). TOON is designed for LLMs as a lossless, drop-in representation of JSON data that reduces token usage by approximately 40% through indentation, minimal quoting, and tabular layouts.
15
16## TOON Syntax Rules
17
18### 1. Indentation-based Nesting
19- Use 2-space indentation to define hierarchy, similar to YAML.
20- Avoid curly braces `{}` and square brackets `[]` for nesting unless defining a tabular schema.
21
22### 2. Minimal Quoting
23- Keys and values do not require quotes unless they contain commas or significant leading/trailing whitespace.
24
25### 3. Explicit Array Lengths
26- Declare the number of items in an array using the `[N]` notation (e.g., `friends[3]`).
27
28### 4. Tabular Arrays (Arrays of Objects)
29- For uniform arrays of objects, use the format: `key[N]{field1,field2,...}:`.
30- List the field names once in the header, followed by rows of values separated by commas.
31
32### 5. Encoding
33- Always use UTF-8.
34
35## Guidelines for Agent Use
361. **Storage**: Prioritize `.toon` files for logs, schedules, and long-term data tracking.
372. **Context Compression**: When summarizing history or notes, use TOON to fit more information into the context window.
383. **Parsing**: Interpret indentation as nested object levels and CSV rows as objects matching the header schema.
39
40## Example Document
41```toon
42metadata:
43 name: Sample Configuration
44 format: TOON
45 efficiency_gain: 0.4
46goals[3]{id,title,category}:
47 1,Lose weight,health
48 2,Increase self-esteem,personal
49 3,Get out of loneliness,social
50```