Claude-skill-registry coding-standard-python
Enforce Python PEP 8 coding standards including snake_case variables, PascalCase classes, and snake_case filenames.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/coding-standard-python" ~/.claude/skills/majiayu000-claude-skill-registry-coding-standard-python && rm -rf "$T"
manifest:
skills/data/coding-standard-python/SKILL.mdsource content
Python Coding Standards (PEP 8)
When reviewing or generating Python code, follow these rules:
File Naming
- Source files: Use snake_case (e.g.,
,user_service.py
)api_client.py - Package directories: Use snake_case (e.g.,
,data_processing/
)utils/ - Test files: Use
prefix (e.g.,test_
)test_user_service.py - Config files: Use snake_case (e.g.,
)config_settings.py
Variable Naming
- Variables: snake_case (e.g.,
,user_name
,is_active
)total_count - Constants: UPPER_SNAKE_CASE (e.g.,
,MAX_RETRIES
)API_BASE_URL - Boolean variables: Prefix with
,is_
,has_
,can_
(e.g.,should_
,is_loading
)has_error - Protected variables: Single underscore prefix (e.g.,
)_internal_data - Private variables: Double underscore prefix (e.g.,
)__private_data
Function Naming
- Functions: snake_case (e.g.,
,calculate_total()
)fetch_user_data() - Private functions: Prefix with underscore (e.g.,
,_validate_input()
)_process_data() - Dunder methods: Double underscores (e.g.,
,__init__
,__str__
)__repr__
Class Naming
- Classes: PascalCase (e.g.,
,UserService
,DataProcessor
)ApiClient - Exception classes: PascalCase with
orError
suffix (e.g.,Exception
)ValidationError - Abstract classes: PascalCase, optionally prefix with
orBase
(e.g.,Abstract
)BaseHandler
Method Naming
- Instance methods: snake_case (e.g.,
,get_user()
)process_data() - Class methods: snake_case with
decorator@classmethod - Static methods: snake_case with
decorator@staticmethod - Properties: snake_case with
decorator@property
Module Organization
- Imports at the top: standard library, third-party, local imports (separated by blank lines)
- Module-level dunder names after imports (
,__all__
)__version__ - One class per file for large classes; multiple related classes okay for small ones
- Use
to define public API__all__