ts

Enforce strict TypeScript conventions with type guards, interfaces, and null safety.

43|4|Updated Dec 19, 2018
One-click install
npx skills add https://github.com/lambdalisue/dotfiles --skill ts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ts
Source: https://github.com/lambdalisue/dotfiles/tree/main/home/claude/skills/ts
Command: npx skills add https://github.com/lambdalisue/dotfiles --skill ts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill encapsulates TypeScript conventions and type-safe patterns to help teams write safer, maintainable TS code.

Core Features & Use Cases

  • Types: strict: true, type guards over assertions
  • Null Safety: Optional chaining (?.), nullish coalescing (??)
  • Style: interface for objects, type for unions, import type for types
  • Tools: oxlint for linting, Vitest for testing
  • Use Case: Add a strong type layer to a small TS service to prevent runtime errors

Quick Start

Create a new TS project with strict mode enabled, define interfaces, and set up Vitest for testing.

Frequently Asked Questions about ts

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

FAQPage Schema
How do I enforce strict typing in TypeScript to prevent runtime errors?

Strict typing in TypeScript prevents runtime errors by enabling `strict: true` in your tsconfig.json, using type guards instead of assertions, and applying optional chaining (`?.`) and nullish coalescing (`??`) for null safety. Define object shapes with interfaces and unions with type statements to ensure consistent, predictable types across your codebase.

What's the best way to set up type-safe patterns in a TypeScript project?

Set up type-safe patterns by configuring strict mode, defining interfaces for object structures, using `import type` for type-only imports, and leveraging type guards for runtime validation. Integrate oxlint for linting and Vitest for testing to automate quality checks and catch type violations early.

When should I use interfaces versus types in TypeScript?

Use interfaces to define object shapes and contracts; use types for unions, primitives, and complex compositions. This convention clarifies intent, improves readability, and aligns with strict TypeScript patterns that enforce consistent object modeling and union type definitions.

Can I use oxlint and Vitest with strict TypeScript conventions?

Yes. Oxlint enforces linting rules aligned with strict TypeScript patterns, and Vitest provides a test framework for validating type-safe code behavior. Together they automate quality checks, catch type violations, and ensure your codebase maintains null safety and type consistency.

What problems does strict TypeScript typing solve in team projects?

Strict typing eliminates inconsistent typing, reduces runtime errors from null/undefined values, and standardizes object modeling across the team. Type guards, interfaces, and import type patterns enforce predictable code structure, making maintenance easier and catching bugs at compile time.