typescript-strict
Deep 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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/clawkk/typescript-strictTypeScript Strict Mode (Deep Workflow)
Strictness 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.
When to Offer This Workflow
Trigger conditions:
- Enabling
strict,strictNullChecks,noImplicitAny, ornoUncheckedIndexedAccess - Legacy codebase full of
anyand@ts-ignore - Runtime bugs that types would have caught (undefined, wrong shapes)
- Library authoring needing accurate
.d.tsexports
Initial 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.
Stage 1: Baseline & Goals
Goal: Know current pain and target strictness with metrics.
Actions
- Capture
tsc --noEmiterror count and top files by errors - Identify critical packages vs leaf apps for sequencing
- Define non-goals (e.g., “no perfect types for untyped third-party JSON this quarter”)
Exit condition: Baseline error count + priority directories.
Stage 2: Compiler Flags Roadmap
Goal: Enable flags incrementally—fix clusters, not the whole repo at once.
Typical order (adapt)
strictNullChecks(often highest value)noImplicitAnyon new files + ratchet oldstrictFunctionTypes,strictBindCallApplynoUncheckedIndexedAccess(verbose—plan forundefinedunions)exactOptionalPropertyTypes(sharp edges—later)
Techniques
// @ts-expect-errorwith ticket over blind@ts-ignore- Path-specific
tsconfigextends for stricter packages - CI gate: no new
anyin changed lines (eslint@typescript-eslint/no-explicit-any)
Exit condition: Flag timeline with owners per package.
Stage 3: Boundary Typing (IO Edges)
Goal: Validate external data once; internal code trusts narrowed types.
Patterns
zod/io-ts/valibotfor runtime parse at API boundarysatisfiesfor config objects—keeps literal types- Avoid casting from
unknownwithout validation
APIs
- Generated types from OpenAPI/graphql-codegen when possible
- Branded types for IDs (
type UserId = string & { __brand: 'UserId' }) to prevent mix-ups
Exit condition: New IO code has parse → typed pipeline documented.
Stage 4: Narrowing & Exhaustiveness
Goal: Control flow analysis works for you—discriminated unions, never checks.
Practices
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-clawkk-typescript-strict": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
data-move
Deep data migration workflow—scope, mapping, validation, batching and ordering, dual-write and cutover, rollback, and reconciliation. Use when moving tenants, bulk backfills, or changing stores without losing trust in data correctness.
data-model
Deep data modeling workflow—grain, facts and dimensions, keys, slowly changing dimensions, normalization trade-offs, and analytics query patterns. Use when designing warehouse/analytics models or reviewing star/snowflake schemas.
guard
Deep AI safety guardrails workflow—policy definition, input/output filtering, monitoring, escalation, and false-positive handling. Use when reducing harmful outputs, misuse, or policy violations in LLM products.
prompts
Deep prompt engineering workflow—task spec, constraints, examples, evaluation sets, iteration protocol, regression testing, and safety alignment. Use when improving LLM outputs, shipping prompt changes, or building reusable prompt templates.
cost-opt
Cloud cost review: rightsizing, reservations, waste. Use when reducing infra spend.