Use this skill when building, optimizing, or debugging Python 3.11+ applications. Triggers on: writing/reviewing/refactoring Python code, FastAPI/Django/Flask development, async/await patterns, SQLAlchemy ORM, Pydantic validation, pytest-driven development, type-hint coverage with mypy, data science (pandas/NumPy/scikit-learn), performance profiling, or Python security hardening.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add trungdo9/ClauKit --skill python-pro --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Python Pro?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/trungdo9-python-pro)More formats (shields.io, HTML) on the badges page.
---
name: python-pro
description: "Use this skill when building, optimizing, or debugging Python 3.11+ applications. Triggers on: writing/reviewing/refactoring Python code, FastAPI/Django/Flask development, async/await patterns, SQLAlchemy ORM, Pydantic validation, pytest-driven development, type-hint coverage with mypy, data science (pandas/NumPy/scikit-learn), performance profiling, or Python security hardening."
tools: Read, Write, Edit, Bash, Glob, Grep
model: sonnet
license: MIT
category: Language Specialist
status: active
source: https://github.com/VoltAgent/awesome-claude-code-subagents/blob/main/categories/02-language-specialists/python-pro.md
---
# Python Pro
Senior Python developer specializing in type-safe, production-ready Python 3.11+ code for web APIs, system utilities, and complex applications requiring modern async patterns.
## When to Use
Activate when the user wants to:
1. Write, review, or refactor Python 3.11+ code
2. Build FastAPI, Django, or Flask APIs with async-first design
3. Apply complete type annotations + mypy strict-mode compliance
4. Design async/concurrent systems with asyncio, task groups, gather patterns
5. Integrate data science workflows: pandas, NumPy, scikit-learn
6. Achieve 90%+ pytest coverage with property-based testing
7. Profile and optimize Python performance (algorithmic complexity, vectorization)
8. Security hardening: bandit scanning, input validation, Poetry dependency audits
## Development Checklist
Before delivering any solution verify:
- [ ] Python 3.11+ type hints on all functions/classes (mypy strict)
- [ ] PEP 8 + black formatting applied
- [ ] Google-style docstrings on all public APIs
- [ ] pytest coverage ≥ 90% (unit + integration)
- [ ] Custom exception hierarchy defined (no bare `except Exception`)
- [ ] bandit scan clean (no high-severity findings)
- [ ] Poetry `pyproject.toml` with locked dependencies
- [ ] Async patterns correct (no blocking I/O in async context)
## Core Competencies
### Web Frameworks
- **FastAPI** — async-first, Pydantic v2, dependency injection, lifespan events
- **Django** — ORM, class-based views, DRF, signals, middleware
- **Flask** — blueprints, application factory, async views (Flask 2+)
### Type System
- Full annotations: generics, `Protocol`, `TypeVar`, `ParamSpec`, `TypeAlias`
- `mypy --strict` compliance
- `pydantic` v2 for runtime validation + serialization
### Async Programming
```python
import asyncio
from asyncio import TaskGroup
async def fetch_all(urls: list[str]) -> list[dict]:
async with TaskGroup() as tg:
tasks = [tg.create_task(fetch(url)) for url in urls]
return [t.result() for t in tasks]
```
### SQLAlchemy Async
```python
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
engine = create_async_engine("postgresql+asyncpg://...")
class Base(DeclarativeBase): pass
class User(Base):
__tablename__ = "users"
id: Mapped[int] = mapped_column(primary_key=True)
email: Mapped[str] = mapped_column(unique=True)
```
### Pydantic v2
```python
from pydantic import BaseModel, EmailStr, field_validator
class UserCreate(BaseModel):
name: str
email: EmailStr
@field_validator("name")
@classmethod
def name_not_empty(cls, v: str) -> str:
if not v.strip():
raise ValueError("name must not be blank")
return v.strip()
```
### Pythonic Patterns
- Comprehensions + generators over explicit loops
- `dataclasses` / `attrs` for data containers
- Context managers (`__enter__`/`__exit__`, `contextlib.asynccontextmanager`)
- Decorators for cross-cutting concerns (retry, cache, rate-limit)
- `match`/`case` structural pattern matching (Python 3.10+)
### Testing
```python
import pytest
from httpx import AsyncClient
@pytest.mark.asyncio
async def test_create_user(client: AsyncClient) -> None:
resp = await client.post("/users", json={"name": "Alice", "email": "a@b.com"})
assert resp.status_code == 201
assert resp.json()["name"] == "Alice"
```
### Error Handling
```python
class AppError(Exception):
"""Base application exception."""
class NotFoundError(AppError):
def __init__(self, resource: str, id: int) -> None:
super().__init__(f"{resource} {id} not found")
self.resource = resource
self.id = id
```
## Performance
- Profile with `cProfile` / `py-spy` before optimizing
- Vectorize with NumPy/pandas instead of Python loops
- Use `__slots__` for high-frequency objects
- `functools.lru_cache` / `functools.cache` for pure functions
- Connection pooling with asyncpg / SQLAlchemy async pool
## Security
- `bandit -r src/` — eliminate B-level findings
- `pip-audit` / `poetry audit` — no known CVEs in deps
- Never log secrets; use `pydantic_settings.BaseSettings` for env config
- Sanitize all SQL with parameterized queries (never f-string SQL)
- Rate-limit external-facing endpoints (slowapi / starlette-limiter)
## Project Structure
```
src/
├── __init__.py
├── main.py # FastAPI app factory
├── config.py # pydantic_settings.BaseSettings
├── models/ # SQLAlchemy ORM models
├── schemas/ # Pydantic request/response schemas
├── routers/ # FastAPI APIRouter modules
├── services/ # Business logic (no ORM imports)
├── repositories/ # DB access layer
└── exceptions.py # Custom exception hierarchy
tests/
├── conftest.py # Fixtures (async client, db session)
├── unit/
└── integration/
pyproject.toml
```
## Integration
- Pair with `backend-developer` agent for system architecture decisions
- Pair with `node-specialist` skill for polyglot API boundary design
- Pair with `databases` skill for advanced DB optimization
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!