Habilidades code-patterns
📦

code-patterns

Seguro

Apply Common Design Patterns

Developers waste time reinventing solutions to common problems. This skill provides ready-to-use TypeScript code patterns for creational, structural, and behavioral design patterns along with async and data access patterns.

Soporta: Claude Codex Code(CC)
📊 69 Adecuado
1

Descargar el ZIP de la skill

2

Subir en Claude

Ve a Configuración → Capacidades → Skills → Subir skill

3

Activa y empieza a usar

Pruébalo

Usando "code-patterns". Show me the Observer pattern

Resultado esperado:

The Observer pattern enables objects to notify other objects about state changes. It uses a subscription model where listeners register to receive updates. Common use cases include event handling systems, UI updates, and real-time data feeds. The pattern consists of a subject that maintains a list of listeners and notifies them when events occur.

Usando "code-patterns". How do I handle errors without exceptions?

Resultado esperado:

The Result type pattern represents operations that can fail without throwing exceptions. It returns { ok: true, value: T } on success or { ok: false, error: E } on failure. This pattern is useful for expected failures where exceptions would be too heavy, such as validation errors or business logic failures. Callers check the ok property before accessing the value.

Usando "code-patterns". How do I limit concurrent API calls?

Resultado esperado:

The Promise Queue pattern limits the number of concurrent async operations. It maintains a queue of functions and processes them based on a concurrency limit. Use this pattern when making multiple API calls or file operations that could overwhelm resources if run in parallel. The queue processes items one at a time up to the concurrency limit.

Auditoría de seguridad

Seguro
v6 • 1/21/2026

All static findings are false positives. The skill contains only documentation with TypeScript code examples. No executable code, network calls, or command execution patterns exist. Scanner misinterpreted template literals in documentation as shell backticks and JSON structure as cryptographic code.

2
Archivos escaneados
895
Líneas analizadas
0
hallazgos
6
Auditorías totales
No se encontraron problemas de seguridad

Puntuación de calidad

38
Arquitectura
100
Mantenibilidad
87
Contenido
21
Comunidad
100
Seguridad
83
Cumplimiento de la especificación

Lo que puedes crear

Architecture Decisions

Senior developers use this skill to patterns when select appropriate designing new features or refactoring existing code.

Learning Design Patterns

Intermediate developers reference this skill to learn when and how to apply common software design patterns in their TypeScript projects.

Quick Pattern Lookup

Developers quickly find working code examples for patterns like Factory, Observer, Strategy, or Repository when implementing features.

Prueba estos prompts

Basic Pattern Request
Show me the [PATTERN_NAME] pattern in TypeScript with a practical example.
Problem-Solution Match
I need to solve [PROBLEM_DESCRIPTION]. Which pattern should I use and show me the implementation.
Pattern Comparison
What is the difference between [PATTERN_A] and [PATTERN_B]? Show me how to implement both in TypeScript.
Real-World Application
Show me how to use the [PATTERN_NAME] pattern in a real-world scenario with [USE_CASE].

Mejores prácticas

  • Prefer composition over inheritance when applying structural patterns like Decorator
  • Use the Result type pattern for expected failures instead of exceptions
  • Apply the Strategy pattern to make algorithms swappable at runtime

Evitar

  • Avoid Singleton pattern as a global state solution; prefer dependency injection
  • Do not use patterns blindly without understanding the problem they solve
  • Avoid over-engineering with patterns for simple one-off solutions

Preguntas frecuentes

What is the Factory pattern?
The Factory pattern creates objects without specifying the exact class. A factory class has a method that returns instances based on input parameters. Use it when object creation logic is complex or when the system should remain flexible about which classes it instantiates.
When should I use the Strategy pattern?
Use the Strategy pattern when you need to select an algorithm at runtime. It defines a family of algorithms, encapsulates each one, and makes them interchangeable. Common use cases include payment processing, sorting algorithms, and validation strategies.
What is the difference between Observer and Pub/Sub?
The Observer pattern has a direct relationship between subjects and observers. Pub/Sub adds a message broker or event channel between publishers and subscribers, providing more decoupling. Observer is simpler for direct notification use cases; Pub/Sub scales better for distributed systems.
How do I handle transient failures?
Use the Retry with Backoff pattern. It attempts an operation multiple times with increasing delays between attempts. Exponential backoff prevents overwhelming failing services while giving them time to recover. Set a maximum attempt count to avoid infinite loops.
What is the Repository pattern?
The Repository pattern abstracts data access logic behind a clean interface. It separates the domain model from data persistence details. Repositories provide methods like findById, findAll, and save without exposing database-specific queries to the business logic layer.
When should I use the Decorator pattern?
Use the Decorator pattern when you need to add behavior to objects dynamically without modifying their class. It wraps objects in a decorator class that adds functionality. This is useful for cross-cutting concerns like logging, caching, or validation that should apply to specific objects rather than entire classes.

Detalles del desarrollador

Estructura de archivos

📄 SKILL.md