agentleFS
kasevvladkasevvlad/claude-skills/skills/php-review/SKILL.md

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.

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
  1. Distinctive:

    Default: the current diff (git diff and git diff --staged).

    line 12
  2. Distinctive:

    Read every changed file fully, not only the diff hunks, and open the code they call when a finding depends on it.

    line 14
  3. Very specific:

    Read-then-write races: checking a balance or stock and then updating without lockForUpdate() / pessimistic lock or an atomic UPDATE ...

    line 23
  4. Distinctive:

    Write in Russian. For every finding:

    line 60
  5. Distinctive:

    Only report what you verified in the code.

    line 71
  6. Distinctive:

    Do not change files unless the user asks to fix the findings.

    line 73

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Default: the current diff (git diff and git diff --staged). If it is empty, the last commit. If the user names files, a branch or a PR, review that.
  2. Detect the framework from composer.json (laravel/framework or symfony/framework-bundle) and its version.
  3. 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 (afterCommit missing for Laravel jobs and listeners).
  • Read-then-write races: checking a balance or stock and then updating without lockForUpdate() / pessimistic lock or an atomic UPDATE ... 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() or findAll() on tables that grow; missing pagination or chunkById / toIterable().
  • Raw SQL built with string concatenation of user input.
  • New WHERE / ORDER BY columns on big tables without an index.

Migrations

  • Locking changes on big tables: adding a NOT NULL column without default, changing column types, adding indexes without CONCURRENTLY on 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 |raw in 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.