Install
npx skillscat add onewaymyway/mini-agent/python-expert Install via the SkillsCat registry.
SKILL.md
Python Expert Skill
When working on Python code:
Style & conventions
- Use Python 3.10+ features: match/case,
|union types, structural pattern matching - Prefer
dataclassesorpydanticover plain dicts for data models - Use
pathlib.Pathoveros.path - Use
f-stringsover.format()or%formatting - Type-annotate all function signatures
Testing
- Write
pytesttests, notunittest - Use
pytest.fixturefor setup - Parametrize with
@pytest.mark.parametrize - Mock with
pytest-mock'smockerfixture
Error handling
- Raise specific exceptions, not bare
Exception - Use
contextlib.suppressfor expected exceptions in cleanup paths - Document exceptions in docstrings
Performance
- Prefer generators over list comprehensions when only iterating
- Use
functools.lru_cache/functools.cachefor pure functions - Profile before optimizing — use
cProfileorpy-spy