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.
npx agentmods add rules/pekral/cursor-rules/laravelgit clone --depth 1 https://github.com/pekral/cursor-rulesWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.04121 | $0.04121 |
| Opus 5 | $0.02060 | $0.02060 |
| Sonnet 5 | $0.00824 | $0.00824 |
| Haiku 4.5 | $0.00412 | $0.00412 |
Grade A, and why
laravel 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Architecture
- Keep business logic out of controllers, middleware, and Blade views.
- Simple, self-contained domain logic (predicates on the model's own attributes, computed values derived from already-loaded data, simple state derivations that touch nothing else) may live as methods on the Eloquent model itself — see the Database and Eloquent section for the boundary. Anything that needs external services, repositories, model managers, or new database queries goes through an Action.
- Use Actions for orchestration-heavy use cases.
- Treat controllers, jobs, events, listeners, and commands as entry points.
- Entry points must stay slim: validate input, delegate work, return a response.
Layer Responsibilities
- Controllers: accept validated input, authorize access, delegate work.
- Actions: orchestrate use cases and business flows.
- Services: focused stateless domain/application services.
- Repositories: read-only data access.
- ModelManagers: write-only persistence.
- Data Builders: multi-method classes that map, hydrate, or normalize input into DTOs. Not Action pattern — no
__invoke(). Never query the database. - Eloquent Models: framework boilerplate (relationships, scopes, casts, accessors) plus simple self-contained domain methods on own data — see the Database and Eloquent section for the boundary.
- Shared Concerns (
app/Concerns/): globally shared and reusable logic — typically traits — that is domain-agnostic and consumed across two or more unrelated domains. Never a home for domain-specific code. See the Shared Concerns section below.
Shared Concerns
app/Concerns/is the canonical home for all globally shared and reusable logic in the application — typically traits, but also small reusable helpers and value objects that exist purely to be consumed across unrelated domains.- Place a trait or helper in
app/Concerns/only when it is globally applicable (consumed across two or more unrelated domains, layers, or entry points), domain-agnostic (no knowledge of a concrete model, aggregate, feature flow, or business rule), and reusable as-is (consumers use it without further specialization). Validation rule traits are exempt from all three — the Validation section below mandates a trait here for every rule set regardless of consumer count or domain scope. - Never put domain-specific logic in
app/Concerns/— anything tied to a concrete model, feature flow, or business rule must live in the relevant business-logic layer underapp/{Domain}/. A validation rule trait named for the aggregate it validates is the sanctioned exception: a rule set is a declarative input contract, not business logic. - Validation rule traits (see the Validation section below) are one specific worked example of this rule, not the only allowed category.
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.
- 2d ago First seen · 194 lines · 4,121 tokens per session scan A 9f30671cbca1
laravel is a cursor rule published in the GitHub repository pekral/cursor-rules (6 stars, last pushed 8d ago), licensed MIT. It adds 4,121 tokens to every session, about $0.0206 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.
Other cursor rules, from other repositories
php
Rules applied when working in PHP files (incl. Laravel, Symfony, WordPress).
10-backend
Laravel Admin 后端开发规范.
laravel
Laravel: Eloquent, Form Requests, policies.
php
PHP 8.x+: typed properties, PSR standards.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
boffin-cpp-routing
Activate ParselFire Core C++ pack index.