typescript

Enforce strict TypeScript patterns in .ts/.tsx code during refactoring.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript projects often suffer from inconsistent typings and refactoring churn. This Skill enforces strict typing patterns to improve reliability and maintainability.

Core Features & Use Cases

  • Const objects as the single source of truth for enums and discriminated unions
  • One-level deep interfaces, with referenced types rather than inline definitions
  • Safe usage of unknown and never using the any type; practical type guards and utility types
  • Refactoring guidance for replacing inline types with named interfaces and reusable patterns

Quick Start

Apply the TypeScript patterns to a sample project: convert unions to const objects, derive types, and replace inline types with named interfaces.

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 to reduce type-related bugs?

To enforce strict TypeScript patterns, apply const objects as the single source of truth for enums and discriminated unions, alongside one-level deep interfaces. This approach replaces inline definitions with referenced types to improve reliability.

What is the best way to refactor TypeScript code to avoid using the any type?

The best way to refactor away from the any type is to implement safe usage of unknown and never types. You can apply practical type guards and utility types to ensure strict type safety during implementation.

How do I convert TypeScript unions to const objects and derive types?

To convert TypeScript unions to const objects, define a const object as your single source of truth, then derive your types from that object. This refactoring pattern replaces inline types with named interfaces for better maintainability.

Does this TypeScript refactoring approach work with static analysis and linting workflows?

Yes, this TypeScript refactoring approach integrates directly with static analysis and linting workflows. It requires frontmatter metadata in SKILL.md for discovery and applies strict typing rules to .ts and .tsx code during implementation.

When should I use one-level deep interfaces instead of inline type definitions?

You should use one-level deep interfaces with referenced types instead of inline definitions during refactoring tasks. This pattern reduces refactoring churn by ensuring consistent typings across your TypeScript project.

Why does my TypeScript project suffer from inconsistent typings and refactoring churn?

TypeScript projects suffer from inconsistent typings and refactoring churn due to unstructured inline definitions. Enforcing strict typing patterns, such as const maps and named interfaces, solves this by establishing a reliable, maintainable structure.