patterns

Selects or rejects design patterns by naming the present force and recording a ledger line.

3|Updated May 2, 2026
One-click install
npx skills add https://github.com/JuanTrujilloDev/agent-config-template --skill patterns-juantrujillodev
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: patterns
Source: https://github.com/JuanTrujilloDev/agent-config-template/tree/main/plugin/skills/patterns
Command: npx skills add https://github.com/JuanTrujilloDev/agent-config-template --skill patterns-juantrujillodev

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill includes references (resource) components.

What problem does it solve? It prevents pattern-stuffing in codebases by forcing every new abstraction to justify itself against a concrete, present force before any named design pattern is applied. ## Core Features & Use Cases - Selection protocol: Inspect existing project patterns first, name the present force, then choose the simplest default or refuse with a one-line why. - Default-reject list: Single-implementation Strategy, speculative Repository, unnecessary Factory, Singleton, Service Locator, and trivial State are rejected unless the force is documented. - Pattern ledger: Every surviving pattern gets a pattern / force / rejected alternative line in the spec's Design notes; missing entries are treated as pattern-stuffing by reviewers. - Use Case: While writing a spec for a payment mini-feature, record Strategy / three payment providers ship today / dict of functions so implementers and reviewers share one justified decision. ## Quick Start Ask the agent to apply the patterns skill to decide whether a new abstraction in your spec or diff earns a named design pattern.

Frequently Asked Questions about patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decide when to use a design pattern in my code?โ–ผ

Name the concrete force present today, such as multiple payment providers or a crash-survival requirement. If the sentence needs 'might' or 'later', there is no force yet, so use the simplest default like a function, dict, or enum instead.

When should I avoid the Repository pattern over an ORM?โ–ผ

Avoid a speculative Repository when the ORM already abstracts storage, since it creates two persistence layers with one empty. Add a Repository only when a second store or a real test seam is present.

Why is Singleton rejected by default in code reviews?โ–ผ

Singleton introduces hidden global state, is untestable, and breaks under concurrency. The recommended default is constructor injection, passing the single instance in while the composition root owns its lifetime.

What is a pattern ledger in a spec?โ–ผ

A ledger is one line per surviving pattern in the spec's Design notes, formatted as pattern / force / rejected alternative. A pattern without a ledger line is treated as pattern-stuffing and flagged as a Blocker by reviewers.

Which design pattern reference covers my domain?โ–ผ

Six domain files route forces to patterns: backend.md for APIs and persistence, frontend.md for UI state, mobile.md for navigation and sync, game.md for Unity, desktop.md for MVVM and undo, and concurrency.md for workers and circuit breakers.