strict-python-mode
БесплатноБез исполняемых скриптовНе проверенEnforces type hints, docstrings, and Python best practices. Use when writing or refactoring Python code, creating new functions, or when user mentions…
Об этом скилле
Strict Python Mode
Core Principles
When writing Python code in this project, ALWAYS follow these rules:
Type hints are mandatory
- Every function parameter must have a type hint
- Every function must have a return type annotation
- Use
from collections.abc importfor generic types (list, dict, set) - Never use
Anytype - if type is unknown, useobjector create proper Protocol
Docstrings are required
- Every public function/method needs a docstring
- Use Google-style docstrings format
- Include Args, Returns, Raises sections
Modern Python syntax (3.12+)
- Use
list[str]instead ofList[str]from typing - Use
dict[str, int]instead ofDict[str, int] - Use
X | Noneinstead ofOptional[X] - Use
X | Yfor Union types
- Use
Code Quality Checks
Before finishing ANY code changes, run these checks:
# 1. Format with Ruff
poetry run ruff format .
# 2. Lint with Ruff
poetry run ruff check . --fix
# 3. Type check with mypy (if available)
poetry run mypy app/ --ignore-missing-imports
Example: Good vs Bad
❌ Bad (will be rejected)
def get_user(id):
user = db.get(id)
return user
✅ Good (approved)
def get_user(user_id: int) -> User | None:
"""Fetch user by ID from database.
Args:
user_id: The unique identifier of the user
Returns:
User object if found, None otherwise
Raises:
DatabaseError: If database connection fails
"""
user = db.get(user_id)
return user
FastAPI-Specific Rules
Endpoint Signatures
# Always use dependency injection
@router.get("/users/{user_id}")
async def get_user(
user_id: int,
db: DatabaseSession = Depends(get_db),
current_user: User = Depends(get_current_user),
) -> UserResponse:
"""Get user by ID."""
...
Response Models
# Always define explicit response models
class UserResponse(BaseModel):
id: int
username: str
email: EmailStr
created_at: datetime
class Config:
from_attributes = True
Validation Rules
Before ANY commit:
- All new functions have type hints
- All public functions have docstrings
- Ruff format passes with no changes needed
- Ruff check passes with no errors
- If mypy is available, it passes with no errors
If any check fails, FIX IT before showing me the code.
Установить strict-python-mode в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
EditWriteReadBash(ruff:*, mypy:*)FAQ
Что делает скилл strict-python-mode?
Enforces type hints, docstrings, and Python best practices. Use when writing or refactoring Python code, creating new functions, or when user mentions "production-ready" or "type-safe" code.
Как установить скилл strict-python-mode?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл strict-python-mode запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic