A modern, AI-ready TypeScript library template.
- ⚡ Ultra-fast formatting, linting, and bundling with the oxc toolchain
- 🤖 AGENTS.md support for AI-assisted development
- 🔁 Claude Code hooks for automated linting on stop
- 📦 Automatic release previews on every PR with pkg.pr.new
- 🚀 One-command interactive release with changelog generation
- 🏷️ Better GitHub labels and repo settings out of the box
- Fork or clone this repository
- Follow the Migration Checklist below to customize it for your library
- Replace
src/useHello.tswith your own code - Run
pnpm installand start developing
After forking, find & replace template-lib-ts with your package name, then go through these steps:
- Find & replace
template-lib-tswith your package name in all files - Update
globalNameintsdown.config.ts(e.g.PosvaTemplateLib→YourLibName) - Update
package.json:description,keywords,homepage,bugs,repository - Update
LICENSEyear and copyright holder - Update
release.ymlrepo condition (github.repository == '...') - Set up npm trusted publishing (see comments in
release.yml) - Set up pkg.pr.new (optional): install the GitHub App on your repo, or remove
.github/workflows/pkg.pr.new.yml - Set up Settings (optional): install the GitHub App on your repo and update
.github/settings.yml, or remove it - Set up Codecov (optional): add
codecov/codecov-actionstep toci.yml - Replace
src/with your library code - Update
AGENTS.md: title, description, and Architecture section to match your project
| Command | Description |
|---|---|
pnpm dev |
Start Vitest UI |
pnpm build |
Build with tsdown |
pnpm test |
Build + test + typecheck |
pnpm test:cov |
Run tests with coverage |
pnpm test:types |
Typecheck |
pnpm lint |
Lint with oxlint |
pnpm fmt |
Format with oxfmt |
pnpm release |
Interactive release script |
pnpm size |
Check bundle size |