lang-typescript

Enforce TypeScript type-safety rules during code review and linting.

16|15|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/ravnhq/ai-toolkit --skill lang-typescript-ravnhq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lang-typescript
Source: https://github.com/ravnhq/ai-toolkit/tree/main/skills/lang-typescript
Command: npx skills add https://github.com/ravnhq/ai-toolkit --skill lang-typescript-ravnhq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enforces TypeScript language patterns and type-safety rules to improve code quality and maintainability by preventing unsafe constructs and promoting robust types.

Core Features & Use Cases

  • Enforces no implicit any by promoting strict mode and type guards.
  • Encourages use of discriminated unions and unknown instead of any.
  • Promotes consistent exports by favoring named exports and avoiding default exports.
  • Use case: refactor a legacy TS module to eliminate any usage and add runtime validation.

Quick Start

Run the lang-typescript skill on a TypeScript project to scan for type-no-any and type-no-assertions and generate a report with recommended changes.

Frequently Asked Questions about lang-typescript

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

FAQPage Schema
How do I enforce type safety and eliminate unsafe any usage in TypeScript?

Enforce TypeScript type safety by enabling strict mode, applying type guards, and replacing any with unknown. Run automated linting to catch unsafe assertions and generate a report with recommended changes.

What is the best way to refactor a legacy TypeScript module to use discriminated unions?

Refactor legacy TypeScript modules by introducing discriminated unions for robust type narrowing and adding runtime validation. Use named exports to ensure consistent module structure and eliminate unsafe constructs.

Why does TypeScript linting recommend using unknown instead of any?

TypeScript linting recommends unknown over any to enforce explicit type checking before usage, preventing unsafe operations. The unknown type forces developers to apply type guards, ensuring strict type safety and code quality.

How do I prevent improper type assertions and default exports in TypeScript projects?

Prevent improper type assertions and default exports by applying linting rules that flag unsafe casts and enforce named exports. This ensures consistent export structures and maintains strict type safety across modules.

Does this TypeScript linting approach work for automated code review across modules and services?

Yes, this TypeScript linting approach applies during automated code review across modules and services. It scans for type-no-any and type-no-assertions, enforcing strict mode configurations and consistent export patterns.

When should I not use type assertions in TypeScript?

Avoid type assertions in TypeScript when strict type safety is required, as they override the compiler and can introduce unsafe any usage. Instead, use type guards, runtime validation, and discriminated unions for safe type narrowing.