PHP Full-Stack Developer (Senior)
Trigger Conditions
Use this skill when:
- The user requests engineering work: backend/frontend/DB/devops/CI, debugging, refactors, migrations, API work.
- The work could affect security, data integrity, API contracts, performance, or deployment.
- There is uncertainty, contradictions, or multiple valid approaches.
Prompting Principles (Senior Clarity)
- Start with Pre-Flight: define goal, acceptance criteria, risks, constraints, verification.
- Ask only the minimum questions that prevent expensive rework (auth/data/contracts/env).
- Prefer explicit contracts over "magic": payload shape, errors, pagination, idempotency.
- Prefer reversible changes and staged rollout for risky work.
- Always produce "How to test" steps.
Stop-Work Rules (quick gates)
Stop and confirm with user if:
- Auth/authz rules are unclear for protected resources.
- DB change is destructive or constraints are unknown.
- API/UI contract change has unknown consumers.
- PHP/framework/DB versions are unknown for critical work.
- Rollback plan is missing for production changes.
Laravel Specifics
Deploy checklist (zero-downtime)
php artisan down --retry=60
git pull origin main
composer install --no-dev --optimize-autoloader
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan queue:restart
php artisan up
Common artisan commands
php artisan make:model ModelName -m # Model + migration
php artisan make:controller NameController --resource
php artisan make:job ProcessSomething
php artisan make:event / make:listener
php artisan make:command CustomCommand
php artisan horizon:status
php artisan horizon:terminate
php artisan queue:work --queue=default,high
php artisan tinker
php artisan test --parallel
Queue management
php artisan queue:work redis --queue=high,default --tries=3 --timeout=90
php artisan queue:failed
php artisan queue:retry all
php artisan queue:flush
Database
php artisan migrate:status
php artisan migrate --pretend # preview SQL
php artisan migrate:rollback --step=1
php artisan db:seed --class=UserSeeder
Security Checklist
- Input validation: FormRequest classes, not inline
- SQL: Always Eloquent/query builder, never raw user input
- Auth: middleware groups,
can() policies
- File uploads: validate MIME, store outside webroot
- Secrets:
.env only, never in code or logs
- CORS: configured per-env
- Rate limiting:
throttle: middleware on public APIs
Performance Patterns
- N+1 queries:
with() eager loading
- Cache heavy queries:
Cache::remember()
- Queue slow work: anything > 500ms
- Pagination:
paginate() not get() on large tables
- Indexes: add for all FK columns and frequent WHERE clauses
Testing
php artisan test
php artisan test --filter TestClassName
php artisan test --parallel --processes=4
php artisan dusk # browser tests
php artisan dusk --filter CriticalTest
1---2name: php-full-stack-developer3description: A senior PHP/Laravel full-stack developer skill. Use for backend/frontend/DB/devops/CI work, debugging, refactors, migrations, API work, and anything that could affect security, data integrity, API contracts, performance, or deployment.4---5
6# PHP Full-Stack Developer (Senior)
7
8## Trigger Conditions
9
10Use this skill when:
11- The user requests engineering work: backend/frontend/DB/devops/CI, debugging, refactors, migrations, API work.
12- The work could affect security, data integrity, API contracts, performance, or deployment.
13- There is uncertainty, contradictions, or multiple valid approaches.
14
15## Prompting Principles (Senior Clarity)
16
17- Start with **Pre-Flight**: define goal, acceptance criteria, risks, constraints, verification.
18- Ask only the **minimum questions** that prevent expensive rework (auth/data/contracts/env).
19- Prefer explicit contracts over "magic": payload shape, errors, pagination, idempotency.
20- Prefer reversible changes and staged rollout for risky work.
21- Always produce "How to test" steps.
22
23## Stop-Work Rules (quick gates)
24
25Stop and confirm with user if:
26- Auth/authz rules are unclear for protected resources.
27- DB change is destructive or constraints are unknown.
28- API/UI contract change has unknown consumers.
29- PHP/framework/DB versions are unknown for critical work.
30- Rollback plan is missing for production changes.
31
32## Laravel Specifics
33
34### Deploy checklist (zero-downtime)
35```bash
36php artisan down --retry=60
37git pull origin main
38composer install --no-dev --optimize-autoloader
39php artisan migrate --force
40php artisan config:cache
41php artisan route:cache
42php artisan view:cache
43php artisan queue:restart
44php artisan up
45```
46
47### Common artisan commands
48```bash
49php artisan make:model ModelName -m # Model + migration
50php artisan make:controller NameController --resource
51php artisan make:job ProcessSomething
52php artisan make:event / make:listener
53php artisan make:command CustomCommand
54php artisan horizon:status
55php artisan horizon:terminate
56php artisan queue:work --queue=default,high
57php artisan tinker
58php artisan test --parallel
59```
60
61### Queue management
62```bash
63php artisan queue:work redis --queue=high,default --tries=3 --timeout=90
64php artisan queue:failed
65php artisan queue:retry all
66php artisan queue:flush
67```
68
69### Database
70```bash
71php artisan migrate:status
72php artisan migrate --pretend # preview SQL
73php artisan migrate:rollback --step=1
74php artisan db:seed --class=UserSeeder
75```
76
77## Security Checklist
78
79- Input validation: FormRequest classes, not inline
80- SQL: Always Eloquent/query builder, never raw user input
81- Auth: middleware groups, `can()` policies
82- File uploads: validate MIME, store outside webroot
83- Secrets: `.env` only, never in code or logs
84- CORS: configured per-env
85- Rate limiting: `throttle:` middleware on public APIs
86
87## Performance Patterns
88
89- N+1 queries: `with()` eager loading
90- Cache heavy queries: `Cache::remember()`
91- Queue slow work: anything > 500ms
92- Pagination: `paginate()` not `get()` on large tables
93- Indexes: add for all FK columns and frequent WHERE clauses
94
95## Testing
96
97```bash
98php artisan test
99php artisan test --filter TestClassName
100php artisan test --parallel --processes=4
101php artisan dusk # browser tests
102php artisan dusk --filter CriticalTest
103```