Provides Python patterns for type-first development with dataclasses, discriminated unions, NewType, and Protocol. Must use when reading or writing Python files.
76
67%
Does it follow best practices?
Impact
88%
1.66xAverage score across 3 eval scenarios
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./data/skills-md/0xbigboss/claude-code/python-best-practices/SKILL.mdType-safe domain model with discriminated unions and NewType
Frozen dataclasses
20%
100%
Discriminated union state
41%
100%
Union type alias
0%
100%
NewType for IDs
100%
100%
match/case exhaustive handling
0%
100%
Descriptive exceptions raised
100%
100%
Exception chaining
0%
0%
Type annotations on all signatures
75%
100%
Comprehensions over loops
0%
0%
No mutable class-level state
100%
100%
Types defined before implementation
100%
100%
Config management with dataclass as single source of truth
Config frozen dataclass
41%
100%
from_env classmethod
20%
100%
No scattered os.getenv
66%
100%
Required value validation
100%
100%
Sensible defaults for optional settings
50%
100%
Config used as single source of truth
100%
100%
Type annotations on config fields
100%
100%
Descriptive startup failure
100%
100%
Config instantiated at module level
100%
100%
No mutable config state
20%
100%
Protocol structural typing and functional patterns
Protocol definition
0%
100%
Protocol used in signatures
0%
100%
pathlib for file paths
0%
100%
Context manager for I/O
100%
37%
Explicit encoding
100%
100%
functools.partial usage
0%
100%
Pure functions preferred
100%
100%
__init__.py public API
100%
100%
Private module naming
0%
100%
Descriptive exceptions
22%
66%
Comprehensions over loops
77%
0%
f772de4
Table of Contents
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.