Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
onmax avatar

Ts Library

  • 1.8k installs
  • 696 repo stars
  • Updated July 27, 2026
  • onmax/nuxt-skills

ts-library is an agent skill for Use when authoring TypeScript libraries or npm packages - covers project setup, package.json exports, build tooling tsdo

About

The ts-library skill Use when authoring TypeScript libraries or npm packages - covers project setup, package.json exports, build tooling tsdown/unbuild , API design patterns, type inference tricks, testing, and publishing to npm. Use when bundling, configuring dual CJS/ESM output, or setting up release workflows. It covers starting a new TypeScript library single or monorepo. Key workflows include setting up package.json exports for dual CJS/ESM. - Starting a new TypeScript library single or monorepo - Setting up package.json exports for dual CJS/ESM - Configuring tsconfig for library development - Choosing build tools tsdown, unbuild - Designing type-safe APIs builder, factory, plugin patterns - Writing advanced TypeScript types - Setting up vitest for library testing - Configuring release workflow and CI For Nuxt module development: use Developers invoke ts-library when the task matches the triggers and reference files in SKILL.md for grounded, stepwise execution.

  • Starting a new TypeScript library single or monorepo
  • Setting up package.json exports for dual CJS/ESM
  • Configuring tsconfig for library development
  • Choosing build tools tsdown, unbuild
  • Designing type-safe APIs builder, factory, plugin patterns

Ts Library by the numbers

  • 1,810 all-time installs (skills.sh)
  • +29 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #421 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

ts-library capabilities & compatibility

Capabilities
starting a new typescript library single or mono · setting up package.json exports for dual cjs/esm · configuring tsconfig for library development · choosing build tools tsdown, unbuild · designing type safe apis builder, factory, plugi
Use cases
documentation
From the docs

What ts-library says it does

Patterns for authoring high-quality TypeScript libraries, extracted from studying unocss, shiki, unplugin, vite, vitest, vueuse, zod, trpc, drizzle-orm, and more.
SKILL.md
npx skills add https://github.com/onmax/nuxt-skills --skill ts-library

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.8k
repo stars696
Security audit3 / 3 scanners passed
Last updatedJuly 27, 2026
Repositoryonmax/nuxt-skills

What problem does ts-library solve for developers using the documented workflows?

Use when authoring TypeScript libraries or npm packages - covers project setup, package.json exports, build tooling tsdown/unbuild , API design patterns, type inference tricks, testing, and publishing

Who is it for?

Developers working with ts-library patterns described in the skill documentation.

Skip if: Skip when docs are empty or the task is outside the skill documented scope.

When should I use this skill?

Use when Use when authoring TypeScript libraries or npm packages - covers project setup, package.json exports, build tooling tsdown/unbuild , API design patterns, type inference tricks, tes

What you get

Actionable ts-library guidance grounded in SKILL.md workflows and reference files.

  • package.json exports map
  • tsdown.config.ts
  • Vitest test harness

By the numbers

  • Bundles 10 on-demand reference files from setup through CI workflows
  • Patterns extracted from 9 named ecosystems including vitest, zod, and trpc

Files

SKILL.mdMarkdownGitHub ↗

TypeScript Library Development

Patterns for authoring high-quality TypeScript libraries, extracted from studying unocss, shiki, unplugin, vite, vitest, vueuse, zod, trpc, drizzle-orm, and more.

When to Use

  • Starting a new TypeScript library (single or monorepo)
  • Setting up package.json exports for dual CJS/ESM
  • Configuring tsconfig for library development
  • Choosing build tools (tsdown, unbuild)
  • Designing type-safe APIs (builder, factory, plugin patterns)
  • Writing advanced TypeScript types
  • Setting up vitest for library testing
  • Configuring release workflow and CI

For Nuxt module development: use nuxt-modules skill

Quick Reference

Working on...Load file
New project setupreferences/project-setup.md
Package exportsreferences/package-exports.md
tsconfig optionsreferences/typescript-config.md
Build configurationreferences/build-tooling.md
ESLint configreferences/eslint-config.md
API design patternsreferences/api-design.md
Type inference tricksreferences/type-patterns.md
Testing setupreferences/testing.md
Release workflowreferences/release.md
CI/CD setupreferences/ci-workflows.md

Loading Files

Consider loading these reference files based on your task:

  • [ ] references/project-setup.md - if starting a new TypeScript library project
  • [ ] references/package-exports.md - if configuring package.json exports or dual CJS/ESM
  • [ ] references/typescript-config.md - if setting up or modifying tsconfig.json
  • [ ] references/build-tooling.md - if configuring tsdown, unbuild, or build scripts
  • [ ] references/eslint-config.md - if setting up ESLint for library development
  • [ ] references/api-design.md - if designing public APIs, builder patterns, or plugin systems
  • [ ] references/type-patterns.md - if working with advanced TypeScript types or type inference
  • [ ] references/testing.md - if setting up vitest or writing tests for library code
  • [ ] references/release.md - if configuring release workflow or versioning
  • [ ] references/ci-workflows.md - if setting up GitHub Actions or CI/CD pipelines

DO NOT load all files at once. Load only what's relevant to your current task.

New Library Workflow

1. Create project structure → load references/project-setup.md 2. Configure package.json exports → load references/package-exports.md 3. Set up build with tsdown → load references/build-tooling.md 4. Verify build: pnpm build && pnpm pack --dry-run — check output includes .mjs, .cjs, .d.ts 5. Add tests → load references/testing.md 6. Configure release → load references/release.md

Quick Start

// package.json (minimal)
{
  "name": "my-lib",
  "type": "module",
  "exports": {
    ".": {
      "import": "./dist/index.mjs",
      "require": "./dist/index.cjs"
    }
  },
  "main": "./dist/index.cjs",
  "module": "./dist/index.mjs",
  "types": "./dist/index.d.ts",
  "files": ["dist"]
}
// tsdown.config.ts
import { defineConfig } from 'tsdown'

export default defineConfig({
  entry: ['src/index.ts'],
  format: ['esm', 'cjs'],
  dts: true,
})

Key Principles

  • ESM-first: "type": "module" with .mjs outputs
  • Dual format: always support both CJS and ESM consumers
  • moduleResolution: "Bundler" for modern TypeScript
  • tsdown for most builds, unbuild for complex cases
  • Smart defaults: detect environment, don't force config
  • Tree-shakeable: lazy getters, proper sideEffects: false

_Token efficiency: Main skill ~300 tokens, each reference ~800-1200 tokens_

Related skills

How it compares

Use ts-library when package.json exports and dual-format dist layout matter, not just tsconfig strictness tweaks.

FAQ

Who is ts-library for?

Developers and software engineers working with ts-library patterns described in the skill documentation.

When should I use ts-library?

When Use when authoring TypeScript libraries or npm packages - covers project setup, package.json exports, build tooling tsdown/unbuild , API design patterns, type inference tricks, tes.

Is ts-library safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.