{{cookiecutter.project_name}}/.claude/skills/strict-python-mode/SKILL.md
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.
npx skillsauth add afaneor/fastapi-docker-boilerplate strict-python-modeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When writing Python code in this project, ALWAYS follow these rules:
Type hints are mandatory
from collections.abc import for generic types (list, dict, set)Any type - if type is unknown, use object or create proper ProtocolDocstrings are required
Modern Python syntax (3.12+)
list[str] instead of List[str] from typingdict[str, int] instead of Dict[str, int]X | None instead of Optional[X]X | Y for Union typesBefore 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
def get_user(id):
user = db.get(id)
return user
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
# 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."""
...
# Always define explicit response models
class UserResponse(BaseModel):
id: int
username: str
email: EmailStr
created_at: datetime
class Config:
from_attributes = True
Before ANY commit:
If any check fails, FIX IT before showing me the code.
development
Detects API keys, passwords, and secrets in code before they reach git. Use before commits, when working with credentials, or when user mentions "security check" or "secrets".
development
Automated code quality checks before commits. Use before committing code, when finishing a feature, or when user mentions "ready to commit" or "quality check".
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.