writing-typescript

Enforce strict TypeScript patterns and tooling configurations for codebases.

7|1|Updated Jul 12, 2026
One-click install
npx skills add https://github.com/julianobarbosa/claude-code-skills --skill writing-typescript-julianobarbosa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-typescript
Source: https://github.com/julianobarbosa/claude-code-skills/tree/main/skills/writing-typescript-skill
Command: npx skills add https://github.com/julianobarbosa/claude-code-skills --skill writing-typescript-julianobarbosa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill promotes idiomatic, type-safe TypeScript development with modern tooling and patterns.

Core Features & Use Cases

  • Type Guards: Narrow types safely
  • Discriminated Unions: Robust union handling
  • Generic Constraints: Strong generic typing
  • Async Patterns: Safe concurrent and retry patterns

Quick Start

Show me a pattern for a type-safe fetch with TypeScript types.

Frequently Asked Questions about writing-typescript

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

FAQPage Schema
How do I write strictly typed TypeScript without using any?

Strict typing in TypeScript eliminates the any type by using unknown, type guards, and discriminated unions to enforce compile-time safety. This Skill provides patterns and tsconfig configurations to enforce no-any rules across Node.js services, React applications, and general codebases, ensuring type safety at every layer.

What are type guards and discriminated unions in TypeScript?

Type guards narrow union types safely through runtime checks, while discriminated unions use a shared literal property to distinguish between union members. These patterns replace unsafe type casting and enable robust handling of complex data structures in async operations, API responses, and application logic.

How do I set up TypeScript tooling with eslint, prettier, and vite?

Project scaffolding with standard tooling configurations establishes consistent code organization, linting, formatting, and bundling across your codebase. This Skill covers tsconfig setup, eslint and prettier integration, and build tool configuration for vite or bun to enforce idiomatic TypeScript patterns from project initialization.

Can I use generic constraints to improve type safety in TypeScript?

Generic constraints enforce strict typing on reusable functions and classes by limiting type parameters to specific shapes. This Skill demonstrates how to use utility types and constrained generics to eliminate runtime type errors and improve code reusability across services and applications.

What async patterns does TypeScript provide for safe concurrent operations?

Safe async patterns in TypeScript include typed Promise handling, retry logic, and concurrent execution with proper error boundaries. This Skill provides composition-based patterns and type-safe wrappers for Node.js async operations, ensuring type correctness in concurrent and retry scenarios.

Why should I use composition over inheritance in TypeScript?

Composition over inheritance reduces coupling and improves type flexibility by combining smaller, focused types rather than building deep class hierarchies. This Skill enforces composition patterns to create maintainable, type-safe codebases that scale across tests, configuration, and feature development.