design-patterns

design-patterns is a skill for Claude Code from piomin/claude-ai-spring-boot. It costs 47 tokens per session (1,490 once invoked), scanned A, original, Apache-2.0.

A Java reference guide for choosing common design patterns—reusable ways to structure code for recurring problems such as object creation, changing behavior, and connecting incompatible parts.

In plain words
What is it for?
Use it when implementing or selecting Java Factory, Builder, Strategy, Observer, Decorator, or Adapter patterns, or when designing components that should be easier to extend.
Why use it?
It helps you choose a suitable structure when code is rigid, has many construction options, or needs behavior that can change. The examples make the trade-offs easier to understand before refactoring.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Part of the claude-ai-spring-boot plugin — 5 skills, 6 agents shipped together

Good fit Use it when implementing or selecting Java Factory, Builder, Strategy, Observer, Decorator, or Adapter patterns, or when designing components that should be easier to extend.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/piomin/claude-ai-spring-boot/design-patterns
About the project

piomin/claude-ai-spring-boot is a starter template for creating Spring Boot applications with Claude Code. Developers clone it as a structured foundation when using Claude Code to generate Spring Boot projects.

piomin/claude-ai-spring-boot · 1,286 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add piomin/claude-ai-spring-boot --skill design-patterns
Clone the repo
git clone --depth 1 https://github.com/piomin/claude-ai-spring-boot

Made for: Claude Code.

Or install claude-ai-spring-boot, the plugin that ships this one along with the rest of its 5 skills, 6 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for design-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/piomin/claude-ai-spring-boot/design-patterns/github.svg)](https://agentmods.dev/skills/piomin/claude-ai-spring-boot/design-patterns)
Your own site
<a href="https://agentmods.dev/skills/piomin/claude-ai-spring-boot/design-patterns"><img src="https://agentmods.dev/badge/skills/piomin/claude-ai-spring-boot/design-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for design-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/piomin/claude-ai-spring-boot/design-patterns"><img src="https://agentmods.dev/badge/skills/piomin/claude-ai-spring-boot/design-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,490 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00047 $0.01490
Opus 5 $0.00023 $0.00745
Sonnet 5 $0.00009 $0.00298
Haiku 4.5 $0.00005 $0.00149

Measured 9d ago against content hash f0114046c07f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

design-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/design-patterns/SKILL.md · 290 lines

How it starts

The opening of the file, as written. The whole thing — 290 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Design Patterns Skill

Quick reference for common design patterns in Java.

When to Use

  • User asks to implement a specific pattern
  • Designing extensible/flexible components
  • Refactoring rigid code

Quick Reference: When to Use What

Problem Pattern Use When
Complex object construction Builder Many parameters, some optional
Create objects without specifying class Factory Type determined at runtime
Multiple algorithms, swap at runtime Strategy Behavior varies by context
Add behavior without changing class Decorator Dynamic composition needed
Notify multiple objects of changes Observer One-to-many dependency
Convert incompatible interfaces Adapter Integrate legacy/3rd party code

Creational Patterns

Builder

Problem: Telescoping constructors, many optional parameters

// ✅ Builder pattern
public class User {
    private final String name;  // required
    private final String email; // required
    private final int age;      // optional

    private User(Builder builder) {
        this.name = builder.name;
        this.email = builder.email;
        this.age = builder.age;
    }

    public static Builder builder(String name, String email) {
        return new Builder(name, email);
    }

    public static class Builder {
        private final String name;
        private final String email;
        private int age = 0;

        private Builder(String name, String email) {
            this.name = name;
            this.email = email;
        }

        public Builder age(int age) {
            this.age = age;
            return this;
        }

        public User build() {
            return new User(this);
        }
    }
}

// Usage
User user = User.builder("John", "[email protected]")
    .age(30)
    .build();

Factory

Problem: Create objects without knowing exact class upfront

// ✅ Factory pattern
public interface Notification {
    void send(String message);
}

public class NotificationFactory {
    public static Notification create(String type) {
        return switch (type.toUpperCase()) {
            case "EMAIL" -> new EmailNotification();
            case "SMS" -> new SmsNotification();
            case "PUSH" -> new PushNotification();
            default -> throw new IllegalArgumentException("Unknown: " + type);
        };
    }
}

// Spring version - preferred
@Component
public class NotificationFactory {
    private final Map<String, NotificationSender> senders;

    public NotificationFactory(List<NotificationSender> senderList) {
        this.senders = senderList.stream()
            .collect(Collectors.toMap(
                NotificationSender::getType,
                Function.identity()
            ));
    }

    public NotificationSender get(String type) {
        return Optional.ofNullable(senders.get(type))
            .orElseThrow(() -> new IllegalArgumentException("Unknown: " + type));
    }
}

Read the full file on GitHub · 290 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 290 lines · 47 tokens per session scan A f0114046c07f

Subscribe to this mod's changes

design-patterns is a skill published in the GitHub repository piomin/claude-ai-spring-boot (1,286 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 47 tokens to every session and 1,490 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

geoserver-cloud

Use when deploying GeoServer on Kubernetes as cloud-native microservices with auto-scaling, service discovery, and centralized configuration. GeoServer Cloud: break monolithic GeoServer into independently scalable WMS/WFS/WCS services.

znlgis/opengis-skills · 49 tokens

java-fast-skill

A beginner-friendly Java learning guide that answers questions about core Java topics such as types, syntax, classes, collections, errors, files, threads, generics, and lambdas.

jiushiwon/wg-skills · 155 tokens

context-service-guide

Navigate and understand any legacy cpp-context- WildFly/Maven service. LEGACY ONLY — must not be applied to new Spring Boot work. Use when onboarding to a context service, exploring its modules, or understanding its CQRS structure and integrations.

hmcts/agentic-plugins-marketplace · 53 tokens

jaipilot-generate-tests

Add or strengthen meaningful Java tests and raise fresh per-class coverage through bounded parallel work. Use for JUnit or TestNG gaps, regression tests, boundary cases, surviving mutations, missing assertions, or an explicit JaCoCo coverage campaign.

JAIPilot/jaipilot · 54 tokens

jaipilot-maintainer-intent

Research repository history and maintainer intent before implementing or publishing a Java maintenance change. Use for dependency-bot failures, unfamiliar upstream contributions, competing fixes, or deciding whether to proceed, join existing work, comment, wait, or take no action.

JAIPilot/jaipilot · 57 tokens

jaipilot-clean-java

Safely remove unused Java, consolidate equivalent logic, reduce real complexity, enforce stable architecture rules, modernize compatible dependencies or JDKs, and optimize measured workloads. Use for dead code, AI-generated clutter, duplication, excessive classes or methods, ArchUnit rules, stable upgrades, slow…

JAIPilot/jaipilot · 77 tokens