agentleFS
jackchukajackchuka/skills/dev-software-design/SKILL.md

dev-software-design

Skill15 starsChanged 9 days agoMITView on GitHub

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.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer boring, obvious code over clever, abstract code.

    line 27
  2. Distinctive:

    When advising on design, follow this priority order:

    line 61
  3. Distinctive:

    When reviewing or advising:

    line 83
  4. Distinctive:

    If multiple principles conflict, state the tension and recommend based on context

    line 88

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.