# write-example

Guides coding agents through creating SDK examples for tldraw, enforcing folder naming, frontmatter fields, and React component conventions.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 445 installs · ★ 51091
- Author: tldraw
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/tldraw/tldraw/tree/HEAD/skills/write-example/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/write-example

## What it does

The skill standardizes SDK demo creation within the `apps/examples/src/examples` directory. Each demo gets its own kebab-case folder housing a `README.md` with structured metadata, a PascalCase React component ending with `Example`, and an optional `.css` file. Titles must use sentence case rather than title case.

Inside the example file, the component requires a default export, a wrapper element with the `tldraw__editor` class, and the stylesheet import `tldraw/tldraw.css`. For interactive buttons, it dictates using the `TopPanel` slot alongside `TldrawUiButton` and the `useEditor` hook. Code notes follow a footnote pattern with numbered markers and detailed explanations at the bottom.

These rules depend strictly on tldraw's internal repository structure: applying them outside `apps/examples` will produce invalid import paths and broken metadata tags.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add tldraw/tldraw --skill write-example -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/write-example/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/write-example/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add tldraw/tldraw --skill write-example -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/write-example/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add tldraw/tldraw --skill write-example -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/write-example/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install tldraw/tldraw write-example
```

2. **Manually: put the files in place**
- File: `.github/skills/write-example/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add tldraw/tldraw --skill write-example -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/tldraw/tldraw --path skills/write-example
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/write-example/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add tldraw/tldraw --skill write-example -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/tldraw/tldraw/tree/HEAD/skills/write-example/SKILL.md

## When to use it
- scaffold a new tldraw SDK example matching repository conventions
- populate frontmatter fields with valid categories and search keywords
- build control panels using the TopPanel slot and TldrawUiButton
- document complex code patterns using numbered footnote comments

## Example prompts
- Create an editor API demonstration with zoom controls inside `apps/examples/src/examples/zoom-controls`.
- Generate the `README.md` and component boilerplate for a new custom shape example in `use-cases`.

## Similar
- [frontend-design](https://affpapa.org/en/nevibecode/skills/frontend-design.md) — skill · 1025790 installs
- [design-taste-frontend](https://affpapa.org/en/nevibecode/skills/design-taste-frontend.md) — skill · 678700 installs
- [prototype](https://affpapa.org/en/nevibecode/skills/prototype.md) — skill · 986201 installs
- [hyperframes](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes.md) — skill · 1200000 installs
- [hyperframes-cli](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes-cli.md) — skill · 1300000 installs
- [webapp-testing](https://affpapa.org/en/nevibecode/skills/webapp-testing.md) — skill · 186758 installs

From the same set: [tldraw/tldraw](https://affpapa.org/en/nevibecode/by/tldraw/tldraw.md) — 10 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
