code-patterns
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.
Descargar el ZIP de la skill
Subir en Claude
Ve a Configuración → Capacidades → Skills → Subir skill
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
SeguroAll 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.
Puntuación de calidad
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
Show me the [PATTERN_NAME] pattern in TypeScript with a practical example.
I need to solve [PROBLEM_DESCRIPTION]. Which pattern should I use and show me the implementation.
What is the difference between [PATTERN_A] and [PATTERN_B]? Show me how to implement both in TypeScript.
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