laravel-agent-rules / lang
CLAUDE.md9 starsChanged 15 days agoMITView on GitHub
Purpose: store user-facing copy. PHP and Blade read strings via __() / trans_choice() — never inline user-facing literals (see app/CLAUDE.md).
In this repository7 other files it gives its agents.
- app/CLAUDE.mdCLAUDE.md
- bootstrap/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- config/CLAUDE.mdCLAUDE.md
- database/CLAUDE.mdCLAUDE.md
- routes/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
MUST: keep keys stable once shipped — changing a key is a breaking rename for every call site.
- Distinctive: line 22
MUST NOT: put HTML structure in translation strings when a Blade component can own the markup — translate phrases, not full layout.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Localization (lang/)
Purpose: store user-facing copy. PHP and Blade read strings via __() / trans_choice() — never inline user-facing literals (see app/CLAUDE.md).
Layout
- PHP files:
lang/{locale}/*.phpreturning arrays — e.g.lang/en/orders.phpwith keys like'status' => ['pending' => 'Pending']. - JSON files:
lang/{locale}.jsonfor short UI strings keyed by the source English phrase, when the project prefers that style. - MUST name PHP files and array keys
snake_case—orders.php,article_added, notOrders.php/articleAdded. - SHOULD group by domain or feature (
orders,auth,validation) rather than one giantmessages.php.
Keys
- MUST keep keys stable once shipped — changing a key is a breaking rename for every call site.
- SHOULD nest by concept:
__('orders.status.pending')rather than flat__('orders_status_pending'). - MUST add a new key to every locale the app ships, in the same commit. Laravel falls back to the fallback locale per key, so a group that exists only in
lang/en/renders mixed-language sentences ("Saved hace 1 minuto"). A new group file needs its twin in eachlang/{locale}/. - MUST pass interpolations as the second argument:
__('mail.invoice_paid.subject', ['number' => $invoice->number]). - MUST pin a JSON phrase key in
lang/{locale}.json(en.jsonincluded) when it matches a PHP group file name (__('Orders')next tolang/en/orders.php). Without the JSON entry Laravel reads the key as a group, and on a case-insensitive filesystem (macOS default)__('Orders')returns the wholeorders.phparray, while Linux returns the string.
Rules
- MUST NOT put HTML structure in translation strings when a Blade component can own the markup — translate phrases, not full layout.
- AVOID concatenating translated fragments into sentences (word order differs by locale); use one string with placeholders instead.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

