Skip to main content

coding-type-script

Best practices for clean and maintainable code in TypeScript. To be used for writing TypeScript code that is easy to read, maintain, and follows industry standards. Use when this capability is needed.

Ir para a instalação

Informações da origem

Repositório
tomevault-io/skills-registry
Última atividade na origem
28 de abril de 2026 às 22:53
Idioma detectado do SKILL.md
inglês
Estrelas
1
Forks
0

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Explorador de arquivos
2 arquivos

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
name
coding-type-script
description
Best practices for clean and maintainable code in TypeScript. To be used for writing TypeScript code that is easy to read, maintain, and follows industry standards. Use when this capability is needed.
metadata
{"author":"albertobasalo"}
# Clean code best practices ## Variables and naming - Name variables and functions descriptively to enhance readability. - Use named constants instead of magic numbers or strings. ## Functions and complexity - Keep functions small and focused on a single task. - Avoid nested structures to reduce complexity. - Use early returns to minimize indentation. ## Classes and modules - Avoid primitive obsession by defining types. - Favor composition over inheritance. - Keep dependencies to a minimum. - Use adapter pattern to decouple from external systems. - Maintain a shared module (folder...) for common utilities and types. ## Error handling and comments - Handle errors gracefully with try-catch blocks and meaningful messages. - Write comments to explain the "why" behind complex logic, not the "what". ## General principles - Keep it simple and avoid over-engineering. - Try to keep it DRY (Don't Repeat Yourself) by reusing code where applicable. ## TypeScript specific guidelines - Use ES modules (`import`/`export`) instead of CommonJS. - Favor named exports over default exports - File names follows `kebab-case.{pattern}.ts`. Ex: `user-login.service.ts` - Use strict typing and avoid using `any`. - Declare `types` for data structures in its own file. - Use `as const` for constant values to infer literal types. - Define `interfaces` for class contract behavior in its own file. - Avoid `null` and `undefined` where possible; prefer optional properties. - Leverage TypeScript's utility types (e.g., `Partial`, `Pick`, `Omit`). - Use async/await; wrap awaits in try/catch with structured errors. --- > Converted and distributed by [TomeVault](https://tomevault.io/claim/albertobasalo) — claim your Tome and manage your conversions. <!-- tomevault:4.0:skill_md:2026-04-14 -->
Ver no GitHub