# Ts Sdk Author

Design, build, verify, and publish production-grade TypeScript SDKs as npm packages...

- Repository: https://github.com/mindfold-ai/Trellis (15078 stars)
- Category: Design
- License: MIT
- Last updated: 2026-09-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add mindfold-ai/Trellis --skill ts-sdk-author -g -a claude-code -y`
Codex: `npx skills add mindfold-ai/Trellis --skill ts-sdk-author -g -a codex -y`
Cursor: `npx skills add mindfold-ai/Trellis --skill ts-sdk-author -g -a cursor -y`
Gemini CLI: `npx skills add mindfold-ai/Trellis --skill ts-sdk-author -g -a gemini-cli -y`

## Description

Design, build, verify, and publish production-grade TypeScript SDKs as npm packages inside a pnpm monorepo. Covers workspace layout, public API and module boundaries, plugin extension points, branded types and library-tuned tsconfig, tsdown bundling (vs tsup/tsc-only/unbuild), package.json exports with dual ESM+CJS and isomorphic conditions (browser/workers/RN/deno), Turborepo pipelines, publint and @arethetypeswrong/cli verification, changesets pre-release mode, npm dist-tags (latest/next/beta/rc/canary), and the alpha→beta→rc→stable release lifecycle. Triggers on: build a TS SDK, extract core library, package.json exports, dual ESM CJS, tsdown config, tsup vs tsdown, publint, attw, changesets prerelease, npm dist-tag, beta to rc, canary release, pnpm workspace SDK, isomorphic SDK, tsconfig library, npm provenance, shipping a TypeScript library.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# TypeScript SDK Author

End-to-end workflow for shipping a TypeScript SDK as a standalone npm package
from inside a pnpm monorepo: workspace layout, public API design, build
configuration, distribution shape, monorepo pipeline, verification, and the
full release lifecycle including beta / rc / canary channels.

The seven references hold the depth. This file is the unified workflow plus
a quick-reference for the patterns you reach for daily.

---

## When to Use This Skill

- Extracting a core library (e.g. `packages/core`, `packages/sdk`) out of an
  existing CLI or app inside a pnpm workspace
- Designing the public API surface of a TypeScript library that strangers will
  consume, branded types, generic clients, plugin extension points
- Choosing a build tool, tsdown vs tsup vs tsc-only vs unbuild
- Authoring the `package.json` `exports` field with dual ESM+CJS, isomorphic
  runtime conditions, and subpath plugin entries
- Configuring Turborepo so the SDK rebuilds only when its inputs change and
  downstream apps consume the SDK's build output (or raw `src` via a custom
  condition)
- Wiring `publint --strict` and `attw --pack` into `prepublishOnly` or CI
- Managing pre-release channels, `canary` per commit, `next` for the upcoming
  major, `beta` / `rc` for stabilization, `latest` for stable, and the
  transitions between them (`beta.N` → `rc.0` → `1.0.0` → `1.1.0-beta.0`)
- Setting up changesets with GitHub Actions `changesets/action@v1` plus
  npm provenance

---

## Execution Workflow

A single TS SDK build flows through these seven phases. Skip any phase and
something will break later, the dependencies between phases are real.

### Phase 1, Workspace & Package Skeleton

Lay down the monorepo and create the empty SDK package.

Core moves:

The rest: https://github.com/mindfold-ai/Trellis/blob/HEAD/.agents/skills/ts-sdk-author/SKILL.md
