project-conventions
Defines project-wide engineering rules for Laravel 12 + Blade + MySQL applications. Use when creating, modifying, reviewing, testing, or refactoring project code.
SKILL.md.agents/skills/project-conventions/SKILL.md
GitHubProject Conventions — Laravel 12 + Blade + MySQL
Role
Act as a senior full-stack Laravel engineer. Optimize for correctness, maintainability, security, testability, performance, accessibility, and a clean user experience.
Fixed baseline
- Laravel 12.x
- PHP version: inspect the project; do not assume
- MySQL: inspect actual version/config
- Blade server-rendered UI
- Vite: use the existing asset pipeline
- Tailwind/Alpine: use only if already installed or explicitly requested
Non-negotiable rules
- Inspect the repository before changing it.
- Preserve working project conventions unless there is a concrete reason to change them.
- Prefer Laravel-native features and existing dependencies.
- Do not add packages merely for convenience.
- Controllers stay thin; business workflows do not belong in Blade or bloated controllers.
- Validate all user-controlled input server-side.
- Enforce authorization server-side with middleware/policies/gates as appropriate.
- Prefer Eloquent relationships and query builder parameterization.
- Prevent N+1 queries and unbounded result sets.
- Use database constraints for data integrity.
- Never hard-code secrets or expose
.envvalues. - Never silently weaken authentication, authorization, CSRF, validation, or security.
- Never run destructive production database commands without explicit confirmation.
- Do not invent APIs for packages; inspect
composer.json/package.jsonand installed versions. - Do not assume Livewire, Inertia, Vue, React, or an admin package exists.
- Important new behavior requires automated tests.
- Before declaring completion, run relevant tests/checks and fix failures.
- Make the smallest coherent change that satisfies the requirement.
Preferred structure
Use Laravel conventions first:
app/Http/Controllersapp/Http/Requestsapp/Modelsapp/Policiesapp/Rulesapp/Servicesorapp/Actionsonly when a real boundary is usefulresources/viewsresources/cssresources/jsroutes/web.phpdatabase/migrationsdatabase/factoriesdatabase/seederstests/Featuretests/Unit
Coding standards
- Type parameters and return values where practical.
- Prefer dependency injection.
- Prefer early returns for guard clauses.
- Use meaningful names.
- Keep methods cohesive.
- Avoid speculative abstractions.
- Avoid duplicate business rules.
Change protocol
Before editing:
- Inspect relevant files.
- Trace the existing request/data flow.
- Identify authorization and validation requirements.
- Identify database and UI impact.
- Choose the smallest safe implementation.
After editing:
- Inspect the diff.
- Run targeted tests.
- Run relevant broader tests/build checks.
- Check logs/errors.
- For UI changes, verify browser behavior if browser tooling is available.
- Report assumptions and unresolved risks honestly.