software-design

Opinionated guide to software design principles and architectural patterns. Use when reviewing code design, planning feature architecture, asking "is this the right design?", "how should I structure this?", or requesting design philosophy guidance. Triggers on questions about SOLID, DRY, KISS, YAGNI, Clean Architecture, DDD, hexagonal architecture, composition vs inheritance, coupling, cohesion, or any software design trade-off discussion.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "software-design" with this command: npx skills add jackchuka/skills/jackchuka-skills-software-design

Software Design Philosophies

Opinionated guidance on classic design principles and architectural patterns, with concrete code examples and trade-off analysis.

When Applying Design Guidance

  1. Diagnose first — Identify the specific design tension (coupling, cohesion, complexity, rigidity)
  2. Name the principle — State which principle applies and why
  3. Show the trade-off — Every principle has a cost; state it explicitly
  4. Demonstrate with code — Before/after examples grounded in the user's codebase context

Core Stance: Pragmatism Over Dogma

  • Principles are heuristics, not laws. Apply them when they reduce complexity; skip them when they add it.
  • Prefer boring, obvious code over clever, abstract code.
  • The best design is the simplest one that handles current requirements. Speculative generality is a code smell.
  • Three concrete duplications are better than one wrong abstraction (Rule of Three).

Classic Principles Quick Reference

PrincipleOne-linerApply when...Skip when...
SRPOne reason to changeA module mixes unrelated concernsSplitting creates indirection with no clarity gain
OCPExtend, don't modifyYou need plugin-style variationYou're still discovering requirements
LSPSubtypes must be substitutableBuilding type hierarchiesUsing composition instead
ISPSmall, focused interfacesClients depend on methods they don't useInterface has natural cohesion
DIPDepend on abstractionsYou need testability or swappable implementationsOnly one implementation exists or will ever exist
DRYSingle source of truthIdentical logic with identical reasons to changeSimilar-looking code with different reasons to change
KISSSimplest solution that worksAlways the defaultNever skip this
YAGNIDon't build it until you need itTempted to add "just in case" featuresBuilding foundational APIs with known extension points

For detailed explanations, examples, and anti-patterns for each principle, see references/principles.md.

Architectural Patterns Quick Reference

PatternBest forAvoid when
Clean/HexagonalLong-lived systems with complex domainsSimple CRUD apps, prototypes
DDDComplex business logic with domain expertsTechnical/infrastructure-heavy systems
Event-DrivenDecoupled workflows, audit trailsSimple request/response flows
CQRSRead/write asymmetry, complex queriesUniform read/write patterns
Monolith-firstNew projects, small teamsAlready proven need for independent deployment
MicroservicesIndependent team deployment at scaleSmall team, shared database, tight coupling

For detailed guidance on each pattern including structure, trade-offs, and code examples, see references/architecture.md.

Decision Framework

When advising on design, follow this priority order:

  1. Does it work correctly? — Correctness over elegance
  2. Can someone else read it? — Clarity over cleverness
  3. Can it be tested? — Testability over convenience
  4. Can it change safely? — Isolation of change over DRY
  5. Does it perform adequately? — Performance only when measured

Common Design Smells and Remedies

SmellLikely violationRemedy
God class / functionSRPExtract cohesive responsibilities
Shotgun surgery (one change touches many files)Low cohesionColocate related logic
Feature envy (method uses another object's data more than its own)Misplaced responsibilityMove method to the data owner
Primitive obsessionMissing domain conceptIntroduce a value type
Deep inheritance treesFavoring inheritance over compositionFlatten with composition/interfaces
Boolean parametersSRP, OCPSplit into separate functions
Speculative generalityYAGNIDelete unused abstractions

Offering Guidance

When reviewing or advising:

  • Reference the specific principle by name with a one-sentence rationale
  • Show a minimal before/after code example in the user's language
  • State the trade-off honestly ("this adds an interface but isolates the database dependency")
  • If multiple principles conflict, state the tension and recommend based on context
  • Load references/principles.md for deep-dive principle discussions
  • Load references/architecture.md for architectural pattern guidance

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

dev-code-quality

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

dev-new-tool

No summary provided by upstream source.

Repository SourceNeeds Review
General

restaurant-search

No summary provided by upstream source.

Repository SourceNeeds Review