From code-quality
Provides tiered Python development guidance from simple scripts to production systems, covering PEP-8 style, Ruff linting, pytest testing, mypy typing, uv tooling, security, and packaging.
npx claudepluginhub melodic-software/claude-code-plugins --plugin code-qualityThis skill is limited to using the following tools:
Comprehensive guide to modern Python development covering conventions, testing, tooling, security, performance, and ecosystem best practices (2024-2025 standards).
assets/pyproject-toml-template.tomlreferences/async-patterns.mdreferences/code-quality-tools.mdreferences/common-libraries.mdreferences/conventions-and-style.mdreferences/dependency-management.mdreferences/docstrings-documentation.mdreferences/installation/linux.mdreferences/installation/macos.mdreferences/installation/overview.mdreferences/installation/windows.mdreferences/packaging-distribution.mdreferences/performance-optimization.mdreferences/project-structure.mdreferences/security-best-practices.mdreferences/skill-evaluation-scenarios.mdreferences/testing-methodology.mdreferences/type-hints.mdSets up Python projects with uv for deps/envs, ruff for linting/formatting, ty for types, pytest for testing. Use for new projects, scripts, or migrations from pip/Poetry.
Guides Python 3.11+ CLI apps with Typer/Rich, pytest test suites, ruff/mypy fixes, pyproject.toml config, portable scripts, and code reviews. Routes to specialist sub-skills.
Guides idiomatic Python 3.12+ development for code, CLI tools, scripts, and services using stdlib first, type hints, protocols, flat control flow, and uv/ruff/pyright toolchain.
Share bugs, ideas, or general feedback.
Comprehensive guide to modern Python development covering conventions, testing, tooling, security, performance, and ecosystem best practices (2024-2025 standards).
For multi-file projects, team collaboration, and maintained code:
# Install Python 3.12 and uv (see Installation guides)
# Windows: winget install Python.Python.3.12 && winget install astral-sh.uv
# macOS: brew install python@3.13 uv
# Linux: apt install python3.13 && curl -LsSf https://astral.sh/uv/install.sh | sh
# Create new project with modern structure
uv init my-project
cd my-project
# Add dependencies
uv add requests httpx pydantic
# Add development dependencies
uv add --dev pytest pytest-cov ruff mypy
# Set up code quality (create pyproject.toml config - see assets/pyproject-toml-template.toml)
# Configure Ruff, mypy, pytest
# Write tests (pytest)
# tests/test_example.py - mirror src/ structure
# Run quality checks
uv run ruff check . # Linting
uv run ruff format . # Formatting
uv run mypy . # Type checking
uv run pytest # Run tests
uv run pytest --cov # With coverage
Invoke this skill when you need guidance on:
This skill provides modern Python development guidance aligned with current best practices (2024-2025):
Core Standards:
str | None)Modern Tooling (2024-2025):
Project Structure:
Official Sources: All guidance backed by official Python documentation, PEPs, and tool documentation:
Choose your complexity level:
โ Single-file utilities, converting scripts, one-off automation โ Just Python code - no tooling overhead โ Jump to Minimal Guidance
โ Multi-file modules, team projects, maintained code โ Modern project structure + testing โ Jump to Standard Guidance
โ PyPI packages, enterprise systems, production deployments โ Complete tooling ecosystem โ Jump to Full Guidance
Not sure? Default to Tier 2 (Standard) - it covers most use cases.
For: Single-file utilities, script conversions, and simple automation.
Just Python 3.12+ - no additional tooling required:
pip install ruff)Follow these simple principles:
snake_case for functions/variables, PascalCase for classespathlib.Path for file operations (not os.path)json, datetime, sys modules#!/usr/bin/env python3
"""Simple logging utility - converts event to JSON."""
import json
import sys
from datetime import datetime, timezone
from pathlib import Path
def log_event(event_name: str, data: dict) -> None:
"""
Log an event to daily JSONL file.
Args:
event_name: Name of the event
data: Event data to log
"""
log_dir = Path(__file__).parent / "logs"
log_dir.mkdir(exist_ok=True)
now = datetime.now(timezone.utc)
log_file = log_dir / f"{now:%Y-%m-%d}.jsonl"
entry = {
"timestamp": now.isoformat(),
"event": event_name,
"data": data
}
with open(log_file, "a", encoding="utf-8") as f:
f.write(json.dumps(entry) + "\n")
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: script.py <event_name>", file=sys.stderr)
sys.exit(1)
event_name = sys.argv[1]
data = json.loads(sys.stdin.read())
log_event(event_name, data)
If you want to check your code style:
# Install Ruff (optional)
pip install ruff
# Check code
ruff check script.py
# Format code
ruff format script.py
Consider upgrading to Tier 2 (Standard) when:
For: Multi-file modules, team projects, and maintained code.
Modern Python project setup with proper structure, testing, and quality tools.
Install Python 3.12+ and uv (modern dependency manager). See platform-specific guides:
Conventions and Style - Follow PEP-8 with Ruff for linting and formatting:
Project Structure - Use modern src/ layout for proper packaging:
Dependency Management - Choose between uv (fastest), Poetry (feature-rich), or pip+venv:
Testing - Use pytest with fixtures, parametrization, and coverage:
Type Hints - Modern typing with mypy, protocols, and generics:
Code Quality - Set up Ruff, mypy, Bandit, and pre-commit hooks:
Async Programming - asyncio patterns, TaskGroup, structured concurrency:
Security - OWASP best practices, input validation, secrets management:
Performance - Profiling, optimization patterns, memory efficiency:
Packaging - Publish to PyPI with pyproject.toml and semantic versioning:
Libraries - Standard library essentials and ecosystem overview:
Documentation - PEP-257 docstrings, Sphinx, ReadTheDocs:
For: PyPI packages, enterprise systems, and production deployments.
Everything in Tier 2 (Standard) PLUS:
See these reference files for comprehensive production guidance:
All detailed guidance is in the references/ directory:
Installation:
Core Development:
Advanced Topics:
Template Files:
This skill includes formal evaluation scenarios to validate effectiveness:
datetime.utcnow() in example code (use datetime.now(timezone.utc))docs/python/Python:
Tools:
PEPs (Python Enhancement Proposals):
Date: 2025-11-28 Model: claude-opus-4-5-20251101