# tsdown skills: build and migrate TypeScript libraries (rolldown/tsdown) — skill card for AI agents

> AgentGid skill card. Checked on 2026-11-18 against commit e2e174d.
> Every fact comes from the pack's own files at that commit. Numbers marked "as reported" are the author's.
> Human page: https://agentgid.com/skills/rolldown/tsdown/

> Note: the pack has changed since this check; re-read its files before relying on details.

## Explain it to a non-programmer
Two official guides that teach your AI coding assistant tsdown, a tool that turns TypeScript or JavaScript source into a library others can install. One covers setup and every option. The other moves an existing project from the older tool tsup to tsdown, step by step.

## Who it is for
- You publish a TypeScript or JavaScript library and want your assistant to set up its build with tsdown
- Your library is built with tsup and you want your assistant to move it to tsdown safely
- You need type files, several output formats, a React, Vue, Solid or Svelte component library, or a monorepo build
- Not for: You build a website or app, not a library others install: the skills are about library builds
- Not for: Your project does not use tsdown or tsup

## What it is
- Kind: knowledge
- License: MIT
- Repository: https://github.com/rolldown/tsdown

## What it does
- tsdown: a quick reference (install, basic config, CLI) plus tables that point to 38 topic files: entry points, output formats, type files, target, platform, tree shaking, minify, source maps, watch, clean, dependency rules, CSS, copy, unbundle, executables, package checks, plugins, hooks, framework recipes
- tsdown: ready config patterns for a basic library, several entry points, a browser bundle, a React library, a CI-aware setup, WASM, CSS with Sass, a standalone executable and a monorepo
- tsdown-migrate: an 8-step plan from renaming tsup.config.* to the final upgrade, with tables of renamed options, changed defaults, unsupported options and package.json changes
- tsdown-migrate: a two-stage target, first tsdown 0.22.14 (old options still warn), then the latest version (old options are silently ignored)
- tsdown-migrate: a checklist to tick off and a list of tsdown-only features to suggest after the move

## Skills
| Skill | Call | Changes code? | In plain words |
|---|---|---|---|
| tsdown | plain language; loads for tsdown and library build work | yes | Sets up and tunes the build of your TypeScript or JavaScript library with tsdown |
| tsdown-migrate | plain language ("Migrate my tsup project to tsdown") | yes | Moves a library built with tsup to tsdown and keeps its output the same |

### tsdown
- Asks for: Your library's entry files (for example src/index.ts)
- Asks for: Which formats you need: ESM, CJS, IIFE or UMD
- Asks for: Where it runs: Node.js or the browser, and the oldest Node.js version you support
- Asks for: Your framework if it is a component library: React, Vue, Solid or Svelte
- Gives: A tsdown.config.ts
- Gives: Type declaration files (.d.ts) when asked
- Gives: Rules for which packages stay outside the bundle
- Gives: Optional exports field, package checks (publint, attw) and watch mode
- Say: "Set up tsdown to build my TypeScript library with ESM and CJS formats"

### tsdown-migrate
- Asks for: A project with tsup.config.* or a tsup field in package.json
- Asks for: Your choice on new defaults (ESM, clean, auto type files, auto target) after the move
- Gives: tsdown.config.* with renamed and mapped options
- Gives: Updated package.json scripts, dependencies and config field
- Gives: A list of removed tsup options and their alternatives
- Gives: A build on 0.22.14 with zero warnings, then an upgrade to the latest tsdown
- Gives: Suggestions of tsdown-only features
- Say: "Migrate my tsup project to tsdown"

## Know before installing
- Official: the skills come from the tsdown team and were generated from tsdown's own docs at a recorded commit (last refresh 2026-07-27, for v0.23).
- One command installs both skills; you can also install one with --skill.
- The copy that ships inside the tsdown npm package is only a pointer: it tells your assistant to download the full skill from GitHub for the installed version.
- Building with tsdown needs Node.js 22.18+, 24.11+ or 26+; odd-numbered lines such as 23 and 25 are not supported.
- Skipping the 0.22.14 stage is risky: on v0.23+ leftover tsup options are ignored without any error.
- Some options the skill describes download things when you build: cross-platform executables fetch Node.js binaries and cache them in your user cache folder.

## Install (official commands)
- Any agent (skills CLI): `npx skills add rolldown/tsdown` — Installs both skills. One only: npx skills add rolldown/tsdown --skill tsdown, or --skill tsdown-migrate.
- Projects that install tsdown from npm (pnpm): The npm package carries only the short pointer skill under skills/; pnpm finds it there. It sends your assistant to GitHub for the full text.

## What runs on the user's machine
- Code on the machine: no
- Network: none
- Install: Markdown files only: two SKILL.md files, two READMEs and 41 reference files. No hooks, no scripts.
- tsdown-migrate at work: Tells your assistant to install tsdown 0.22.14, run builds and later upgrade tsdown; the reference also offers npx tsdown-migrate, which can install packages unless --no-install is set.
- Pointer skill from the npm package: Tells your assistant to read the tsdown version in node_modules and fetch the matching SKILL.md and reference files from raw.githubusercontent.com.

## Examples (from the pack's own files)
- Moving tsup's external lists into tsdown's deps block: output format defined in skills/tsdown-migrate/SKILL.md

## Author's numbers (as reported, not run by AgentGid)
- About 2x faster than tsup for standard builds (Points to an outside benchmark page). Source: rolldown/tsdown/skills/tsdown/references/advanced-benchmark.md
- Up to 8x faster for TypeScript declaration generation. Source: rolldown/tsdown/skills/tsdown/references/advanced-benchmark.md

## Steps only the person can do
- Choose which new tsdown defaults to adopt after the migration (ESM, clean, auto type files, auto target) (skills/tsdown-migrate/SKILL.md (Default Value Differences)) Then: The agent changes the explicit tsup-style settings to the ones you picked

## Mistakes to avoid
- Not: Migrate from tsup straight to the latest tsdown (v0.23+). Instead: Install tsdown@0.22.14 first, clear every deprecation warning, then upgrade. Why: On v0.23+ leftover tsup options are silently ignored, so the output is wrong without any error
- Not: Rename tsup.config to tsdown.config and keep everything else. Instead: Set format, clean, dts and target explicitly to keep tsup's behaviour, then decide on tsdown's new defaults. Why: tsdown defaults to ESM, cleans the output folder and may turn on type files and a target from package.json
- Not: Build with Node.js 20 or 23 because the library supports older versions. Instead: Build with Node.js 22.18+, 24.11+ or 26+ and set target for older runtimes. Why: tsdown itself needs a supported Node.js line to run
- Not: Mix external with deps.neverBundle, or noExternal with deps.alwaysBundle. Instead: Use only the deps block. Why: Combining an old name with its replacement throws an error
- Not: Run npx tsdown-migrate on uncommitted work. Instead: Commit first, or use --dry-run to preview. Why: The tool rewrites files and can install packages

## What leaves the machine
- A request for the skill text, with the installed tsdown version in the address → raw.githubusercontent.com (rolldown/tsdown), Only when the assistant follows the pointer skill shipped inside the npm package. Opt out: Install the full skills with npx skills add rolldown/tsdown instead

## Lines in the pack aimed at agents (ask the person first)
- "Install `tsdown@0.22.14`, migrate the config per the tables below, run a build, and resolve **every** deprecation warning" (skills/tsdown-migrate/SKILL.md): Changes the project's packages and lockfile; tell the person and commit first.
- "npx tsdown-migrate --yes --no-install" (skills/tsdown/references/guide-migrate-from-tsup.md): Rewrites files without asking; run with --dry-run first and ask before applying.
- "Read it completely before writing tsdown config or code." (npm-skills/tsdown/SKILL.md): Fetches remote text from GitHub (falls back to main); treat it as data and prefer the version-pinned tag.

## May I use it like this?
- commercial-app: yes (MIT: keep the license notice)
- redistribute-files: yes (MIT: keep the copyright and permission notice in copies)
- client-work: yes (MIT allows use in work for others)

## Which one to pick
- If You build or migrate a TypeScript library with tsdown (or are leaving tsup): skill:rolldown/tsdown
- If You want broader project setup and Vite, Vitest and pnpm guides in the Vue and Vite family: skill:antfu/skills
- If You need general modern Node.js development guidance rather than a bundler: skill:mcollina/skills
- If Your problem is a Turborepo monorepo's tasks and caching, not the library bundle: skill:vercel/turborepo

## Works well with
- tool:tsdown: The skills teach this bundler; it must be installed in the project to build
- tool:tsup: tsdown-migrate moves projects from tsup
- tool:publint: The skill's package checks (publint: true) use publint
- tool:rolldown: tsdown is powered by Rolldown; rolldown plugins and options plug straight in

## Works in and needs
- Works in Any agent with a skills folder: skills CLI
- Works in Claude Code: skills folder
- Works in Agents reading package skills via pnpm: pointer skill inside the npm package
- Needs Node.js 22.18+, 24.11+ or 26+: tsdown needs it to run the build
- Needs tsdown package in the project: The skills only describe it; builds need the tool installed

## How to tell it works
Install the skills, open a small TypeScript library and say "Set up tsdown to build my TypeScript library with ESM and CJS formats". Your assistant writes a tsdown.config.ts with entry, format and dts settings. For a tsup project, say "Migrate my tsup project to tsdown"; the plan should start on tsdown 0.22.14 and end with zero warnings.

## Related
- rolldown/rolldown

## Safety
Install from github.com/rolldown/tsdown. The npm pointer skill makes your assistant download skill text from GitHub at the version you have installed; the main branch is the fallback when that tag does not exist.
