with one click
python-best-practices
Python best practices e styleguide
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Python best practices e styleguide
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | python-best-practices |
| description | Python best practices e styleguide |
| triggers | ["python","pep8","ruff","black","flake8","mypy","type hints"] |
| sources | ["https://docs.astral.sh/ruff/","https://github.com/kennethreitz/python-guide","https://github.com/wemake-services/wemake-python-styleguide","https://github.com/vinta/awesome-python"] |
Convenções e styleguide para código Python.
SEMPRE usar type hints em todas as assinaturas de função:
from typing import Optional, List, Dict, Any
def process_data(
user_id: int,
data: Dict[str, Any],
optional_param: Optional[str] = None
) -> List[Dict[str, Any]]:
"""Processa dados do usuário."""
return []
Quando um módulo tem mais de uma classe, cada classe deve estar em um arquivo separado:
# ❌ ERRADO
utils/validators.py:
- EmailValidator
- PhoneValidator
- URLValidator
# ✅ CORRETO
utils/validators/
├── __init__.py
├── email.py
├── phone.py
└── url.py
black .
isort .
flake8 .
mypy src/
project/
├── src/
│ ├── app/
│ │ ├── __init__.py
│ │ ├── main.py
│ │ └── modules/
│ └── tests/
├── requirements/
│ ├── base.txt
│ ├── dev.txt
│ └── prod.txt
└── pyproject.toml
ruff check . --fix e ruff format .)Integração completa com Notion usando MCP customizado (notion-automation-suite)
Gera critérios de aceite Given/When/Then para requisitos funcionais. Inclui happy path, edge cases e falhas.
Cria Architecture Decision Records (ADRs) para decisões técnicas. Inclui alternativas, justificativa e consequências.
Extrai especificações de um sistema legado (código existente) quando não há documentação adequada.
Converte input não estruturado (texto, notas, docs parciais) em requisitos funcionais (FR) e perguntas abertas. Não inventa requisitos.
Ruff como linter e formatter padrão para Python (substitui Flake8, Black, isort)