Install
openclaw skills install typescript-strictDeep TypeScript strictness workflow—incremental enablement, compiler flags, typing boundaries, narrowing, generics, utility types, and safe refactors. Use when adopting strict mode, reducing any, or hardening large TS codebases.
openclaw skills install typescript-strictStrictness is a gradient, not a single switch. The goal is fewer runtime surprises without blocking delivery—via incremental migration and clear typing boundaries at IO edges.
Trigger conditions:
strict, strictNullChecks, noImplicitAny, or noUncheckedIndexedAccessany and @ts-ignore.d.ts exportsInitial offer:
Use six stages: (1) baseline & goals, (2) compiler flags roadmap, (3) boundary typing, (4) narrowing & exhaustiveness, (5) generics & patterns, (6) verify & guardrails). Confirm TS version, build tool (tsc, esbuild, etc.), and monorepo layout.
Goal: Know current pain and target strictness with metrics.
tsc --noEmit error count and top files by errorsExit condition: Baseline error count + priority directories.
Goal: Enable flags incrementally—fix clusters, not the whole repo at once.
strictNullChecks (often highest value)noImplicitAny on new files + ratchet oldstrictFunctionTypes, strictBindCallApplynoUncheckedIndexedAccess (verbose—plan for undefined unions)exactOptionalPropertyTypes (sharp edges—later)// @ts-expect-error with ticket over blind @ts-ignoretsconfig extends for stricter packagesany in changed lines (eslint @typescript-eslint/no-explicit-any)Exit condition: Flag timeline with owners per package.
Goal: Validate external data once; internal code trusts narrowed types.
zod / io-ts / valibot for runtime parse at API boundarysatisfies for config objects—keeps literal typesunknown without validationtype UserId = string & { __brand: 'UserId' }) to prevent mix-upsExit condition: New IO code has parse → typed pipeline documented.
Goal: Control flow analysis works for you—discriminated unions, never checks.
{ status: 'loading' } | { status: 'ok', data: T }switch with assertNever(x) for compile-time exhaustivenessundefined vs null one convention per codebase sectionExit condition: Representative modules refactored with fewer optional footguns.
Goal: Reuse without any soup—constraints and defaults.
extends constraints; avoid unconstrained generics unless truly genericReturnType / Parameters for inference gluetsc—split types or simplifyExit condition: Style guide section for generics in shared libraries.
Goal: Strictness sticks—regressions caught in CI.
tsc --noEmit required green for affected projectsdtslint or tsd for library typings tests when authoring packagesunknown over any—forces narrowing at use site.noUncheckedIndexedAccess, show helper getters or Record patterns.d.ts or wrapper module with narrow exports.