← ClaudeAtlas

pattern-engineer-typescriptlisted

TypeScript bullets: `strict` + `noUncheckedIndexedAccess` + `exactOptionalPropertyTypes` + the no-implicit/no-fallthrough flags; no `any` (use `unknown` at boundaries, narrow); no `!` without a documented invariant; `type` for unions, `interface` for extendable shapes; discriminated unions; wrap `JSON.parse`; never `forEach(async)`; schema-validate untrusted objects before merge; explicit return types on public exports. Activate when editing TypeScript or `tsconfig.json`.
MartinKChen/harness-claude-code · ★ 0 · AI & Automation · score 72
Install: claude install-skill MartinKChen/harness-claude-code
# pattern-engineer-typescript ## When to activate Activate when editing any `.ts` / `.tsx` file, `tsconfig.json`, type-only declarations, generics, or TypeScript-specific tooling (tsc, biome's TS rules). Applies to both frontend and Node/TS backend code. Skip for `.js` / `.jsx` files in JS-only projects. ## Project memory overlay After loading this skill, also check `$MAIN_ROOT/.claude/memory/patterns/pattern-engineer-typescript.md` in the consuming project (resolve `MAIN_ROOT="$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")"`). If present, load it as an **additive overlay** to the rules below; if absent, skip silently. See `memory-convention` for the full contract (additivity, severity floor, conflict surfacing). ## Patterns ### tsconfig — non-negotiable flags Copy the block in `templates/tsconfig.json` into the project's `tsconfig.json`. The required `compilerOptions`: - `"strict": true` — enables `strictNullChecks`, `noImplicitAny`, and friends in one knob. - `"noUncheckedIndexedAccess": true` — `arr[i]` is `T | undefined`, not `T`. Forces an explicit narrow before use. - `"exactOptionalPropertyTypes": true` — `{ x?: string }` is `string | undefined`, not `string | undefined | unset`. No silent `undefined` in places that should be missing-key. - `"noImplicitReturns": true` — every branch in a function returns. - `"noFallthroughCasesInSwitch": true` — `switch` cases must `break` / `return` / `throw`. - `"noImplicitOverride": true` — method over