One folder. Nine reference files. Nothing to build.
Claude loads SKILL.md when the work involves class design,
refactoring or an LLD problem — then reads only the reference file that the problem's
forces point to. The other eight stay out of the context window.
Same prompt. A different engineer answering.
Asked to design a parking lot, here is what moves. The skill's
main job is not adding patterns — it is removing the ones nobody asked for and
catching the race condition underneath them.
- Singleton
ParkingLotManager, unexplained VehicleFactoryover classes that differ by one enum- Fees as
double; the clock called inline - Concurrency waved at — “add a lock”
- Patterns listed, never justified
- Nothing on how you would know it broke in production
- Axis of change named before a class is written
- Allocation and pricing split — they change for different reasons
- Claiming a spot is one atomic op: CAS, not check-then-act
Moneyvalue object;Clockinjected- Pattern ledger: force resolved, alternative rejected
- One metric per pattern, and what would page someone
Rated by how often it is actually the right answer.
Every pattern carries a real-codebase sighting — Spring's proxies,
Kubernetes' plugin interfaces, java.io's decorator chains — and, more usefully,
the conditions under which it is the wrong call.
Gang of Four, all 23
Intent, the force it resolves, where it shows up in code people ship — and the pairs everyone confuses: Strategy vs. State, Decorator vs. Proxy, Adapter vs. Facade.
Architecture & application
DI without a container, Repository without wrapping your ORM twice, ports & adapters, CQRS, event sourcing, result types, plugin systems, feature flags.
Concurrency
Worker pools, pipelines, fan-out/fan-in, actors, the single-writer principle, CAS, backpressure — plus the nine bugs reviewers actually look for.
Distributed & resilience
Circuit breakers, deadline budgets, retry budgets, hedged requests, bulkheads, five rate-limiting algorithms, sagas, the outbox, expand-contract migration.
Frontend components
Compound components, custom hooks, provider splitting, props getters, state reducers, error boundaries — and why eleven boolean props is a design bug.
Anti-patterns
Twenty-one smells with a detectable signature and the smallest first move. Including pattern-stuffing, which is the one this whole skill exists to prevent.
Operating a pattern
How to test and observe each family, RED and USE signals, and what each costs to run. A circuit breaker you cannot observe is a mystery-outage generator.
It grades the design before it shows you.
Ten dimensions, scored 0–3. Below 20 and the skill revises rather than presents. Any single zero is a blocker — a beautifully factored design that loses data under concurrency is not a good design.
- 01Requirements fidelity
Requirements enumerated and traceable; ambiguities named rather than silently resolved.
- 02Responsibility allocation
Boundaries follow reasons for change, not merely topic similarity.
- 03Extensibility on the stated axis
Adding the likely variant touches two files or fewer — demonstrated, not claimed.
- 04Interface quality
Minimal, consumer-owned, hard to misuse. Illegal states unrepresentable.
- 05Pattern selection
Caps at 1 if any pattern cannot be traced to a stated requirement.
- 06Concurrency correctness
What is shared, what the atomic unit is, and no lock held across I/O.
- 07Failure handling
Partial failure reasoned about: what is idempotent, what compensates, what the caller sees.
- 08Testability & observability
Clock and randomness injected; and one metric per breaker, queue or cache, with what would page someone.
- 09Data modelling
Invariants enforced at construction; persistence shape not dictating domain shape.
- 10Trade-off communication
States what the design is bad at, and what the simpler version would have been.
Automatic red flags — cap the total at 20
- A Singleton that is not process-wide immutable config
- A Strategy or Factory interface with one implementation
- Check-then-act on a contended resource
- An unbounded queue, or unbounded thread creation
- Domain classes importing ORM or vendor types
- A remote call with no timeout
- Retry on a non-idempotent operation, no idempotency key
- Every class name ending in
ManagerorHelper - A breaker, queue or cache with no stated metric
- Writing to a database and a queue as two separate commits
Thirty problems, each with its trap.
For practice, for generating problems, and as ground truth when grading. Every entry carries the axis of change, the patterns that legitimately fit, the plausible wrong answer, and the follow-up probe that breaks a memorised one. Highlighted are the ten near-certain to appear.
Three steps. No dependencies.
Clone it
The skill is plain Markdown. Nothing to build, nothing to install, no runtime.
git clone https://github.com/00suryavanshi00/code-design-patterns.git
Drop it where Claude reads skills
Project scope or personal scope both work for Claude Code. For Claude.ai and Cowork, upload the folder from Settings → Capabilities → Skills.
# project scope cp -r code-design-patterns/skill/code-design-patterns .claude/skills/ # personal scope cp -r code-design-patterns/skill/code-design-patterns ~/.claude/skills/
Ask it something with a design in it
The skill triggers on class design, refactoring, architecture and LLD work — including when you never say the words “design pattern”.
“Design a rate limiter that works across 10 nodes.” “Review this OrderService — it's 400 lines.” “Should I use Visitor for my plugin node types?” “Grade my vending machine design out of 30.”