Самопроверка перед PR

Проходит чек-листом по вашему же diff перед открытием PR: отладочный мусор, мёртвый код, секреты, тесты, нейминг, выход за рамки задачи, влияние на миграции и конфиг. Используйте, когда вы собираетесь открыть PR или работа закончена.

Код-ревьюПак: Код-ревью97 строкself-review-before-pr

Установка

Выполните одну команду — она сохранит SKILL.md в папку скиллов агента. Перезапустите агента, и он подхватит скилл сам.

Claude Code — macOS, Linux
mkdir -p ~/.claude/skills/self-review-before-pr && curl -fsSL https://anymodel.org/en/skills/code-review/self-review-before-pr/SKILL.md -o ~/.claude/skills/self-review-before-pr/SKILL.md
Codex, Cursor — macOS, Linux
mkdir -p ~/.agents/skills/self-review-before-pr && curl -fsSL https://anymodel.org/en/skills/code-review/self-review-before-pr/SKILL.md -o ~/.agents/skills/self-review-before-pr/SKILL.md
Claude Code — Windows PowerShell
New-Item -ItemType Directory -Force "$HOME\.claude\skills\self-review-before-pr" | Out-Null; Invoke-WebRequest https://anymodel.org/en/skills/code-review/self-review-before-pr/SKILL.md -UseBasicParsing -OutFile "$HOME\.claude\skills\self-review-before-pr\SKILL.md"
Codex, Cursor — Windows PowerShell
New-Item -ItemType Directory -Force "$HOME\.agents\skills\self-review-before-pr" | Out-Null; Invoke-WebRequest https://anymodel.org/en/skills/code-review/self-review-before-pr/SKILL.md -UseBasicParsing -OutFile "$HOME\.agents\skills\self-review-before-pr\SKILL.md"

Другой агент: сохраните файл в его папку скиллов или дайте ему ссылку на файл: https://anymodel.org/en/skills/code-review/self-review-before-pr/SKILL.md

SKILL.md

Исходник

Self-Review Before PR

Read your own diff as if a stranger wrote it. Everything you catch here is a review round trip you save.

1. Look at exactly what will be submitted

git fetch origin
git status --short
git diff origin/main...HEAD --stat
git diff origin/main...HEAD
git diff                      # anything unstaged or forgotten?
git diff --staged              # staged but not committed
git ls-files --others --exclude-standard   # untracked files

Read the whole diff top to bottom once without fixing anything, then go through the checklist below and fix.

2. Checklist

Leftovers:

  • Debug output: console.log, print, dbg!, debugger, TODO/FIXME you added, commented-out code.
  • Temporary files, local scripts, logs, .bak files, editor settings, build output accidentally tracked.
  • Focus and skip markers left in tests (.only, fit, .skip, xit, @pytest.mark.skip, t.Skip).

Secrets and private data:

  • API keys, tokens, passwords, private URLs, real emails or phone numbers, internal hostnames in code, tests, fixtures or docs.
  • .env files or credentials staged. If found, stop and tell the user; the secret must be rotated, not just deleted.

Scope:

  • Every changed file is related to the stated goal. Unrelated reformatting, drive-by renames or lockfile churn should be split into a separate commit or PR.
  • Diff size is reviewable. If it is huge, propose a split into independent commits or PRs.

Correctness:

  • Edge cases handled: empty input, null, large input, errors from network or disk.
  • Error paths do something sensible and do not swallow exceptions silently.
  • No hardcoded values that belong in config.

Tests:

  • New behavior has a test; a bug fix has a test that fails without the fix.
  • The test suite, linter, formatter and type checker pass locally. Run them and note the result.
  • Tests assert behavior, not only that code runs.

Naming and clarity:

  • Names say what things are; no leftover tmp, data2, foo.
  • Comments explain why, not what; outdated comments updated or removed.
  • Public APIs, docs and README updated if behavior changed.

Impact outside the code:

  • Database migrations: reversible, safe on big tables, deploy order considered.
  • Config and environment: new env vars documented and added to examples and deployment files.
  • Dependencies: every new package is needed and intended; lockfile changes match.
  • Backward compatibility: API shape, CLI flags, file formats, events consumed by others.
  • Rollout and rollback: can this be deployed safely, and undone?

3. Commits and branch

git log --oneline origin/main..HEAD
  • Commit messages are clear and follow the repo's convention; no "wip" or "fix fix".
  • The branch is based on a recent main (git merge-base --is-ancestor origin/main HEAD && echo "main included" || echo "behind main"; the command itself answers only with its exit code). If not, offer to rebase or merge and ask before rewriting shared history.

4. Output format

Fix what is safe to fix (leftovers, naming, missing tests the user asked for) and report:

Ready to open PR: yes / no
Fixed during self-review: <list>
Needs your decision: <list, e.g. split the PR, rotate a leaked key>
Checks run: <commands and results>
Risks to mention in the PR description: <migration, env var, behavior change>

Pitfalls

  • Do not skip the untracked-files check; forgotten new files break CI.
  • Do not "clean up" unrelated code while at it; that is the scope creep you are looking for.
  • Do not delete files, rewrite history or force-push without asking the user.
  • Do not claim tests pass unless you ran them in this session.
  • Do not open the PR yourself unless the user asked for it.

Source: AnyModel skills catalog · License: CC BY 4.0

Подключить через AnyModel API

Скилл работает на той модели, которую использует агент. Подключите Claude Code, Codex или Cursor к AnyModel и запускайте его на Claude, GPT, Gemini и других моделях по одному ключу — оплата за токены, без подписки.

Ещё из пака Код-ревью

Ревью пул-реквеста

Ревьюит PR, ветку или незакоммиченные изменения: сначала ошибки в логике, потом дизайн; замечания по важности, с файлом и строкой. Используйте, когда просят проверить PR, ветку или diff.

Ревью безопасности

Проверяет изменение на инъекции, сломанную авторизацию, утечки секретов, SSRF, path traversal, небезопасную десериализацию, слабую криптографию и отсутствие rate limit, прослеживая недоверенный ввод до опасных мест. Используйте, когда просят аудит безопасности изменения.

Ревью производительности

Ищет проблемы производительности: N+1-запросы, работу в горячих циклах, неограниченный рост памяти, отсутствующие индексы, блокирующий I/O в запросе и лишние мелкие сетевые вызовы. Используйте, когда код медленный или нужно проверить изменение на производительность.

Ответы на комментарии ревью

Разбирает комментарии ревьюера к PR: проверяет каждое утверждение по коду, исправляет то, что верно, возражает с доказательствами там, где неверно, и готовит ответ на каждый комментарий. Используйте, когда пользователь прислал комментарии ревьюера, которые нужно отработать.