typescript

Guide TypeScript type modeling, error handling, and strict-mode configuration.

16|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/JCETools-Petra/JCE-Opencode-Tools --skill typescript-jcetools-petra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/JCETools-Petra/JCE-Opencode-Tools/tree/main/config/skills/typescript
Command: npx skills add https://github.com/JCETools-Petra/JCE-Opencode-Tools --skill typescript-jcetools-petra

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you implement, debug, review, and verify TypeScript/JavaScript work with consistent, strict-mode-friendly patterns so you reduce type bugs and runtime surprises.

Core Features & Use Cases

  • Auto-detect TypeScript/JavaScript contexts: activates for .ts/.tsx/.js/.jsx/.mts/.cts files and common TypeScript config signals.
  • Type-first design guidance: choose between type vs interface, model errors via Result/discriminated unions, and apply narrowing and generics correctly.
  • Runtime and tool selection: align Node.js vs Bun vs CLI/library strategies and recommend safer boundary validation (e.g., Zod).
  • Quality checks for strict mode: enforce a production-grade tsconfig approach and verification habits (zero any, boundary validation, no unsafe assertions).

Quick Start

Use the typescript skill to review your .ts/.tsx change and propose fixes that make your code pass strict TypeScript rules and improve error handling with a discriminated union or Result pattern.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I configure TypeScript strict mode to eliminate unsafe type assertions?

To configure TypeScript strict mode, apply a production-grade tsconfig approach that enforces strict compiler options, ensuring zero `any` usage and no unsafe assertions. This prevents runtime surprises and reduces type bugs in real codebases.

When should I use type vs interface for TypeScript type modeling?

Choosing between type vs interface depends on your TypeScript type modeling needs; type is versatile for unions and primitives, while interface is extendable for object shapes. Apply disciplined conventions to ensure reliable generics and safe narrowing.

What is the best way to handle errors in TypeScript without runtime surprises?

The best way to handle errors in TypeScript is modeling them via Result patterns or discriminated unions. This approach ensures safe runtime decisions and reliable narrowing, reducing inconsistent and unsafe TypeScript implementations.

Does Zod work with TypeScript for runtime boundary validation?

Yes, Zod works with TypeScript to provide safer boundary validation. It validates external data inputs at runtime boundaries, complementing static type checking to prevent runtime surprises and enforce strict-mode friendly patterns.

How do I fix inconsistent TypeScript generics and narrowing in a real codebase?

Fix inconsistent TypeScript generics and narrowing by reviewing .ts and .tsx files to apply correct narrowing techniques and disciplined type modeling. This ensures reliable runtime decisions and eliminates unsafe type assertions.

Can I use this TypeScript workflow for debugging .js and .jsx files?

Yes, you can use this workflow for debugging .js and .jsx files, as it auto-detects TypeScript and JavaScript contexts. It guides refactoring and review tasks to apply strict-mode-friendly patterns across mixed codebases.