skills/write-docs/write-docs/SKILL.md
Writing SDK documentation for tldraw. Use when creating new documentation articles, updating existing docs, or when documentation writing guidance is needed. Applies to docs in apps/docs/content/.
npx skillsauth add aiagentskills/skills write-docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write like a colleague walking someone through code they know well. Confident, casual, code-first.
Characteristic patterns:
Have five minutes? Run this command...
That's pretty much it!
Let's add local persistence by passing a
persistenceKeyprop...
Need to create some shapes? Use Editor#createShapes. Need to delete them? Use Editor#deleteShapes.
What makes it work:
State facts. Don't soften them.
// Good
The Editor class is the main way of controlling tldraw's editor.
// Bad
The Editor class can be used to control tldraw's editor.
Real tldraw docs are code-heavy. A section might be 20 lines of code with 2 sentences of explanation. Don't pad with prose.
These break trust instantly:
---
title: Feature name
status: published
author: steveruizok
date: 3/22/2023
order: 1
keywords:
- keyword1
- keyword2
---
Use [ClassName](?) or [ClassName#methodName](?) for API references:
The [Editor](?) class has many methods. Use [Editor#createShapes](?) to create shapes.
Use <FocusLines> to highlight specific lines:
<FocusLines lines={[2,6,10]}>
\`\`\`tsx
import { Tldraw } from 'tldraw'
import { useSyncDemo } from '@tldraw/sync'
\`\`\`
</FocusLines>
<Image
src="/images/api/events.png"
alt="A diagram showing an event being sent to the editor."
title="Caption text here."
/>
Use tables for listing methods, options, or properties:
| Method | Description |
| ------------------------ | ---------------------------------------------- |
| [Editor#screenToPage](?) | Convert a point in screen space to page space. |
| [Editor#pageToScreen](?) | Convert a point in page space to screen space. |
| Value | Description |
| --------- | ---------------------------------------------------- |
| `default` | Sets the initial zoom to 100%. |
| `fit-x` | The x axis will completely fill the viewport bounds. |
Show code early, explain around it. Don't build up to code with paragraphs of context.
// Good: Real shape, real values
editor.createShapes([
{
type: 'geo',
x: 0,
y: 0,
props: { geo: 'rectangle', w: 100, h: 100 },
},
])
// Bad: Placeholder nonsense
editor.createShape({ type: 'example-type', props: { prop1: 'value1' } })
Full components are fine when showing integration patterns:
export default function App() {
return (
<div style={{ position: 'fixed', inset: 0 }}>
<Tldraw persistenceKey="example" />
</div>
)
}
Minimal snippets when showing a single API:
editor.setFocusedGroup(groupId)
1-2 paragraphs establishing what and why before diving into how.
Start with the common case. Add complexity incrementally. Put edge cases later.
End sections with links to relevant examples:
> For an example of how to create custom shapes, see our [custom shapes example](/examples/shapes/tools/custom-shape).
Or in a section:
---
See the [tldraw repository](https://github.com/tldraw/tldraw/tree/main/apps/examples) for examples of how to use tldraw's Editor API.
documentation
Guides using bun.sys for system calls and file I/O in Zig. Use when implementing file operations instead of std.fs or std.posix.
development
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
development
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
development
Guides writing HMR/Dev Server tests in test/bake/. Use when creating or modifying dev server, hot reloading, or bundling tests.