typescript

Enforce strict TypeScript patterns with const types, flat interfaces, and no 'any'.

Updated Feb 21, 2026
One-click install
npx skills add https://github.com/josemartinrodriguezmortaloni/opencode-config --skill typescript-josemartinrodriguezmortaloni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/josemartinrodriguezmortaloni/opencode-config/tree/main/skill/typescript
Command: npx skills add https://github.com/josemartinrodriguezmortaloni/opencode-config --skill typescript-josemartinrodriguezmortaloni

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces strict TypeScript patterns and best practices, preventing common pitfalls and improving code quality and maintainability.

Core Features & Use Cases

  • Const Types Pattern: Ensures a single source of truth for type definitions, enhancing refactoring and autocomplete.
  • Flat Interfaces: Promotes a clean, readable interface structure by avoiding excessive nesting.
  • Avoid any: Encourages the use of unknown and generics for better type safety.
  • Utility Types: Leverages TypeScript's built-in utility types for concise type manipulation.
  • Type Guards: Provides a mechanism for narrowing down types safely.

Quick Start

Apply the const types pattern to the STATUS variable in your TypeScript code.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I enforce strict TypeScript patterns in my codebase?

To enforce strict TypeScript patterns, apply const types for a single source of truth, maintain flat interfaces, and avoid the 'any' type by using 'unknown' and generics for robust type safety.

What is the best way to avoid 'any' in TypeScript for better type safety?

The best way to avoid 'any' in TypeScript is to use the 'unknown' type alongside generics, which enforces type checking and prevents unpredictable data structures while maintaining robust type safety.

How do I use utility types and type guards to narrow down types safely?

Use utility types and type guards to safely narrow down types by leveraging TypeScript's built-in utilities for concise type manipulation, ensuring predictable data structures and clear type definitions.

When do I need flat interfaces in TypeScript development?

You need flat interfaces in TypeScript development when you want to promote a clean, readable interface structure by avoiding excessive nesting, which improves code quality and maintainability across your codebase.

Does using const types improve TypeScript refactoring and autocomplete?

Yes, using the const types pattern ensures a single source of truth for type definitions, which directly enhances your TypeScript refactoring capabilities and improves autocomplete performance.

Why does defining predictable data structures matter for maintaining TypeScript codebases?

Defining predictable data structures matters because it ensures robust type safety and maintainable codebases, preventing common pitfalls by applying clear type definitions and flat interfaces across all scenarios.