python-quality
Run formatting, linting, and tests using uv + Ruff + pytest
When & Why to Use This Skill
This Claude skill automates Python code quality workflows by integrating uv for dependency management, Ruff for high-speed linting and formatting, and pytest for robust testing. It helps developers maintain clean, standardized, and error-free codebases while accelerating the path to production-ready pull requests.
Use Cases
- Pre-PR Quality Assurance: Automatically format and lint code to meet project standards and pass CI checks before submission.
- Automated Regression Testing: Run the full pytest suite to ensure new changes haven't introduced bugs into existing functionality.
- Codebase Standardization: Enforce consistent Python styling and fix common linting errors across the entire project with Ruff.
- Dependency Management: Synchronize project environments using uv to ensure tests run against the correct package versions.
| name | python-quality |
|---|---|
| description | Run formatting, linting, and tests using uv + Ruff + pytest |
Python Quality Check Skill
Use this skill when asked to:
- "check quality"
- "make CI pass"
- "fix lint errors"
- "run tests"
- "prepare for PR"
Workflow
Execute these steps in order:
1. Sync Dependencies
uv sync --all-groups
2. Format Code
uv run ruff format .
3. Lint and Auto-fix
uv run ruff check . --fix
4. Run Tests
uv run pytest -q
On Failure
If any step fails:
- Format fails: Check for syntax errors first
- Lint fails: Review unfixable issues, explain the root cause
- Tests fail:
- Show the failing test output
- Explain the root cause
- Propose a minimal fix
- Update tests if behavior change is intentional
Quick Script
For automated checks, use:
uv run python .github/skills/python-quality/scripts/check.py
Success Criteria
- All files formatted consistently
- No lint errors (warnings may be acceptable)
- All tests pass
- No decrease in test coverage (if measured)