typescript

Enforce strict TypeScript patterns and replace any with unknown.

Updated Jan 19, 2026
One-click install
npx skills add https://github.com/adbertram/Devolutions-CIEM --skill typescript-adbertram
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/adbertram/Devolutions-CIEM/tree/main/prowler/skills/typescript
Command: npx skills add https://github.com/adbertram/Devolutions-CIEM --skill typescript-adbertram

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill targets unsafe TypeScript patterns that lead to runtime errors, brittle interfaces, and maintenance headaches by enforcing strict type practices across codebases.

Core Features & Use Cases

  • Const Types Pattern: Create a single source of truth with const objects and derived types for reliable runtime values.
  • Flat Interfaces: Favor flat, single-level interfaces to improve readability and maintainability.
  • Never Use any: Replace any with unknown and utilize generics for flexible, controlled typing.
  • Utility Types & Type Guards: Leverage Pick, Omit, Partial, Required, Readonly, and custom guards to enforce safe shapes.
  • Type Import Patterns: Use type-only imports to avoid runtime overhead and confusion.
  • Use Case: When refactoring legacy TypeScript to modern patterns, or when introducing strict typing in a new project.

Quick Start

Run the TypeScript strict patterns checker on a project file, then apply the recommended const pattern, flat interfaces, and no-any policy to begin improving type safety.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I replace any with safer types in TypeScript?

To replace any in TypeScript, use the unknown type for flexible values and apply generics for controlled typing. This enforces strict type checking while maintaining runtime safety across your codebase.

What is the best way to define runtime-safe TypeScript types and constants?

Defining runtime-safe TypeScript types is best achieved using const objects as a single source of truth. Derive types from these const objects to ensure reliable values and strict typing throughout your project.

How do I refactor legacy TypeScript to use strict type patterns?

Refactoring legacy TypeScript to strict patterns involves replacing any with unknown, flattening interfaces to a single level, and leveraging utility types like Pick and Omit to enforce safe shapes.

When should I use TypeScript type guards and utility types?

Use TypeScript type guards and utility types like Pick, Omit, Partial, and Readonly when you need to enforce safe data shapes at runtime and narrow complex types securely within your codebase.

Does using type-only imports improve TypeScript performance?

Using type-only imports in TypeScript eliminates runtime overhead by ensuring types are stripped out during compilation. This prevents confusion and keeps your runtime bundles clean.

Why are flat interfaces recommended for TypeScript codebases?

Flat interfaces are recommended for TypeScript because they favor single-level structures that significantly improve code readability and long-term maintainability over deeply nested object shapes.