Toon format

From closedloop-ai/claude-plugins · View interactive version

Toon format is an AI agent skill from the GitHub repository closedloop-ai/claude-plugins. This skill should be used when writing or parsing TOON (Token-Oriented Object Notation) files. Triggers on .toon file operations, org-patterns.toon generation, or when converting between JSON and TOON formats. Provides syntax rules, quoting conventions, and examples for LLM-optimized data serializat

How to use this skill

Skill file

TOON Format (Token-Oriented Object Notation)

TOON is a compact, human-readable encoding of the JSON data model optimized for LLM prompts. It achieves ~40% token reduction compared to JSON while maintaining lossless round-trip compatibility.

Core Syntax Rules

Array Declaration

Arrays use bracketed headers with mandatory length count:

tags[3]: admin,ops,dev

Tabular Arrays (Uniform Object Arrays)

For arrays of objects with identical structure, use field headers in braces:

patterns[2]{id,category,summary}:
  P-001,pattern,"Use tokens for colors"
  P-002,mistake,"Check auth before routes"

Objects

Objects use indentation-based nesting (2 spaces per level):

user:
  id: 123
  name: Ada

Quoting Rules (Critical)

Strings MUST be quoted if they contain:

Escape sequences: \\, \", \n, \r, \t

org-patterns.toon Format

Standard format for ClosedLoop organization learnings:

patterns[N]{id,category,summary,confidence,seen_count,success_rate,flags,applies_to,context,repo}:
  P-001,pattern,"Summary here",high,5,0.85,,implementation-subagent,UI|styling,*
  P-002,mistake,"Check auth before routes",medium,3,0.60,[REVIEW],*,auth|routes,astoria-frontend

Field notes:

Validation Checklist

  1. Count matches actual rows/items
  2. Field count in rows matches declaration
  3. Strings needing quotes are quoted
  4. 2-space indentation (no tabs)
  5. No blank lines within array blocks

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.