← All recipes

OSS Library

Customize your project context

Your project

Prefer terminal? npx github:Pranavoro/tailormd init oss-library

Live preview — CLAUDE.md

# my-lib

TailorMD recipe: **OSS Library**

## Stack

- **Language:** TypeScript
- **Package manager:** npm
- **Test runner:** Vitest
- **License:** MIT

## Folder map

```
src/               # library source
tests/ or __tests__/
  unit/
  integration/
docs/              # API docs, examples
examples/          # minimal usage samples
CHANGELOG.md
LICENSE
README.md
```

## Non-negotiables

- Follow semver — breaking changes require major version bump
- Every public API change updates CHANGELOG.md
- 100% of public exports documented
- No breaking changes without migration notes
- CI must pass: lint, test, build before merge
- License file (MIT) present and accurate

## Naming and style

- Package name: `my-lib` (npm/cargo convention)
- Exports: clear, stable names — avoid renaming without deprecation cycle
- Internal modules: language-idiomatic (`snake_case` Python, `camelCase` TS)
- Test files colocated or mirrored in `tests/`

## Commands

```bash
# Adjust for npm
npm run build        # compile / bundle
npm run test         # Vitest
npm run lint
npm publish --dry-run
```

## Ship checklist

Before merging or releasing:

- [ ] All tests pass (Vitest)
- [ ] Lint and type checks clean
- [ ] CHANGELOG.md updated with user-facing changes
- [ ] Version bumped per semver rules
- [ ] Public API docs updated
- [ ] Examples still run
- [ ] LICENSE (MIT) unchanged unless intentional
- [ ] `publish --dry-run` succeeds

## Release (npm)

- Patch: bug fixes, internal refactors
- Minor: new features, backward compatible
- Major: breaking API changes — include migration guide
- Tag releases in git; publish from clean CI build

## Contributing

- PRs need tests for behavior changes
- Keep diff focused — one concern per PR
- Document new public APIs in README or docs/