gesmith0606/claude-config-public/python-idioms
Claude Code and agent skill by gesmith0606/claude-config-public
- community
Checking that the SKILL.md file is still in the repository.
Declares the user's Python toolchain defaults and idiom decisions so each session stops re-negotiating tool choice. Use when starting a new Python project, picking a linter/formatter, choosing between dataclass and Pydantic, deciding on async, or setting up pytest fixtures.
Install
npx vskill@latest install gesmith0606/claude-config-public/python-idiomsSKILL.md
The same SKILL.md was published earlier as gesmith0606/claude-config-public/python-idioms.
Python Idioms
Routing: dataframe correctness →dataframes; the TDD cycle itself →test-driven-development; error-handling design →error-handling.
One page of locked-in decisions. Claude already knows this language; this skill stops relitigating tool choice. Follow these defaults unless the project already diverges — if it does, note the delta and move on.
Toolchain defaults
| Concern | Use | Not | |
|---|---|---|---|
| Package/env management | uv | pip, poetry, venv | |
| Lint + format + import sort | ruff | black + flake8 + isort | |
| Type checking | mypy | (see ty note below) | |
| Testing | pytest + pytest-cov | unittest |
uv — already installed. Always use it.
ruff replaces black + flake8 + isort in one pass. Default config in pyproject.toml:
mypy is the safe default today. ty (astral-sh/ty) is the faster forward path but still BETA as of mid-2025 — do not default to it yet; note the option when mypy is the bottleneck.
dataclass vs Pydantic v2
Rule: dataclass for internal value objects; Pydantic v2 for anything crossing a trust boundary.
- Internal pipeline node, named tuple replacement, simple struct →
@dataclass - API request/response, config file, CLI args, external JSON →
pydantic.BaseModel
Pydantic v2 only. Do not mix v1 patterns (orm_mode, validator) — use model_config and @field_validator.
Typing defaults
Prefer typed shapes over bare containers:
Use X | None (Python 3.10+ union syntax) over Optional[X].
pytest quick-ref
Coverage: uv run pytest --cov=src --cov-report=term-missing
Async rule
Sync first. Add asyncio only when an I/O boundary forces concurrent waiting (HTTP fan-out, multiple DB calls in parallel). Never for CPU-bound work — use multiprocessing or concurrent.futures.
If you do go async: asyncio.TaskGroup (3.11+) over gather; anyio if you need backend-agnostic code.
Profiling ladder
Start cheap; escalate only when the previous step doesn't answer the question.
- cProfile — call-count hotspots, zero install:
``bash uv run python -m cProfile -s cumulative my_script.py | head -30 ``
- py-spy — sampling profiler, attach to live process, no code changes:
``bash uv tool install py-spy py-spy top --pid <PID> # live top-like view py-spy record -o profile.svg --pid <PID> # flamegraph ``
- memray — memory profiling. Linux/macOS/WSL only (not native Windows):
``bash uv add --dev memray uv run memray run my_script.py uv run memray flamegraph memray-my_script.py.bin ``
All tooling runs locally. No egress.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/python-idioms/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/gesmith0606/claude-config-public/python-idioms)