Configure and use automated code quality tools (ruff, mypy, pre-commit) for scientific Python projects. Use when setting up linting, formatting, type checking, or automated quality gates. Ideal for enforcing code style, catching type errors, managing pre-commit hooks, or integrating quality checks in CI/CD pipelines.
View on GitHubuw-ssec/rse-plugins
scientific-python-development
January 22, 2026
Select agents to install to:
npx add-skill https://github.com/uw-ssec/rse-plugins/blob/main/plugins/scientific-python-development/skills/code-quality-tools/SKILL.md -a claude-code --skill code-quality-toolsInstallation paths:
.claude/skills/code-quality-tools/# Code Quality Tools for Scientific Python Master the essential code quality tools that keep scientific Python projects maintainable, consistent, and error-free. Learn how to configure **ruff** for lightning-fast linting and formatting, **mypy** for static type checking, and **pre-commit** hooks for automated quality gates. These tools help catch bugs early, enforce consistent style across teams, and make code reviews focus on logic rather than formatting. **Key Tools:** - **Ruff**: Ultra-fast Python linter and formatter (replaces flake8, black, isort, and more) - **MyPy**: Static type checker for Python - **Pre-commit**: Git hook framework for automated checks ## Quick Reference Card ### Installation & Setup ```bash # Using pixi (recommended for scientific projects) pixi add --feature dev ruff mypy pre-commit # Using pip pip install ruff mypy pre-commit # Initialize pre-commit pre-commit install ``` ### Essential Ruff Commands ```bash # Check code (linting) ruff check . # Fix auto-fixable issues ruff check --fix . # Format code ruff format . # Check and format together ruff check --fix . && ruff format . ``` ### Essential MyPy Commands ```bash # Type check entire project mypy src/ # Type check with strict mode mypy --strict src/ # Type check specific file mypy src/mymodule/analysis.py # Generate type coverage report mypy --html-report mypy-report src/ ``` ### Essential Pre-commit Commands ```bash # Run all hooks on all files pre-commit run --all-files # Run hooks on staged files only pre-commit run # Update hook versions pre-commit autoupdate # Skip hooks temporarily (not recommended) git commit --no-verify ``` ### Quick Decision Tree ``` Need to enforce code style and catch common errors? YES → Use Ruff (linting + formatting) NO → Skip to type checking Want to catch type-related bugs before runtime? YES → Add MyPy NO → Ruff alone is sufficient Need to ensure checks run automatically? YES → Set up pre-commit hooks NO → Run tools ma