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 a la instalación

Datos de origen

Repositorio
tomevault-io/skills-registry
Última actividad en el origen
28 de abril de 2026 a las 22:53
Idioma detectado de SKILL.md
inglés
Estrellas
1
Forks
0

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Explorador de archivos
2 archivos

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
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 en GitHub