- Home
- Skills
- Masanao Ohba
- Claude Manifests
- Design Patterns
design-patterns_skill
- Shell
2
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill masanao-ohba/claude-manifests --skill design-patterns- SKILL.md6.9 KB
Overview
This skill provides a technology-agnostic catalog of software design patterns for architecture, components, databases, and APIs. It helps teams choose, apply, and communicate proven structures for maintainable, testable systems. The content emphasizes clear responsibilities, dependency direction, and practical rules for implementation.
How this skill works
The skill organizes patterns by architectural style (layered, clean, hexagonal), component patterns (repository, service, factory), database modeling and query optimizations, and API design best practices. For each pattern it describes responsibilities, structure, usage rules, and common implementation variants to guide decisions and code organization. It is intended as a reference to align design choices, reduce coupling, and improve testability.
When to use it
- Defining high-level architecture for a new system or major refactor
- Separating domain logic from persistence or external systems
- Standardizing component responsibilities for cross-team consistency
- Designing database schemas and optimizing query performance
- Establishing REST API naming, methods, and response conventions
Best practices
- Keep dependencies pointing inward: domain and entities should have no external dependencies
- Encapsulate data access behind repositories to enable in-memory testing and multiple data sources
- Prefer stateless services that orchestrate use cases and delegate business rules to domain models
- Use factories to centralize complex creation logic and enforce invariants at construction
- Index columns used in WHERE, JOIN, and ORDER BY, but avoid over-indexing to preserve write performance
- Design APIs around nouns, use appropriate HTTP verbs, and return clear status codes and envelope metadata when useful
Example use cases
- Apply hexagonal architecture to isolate core domain logic and make adapters swappable for DB or messaging
- Use a repository interface with an in-memory implementation for fast unit tests and a DB-backed implementation in production
- Introduce a TransferService (domain service) for operations that span multiple entities without belonging to any single entity
- Create pagination and cursor-based queries for large result sets and eager loading when related data is always required
- Design REST resources with plural nouns, nested routes for relationships, and consistent response envelopes including meta and links
FAQ
Layered architecture is simple and suits many apps; choose clean architecture when you need stronger decoupling, explicit use-cases, and clearer dependency inversion for long-lived systems.
When should I use a repository vs direct ORM access?
Use a repository when you need a stable domain-facing API, multiple data sources, or easier testing. Direct ORM access is acceptable for small apps where extra abstraction adds little value.