php-review
Skill0 starsChanged 22 days agoMITView on GitHub
Review PHP code in Laravel or Symfony projects for real bugs - transactions, race conditions, N+1 queries, security holes, unsafe migrations. Use when the user asks to "проверь код", "сделай ревью", "review this PHP", "посмотри PR", or before committing changes in a Laravel or Symfony project.
In this repository3 other files it gives its agents.
- go-serviceSkill
- interview-prepSkill
- learning-articleSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Default: the current diff (git diff and git diff --staged).
- Distinctive: line 14
Read every changed file fully, not only the diff hunks, and open the code they call when a finding depends on it.
- Very specific: line 23
Read-then-write races: checking a balance or stock and then updating without lockForUpdate() / pessimistic lock or an atomic UPDATE ...
- Distinctive: line 60
Write in Russian. For every finding:
- Distinctive: line 71
Only report what you verified in the code.
- Distinctive: line 73
Do not change files unless the user asks to fix the findings.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill 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
PHP review
Find problems that will hurt in production. Skip style: formatting, naming taste and "I would have written it differently" are not findings.
What to review
- Default: the current diff (
git diffandgit diff --staged). If it is empty, the last commit. If the user names files, a branch or a PR, review that. - Detect the framework from
composer.json(laravel/frameworkorsymfony/framework-bundle) and its version. - Read every changed file fully, not only the diff hunks, and open the code they call when a finding depends on it.
Checklist
Go through every item that applies to the changed code.
Data and transactions
- Several writes that must succeed together without
DB::transaction/$em->wrapInTransaction. - External calls (HTTP, queues, emails) inside a transaction, or events dispatched before commit (
afterCommitmissing for Laravel jobs and listeners). - Read-then-write races: checking a balance or stock and then updating without
lockForUpdate()/ pessimistic lock or an atomicUPDATE ... WHERE. - Unique things guarded only in code without a unique index.
- Money in
float. Dates without explicit timezone.
Queries
- N+1: relations used in a loop without
with()/ joins /fetch="EAGER"where needed. ->get()orfindAll()on tables that grow; missing pagination orchunkById/toIterable().- Raw SQL built with string concatenation of user input.
- New
WHERE/ORDER BYcolumns on big tables without an index.
Migrations
- Locking changes on big tables: adding a
NOT NULLcolumn without default, changing column types, adding indexes withoutCONCURRENTLYon PostgreSQL. - Destructive changes (drop column, rename) in the same release as the code that stops using them.
down()that cannot restore data, when the project relies on rollbacks.
Security
- Missing authorization: no policy / voter /
authorize()check, object fetched by id without checking the owner. - Mass assignment:
$guarded = [],fill($request->all()), Symfony forms without explicit fields. - Validation missing or done after use. Trusting
ids, prices or roles from the request. {!! !!}in Blade or|rawin Twig with user data.- File uploads: no type or size check, original file name used in a path.
- Secrets in code or logged. Sensitive data in exceptions returned to the client.
Retries and queues
- Jobs that are not safe to run twice (charging, sending, incrementing) without an idempotency guard.
- POST endpoints that create money-related records without idempotency.
- Missing
$tries,$backoff,failed()for jobs that call external services.
Errors
- Swallowed exceptions (
catch (\Throwable) {}), especially around money and external calls. - Wrong HTTP status for the situation (500 for validation, 200 with
"error"in body).
Tests
- Changed behaviour without a test. Point to the exact case that is missing, not "add more tests".
Output
Write in Russian. For every finding:
[критично | важно | заметка] path/to/File.php:42
Что не так: одно предложение.
Когда сломается: конкретный сценарий с данными.
Как исправить: код или точное действие.Order by severity. "Критично" means data loss, money, security or a crash in a common path; "важно" means a real bug in a less common path or a serious performance problem; "заметка" is everything else worth knowing.
Only report what you verified in the code. If something depends on code you could not see, say so and do not guess. If nothing is wrong, say that plainly in one line instead of inventing findings.
Do not change files unless the user asks to fix the findings.
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.

