greenfield-ts-stacklisted
Install: claude install-skill lawzava/megapowers
# Greenfield TypeScript Stack
Opinionated defaults for a new TypeScript service in 2026. Time-stamped: these
reflect today's tools and will go stale — adapt them.
For a non-trivial new project, run megapowers:brainstorming and
megapowers:writing-plans first (if installed) — this skill supplies the stack,
not the process.
## Toolchain (pin these)
- **pnpm** — package manager (fast, strict, content-addressed store, a real
lockfile). Commit `pnpm-lock.yaml`.
- **TypeScript, strict** — `"strict": true` plus `"noUncheckedIndexedAccess": true`,
`"exactOptionalPropertyTypes": true`, `"noImplicitOverride": true`. Types are a
correctness tool; CI fails on a type error (`tsc --noEmit`).
- **vitest** — tests (fast, TS-native, ESM-first).
- **Biome** (lint + format in one) *or* eslint + prettier — pick one and commit its
config. Biome is the fewer-moving-parts default.
- **zod** — runtime validation at the boundaries; infer static types from schemas
(`z.infer`) so the validator and the type never drift.
- Target **ESM** (`"type": "module"`) and a current Node LTS.
## Web: Hono (or Fastify)
Hono for a small, fast, edge-portable service; Fastify when you want its plugin
ecosystem. Validate every request body/query with zod and derive the handler's types
from the schema.
### Middleware order
Middleware wraps in the order registered: the **first** registered is the
**outermost** (runs first inbound, last outbound). So register the **logger first**
so it sees every request —