typescript-coding-standards

Enforces strict TypeScript coding standards covering type safety, generics, decorators, and testing.

4|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/minexo79/coser-card-maker --skill typescript-coding-standards-minexo79
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-coding-standards
Source: https://github.com/minexo79/coser-card-maker/tree/main/.kilo/skills/coding-standards/typescript
Command: npx skills add https://github.com/minexo79/coser-card-maker --skill typescript-coding-standards-minexo79

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? TypeScript codebases often suffer from inconsistent typing, unsafe any usage, and misconfigured tooling, leading to runtime bugs that strict typing should have caught. This Skill provides a complete, layered reference for writing type-safe TypeScript with strict compiler settings, advanced type patterns, and consistent linting rules. ## Core Features & Use Cases - Strict Type System Guidance: Covers strict mode configuration, type guards, discriminated unions, branded types, and utility types with working code examples. - Ready-to-Use Configurations: Ships strict tsconfig.json variants and ESLint configurations for TypeScript projects, including naming conventions and promise-handling rules. - Reusable Templates: Provides generic repository, builder, event emitter, and branded-type templates for common application patterns. - Use Case: When starting a new Node.js or React service, apply the strict tsconfig and ESLint config, then follow the generics and error-handling patterns to build a type-safe API client with Result-based error handling. ## Quick Start Apply the TypeScript coding standards from this skill to review my src directory and configure strict mode in tsconfig.json.

Frequently Asked Questions about typescript-coding-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable strict mode in TypeScript?

Set "strict": true in tsconfig.json compilerOptions, which enables noImplicitAny, strictNullChecks, strictFunctionTypes, and related checks. The provided tsconfig.strict.json also adds noUncheckedIndexedAccess and noImplicitOverride for stronger safety.

What are branded types in TypeScript and when should I use them?

Branded types intersect a primitive with a unique brand property, creating distinct types like UserId versus ProductId that cannot be mixed at compile time. Use them for entity IDs, currencies, and validated strings where primitive values carry different semantics.

Should I use any or unknown for dynamic data in TypeScript?

Use unknown for truly dynamic data because it forces type narrowing before use, while any disables type checking entirely. The standards prohibit any via the @typescript-eslint/no-explicit-any ESLint rule.

How do I write type-safe error handling in TypeScript?

Use a discriminated union Result type with success and failure variants, plus custom Error subclasses carrying context like field names or operation codes. A tryCatch wrapper converts rejected promises into Result values for consistent handling.

Does this ESLint config work with type-aware TypeScript rules?

Yes, the configuration sets parserOptions.project to tsconfig.json, enabling type-aware rules like no-floating-promises and no-misused-promises from @typescript-eslint. It also integrates import ordering, promise rules, and security checks.

What are the limitations of TypeScript branded types?

Branded types exist only at compile time and are erased after compilation, so they provide zero runtime validation. Factory functions like createUserId must perform runtime checks, and values can still be forged with explicit type assertions.