lean-ts-patterns

Installation
SKILL.md

Lean TypeScript Patterns

Patterns for building lightweight, zero-dependency TypeScript/Bun tools. Distilled from studying exemplary repos: unjs/citty (CLI), unjs/consola (logging), unjs/ofetch (HTTP), unjs/defu (merging), unjs/scule (strings), unjs/pathe (paths), antfu/taze (package updates).

The 7 Principles

1. Zero Dependencies by Design

Inline tiny utils. Use node: builtins. Vendor at build time if needed.

  • CLI parsing: node:util.parseArgs (not commander/yargs)
  • Colors: 22 lines of ANSI codes (not chalk/picocolors)
  • Path utils: 7-line normalizer (not path polyfills)
  • HTTP: globalThis.fetch wrapper (not axios)
  • Object merging: 40-line recursive merge (not lodash.merge)

2. Identity Functions as Type Helpers

Installs
24
Repository
caidanw/skills
GitHub Stars
1
First Seen
Mar 3, 2026
lean-ts-patterns — caidanw/skills