typescript-best-practices

Enforce strict TypeScript coding standards and type-safe architectural patterns.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/hiddink-ai/hiddink-harness --skill typescript-best-practices-hiddink-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-best-practices
Source: https://github.com/hiddink-ai/hiddink-harness/tree/main/templates/skills/typescript-best-practices
Command: npx skills add https://github.com/hiddink-ai/hiddink-harness --skill typescript-best-practices-hiddink-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the common pitfalls of loose TypeScript configurations, helping developers avoid runtime errors and maintain a strictly typed, predictable codebase.

Core Features & Use Cases

  • Type Safety Enforcement: Promotes the use of unknown over any and mandates explicit return types for public APIs.
  • Standardized Patterns: Provides clear guidelines for interface usage, class structure, and error handling to ensure consistency across large projects.
  • Use Case: When refactoring a legacy module, apply these rules to replace unsafe any types with proper interfaces and narrowing techniques, significantly reducing potential production bugs.

Quick Start

Apply the typescript-best-practices skill to review the current file and suggest improvements for type safety and naming conventions.

Frequently Asked Questions about typescript-best-practices

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

FAQPage Schema
How do I enforce strict TypeScript coding standards during code review?

To enforce strict TypeScript coding standards, apply rules that mandate explicit return types for public APIs and promote using unknown over any. This ensures interface-driven design and strict null checks across your project.

What's the best way to refactor legacy TypeScript modules to improve type safety?

The best way to refactor legacy TypeScript modules for type safety is replacing unsafe any types with proper interfaces and narrowing techniques. This process significantly reduces potential production bugs and ensures predictable codebase behavior.

Why should I use unknown instead of any for TypeScript type safety?

You should use unknown instead of any to enforce TypeScript type safety because unknown forces explicit type narrowing before usage. This prevents unchecked runtime errors and maintains a strictly typed, predictable codebase architecture.

Does this approach to TypeScript best practices work for large project architectures?

Yes, this approach to TypeScript best practices works for large project architectures by providing clear guidelines for interface usage, class structure, and error handling. This standardized pattern ensures maintainability and consistency across complex modules.

When do I need explicit typing and strict null checks in TypeScript?

You need explicit typing and strict null checks in TypeScript when developing new features or refactoring existing code to prevent runtime errors. These practices maintain a strictly typed codebase and satisfy requirements for error prevention.

What are the limitations of loose TypeScript configurations?

The limitations of loose TypeScript configurations include exposing your project to common pitfalls like runtime errors and unpredictable code behavior. Without strict type safety enforcement, maintainability decreases and potential production bugs increase significantly.