typescript-pedantry

Enforce strict TypeScript type safety with Zod runtime validation.

28|3|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/oborchers/fractional-cto --skill typescript-pedantry
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-pedantry
Source: https://github.com/oborchers/fractional-cto/tree/main/pedantic-coder/skills/typescript-pedantry
Command: npx skills add https://github.com/oborchers/fractional-cto --skill typescript-pedantry

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enforces strict TypeScript best practices, preventing common bugs related to type safety, runtime validation, and code maintainability.

Core Features & Use Cases

  • Strict Type Safety: Enforces strict: true in tsconfig.json and promotes discriminated unions over unsafe type assertions.
  • Runtime Validation: Integrates Zod for validating data at system boundaries, ensuring type safety even with external inputs.
  • Code Maintainability: Guides on using barrel exports, as const, and template literal types for cleaner, more robust code.
  • Use Case: When refactoring a JavaScript codebase to TypeScript, or when encountering runtime errors due to type mismatches, this Skill provides the rules and patterns to write truly type-safe TypeScript.

Quick Start

Apply the typescript-pedantry skill to ensure all TypeScript code adheres to strict type-checking rules and uses discriminated unions for variant types.

Frequently Asked Questions about typescript-pedantry

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

FAQPage Schema
How do I ensure type safety for external API inputs in TypeScript?

To ensure type safety for external API inputs in TypeScript, use Zod schemas to validate data at system boundaries. This guarantees runtime data matches compile-time types, preventing errors from untrusted inputs.

What is the best way to handle variant types without unsafe type assertions?

The best way to handle variant types without unsafe type assertions is using discriminated unions. Defining a common literal property across object types allows TypeScript to safely narrow types during control flow checks.

How do I configure strict TypeScript compiler flags for robust codebases?

To configure strict TypeScript compiler flags, set `strict: true` in your `tsconfig.json`. This enables comprehensive compile-time type checking rules, preventing common type-related bugs across your codebase.

Why does TypeScript still throw runtime errors despite passing type checks?

TypeScript throws runtime errors despite passing type checks because compile-time types are erased at runtime. Integrating Zod validation at system boundaries ensures incoming data actually matches expected structures.

Do I need Zod to refactor a JavaScript codebase to TypeScript?

You need Zod when refactoring a JavaScript codebase to TypeScript if you require runtime data validation at system boundaries. While strict compile-time checks catch internal bugs, Zod ensures external inputs match defined schemas.

What TypeScript patterns improve code maintainability and type safety?

TypeScript patterns that improve code maintainability include using `as const` for immutable literals, template literal types for string unions, and barrel exports for organized module loading. These features ensure cleaner, robust codebases.