← Back to list

core-python-best-practices
by mdbabumiamssm
⭐ 9🍴 2📅 Jan 23, 2026
SKILL.md
name: core-python-best-practices description: Essential guidelines for writing modern, type-safe, and idiomatic Python 3 code. license: MIT metadata: author: AI Group version: "1.0.0" category: Software_Engineering compatibility:
- system: Python 3.10+ allowed-tools:
- read_file
- replace
- write_file
Core Python Best Practices
This skill defines the coding standards for Python development within the project. It emphasizes modern features, type safety, and readability.
When to Use This Skill
- New Scripts: Starting a new agent or tool.
- Refactoring: Modernizing legacy code.
- Library Design: Creating reusable modules.
Core Capabilities
- Type Hinting: Mandatory use of
typingmodule or native types (Python 3.9+). - Data Classes: Using
@dataclassorPydanticfor data containers instead of raw dictionaries/tuples. - Modern Control Flow: Using
match/case(Python 3.10) where appropriate. - Error Handling: Proper use of
try/exceptchains and custom exceptions.
Workflow
- Define Interface: Start with function signatures and type hints.
- Select Structure: Choose between a simple function, a class, or a dataclass.
- Implement: Write logic using list comprehensions and generators where possible.
- Document: Add docstrings (Google or NumPy style).
Example Usage
User: "Write a function to process a list of users."
Agent Action:
- Reads
references/rules.md. - Generates:
from dataclasses import dataclass @dataclass class User: id: int name: str def process_users(users: list[User]) -> None: """Processes a list of users.""" for user in users: ...
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon