Python coding style enforcement (PEP standards, type hints, docstrings, modern patterns). Auto-loads when writing or reviewing Python code.
62
73%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./plugins/python-experts/skills/python-style/SKILL.mdThis skill automatically activates when writing Python code to ensure consistency with PEP standards, type hints, and modern Python idioms.
list[str] not List[str], X | None not Optional[X])# Classes: PascalCase
class UserAccount:
pass
# Functions/variables: snake_case
def calculate_total():
user_name = "john"
# Constants: SCREAMING_SNAKE_CASE
MAX_RETRY_COUNT = 3
# Private: single underscore prefix
def _internal_helper():
pass# Use built-in generics
def process(items: list[str]) -> dict[str, int]:
pass
# Use | for Optional/Union
def find_user(id: str) -> User | None:
pass
# TypedDict for structured dicts
class UserData(TypedDict):
id: str
name: strexcept: clausesd, temp, x)process, handle, do_stuff)When multiple agents modify the same module, follow these patterns to enable automatic merge resolution by semantic merge tools (mergiraf).
uv run ruff format .
uv run ruff check --fix .This ensures imports are consistently ordered, enabling clean merges.
__all__ Must Be AlphabeticalEnable RUF022 in ruff to enforce this automatically:
[tool.ruff.lint]
select = [
# ... other rules
"RUF022", # unsorted-dunder-all (enforces alphabetical __all__)
]# CORRECT - alphabetical, one per line, no comments
__all__ = [
"ACLFilterSpec",
"Chunk",
"ChunkerInterface",
"Document",
"QueryACLContext",
"Visibility",
]
# WRONG - grouped by category (causes merge conflicts)
__all__ = [
# Types
"Chunk",
"Document",
# Interfaces
"ChunkerInterface",
]Comments inside __all__, import groups, or other lists break deterministic ordering and cause merge conflicts. Keep comments outside:
# ACL and schema types exported for public API
__all__ = [
"ACLFilterSpec",
"Chunk",
"Document",
]__init__.py, etc.)ruff format immediately after changesSemantic merge tools like mergiraf can automatically resolve conflicts when:
Without these patterns, parallel agents adding exports to the same __init__.py will create conflicts requiring manual resolution.
0ebe7ae
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.