design-patterns

design-patterns is a skill for Claude Code from nasrulhazim/claude. It costs 228 tokens per session (2,637 once invoked), scanned A, original, MIT.

A guide for choosing and applying common ways to organise PHP and Laravel code. These design patterns are reusable structures for solving recurring problems, such as creating objects, accessing data, or reacting to events.

In plain words
What is it for?
Use it to recommend a pattern for a described problem, implement one, refactor existing code, or review code for architectural problems.
Why use it?
It helps avoid ad-hoc architecture and explains how existing code can be reorganised when its responsibilities or dependencies become difficult to manage. It can also identify anti-patterns and violations of SOLID design principles.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-toolkit plugin — 36 skills, 12 commands, 20 agents shipped together

Good fit Use it to recommend a pattern for a described problem, implement one, refactor existing code, or review code for architectural problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nasrulhazim/claude/design-patterns
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 nasrulhazim/claude --skill design-patterns
Clone the repo
git clone --depth 1 https://github.com/nasrulhazim/claude

Made for: Claude Code.

Or install claude-toolkit, the plugin that ships this one along with the rest of its 36 skills, 12 commands, 20 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/nasrulhazim/claude/design-patterns.svg)](https://agentmods.dev/skills/nasrulhazim/claude/design-patterns)
Your own site
<a href="https://agentmods.dev/skills/nasrulhazim/claude/design-patterns"><img src="https://agentmods.dev/badge/skills/nasrulhazim/claude/design-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 228 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,637 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 182
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
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.00228 $0.02637
Opus 5 $0.00114 $0.01319
Sonnet 5 $0.00046 $0.00527
Haiku 4.5 $0.00023 $0.00264

Measured 4d ago against content hash 6e23ad6d2ede, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, 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 4d 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.

skills/design-patterns/SKILL.md · 298 lines

How it starts

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

Design Patterns — PHP & Laravel

Pattern advisor for PHP and Laravel projects. Suggests the right pattern for the problem, implements it with production-ready code, refactors existing code toward better patterns, and reviews architecture for anti-patterns.

Command Reference

Command Description
/pattern suggest Analyse a problem or code snippet and recommend the best pattern(s)
/pattern implement Generate production-ready implementation of a specific pattern
/pattern refactor Refactor existing code to follow a recommended pattern
/pattern review Review code for anti-patterns, SOLID violations, and improvement opportunities

1. /pattern suggest — Pattern Recommendation

When the user describes a problem or pastes code:

Step 1: Identify the Problem Category

Problem Category Likely Patterns
Complex object creation Factory, Builder
Data access / persistence Repository
Cross-cutting concerns (logging, caching, auth) Decorator, Pipeline
Multiple algorithms / strategies for same task Strategy
Reacting to events / side effects Observer (Event/Listener)
State transitions / workflows State Machine
Encapsulating a business operation Action, Command (Job)
Transforming data between layers DTO, API Resource, Value Object
Simplifying a complex subsystem Facade (real), Adapter
Validation / input processing Form Request
Query composition / reuse Query Builder Scopes

Step 2: Read the Decision Matrix

Read references/decision-matrix.md for the full mapping of problem types to patterns with trade-offs and when-to-avoid guidance.

Step 3: Present Recommendation

Format:

**Recommended:** [Pattern Name]
**Why:** [One sentence — what problem it solves in this context]
**Trade-off:** [What you give up]
**Alternative:** [Second-best option and when you'd pick it instead]

If multiple patterns apply (e.g., Repository + DTO), explain how they compose together.

Read the full file on GitHub · 298 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago Changed · +22 lines 6e23ad6d2ede
  2. 8d ago First seen · 276 lines · 228 tokens per session scan A 26f2f915c12c

Subscribe to this mod's changes

design-patterns is a skill published in the GitHub repository nasrulhazim/claude (22 stars, last pushed 5d ago), licensed MIT. It adds 228 tokens to every session and 2,637 once invoked, about $0.0011 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

laravel-specialist

Build and configure Laravel 10+ applications, including creating Eloquent models and relationships, implementing Sanctum authentication, configuring Horizon queues, designing RESTful APIs with API resources, and building reactive interfaces with Livewire. Use when creating Laravel models, setting up queue workers…

Jeffallan/claude-skills · 86 tokens

create-powergrid-plugin

Create a complete PowerGrid plugin from scratch, including PHP class, Column macro, Blade view, Alpine.js component, and registration.

Power-Components/livewire-powergrid · 31 tokens

owl-admin-devtools-generator

A development guide for Owl Admin, a Laravel-based administration system, covering its code generator, API templates, relationships, and visual pages.

slowlyo/owl-admin · 82 tokens

llamaindex-development

Expert guidance for LlamaIndex development including RAG applications, vector stores, document processing, query engines, and building production AI applications.

Mindrally/skills · 32 tokens

craftcms

Craft CMS 5 plugin and module development — extending Craft with PHP. Covers elements, element queries, services, models, records, controllers, migrations, queue jobs, console commands, field types, native fields, events, behaviors, Twig extensions, widgets, filesystems, permissions, project config, GraphQL, testing…

michtio/craftcms-claude-skills · 327 tokens

php-development

Expert guidance for PHP 8+ development with SOLID principles, PSR standards, and modern best practices.

Mindrally/skills · 24 tokens