typescript-expert

Guide TypeScript developers to write type-safe, maintainable code.

Updated Apr 5, 2023
One-click install
npx skills add https://github.com/edneyreis999/zord-project --skill typescript-expert-edneyreis999
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-expert
Source: https://github.com/edneyreis999/zord-project/tree/main/service_financial-claude/skills/typescript-expert
Command: npx skills add https://github.com/edneyreis999/zord-project --skill typescript-expert-edneyreis999

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Fornece diretrizes de alto nível para desenvolvimento em TypeScript com foco em segurança de tipos, legibilidade e padrões.

Core Features & Use Cases

  • Regras de tipagem forte, uso de utility types, e discriminated unions.
  • Organização de código, nomenclaturas, e padrões de documentação.
  • Práticas de segurança, testes e performance para TS.

Quick Start

Aplique as diretrizes em novos arquivos TS/TSX e em revisões de código.

Frequently Asked Questions about typescript-expert

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

FAQPage Schema
How do I write type-safe TypeScript code that avoids common pitfalls?

Type-safe TypeScript prioritizes explicit types over `any`, uses discriminated unions and utility types to model domain logic precisely, and validates inputs while sanitizing outputs. This prevents runtime errors and makes code intent clear to maintainers.

What's the best way to structure and organize a TypeScript project?

Organize TypeScript projects with simple, readable modules following consistent naming conventions. Document public APIs with JSDoc, maintain project-specific testing and lifecycle patterns, and apply security practices like avoiding dynamic code execution throughout the codebase.

How do I review or refactor existing TypeScript code for maintainability?

Refactoring TypeScript code means replacing loose typing with strong type constraints, simplifying module boundaries, ensuring input validation and output sanitization, and aligning naming and documentation with project conventions. This improves security and readability.

What TypeScript patterns improve code security and testing?

Security-focused TypeScript patterns include strict input validation, output sanitization, avoiding dynamic code execution, and leveraging the type system to prevent entire classes of bugs. Pair these with comprehensive test coverage aligned to project standards.

When should I use discriminated unions and utility types in TypeScript?

Discriminated unions model mutually exclusive states precisely and enable exhaustiveness checking at compile time. Utility types (`Omit`, `Pick`, `Readonly`) reduce duplication and enforce immutability constraints, making type relationships explicit and maintainable.

Do I need to document TypeScript APIs, and how do I do it?

Yes, document public TypeScript APIs with JSDoc comments to clarify intent, parameters, and return values for maintainers and tools. Follow your project's conventions for naming, testing lifecycles, and documentation depth to keep documentation in sync with code.