From 7205de8cf6f5bb8abdb9b33d854f8ffa177fb3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morel=20Se=CC=81bastien?= Date: Thu, 1 Oct 2026 15:15:23 -0700 Subject: [PATCH] feat(skills): add content-json skill No skill described the rich text Content JSON format: the node tree (kind, type, textContent, children, metadata) that rich text components store, and that Claudette's documentation runs have to produce. New skill `content-json`: the block and inline node types with their HTML equivalents, the metadata Crystallize accepts (href, target, id), the nesting rules for lists and tables, and the strict rules a generated tree must follow (explicit `type`, formatting nodes wrap their text in children, no empty blocks). Copied unchanged from the backend documentation tool (crystallize/tools/documentation/.claude/skills/content-json), which Claudette replaces. --- README.md | 2 +- use-crystallize/skills/content-json/SKILL.md | 207 +++++++++++++++++++ 2 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 use-crystallize/skills/content-json/SKILL.md diff --git a/README.md b/README.md index 85c5d58..b3d3f00 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ bun type-check # TypeScript type checking Skills are plain markdown files in `use-crystallize/skills/` — no build step required. Each skill has a `SKILL.md` with YAML frontmatter and an optional `references/` directory with supporting docs. -Available skills: `bookable-resources`, `content-model`, `data-creation`, `information-architecture`, `js-api-client`, `mass-operations`, `mutation`, `payments`, `permissions`, `plugins`, `pricing`, `query`, `responsive-images`, `subscriptions`, `taxonomy`, `vector-ranking` — the directory itself is the authoritative list. +Available skills: `bookable-resources`, `content-json`, `content-model`, `data-creation`, `information-architecture`, `js-api-client`, `mass-operations`, `mutation`, `payments`, `permissions`, `plugins`, `pricing`, `query`, `responsive-images`, `subscriptions`, `taxonomy`, `vector-ranking` — the directory itself is the authoritative list. ## Using the Claude Plugin diff --git a/use-crystallize/skills/content-json/SKILL.md b/use-crystallize/skills/content-json/SKILL.md new file mode 100644 index 0000000..e3effd2 --- /dev/null +++ b/use-crystallize/skills/content-json/SKILL.md @@ -0,0 +1,207 @@ +--- +name: content-json +description: Generate Crystallize Rich Text Content JSON — the tree-based AST format used by Crystallize for structured rich text. Use this skill whenever the user needs to create, convert, or manipulate rich text content for Crystallize, including converting HTML/Markdown to Crystallize JSON, building content programmatically, or understanding the Content Transformer format. Also use when the user mentions "rich text JSON", "content nodes", "Crystallize content format", or needs to populate rich text components. +--- + +# Crystallize Rich Text Content JSON + +You are generating rich text content in the **Crystallize Content Transformer JSON** format — a tree of nodes representing structured rich text (similar to an AST). + +The output must be a **JSON array of block nodes** (or a single node object when used inline). + +## Node Structure + +Every node has these properties: + +| Property | Type | Required | Description | +|---------------|-----------------------|----------|-------------| +| `kind` | `"block"` or `"inline"` | yes | Block-level or inline | +| `type` | `string` or `null` | yes | Semantic content type (see tables below) | +| `textContent` | `string` | no | Raw text (leaf nodes only — mutually exclusive with `children`) | +| `children` | `node[]` | no | Child nodes (mutually exclusive with `textContent`) | +| `metadata` | `object` | no | Extra attributes (e.g. `{ "href": "..." }` for links, `{ "id": "..." }` for any element) | + +A node is either a **leaf** (has `textContent`) or a **branch** (has `children`). Never set both. + +## Block Node Types (`kind: "block"`) + +| `type` | HTML equivalent | Notes | +|-------------------|-----------------|-------| +| `"paragraph"` | `

` | Most common block type | +| `"heading1"` – `"heading6"` | `

` – `

` | | +| `"unordered-list"`| `