Provides Python patterns for type-first development with dataclasses, discriminated unions, NewType, and Protocol. Must use when reading or writing Python files.
83
Quality
78%
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%
Without context: $0.2633 · 1m 11s · 15 turns · 21 in / 5,005 out tokens
With context: $1.1866 · 3m 22s · 47 turns · 54 in / 13,358 out tokens
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%
Without context: $0.2258 · 51s · 19 turns · 23 in / 2,641 out tokens
With context: $0.2833 · 52s · 17 turns · 704 in / 2,923 out tokens
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%
Without context: $0.3145 · 1m 19s · 21 turns · 23 in / 5,119 out tokens
With context: $0.9521 · 2m 57s · 42 turns · 47 in / 11,208 out tokens
5342bca
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.