원클릭으로
design-principles
Reference for software design principles including SOLID, DRY, YAGNI, and separation of concerns.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Reference for software design principles including SOLID, DRY, YAGNI, and separation of concerns.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
CLI client for the Creddit API (Reddit for AI agents). Use when interacting with creddit - posting, voting, commenting, browsing communities, checking karma, converting credits, or redeeming rewards.
Use this skill whenever the user wants to create, write, review, or improve a Product Requirements Document (PRD). Also use when the user asks to document product goals, user stories, acceptance criteria, or feature scope — or says things like 'write a spec', 'define requirements'. Use for both new PRDs and reviews/critiques of existing ones.
Design and implement lightweight, ergonomic JSON HTTP APIs for machine-to-machine communication. Use this skill whenever the user is designing API endpoints, writing OpenAPI specs, building REST or HTTP API routes, defining request/response schemas, implementing error handling for APIs, or discussing API contracts.
Design and build social networking sites and community platforms. Use this skill when the user asks to create a social network, community platform, forum, feed-based app, or any site centered on user profiles, social interactions, content sharing, or community engagement. Covers UX architecture, visual design, engagement systems, moderation, and frontend implementation. Applies to full platforms, individual features (feeds, profiles, chat), or redesigns of existing social products.
Design and build consumer-facing websites using 2025-2026 web design trends. Use when the user asks to create a website, landing page, SaaS marketing site, product page, or consumer-facing web UI and wants it to look modern and current. Extends the frontend-design skill with specific trend knowledge, CSS patterns, and implementation guidance.
Reference for software architecture patterns including Clean Architecture, Hexagonal Architecture, Modular Monolith, and Vertical Slice Architecture.
| name | design-principles |
| description | Reference for software design principles including SOLID, DRY, YAGNI, and separation of concerns. |
A module/class should have one reason to change, meaning one actor or stakeholder it serves.
Test: "If I describe this module's job, do I use the word 'and'?" If yes, consider splitting.
Violation pattern:
UserService → handles registration AND sends emails AND generates reports
Fix: Split into RegistrationService, EmailNotifier, UserReportGenerator.
Nuance: SRP is about change-axes, not about doing only one thing. A JsonParser does many steps but changes for one reason (JSON format changes).
Modules should be extendable without modifying existing code.
Primary mechanism: Define behavior behind interfaces. New behavior = new implementation, not editing existing code.
# Instead of:
if type == "pdf": ...
elif type == "csv": ...
elif type == "xlsx": ... # Must edit to add new format
# Define:
type Exporter interface { Export(data) }
# Then: PdfExporter, CsvExporter, XlsxExporter each implement it
# New format = new struct, no edits to existing code
When to apply: When you can anticipate a clear extension axis. Don't pre-engineer OCP for hypothetical changes.
Subtypes must honor the behavioral contract of their parent type. Any code using a base type must work correctly with any subtype.
Classic violation: Square extending Rectangle — setting width on a Square also changes height, breaking Rectangle's contract.
Practical test: If subtype overrides a method and changes behavior in ways callers don't expect, LSP is violated.
Prefer focused interfaces over broad ones. Clients should not depend on methods they don't use.
Violation:
type DataStore interface {
Read(id) → Item
Write(item)
Delete(id)
BulkImport(items)
RunMigration()
GenerateReport()
}
Fix: Split by consumer need:
type Reader interface { Read(id) → Item }
type Writer interface { Write(item); Delete(id) }
type Admin interface { BulkImport(items); RunMigration() }
Go idiom: Accept interfaces, return structs. Define interfaces at the call site (consumer), not the implementation site.
High-level policy should not depend on low-level detail. Both should depend on abstractions.
In practice: Use cases define the interfaces they need (ports). Infrastructure implements them (adapters). The wiring happens at the composition root.
# usecases/ports.go — owned by use case layer
type OrderRepository interface { Save(order Order) error }
# adapters/postgres/order_repo.go — implements the interface
type PostgresOrderRepo struct { db *sql.DB }
func (r *PostgresOrderRepo) Save(order Order) error { ... }
# main.go — wires it
repo := postgres.NewOrderRepo(db)
useCase := usecases.NewCreateOrder(repo)
| Approach | Description | Best For |
|---|---|---|
| Constructor injection | Pass deps as constructor args | Default choice, explicit and testable |
| Interface binding (DI container) | Framework resolves deps | Large apps with many bindings (Java/C#) |
| Functional injection | Pass deps as function args or closures | Functional languages, small services |
| Wire/compile-time DI | Code-generate the wiring | Go (google/wire), Rust |
main() or an app bootstrap functionnew ConcreteType() for injectable dependenciesGoal: Stay at data coupling or stamp coupling. If you see control or content coupling, refactor.
Goal: Aim for functional or sequential cohesion. If a module has logical or coincidental cohesion, split it.
Storer not DatabaseClient)// Define interfaces where they're USED, not where they're implemented
// In the consumer package:
type UserFinder interface {
FindByID(ctx context.Context, id string) (*User, error)
}
// Accept the narrowest interface possible
func NewOrderService(users UserFinder) *OrderService { ... }
Readable, Closable not File)