programming-typescript

Enforce type-first architecture with discriminated unions and unknown-at-the-edge narrowing in TypeScript.

3|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/Muvon/octomind-tap --skill programming-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: programming-typescript
Source: https://github.com/Muvon/octomind-tap/tree/main/skills/programming-typescript
Command: npx skills add https://github.com/Muvon/octomind-tap --skill programming-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you reduce maintenance pain in TypeScript codebases by preventing type leaks, runtime mismatches, and boundary errors that spread through the call graph.

Core Features & Use Cases

It provides pragmatic guidance for designing type-driven architectures with strong module boundaries, safe handling of external data using unknown-and-narrowing, and maintainable error handling with typed errors and causes. It also recommends modern async patterns, dependency direction and side-effect placement to keep core logic framework-free, and ecosystem defaults (validation, ORMs, testing, HTTP) that fit typical Node/React/Next.js projects. It is especially useful when refactoring legacy code, scaling a monorepo, or standardizing conventions across a team.

Quick Start

Ask the AI to review your TypeScript project structure and propose concrete changes to strengthen type boundaries and improve async, error-handling, and module separation.

Frequently Asked Questions about programming-typescript

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

FAQPage Schema
How do I prevent unsafe any types from spreading across TypeScript module boundaries?

To prevent unsafe any types from spreading across TypeScript module boundaries, enforce type-first architecture using unknown-at-the-edge narrowing and discriminated unions. This approach stops runtime type mismatches from leaking through your call graph.

What is the best way to validate external inputs in a Node.js TypeScript backend?

The best way to validate external inputs in a Node.js TypeScript backend is treating external data as unknown and applying runtime validation. This narrows types safely at module boundaries before data enters your core framework-free logic.

How do I handle errors in TypeScript async flows without unsafe type assertions?

Handle errors in TypeScript async flows by using typed errors with causes and modern async patterns. Prefer validators and the satisfies keyword over unsafe assertions to maintain type safety across asynchronous operations.

Does this TypeScript architecture approach work for scaling monorepos and legacy refactoring?

Yes, this TypeScript architecture approach works for scaling monorepos and legacy refactoring. It standardizes team conventions by enforcing dependency direction, side-effect placement, and strong module boundaries to reduce maintenance pain.

Why should I use satisfies instead of type assertions in TypeScript?

You should use satisfies instead of type assertions in TypeScript because it verifies type compatibility without unsafely overriding the compiler. This prevents runtime type mismatches while ensuring values conform to expected type definitions.