nestjs-oop-design-patterns
БесплатноБез исполняемых скриптовНе проверенApplies pragmatic OOP, SOLID, object-design rules, and design patterns to NestJS and TypeScript code. Use when writing or refactoring controllers, providers…
от aiskillstore★ 509 звёзд на GitHubОб этом скилле
NestJS OOP and Design Patterns
Improve changeability and correctness through clear responsibilities, encapsulated invariants, and deliberate collaboration. Use patterns to solve observed forces, never as decoration.
Pre-execution conflict guard
Before editing files or running any state-changing command, reconcile active instructions. Read-only inspection may continue.
Prerequisites
Inspect repository instructions, installed versions, callers, tests, module wiring, and the observed design pressure. Preserve behavior and user changes; do not select a pattern before architecture/runtime constraints are known. Read other active skills only when their decisions overlap.
Primary ownership
This skill owns object responsibilities, invariants, encapsulation, collaborator contracts, SOLID trade-offs, patterns, and behavior-preserving refactoring. When installed and relevant, coordinate with:
nestjs-architecture-principles: module, dependency, data, and transaction boundaries.nestjs-features-performance: lifecycle, API/security, testing, runtime, and performance.nestjs-professional-software-engineering: implementation and verification.nestjs-code-audit: read-only quality evidence and deduplicated reporting.nestjs-feature-audit: branch-specific roadmap gate and feature reporting.nestjs-git-commit-pr-message: authorized Git publication and CI follow-up.
These are decision boundaries, not required dependencies. Retain domain ownership when handing work to another workflow.
Conflict test
Check for incompatible edits/contracts, command order or side effects, competing owners, and unmet version, evidence, authorization, or repository prerequisites. Resolve using explicit user intent, repository contracts, verified runtime constraints, then the narrowest owner. Assign one lead per decision; do not create parallel designs to satisfy incompatible advice. If a material conflict remains, stop before mutation and ask for the smallest missing decision. Audits stay read-only; explicit fix authorization applies in a distinct implementation phase.
Inspect before prescribing
- Read the relevant controller/provider/entity plus its callers, tests, module wiring, DTOs, and persistence mapping.
- Identify the object's role: transport adapter, application coordinator, domain object/policy, infrastructure adapter, or composition root.
- Name the actual pain: invariant leakage, divergent change, difficult substitution, hidden dependency, duplicated decision logic, or framework coupling.
- Check repository conventions and existing abstractions before adding a new one.
- Preserve behavior with a characterization test before a risky refactor.
Do not infer poor design from file length alone. Complexity, cohesion, public surface, dependency count, and change history are stronger evidence.
OOP defaults
- Encapsulate invariants; do not merely move data behind getters and setters.
- Prefer composition and delegation over inheritance.
- Keep mutable state private and minimize its lifetime.
- Use polymorphism when a stable operation has real, varying implementations.
- Inject effects and volatility; keep deterministic calculations plain.
- Make invalid states difficult to construct when the domain value justifies the type.
- Use domain language consistently across types, methods, tests, and errors.
- Let Nest's container construct providers; do not instantiate dependency graphs inside business methods.
Load references/oop-solid.md for detailed OOP and SOLID guidance and references/object-design.md for entities, value objects, policies, services, and DTO boundaries.
Apply SOLID as diagnostic questions
Single Responsibility
Does this unit own one cohesive policy or change axis? A use case may coordinate several collaborators and still have one responsibility. Splitting every method into a provider creates navigation cost without cohesion.
Open/Closed
Is a real variation forcing the same conditional to change repeatedly? Extract a strategy, policy, or adapter around that variation. Do not build extension points for hypothetical providers.
Liskov Substitution
Can every implementation honor the same inputs, outputs, errors, side effects, timing assumptions, and invariants? If not, narrow the contract or use composition instead of inheritance.
Interface Segregation
Does each consumer depend only on the capability it uses? Prefer small application-owned ports over one CommonService or generic repository interface.
Dependency Inversion
Does high-level policy depend on an application contract while Nest modules select infrastructure implementations? Add a boundary for volatile effects, not an interface for every local class.
Select patterns from forces
Use references/pattern-catalog.md and [references/nestjs-native-patterns.md](references/nestjs-native-patte
Установить nestjs-oop-design-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл nestjs-oop-design-patterns?
Applies pragmatic OOP, SOLID, object-design rules, and design patterns to NestJS and TypeScript code. Use when writing or refactoring controllers, providers, use cases, entities, value objects, repositories, adapters, factories, strategies, handlers, or tests; when diagnosing god services, primitive obsession, inheritance misuse, duplicated conditionals, or leaky abstractions; and when selecting a pattern without over-engineering. Do not use for pure functional codebases or non-NestJS frontend work. When other skills also apply, reconcile ownership before mutation.
Как установить скилл nestjs-oop-design-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nestjs-oop-design-patterns запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic