From qe-framework
Generates type-safe, async-first Python 3.11+ code with mypy strict mode, pytest test suites, and black/ruff validation. Useful for type hints, async/await, dataclasses, and structured error handling.
How this skill is triggered — by the user, by Claude, or both
Slash command
/qe-framework:Qpython-proThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Modern Python 3.11+ specialist focused on type-safe, async-first, production-ready code.
Modern Python 3.11+ specialist focused on type-safe, async-first, production-ready code.
mypy --strict, black, ruff
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Code Patterns | references/code-patterns.md | Functions, error handling, dataclasses, async patterns |
| Anti-patterns | references/anti-patterns.md | Mutable defaults, bare except, globals, string loops, file handling |
| Type System | references/type-system.md | Type hints, mypy, generics, Protocol |
| Testing | references/testing.md | pytest, fixtures, mocking, parametrize |
| Async Patterns | references/async-patterns.md | async/await, asyncio, task groups, context managers |
X | None instead of Optional[X] (Python 3.10+)Python Pro uses three essential patterns: basic type-annotated functions, error handling with custom exceptions, and async context managers. See references/code-patterns.md for complete examples.
Basic: Function with type hints and Google-style docstring
def read_config(path: Path) -> dict[str, str]:
"""Read configuration from a file.
Args:
path: Path to the configuration file.
Returns:
Parsed key-value configuration entries.
"""
...
Intermediate: Error handling with custom exception and logging
class ConfigError(Exception):
"""Raised when configuration loading fails."""
pass
def parse_json_config(data: str) -> dict[str, Any]:
"""Parse JSON configuration."""
try:
config = json.loads(data)
except json.JSONDecodeError as e:
logger.error(f"Failed to parse: {e}")
raise ConfigError(f"Invalid JSON: {e}") from e
Advanced: Async context manager with dataclass
@dataclass
class DatabasePool:
"""Database connection pool manager."""
host: str
port: int = 5432
async def __aenter__(self) -> "DatabasePool":
"""Initialize connection pool."""
return self
Use Google-style docstrings for all modules, classes, and functions:
"""Module docstring: One-line summary. Optional longer description."""
def function_name(param: str) -> int:
"""Brief description.
Args:
param: Parameter description.
Returns:
Return value description.
Raises:
ValueError: Error description.
Example:
>>> function_name("test")
42
"""
class ClassName:
"""Class docstring.
Attributes:
attr: Attribute description.
"""
Validate all Python code against these standards:
# Static analysis
ruff check {file} # Report style and logic issues
ruff check --fix {file} # Auto-fix fixable issues
# Type checking (strict mode required)
mypy --strict {file} # Verify full type coverage
# Code formatting
black {file} # Enforce consistent formatting
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B"]
[tool.black]
line-length = 100
target-version = ["py311"]
Any types in public API signaturesBefore committing code, verify:
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))json instead of picklesubprocess.run(["process", filename], check=True)json.loads() or ast.literal_eval() insteadurlparse(url).hostname against whitelist before requestingos.environAvoid common mistakes: mutable default arguments, bare except clauses, global state mutation, string concatenation in loops, and ignoring context managers. See references/anti-patterns.md for complete examples and explanations.
When implementing Python features, provide:
Python 3.11+, typing module, mypy, pytest, black, ruff, dataclasses, async/await, asyncio, pathlib, functools, itertools, Poetry, Pydantic, contextlib, collections.abc, Protocol
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub inho-team/qe-framework --plugin qe-framework