Skip to content

Commit 7ea68e5

Browse files
authored
chore(skills): tldraw-migrate sources release notes from github (tldraw#8779)
In order to keep the tldraw-migrate skill's release-notes view aligned with what's actually on `main`, this PR switches the changelog source from `tldraw.dev/llms-releases.txt` to GitHub's `apps/docs/content/releases/` directory. A few smaller improvements ride along to make the skill easier to distribute across agents. Previously the skill `curl`'d the published `llms-releases.txt` from tldraw.dev, which meant pre-release notes (`next.mdx`) and recently merged but unpublished release-note edits were invisible to the migration workflow. The skill now lists `apps/docs/content/releases/` via the GitHub contents API and fetches each `.mdx` directly from `raw.githubusercontent.com`. GitHub is the source of truth. Other changes: - Pre-release semver suffixes (e.g. `4.7.0-canary.abc`) are now preserved in `detect-versions.mjs` and compared correctly in the new fetcher, so a user on a canary gets the right version range and the upcoming `next.mdx` content. - The `${SKILL_DIR}` probe gained `.codex/skills/`. - Removed `disable-model-invocation: true` from the frontmatter so any agent that respects skill metadata can auto-invoke after copying. - Added a one-line cross-agent note above the auto-fetch blocks for agents that don't auto-run Claude Code's `!`-prefix syntax (Cursor, Codex, plain Claude API, etc.). - Replaced `filter-changelog.mjs` with `fetch-release-notes.mjs` (filtering happens at fetch time). The motivation is partly to support distributing the skill via a one-shot prompt — "copy `skills/tldraw-migrate` from this repo into your repo and follow it" — across different coding agents. ### Change type - [x] `improvement` ### Test plan 1. From a project on tldraw 4.4.0, run `/tldraw-migrate` — should fetch v4.5.0 notes from GitHub and skip `next.mdx` (stable target). 2. From a project on a pre-release like `4.7.0-canary.abc` with target `canary`, run `/tldraw-migrate` — should fetch `next.mdx` into `references/tldraw-next.mdx`. 3. Pin a stable upper bound: `node skills/tldraw-migrate/fetch-release-notes.mjs 4.0.0 4.2.0` — should include v4.1.0 and v4.2.0 only. 4. Place the skill folder under each of `.claude/skills/`, `.agents/skills/`, `.codex/skills/`, `.cursor/skills/`, `skills/` — auto-fetch blocks resolve `SKILL_DIR` correctly in each case.
1 parent a02e41a commit 7ea68e5

5 files changed

Lines changed: 280 additions & 93 deletions

File tree

skills/tldraw-migrate/README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# tldraw-migrate skill
2+
3+
> Note: Are you human? You should probably not be. Pass a link to this file to your agent of choice and have them take it from here.
4+
5+
A portable agent skill that walks an AI coding agent through upgrading a project to a newer version of the tldraw SDK.
6+
7+
This README documents distribution and installation. The skill itself lives in [`SKILL.md`](./SKILL.md).
8+
9+
## Distribution
10+
11+
The canonical source of truth is `skills/tldraw-migrate/` on `main` in the [tldraw monorepo](https://github.com/tldraw/tldraw). Distribute the skill by copying the entire folder into the agent-skills directory of the project being migrated. The skill is self-contained — `SKILL.md`, the three `.mjs` helpers, and a `references/` cache.
12+
13+
### Where to install
14+
15+
Copy `skills/tldraw-migrate/` into one of the following paths in the target project. The skill probes them in this order and uses the first one it finds:
16+
17+
| Path | Harness |
18+
| --- | --- |
19+
| `.claude/skills/tldraw-migrate/` | Claude Code |
20+
| `.agents/skills/tldraw-migrate/` | Generic / open agent-skills spec |
21+
| `.codex/skills/tldraw-migrate/` | OpenAI Codex |
22+
| `.cursor/skills/tldraw-migrate/` | Cursor |
23+
| `skills/tldraw-migrate/` | Fallback / vendored alongside source |
24+
25+
If multiple harnesses share a project, install once and symlink the others to the same folder (this is what the tldraw monorepo itself does — see `AGENTS.md`).
26+
27+
### One-shot install from GitHub
28+
29+
```sh
30+
DEST=.claude/skills/tldraw-migrate # or .agents/skills/tldraw-migrate, .cursor/skills/tldraw-migrate, etc.
31+
mkdir -p "$DEST"
32+
curl -fsSL https://github.com/tldraw/tldraw/archive/refs/heads/main.tar.gz \
33+
| tar -xz --strip-components=3 -C "$DEST" tldraw-main/skills/tldraw-migrate
34+
```
35+
36+
### Updating an installed copy
37+
38+
The skill changes whenever migration patterns shift in the SDK (new error categories, new helpers, edge-case fixes). Re-run the one-shot install command above to overwrite `SKILL.md` and the helper scripts, or pull the latest from `tldraw/tldraw` main. The skill's *content* — release notes and docs — is auto-refreshed on every invocation, so updating `SKILL.md` itself is only needed when the workflow changes.
39+
40+
### Skill-location override
41+
42+
If the skill is installed somewhere outside the probed locations, export `SKILL_DIR` before invocation:
43+
44+
```sh
45+
SKILL_DIR=/abs/path/to/tldraw-migrate
46+
```
47+
48+
The auto-fetch blocks and all internal grep examples honor this variable.
49+
50+
## Requirements
51+
52+
- **Node ≥ 20** for the three helper scripts (`detect-versions.mjs`, `detect-target.mjs`, `fetch-release-notes.mjs`). No npm dependencies — they are zero-dep ES modules.
53+
- **`curl`** for the docs fetch.
54+
- **`git`** is optional but improves from-version detection (the skill compares `main`, `HEAD~1`, and the working tree).
55+
- **`GITHUB_TOKEN`** env var is optional; setting it raises the unauthenticated GitHub API rate limit (60/hr) so re-runs and long version ranges don't fail.
56+
57+
## What gets fetched on invocation
58+
59+
The skill writes three files into `references/` at run time. None of them is committed to the skill's source — they are recreated on demand.
60+
61+
| File | Source | When fetched |
62+
| --- | --- | --- |
63+
| `tldraw-releases.txt` | `github.com/tldraw/tldraw``apps/docs/content/releases/v*.mdx`, filtered to versions strictly greater than the detected from-version | Always |
64+
| `tldraw-full-docs.txt` | `tldraw.dev/llms-full.txt` | Cached locally, 30-day TTL — delete the file or wait 30 days to refresh |
65+
| `tldraw-next.mdx` | `github.com/tldraw/tldraw``apps/docs/content/releases/next.mdx` | Pre-release targets only (`canary`, `next`, `beta`, or pre-release semver) |
66+
67+
GitHub is the source of truth, deliberately. `next.mdx` does not exist on npm, and tldraw.dev can lag behind main. This means migration recipes for unreleased versions are available to the skill the moment they land in `main`.
68+
69+
## Harness compatibility
70+
71+
The `!`-prefix bash blocks at the top of `SKILL.md` are written for Claude Code's auto-execute syntax. Other harnesses (Cursor, Codex, plain Claude API, etc.) must run each block as a shell command before continuing the workflow. The skill flags this explicitly at the top of the resources section.
72+
73+
For agent harnesses without slash-command support, the skill still works as a plain workflow document — point the agent at `SKILL.md` and the same step-by-step process applies.
74+
75+
## Files in this folder
76+
77+
- `SKILL.md` — the skill workflow itself
78+
- `detect-versions.mjs` — resolves the from-version (explicit arg → `main``HEAD~1` → working tree)
79+
- `detect-target.mjs` — resolves the target version (default `latest`; accepts a dist-tag or semver)
80+
- `fetch-release-notes.mjs` — pulls release notes between two versions from `tldraw/tldraw` main
81+
- `references/` — auto-populated cache of fetched references (gitignored or freshly recreated)
82+
- `README.md` — this file

0 commit comments

Comments
 (0)