TypeScript Library taste — Claude & Claude.ai prompt: TS library
A prompt that pins down conventions for a TypeScript library: pnpm, strict tsconfig, tsup, vitest, Changesets. Useful when a project needs one style from the first commit.
Open on GitHubWhat TypeScript Library taste does
This is a prompt listing default choices for a TypeScript library. Each rule carries a confidence score: pnpm as the package manager and strict mode with noUncheckedIndexedAccess in tsconfig sit at 0.95, while building with tsup to emit both ESM and CJS plus .d.ts files sits at 0.90. The low scores matter too. Biome instead of ESLint plus Prettier is 0.70, and publishing with npm provenance from GitHub Actions is 0.75 — the author flags where a rule is debatable.
Packaging and tests come next. The exports map goes into package.json rather than leaning on main, the package is marked "sideEffects": false for tree shaking, and runtime dependencies stay near zero. Tests run on vitest with *.test.ts files kept next to the source. Changesets handles versioning and changelogs, versions start at 0.1.0 and follow semver strictly once stable. Named exports beat default exports, and types come in through import type.
Untrusted input gets validated with zod, with types inferred from the schemas. Before every release, CI runs publint and arethetypeswrong — skip that and a broken exports map ships to npm, which is reason enough to keep the step. The README stays short: an install line, a minimal example, an API table. The prompt targets Claude and Claude.ai and ships no installable file, so you paste the text into a chat as a system instruction or an opening message.
What it helps with
- set one convention set for a new TypeScript library
- configure strict mode and noUncheckedIndexedAccess in tsconfig
- build ESM and CJS with tsup plus .d.ts output
- check the exports map before publishing to npm
- move a project off ESLint and Prettier onto Biome
Example prompts for the agent
- Apply these rules and scaffold a new TypeScript package for me
- Check my package.json and tsconfig against these rules and list the gaps
- Build the library with tsup and add vitest and Changesets following these rules
How to install TypeScript Library taste
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about TypeScript Library taste
How do I install TypeScript Library taste in Claude?
There is no install command: you paste the prompt text into a Claude chat as a system instruction or an opening message.
What does TypeScript Library taste do?
It sets default choices for a TypeScript library: pnpm, a strict tsconfig, tsup, vitest, Changesets, zod, and publint plus arethetypeswrong in CI.
What do the confidence scores mean?
Each rule carries a number between 0.70 and 0.95. A low value, such as 0.70 for Biome over ESLint and Prettier, signals a debatable rule worth discussing.
Source text
prompts.csv · CC0-1.0
# TypeScript library taste - Use pnpm as the package manager. Confidence: 0.95 - Enable strict mode and noUncheckedIndexedAccess in tsconfig. Confidence: 0.95 - Build with tsup and emit both ESM and CJS with .d.ts files. Confidence: 0.90 - Declare the exports map in package.json instead of relying on main. Confidence: 0.90 - Test with vitest and keep tests next to source as *.test.ts. Confidence: 0.90 - Use Changesets for versioning and changelogs. Confidence: 0.85 - Lint and format with Biome instead of ESLint plus Prettier. Confidence: 0.70 - Keep runtime dependencies at zero where practical. Confidence: 0.85 - Mark the package with "sideEffects": false to enable tree shaking. Confidence: 0.85 - Prefer named exports over default exports. Confidence: 0.90 - Validate untrusted input with zod and infer types from the schemas. Confidence: 0.80 - Run publint and arethetypeswrong in CI before every release. Confidence: 0.80 - Use type-only imports (import type) for types. Confidence: 0.85 - Publish with npm provenance enabled from GitHub Actions. Confidence: 0.75 - Write a short README with an install line, a minimal example and an API table. Confidence: 0.90 - Start versions at 0.1.0 and follow semver strictly once stable. Confidence: 0.70
© f · CC0-1.0 · f/prompts.chat