ts-conventions

Enforce strict TypeScript conventions across TypeScript projects.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/jsamuelsen11/claude-config --skill ts-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ts-conventions
Source: https://github.com/jsamuelsen11/claude-config/tree/main/plugins/ccfg-typescript/skills/ts-conventions
Command: npx skills add https://github.com/jsamuelsen11/claude-config --skill ts-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript projects frequently suffer from weak typing, inconsistent patterns, and fragile code as teams scale. This skill defines a comprehensive set of conventions to maximize type safety, maintainability, and developer experience across codebases.

Core Features & Use Cases

  • Strict mode and tsconfig configurations that enforce rigorous type checks across modules and packages.
  • Discriminated unions, type guards, and branded types to model domain data safely and prevent runtime errors.
  • Runtime validation, linting, and testing practices (e.g., ESLint, Vitest) to catch issues early and ensure code quality.

Quick Start

Enable strict mode, configure tsconfig with strict options, and start applying the conventions in new or existing TypeScript projects.

Frequently Asked Questions about ts-conventions

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

FAQPage Schema
How do I enforce strict TypeScript conventions across multiple packages?

Use discriminated unions and type guards to model domain data, preventing invalid states at compile time. These patterns enforce runtime type safety and reduce runtime errors by narrowing types through explicit checks.

What's the best way to set up ESLint and Vitest for TypeScript type safety?

Yes, runtime validation catches type mismatches that compile-time checks miss by validating data boundaries. Combining runtime validation with strict mode and type guards prevents invalid data from propagating through your TypeScript application logic.

How do I prevent runtime errors using branded types and discriminated unions in TypeScript?

Prevent runtime errors by using branded types and discriminated unions to safely model domain data. These TypeScript patterns enforce strict type narrowing, ensuring invalid states are caught during compilation rather than at runtime.

Does this approach work for existing TypeScript projects or only new codebases?

These TypeScript conventions apply to both new and existing projects by progressively enabling strict mode and adopting type safety patterns. You can incrementally integrate discriminated unions and runtime validation into current codebases.