python-coding-standards
Original:🇨🇳 Chinese
Translated
Python Coding Standards, including type hints, logging specifications, naming conventions, code structure, etc. Applicable to all Python code files.
1installs
Sourceqiao-925/qiao-skills
Added on
NPX Install
npx skill4agent add qiao-925/qiao-skills python-coding-standardsTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Python Coding Standards
Unified baseline for Python code implementation phase, covering requirements for types, logging, naming and structure.
⚠️ Core Mandatory Requirements
1. Type Hints
All functions, methods, and class declarations must complete type hints.
- Use for return values with no data
-> None - Public APIs must provide complete docstrings (parameters, return values, exceptions)
2. Logging Specifications
Business code must uniformly obtain logger through , and is prohibited.
src.logger.setup_loggerprint- Except for test sample code
- Error paths must use or
logger.errorlogger.exception
AI Agent Behavior Requirements
When Creating New Files
- Must add type hints
- Must use logger (print is prohibited)
When Modifying Existing Files
- Newly added code must comply with type hint requirements
- Newly added logs must use logger
During Code Review
- Check completeness of type hints
- Check if print is used
Acceptance Criteria
- All functions, methods, and classes have type hints
- Public APIs have complete docstrings
- Logs of key modules cover normal operation and exception branches
Reference Materials
- - Detailed specifications for type hints
references/type-hints.md - - Detailed explanation of logging specifications
references/logging.md - - Detailed explanation of naming conventions
references/naming-conventions.md - - Detailed explanation of code structure
references/code-structure.md