typescript

Enforce TypeScript coding conventions for interfaces, types, enums, and runtime schemas.

19|3|Updated Feb 4, 2021
One-click install
npx skills add https://github.com/laulauland/dotfiles --skill typescript-laulauland
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/laulauland/dotfiles/tree/main/shared/.claude/skills/typescript
Command: npx skills add https://github.com/laulauland/dotfiles --skill typescript-laulauland

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript coding conventions and best practices to reduce type errors, improve readability, and enforce consistent patterns across projects.

Core Features & Use Cases

  • Enforces strict typing rules, prefers interfaces over type aliases for object definitions
  • Recommends const assertions for runtime objects and schema-based validation when applicable
  • Guides on error handling, return types, and usage of common TypeScript patterns across frontend and backend code

Quick Start

Apply the TypeScript guidelines to a project by integrating the conventions in new files and refactoring existing code to align with the standards.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I enforce TypeScript coding standards to reduce type errors?

To enforce TypeScript coding standards, apply strict typing rules across modules, prefer interfaces over type aliases for object definitions, and require explicit return types to reduce type errors and improve readability.

What's the best way to define object types in TypeScript for better code quality?

The best way to define object types for code quality is using interfaces rather than type aliases. This standardizes TypeScript usage and enforces consistent structural patterns across frontend and backend project modules.

When do I need runtime validation in a TypeScript project?

You need runtime validation in TypeScript projects when handling external data inputs. Apply schema-based validation libraries alongside const assertions for runtime objects to satisfy project standards and ensure end-to-end type safety.

Can I use these TypeScript conventions in both frontend and backend code?

Yes, you can apply these TypeScript conventions to both frontend and backend projects. The guidelines cover interfaces, types, enums, and error handling patterns across all modules to ensure consistency regardless of the runtime environment.

How do I apply TypeScript guidelines when refactoring existing code?

To apply TypeScript guidelines when refactoring, align existing code with the standards by adding explicit return types, using const assertions for objects, and replacing type aliases with interfaces to enforce strict typing rules across files.

Why does standardizing TypeScript usage improve application robustness?

Standardizing TypeScript usage improves robustness by reducing type errors and enforcing consistent patterns. Requiring explicit return types and schema-based validation ensures type safety across all application modules.