toon-format
$
npx mdskill add closedloop-ai/claude-plugins/toon-formatGenerate compact TOON files for LLM-optimized data serialization.
- Reduces token usage by 40% while keeping JSON round-trip compatible.
- Handles .toon file operations and org-patterns.toon generation.
- Applies strict syntax rules for arrays, objects, and quoting.
- Delivers formatted output ready for direct LLM prompt ingestion.
SKILL.md
.github/skills/toon-formatView on GitHub ↗
---
name: toon-format
description: 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 serialization.
---
# 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:
```toon
tags[3]: admin,ops,dev
```
### Tabular Arrays (Uniform Object Arrays)
For arrays of objects with identical structure, use field headers in braces:
```toon
patterns[2]{id,category,summary}:
P-001,pattern,"Use tokens for colors"
P-002,mistake,"Check auth before routes"
```
- Field names declared once in `{...}` after the count
- Each row contains values in declared field order
- Rows indented with 2 spaces (NEVER tabs)
### Objects
Objects use indentation-based nesting (2 spaces per level):
```toon
user:
id: 123
name: Ada
```
## Quoting Rules (Critical)
Strings MUST be quoted if they contain:
- The active delimiter (comma by default)
- Empty string, leading/trailing whitespace
- Reserved literals (`true`, `false`, `null`)
- Numeric-like patterns
- Colons, quotes, backslashes, brackets, braces
- Control characters or leading hyphens
**Escape sequences:** `\\`, `\"`, `\n`, `\r`, `\t`
## org-patterns.toon Format
Standard format for ClosedLoop organization learnings:
```toon
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:**
- `summary` - **Always quoted** (contains natural language with commas)
- `flags` - `[REVIEW]`, `[STALE]`, `[UNTESTED]`, `[PRUNE]`, or empty
- `applies_to` - Pipe-separated agent names or `*` for all
- `context` - Pipe-separated tags
- `repo` - Repository name (derived from git remote basename) or `*` for all repos
## 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
- See `references/examples.md` for comprehensive examples
- [TOON Specification](https://github.com/toon-format/spec)
- [Reference Implementation](https://github.com/toon-format/toon)
More from closedloop-ai/claude-plugins
- artifact-type-tailored-contextCompresses artifacts for judge evaluation. Reads a single raw artifact, applies tiered summarization within a token budget, and returns compacted content with metadata. Isolation via forked context prevents pollution of agent context
- build-status-cache|
- closedloop-envProvides ClosedLoop environment paths (CLOSEDLOOP_WORKDIR, CLAUDE_PLUGIN_ROOT) to agents. This skill should be used by any agent that needs to access ClosedLoop run directories, plugin schemas, or other path-dependent resources.
- critic-cache|
- cross-repo-cache|
- decision-tableUse when the user wants a code-grounded decision table for current behavior, wants to compare current behavior against a plan or work item, or needs a control-flow artifact for recovery, retry, finalization, validation, state-machine, or review-heavy edge cases.
- eval-cache|
- extract-plan-md|
- find-plugin-fileThis skill should be used when needing to locate files within the Claude Code plugins cache directory (~/.claude/plugins/cache). Triggers include finding tool scripts, skill files, or any plugin resource when the hardcoded path is unknown or varies by plugin version. Use when slash commands or orchestrators need to dynamically resolve plugin file paths.
- learning-qualityStructured format for capturing high-quality learnings during ClosedLoop runs