← スキル一覧に戻る

python
by htlin222
pythonは、other分野における実用的なスキルです。複雑な課題への対応力を強化し、業務効率と成果の質を改善します。
⭐ 66🍴 4📅 2026年1月23日
SKILL.md
name: python description: Write idiomatic Python with advanced features. Use for Python development, refactoring, or optimization.
Python Development
Write clean, performant, idiomatic Python code.
When to Use
- Writing Python code
- Refactoring Python projects
- Performance optimization
- Setting up Python tooling
- Code review for Python
Python Best Practices
Code Style
- Follow PEP 8
- Use type hints (Python 3.9+)
- Prefer f-strings over .format()
- Use pathlib over os.path
Modern Features
# Type hints
def process(data: list[dict]) -> dict[str, int]:
...
# Dataclasses
from dataclasses import dataclass
@dataclass
class User:
name: str
email: str
active: bool = True
# Context managers
from contextlib import contextmanager
@contextmanager
def timer():
start = time.time()
yield
print(f"Elapsed: {time.time() - start:.2f}s")
# Generators for memory efficiency
def read_large_file(path):
with open(path) as f:
yield from f
Error Handling
# Custom exceptions
class ValidationError(Exception):
def __init__(self, field: str, message: str):
self.field = field
self.message = message
super().__init__(f"{field}: {message}")
# Proper exception chaining
try:
process()
except ValueError as e:
raise ProcessingError("Failed to process") from e
Project Structure
project/
├── src/
│ └── package/
│ ├── __init__.py
│ └── module.py
├── tests/
│ └── test_module.py
├── pyproject.toml
└── README.md
Tooling Setup
# pyproject.toml
[tool.ruff]
line-length = 88
select = ["E", "F", "I", "UP"]
[tool.mypy]
strict = true
[tool.pytest.ini_options]
testpaths = ["tests"]
Testing Pattern
import pytest
@pytest.fixture
def sample_data():
return {"key": "value"}
def test_process(sample_data):
result = process(sample_data)
assert result["status"] == "success"
Examples
Input: "Refactor this Python code" Action: Apply PEP 8, add type hints, simplify logic, improve error handling
Input: "Make this faster" Action: Profile, identify bottlenecks, use generators/caching, verify improvement
スコア
総合スコア
55/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です


