laravel-patterns

laravel-patterns is a skill for Claude Code from Foysal50x/skills. It costs 95 tokens per session (3,306 once invoked), scanned A, original, MIT.

A set of rules for structuring Laravel applications around business areas, including guidance on Actions, Services, Repositories, Query Classes, Value Objects, and Eloquent.

In plain words
What is it for?
Use it when creating, reviewing, or refactoring Laravel classes under app/Domain, choosing between inline Eloquent code and separate classes, or connecting bounded business areas.
Why use it?
It helps developers choose an appropriate place for code without creating unnecessary layers or scattering database queries throughout the application.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions AGENTS.md.

Part of the laravel-skill plugin — 6 skills shipped together

Good fit Use it when creating, reviewing, or refactoring Laravel classes under app/Domain, choosing between inline Eloquent code and separate classes, or connecting bounded business areas.

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

Made for: Claude Code.

Or install laravel-skill, the plugin that ships this one along with the rest of its 6 skills.

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 laravel-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/foysal50x/skills/laravel-patterns/github.svg)](https://agentmods.dev/skills/foysal50x/skills/laravel-patterns)
Your own site
<a href="https://agentmods.dev/skills/foysal50x/skills/laravel-patterns"><img src="https://agentmods.dev/badge/skills/foysal50x/skills/laravel-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 laravel-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/foysal50x/skills/laravel-patterns"><img src="https://agentmods.dev/badge/skills/foysal50x/skills/laravel-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,306 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.
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.00095 $0.03306
Opus 5 $0.00048 $0.01653
Sonnet 5 $0.00019 $0.00661
Haiku 4.5 $0.00010 $0.00331

Measured yesterday against content hash 96909f4261a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

laravel-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 yesterday.

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/laravel-patterns/SKILL.md · 252 lines

How it starts

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

Laravel Patterns

Placement rules for domain-driven Laravel applications: Action, Service, Repository, Query Class, Value Object. 63 rules across 9 sections.

Core philosophy: practicality over purity. Never take a greedy decision.

  • Eloquent is already a good abstraction for most data access.
  • A Repository over Eloquent does not fully decouple you from Eloquent. That is acceptable and expected — do not chase purity.
  • Both extremes are bugs: a layer for every model (dead boilerplate) and none at all (queries scattered everywhere).
  • A Query Class is the internal implementation technique of a Repository, not a competing pattern.
  • Value Objects keep signatures clean and carry pure behavior. They never touch a Builder.
  • Domains are bounded contexts. One domain never imports another's internals.

When to Apply

Reference these rules when:

  • Creating any class under app/Domain/
  • Deciding between a Service, a Repository and inline code
  • Reviewing a pull request that adds a layer
  • Refactoring queries scattered across Actions, Services or Blade
  • Splitting a monolithic app/ into bounded contexts
  • Wiring one domain to another

Start Here

Run the Decision Gate before writing any class: references/decision-gate.md.

Default answer: keep it in the Action, use Eloquent directly.

Q1. Single end-to-end use case?              → ACTION
Q2. Called by 2+ Actions, or worth isolating? → SERVICE
Q3. Used in only one Action?                  → KEEP IT IN THE ACTION
Q4. Single-record CRUD (find / create /
    update / delete)?                         → ELOQUENT DIRECTLY
                                                (from an Action or Repository)
Q5. Backend may swap, OR the query earns a
    name and its own tests?                   → REPOSITORY (+ Query Classes)
Q6. Two real implementations, a concrete
    backend swap, or a host extension point?  → INTERFACE
                                                (otherwise one concrete class)
Q7. Callers pick one by a config or
    request key?                              → FACTORY / REGISTRY

Read the full file on GitHub · 252 lines

Files

What ships with it

60 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. yesterday Changed · +1 lines 96909f4261a2
  2. 10d ago First seen · 251 lines · 95 tokens per session scan A e88953ea8564

Subscribe to this mod's changes

laravel-patterns is a skill published in the GitHub repository Foysal50x/skills (9 stars, last pushed 2d ago), licensed MIT. It adds 95 tokens to every session and 3,306 once invoked, about $0.0005 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-31.

Related

Other skills, from other repositories