Skip to content
aipatterns.dev

Skills

Four skills that teach a coding agent when to reach for a pattern or a refactoring, and when not to. They install with the open skills CLI into Claude Code, Cursor, Codex, GitHub Copilot, Gemini CLI and other agents that read SKILL.md.
View as Markdown
Install all four from this website
npx skills add https://aipatterns.dev
Pick skills and agents without prompts
npx skills add https://aipatterns.dev --skill aipatterns-pattern-selection -a claude-code -a cursor -y

Index

  • aipatterns-code-smells

    31 files

    Detect code smells such as Long Method, Large Class, Primitive Obsession, Feature Envy, Shotgun Surgery, Duplicate Code, Speculative Generality and 17 more. Maps each smell to the refactorings that treat it, and says when to leave a smell alone. Use when reviewing code, when asked "what's wrong with this code", when planning a refactor, or when deciding whether code is worth changing.

    Read SKILL.mdnpx skills add https://aipatterns.dev --skill aipatterns-code-smells
  • aipatterns-design-patterns

    42 files

    Implement the 22 classic GoF design patterns in TypeScript, Python, Go or Java. Each pattern gives its forces, structure, steps, trade-offs and "do not use it when" rules. Use before you implement, review or explain a pattern such as Factory Method, Abstract Factory, Builder, Prototype, Singleton, Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy, Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method or Visitor. Also covers patterns original to the reference - resilience (Timeout, Retry, Exponential Backoff, Circuit Breaker, Fallback, Rate Limiting), data (Cache-Aside, Transactional Outbox, Saga, Idempotent Consumer, CQRS) and architecture (Strangler Fig, Backends for Frontends). Not for behavior changes or when a language feature covers the variance - run aipatterns-pattern-selection first.

    Read SKILL.mdnpx skills add https://aipatterns.dev --skill aipatterns-design-patterns
  • aipatterns-grill

    6 files

    Grill a product from idea to production, or grill a design-pattern application before code. Use when the user starts a new project, presents a product idea, or asks to build an app. Use for the full product lifecycle - discovery, research, requirements, architecture, design, implementation, testing, deployment, and cost planning. Use when the user wants to apply or implement a pattern such as factory, saga, circuit breaker, or rate limiting in real code. Asks questions in small rounds with recommended answers. Writes planning documents. Builds to a deployed, tested application. Not for explaining, researching, comparing, or reviewing a pattern in the abstract. Not for stress-testing a plan the user does not intend to build.

    Read SKILL.mdnpx skills add https://aipatterns.dev --skill aipatterns-grill
  • aipatterns-pattern-selection

    11 files

    Decide whether the code needs a design pattern, and which one. Use before you introduce any GoF pattern such as factory, builder, singleton, adapter, decorator, strategy, observer or visitor. Use when a user asks "which pattern should I use". Use when you review code that adds abstraction layers. Use when you want an interface "for flexibility". Default to no pattern unless a concrete, current pain justifies one.

    Read SKILL.mdnpx skills add https://aipatterns.dev --skill aipatterns-pattern-selection
  • aipatterns-refactoring

    74 files

    Apply 67 refactoring techniques - the 66 classics (Extract Method, Move Method, Replace Conditional with Polymorphism, Introduce Parameter Object) plus Consolidate Tools for agent-facing tool surfaces - as small steps. Each step preserves behavior, and tests stay green between steps. Use when a task asks you to refactor, clean up, simplify, restructure or "make this code better" without changing behavior. Use also when someone identified a code smell and needs its treatment.

    Read SKILL.mdnpx skills add https://aipatterns.dev --skill aipatterns-refactoring

How they stay current

Each skill holds a short decision procedure in SKILL.md. Its references/ folder is generated from this site's content on every build, so the guidance an agent loads matches what you read here. Agents load the references only when they need them.