ts-sdk-author

Configure TypeScript SDK packaging with dual ESM+CJS builds and npm release workflows.

92|8|Updated May 15, 2026
One-click install
npx skills add https://github.com/LonelyHerbivore/Trellis-Herbivore --skill ts-sdk-author
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ts-sdk-author
Source: https://github.com/LonelyHerbivore/Trellis-Herbivore/tree/main/.agents/skills/ts-sdk-author
Command: npx skills add https://github.com/LonelyHerbivore/Trellis-Herbivore --skill ts-sdk-author

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill turns a TypeScript library-from-scratch into a production-grade npm SDK by standardizing workspace layout, build output, module boundaries, verification, and a safe release lifecycle.

Core Features & Use Cases

  • Public API design with enforceable boundaries: Define what consumers can import via src/api re-exports and keep internal/ unexported.
  • Dual ESM+CJS packaging with correct declarations: Generate the right package.json#exports map for modern TypeScript and multiple runtimes.
  • Monorepo pipeline and release engineering: Integrate Turborepo caching, publint verification, attw type-resolution checks, changesets prerelease channels, and npm dist-tags.

Quick Start

Use this skill when you want to build a new npm-published TypeScript SDK package inside a pnpm monorepo, and ask the AI to produce the workspace layout, build config (tsdown or equivalent), exports map, verification steps, and changesets prerelease-to-stable flow for your package.

Frequently Asked Questions about ts-sdk-author

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure dual ESM and CJS build outputs for a TypeScript npm package?

To configure dual ESM and CJS build outputs for a TypeScript npm package, use a bundler like tsdown to generate separate output directories and emit .d.mts/.d.cts declaration files for multi-runtime consumers.

What is the best way to structure a TypeScript SDK public API in a pnpm monorepo?

The best way to structure a TypeScript SDK public API in a pnpm monorepo is to define enforceable module boundaries by re-exporting public interfaces from a dedicated `src/api` directory while keeping internal implementation files unexported.

How do I set up package.json exports for a TypeScript SDK with multiple runtime conditions?

Setting up package.json exports for a TypeScript SDK involves creating an export condition map that resolves dual ESM and CJS outputs and includes isomorphic runtime conditions for browser and Node.js environments.

How do I manage alpha, beta, and rc prerelease lifecycles for an npm package?

Managing alpha, beta, and rc prerelease lifecycles for an npm package requires using changesets to transition prerelease versions and applying npm dist-tags to isolate and distribute prerelease channels safely.

How do I verify TypeScript SDK packaging before publishing to npm?

To verify TypeScript SDK packaging before publishing to npm, wire publint for package.json exports validation and attw for type-resolution checks directly into the `prepublishOnly` npm script.

Can I use Turborepo pipelines for caching TypeScript SDK builds in a monorepo?

Yes, you can use Turborepo pipelines for caching TypeScript SDK builds in a monorepo by configuring the pipeline to cache tsdown bundling outputs, generation of .d.mts/.d.cts declarations, and package verification steps.