plugins/typescript-expert/skills/ts-packaging/SKILL.md
Use when publishing a TypeScript library — exports map, JSR vs npm, dual ESM/CJS, type validation, provenance. Covers modern package.json, jsr.json, and release CI. Do NOT use for application deployment (not a library) or framework build pipelines (use the framework expert's skills).
npx skillsauth add fusengine/agents ts-packagingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ship a TypeScript library with a correct exports map, on the right registry.
Before ANY implementation, use TeamCreate to spawn 3 agents:
After implementation, run fuse-ai-pilot:sniper for validation.
| Registry | Format | Publishes | Best for |
|----------|--------|-----------|----------|
| JSR | ESM only | TS source directly | Deno/Node/Bun libs, doc-rich APIs |
| npm | ESM (or dual ESM/CJS) | Built .js + .d.ts | Broadest public reach, CJS consumers |
Rule of thumb: internal or Bun/Deno/ESM-only consumer → ESM-pure; broad public library still serving CommonJS → dual ESM/CJS.
"types" first, "default" last - Conditions match in object orderimport↔ESM and require↔CJS - Never point require at ESM"type": "module" explicitlyarethetypeswrong before every publishid-token: writePublishing a TS library?
├── Consumers on Deno/Bun/Node ESM, want source + docs → JSR (ESM only)
│ └── Fix "slow types" (explicit return/prop/const types)
└── Public npm audience
├── ESM-only consumers → ESM-pure package.json
└── Some consumers still on CJS → dual ESM/CJS exports
→ See references/exports-map.md for the conditions model
| Topic | Reference | Load when |
|-------|-----------|-----------|
| Exports map & conditions | references/exports-map.md | Writing the exports field |
| JSR publishing | references/jsr-publishing.md | Publishing TS source to JSR |
| npm publishing | references/npm-publishing.md | Publishing to npm (dual/ESM) |
| Type validation | references/validation.md | Checking types resolve correctly |
| Template | Use Case |
|----------|----------|
| references/templates/package-json-dual.md | Dual ESM/CJS + ESM-pure package.json |
| references/templates/jsr-json.md | jsr.json with multi-entry exports |
| references/templates/publish-workflow.md | GitHub Actions release with provenance |
{
"type": "module",
"exports": {
".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
}
}
npx @arethetypeswrong/cli --pack
→ See references/validation.md
"type" explicitly, even for CJS packagestypes in every conditional branch"default" before "types" (breaks type resolution)--allow-slow-types on JSR as a habit (degrades docs + npm compat)testing
Copy self-audit and ban-lists — filler verbs/hype adjectives, slop placeholder names, fake-precise numbers, Title Case headlines, humor in error copy ('Oops!'), em-dash crutch, one copy register per page.
development
Logged-in web apps — dashboards, auth flows, settings, onboarding, data tables, command palettes, modals, toasts. Register `product`: density and glance-speed over marketing polish, no hero/CTA-tricks, every data surface covers empty/loading/error explicitly, tables and dataviz follow preattentive-processing rules.
development
Marketing sites, landing pages, campaign pages — register `brand` (design IS the product). Structure comes from the register's POV + a macrostructure pick, never from copying an inspiration site's section flow. Hero discipline, deviated section order, asymmetric grids, and a silhouette lookalike-test gate before ship.
development
Token-strategy core — OKLCH color rules, neutral tinting, accent-commitment levels, type scale, 8pt spacing grid, touch targets, and the canonical output format of design-system.md (the file the harness gates on). This is routing step 1 of design-method/SKILL.md — read it before design-web/design-webapp/design-ios/design-android, before picking or auditing a single color/type/spacing value.