Mohammad's personal coding rules and development guidelines, organized by category.
They apply to every Laravel 13 + Livewire project (Livewire 3/4, Alpine, Tailwind, Pest, PHP 8.4). Each rule says what to do, why it is worth doing (its benefit), and when a deviation is acceptable.
New here? Read How to read these rules first (about five minutes). It explains the [H] / [+] tags and the MUST / SHOULD levels. For a one-page overview, read the summary.
Every page has a breadcrumb at the top and previous/next links, so you can read straight through or jump to a topic.
- How to read these rules: notation, rule anatomy, tags and levels, the benefit principle
- Code quality: PHP style, tooling (Pint, PHPStan), honest hand-off, docs
- Proposed rules: ideas not yet adopted, each with its benefit
- Layering and patterns: the request flow, services, policies, enums, DTOs
- Views and components: no inline PHP, CSS or JS; cards not tables; accessibility
- Routes and screens: one URL per task, English kebab-case, named routes, query-string filters
- Data and performance: migrations, money types, indexes, N+1, queues, transactions
- Translations: per-feature bundles, every locale, right-to-left for Arabic
- Security: rate limiting, policies, tenant scoping, soft deletes, audit log
- Testing: Pest rules, integrity of the suite, the pre-hand-off self-check
- Git workflow: branch from
develop, conventional commits, PR contents
- Agent prompt: the short version to paste into a project's
CLAUDE.mdorAGENTS.md CLAUDE.md: the prompt itself, with the MUST rules and the pre-finish checklist
originals/: the unchanged source files,CLAUDE.mdandMohammad-Development-Rules.pdf
| Folder | What's in it |
|---|---|
general/ |
How to read the rules, code quality (PHP style, Pint, PHPStan, honest hand-offs), proposed rules |
architecture/ |
Layering and patterns: thin controllers/Livewire, service layer, policies, enums, DTOs |
frontend/ |
Views and components (no inline PHP/CSS/JS, cards not tables, accessibility) and routes and screens |
backend/ |
Data and performance: migrations, money types, indexes, N+1, queues, transactions |
i18n/ |
Translations: per-feature lang bundles, every locale, RTL for Arabic |
security/ |
Security: rate limiting, policies, tenant scoping, soft deletes, audit log |
testing/ |
Testing: Pest rules and the pre-hand-off self-check |
git/ |
Git workflow: branch from develop, conventional commits, PR contents |
ai-agents/ |
CLAUDE.md, the short prompt to paste into a project's CLAUDE.md or AGENTS.md |
originals/ |
The original source files, unchanged: CLAUDE.md and Mohammad-Development-Rules.pdf |