python-expert-best-practices-code-review — скилл для Claude Code
Набор правил по Python для написания, ревью и рефакторинга кода. Пригодится, когда агент правит обработку ошибок или чистит словари.
npx skills add wispbit-ai/skills --skill python-expert-best-practices-code-review -a claude-codeЧто делает python-expert-best-practices-code-review
Скилл задаёт агенту восемь правил, разбитых по приоритету. Первый уровень — обработка ошибок: обращение к обязательным ключам словаря через d[key], чтобы падать сразу с KeyError, и запрет на общий except, который прячет неожиданные сбои. Второй — типичные баги: изменяемые значения по умолчанию в параметрах и возврат NotImplemented для неподдерживаемых операндов.
Дальше идёт читаемость: списковые включения должны возвращать значение, которое вы используете, а не работать ради побочных эффектов; импорты держатся в начале файла; лишние комментарии и блоки else после return или break убираются. У каждого правила есть свой файл в rules/ с разбором, примерами неправильного и правильного кода и ссылками.
Скилл рассчитан на Python 3.14+. Если ваш проект живёт на более старой ветке, часть примеров придётся проверять руками — синтаксис и поведение там отличаются. Установка идёт через npx skills add, для GitHub Copilot команда другая.
Какие задачи решает
- поймать обязательный ключ словаря сразу, а не через десять шагов
- убрать общий
except, который глотает чужие ошибки - найти изменяемое значение по умолчанию в параметрах функции
- переписать списковое включение, которое работает ради побочного эффекта
- разложить импорты по началу файла и вычистить лишние
else
Примеры запросов агенту
- Отревьюй этот модуль по правилам скилла и покажи, где нарушен
no-mutable-defaults - Отрефактори
parser.py: убери общийexceptи замени обращения к словарю наd[key]там, где ключ обязателен - Проверь списковые включения в
report.py— есть ли среди них те, что не возвращают значение
Как установить python-expert-best-practices-code-review
1Через Skills CLI (Vercel)
npx skills add wispbit-ai/skills --skill python-expert-best-practices-code-review -a claude-code2Вручную: положить файлы
~/.claude/skills/python-expert-best-practices-code-review/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/python-expert-best-practices-code-review/
1Через Skills CLI (Vercel)
npx skills add wispbit-ai/skills --skill python-expert-best-practices-code-review -a codex2Вручную: положить файлы
.agents/skills/python-expert-best-practices-code-review/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add wispbit-ai/skills --skill python-expert-best-practices-code-review -a cursor2Вручную: положить файлы
.cursor/skills/python-expert-best-practices-code-review/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install wispbit-ai/skills python-expert-best-practices-code-review2Вручную: положить файлы
.github/skills/python-expert-best-practices-code-review/SKILL.md1Через Skills CLI (Vercel)
npx skills add wispbit-ai/skills --skill python-expert-best-practices-code-review -a gemini-cli2Командой платформы
gemini skills install https://github.com/wispbit-ai/skills --path skills/python-expert-best-practices-code-reviewВручную: положить файлы
.devin/skills/python-expert-best-practices-code-review/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add wispbit-ai/skills --skill python-expert-best-practices-code-review -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о python-expert-best-practices-code-review
Как установить python-expert-best-practices-code-review в Claude?
Выполните npx skills add wispbit-ai/skills --skill python-expert-best-practices-code-review -a claude-code. Файл скилла окажется по пути ~/.claude/skills/python-expert-best-practices-code-review/SKILL.md.
Что делает этот скилл?
Даёт агенту свод правил по Python: обработка ошибок, типичные баги, читаемость и стиль. Агент опирается на них при написании, ревью и рефакторинге кода.
Для какой версии Python подходят эти правила?
Скилл описывает Python 3.14+. На более старых версиях примеры стоит проверять отдельно.
Исходный текст
SKILL.md · MIT
--- name: python-expert-best-practices-code-review description: Python best practices for writing production-grade code. This skill should be used when writing, reviewing, or refactoring Python code. Triggers on tasks involving Python development, error handling patterns, dictionary operations, and code quality improvements. license: MIT metadata: author: wispbit version: "1.0.0" --- # Python 3.14+ Expert Best Practices Simple, pragmatic, opinionated. Only what matters for writing production-grade python code. ## When to Apply Reference these guidelines when: - Writing Python functions, classes, or modules - Reviewing Python code for error handling issues - Refactoring existing Python codebases - Implementing data validation and API boundaries - Optimizing error detection and debugging patterns ## Rule Categories by Priority | Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Error Handling | CRITICAL | `dict-`, `operators-` | | 2 | Common Bugs | CRITICAL-HIGH | `no-mutable-`, `no-generic-` | | 3 | Code Clarity | HIGH-MEDIUM | `listcomp-`, `no-inline-` | | 4 | Code Style | LOW | `avoid-`, `unnecessary-` | ## Quick Reference - `dict-required-keys` - Use `d[key]` for required dictionary keys to fail fast with KeyError - `no-mutable-defaults` - No mutable defaults in function/method parameters - `operators-return-notimplemented` - Return NotImplemented for unsupported operand types and design + vs += intentionally - `no-generic-except` - Avoid generic except clauses to prevent hiding unexpected errors - `listcomp-no-side-effects` - List comprehensions must produce a value you use (no side-effect listcomps) - `no-inline-imports` - Place all import statements at the top of the file - `avoid-explanatory-comments` - Avoid unnecessary comments for self-documenting code - `unnecessary-else-blocks` - Avoid unnecessary else blocks after return/break/continue statements ## How to Use Read individual rule files for detailed explanations and code examples: ``` rules/dict-required-keys.md rules/no-mutable-defaults.md rules/operators-return-notimplemented.md rules/no-generic-except.md rules/listcomp-no-side-effects.md rules/no-inline-imports.md rules/avoid-explanatory-comments.md rules/unnecessary-else-blocks.md ``` Each rule file contains: - Brief explanation of why it matters - When to use and when not to use the pattern - Implementation requirements - Incorrect code example with explanation - Correct code example with explanation - Additional context and references
© wispbit · MIT · wispbit-ai/skills