From nuxt-skills
Guides TypeScript library authoring: project setup, dual CJS/ESM package exports, tsdown/unbuild config, type-safe API design, advanced type patterns, vitest testing, and npm release workflows.
How this skill is triggered — by the user, by Claude, or both
Slash command
/nuxt-skills:ts-libraryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Patterns for authoring high-quality TypeScript libraries, extracted from studying unocss, shiki, unplugin, vite, vitest, vueuse, zod, trpc, drizzle-orm, and more.
build/tooling.mdpatterns/api.mdpatterns/types.mdreferences/api-design.mdreferences/build-tooling.mdreferences/ci-workflows.mdreferences/eslint-config.mdreferences/package-exports.mdreferences/project-setup.mdreferences/release.mdreferences/testing.mdreferences/type-patterns.mdreferences/typescript-config.mdsetup/exports.mdsetup/project.mdsetup/tsconfig.mdworkflows/ci.mdworkflows/release.mdworkflows/testing.mdPatterns for authoring high-quality TypeScript libraries, extracted from studying unocss, shiki, unplugin, vite, vitest, vueuse, zod, trpc, drizzle-orm, and more.
For Nuxt module development: use nuxt-modules skill
| Working on... | Load file |
|---|---|
| New project setup | references/project-setup.md |
| Package exports | references/package-exports.md |
| tsconfig options | references/typescript-config.md |
| Build configuration | references/build-tooling.md |
| ESLint config | references/eslint-config.md |
| API design patterns | references/api-design.md |
| Type inference tricks | references/type-patterns.md |
| Testing setup | references/testing.md |
| Release workflow | references/release.md |
| CI/CD setup | references/ci-workflows.md |
Consider loading these reference files based on your task:
DO NOT load all files at once. Load only what's relevant to your current task.
package.json exports → load references/package-exports.mdpnpm build && pnpm pack --dry-run — check output includes .mjs, .cjs, .d.ts// 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,
})
"type": "module" with .mjs outputsmoduleResolution: "Bundler" for modern TypeScriptsideEffects: falseToken efficiency: Main skill ~300 tokens, each reference ~800-1200 tokens
npx claudepluginhub onmax/nuxt-skills --plugin nuxt-skillsDevelops npm packages with Node.js and TypeScript: library setup, CLI tools, dual ESM/CJS exports, tsup/tsc builds, vitest testing, and versioning/dist-tag strategies.
Bundles TypeScript libraries with tsdown, providing dual ESM/CJS output, .d.ts declaration generation, and package validation. Useful when building or publishing npm packages.
TypeScript deep-dive skill covering type-level programming, performance optimization, monorepo patterns, and migration strategies. Also redirects to specialized subagents for bundler/module/type issues.