typescript

Enforce TypeScript strict typing with const-first patterns and unknown types.

1|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/Pallepadehat/agentkit --skill typescript-pallepadehat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/Pallepadehat/agentkit/tree/main/.agent/skills/typescript
Command: npx skills add https://github.com/Pallepadehat/agentkit --skill typescript-pallepadehat

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript strict patterns and best practices help teams write safer, more maintainable code by enforcing consistent typings and preventing accidental use of unsafe types.

Core Features & Use Cases

  • Enforce const-first patterns and stable runtime values with explicit interfaces
  • Promote flat interface design, well-scoped generics, and robust type guards
  • Replace any with unknown where appropriate and leverage common utility types for composition
  • Use cases include migrating a JS codebase to TS, refactoring complex types, and improving autocomplete and refactor safety

Quick Start

Run the TypeScript strict patterns guide on a sample project to convert inline types to separate interfaces, introduce const objects, and replace any with unknown.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I enforce strict typing across a TypeScript codebase to prevent runtime errors?

Strict typing enforcement catches type drift and runtime errors by applying const-first patterns, explicit interfaces, and type guards across .ts/.tsx files. Replace unsafe any types with unknown, use modular interfaces, and leverage utility types for composition to maintain consistent typing discipline throughout your codebase.

What's the best way to migrate a JavaScript project to TypeScript with proper type safety?

Migrate incrementally by converting inline types to separate interfaces, introducing const objects for stable runtime values, and systematically replacing any with unknown. Apply flat interface design and well-scoped generics to establish a foundation for safe, maintainable TypeScript.

When should I use unknown instead of any in TypeScript?

Use unknown for type-safe handling when the type is truly unknown, requiring explicit type guards before operations. Replace any with unknown to enforce stricter typing discipline and catch potential errors at compile time rather than runtime.

How do I refactor complex TypeScript types into maintainable patterns?

Refactor by breaking complex types into flat, well-scoped interfaces and leveraging utility types for composition. Introduce type guards to safely narrow unions and validate data, improving both type safety and autocomplete accuracy during refactoring.

Can I improve TypeScript autocomplete and refactor safety with better type patterns?

Yes. Explicit interfaces, const-first patterns, and robust type guards provide precise type information that enhances IDE autocomplete and makes refactoring safer by catching type mismatches before runtime.