From ml-research
Run comprehensive code quality checks with ruff (format, lint) and ty (type checking). Use when checking code quality, fixing linting errors, or ensuring code follows best practices before commits or PRs.
npx claudepluginhub nishide-dev/claude-code-ml-researchThis skill uses the workspace's default tool permissions.
Run comprehensive code quality checks including formatting, linting, and type checking.
Verifies tests pass on completed feature branch, presents options to merge locally, create GitHub PR, keep as-is or discard; executes choice and cleans up worktree.
Guides root cause investigation for bugs, test failures, unexpected behavior, performance issues, and build failures before proposing fixes.
Writes implementation plans from specs for multi-step tasks, mapping files and breaking into TDD bite-sized steps before coding.
Share bugs, ideas, or general feedback.
Run comprehensive code quality checks including formatting, linting, and type checking.
First, ask the user what to check:
src/, scripts/)If not specified, default to checking all Python files in the project.
Check code formatting with ruff:
# Check all files
uv run ruff format --check .
# Check specific directory
uv run ruff format --check src/
# Check specific files
uv run ruff format --check src/train.py src/models/model.py
Output interpretation:
Check code quality with ruff linter:
# Check all files
uv run ruff check .
# Check with auto-fix (if user requests)
uv run ruff check --fix .
# Check specific directory
uv run ruff check src/
# Check with specific rules
uv run ruff check --select F,E,W . # pyflakes, pycodestyle errors/warnings
Output interpretation:
Common rule categories:
F - Pyflakes (undefined names, unused imports)E - Pycodestyle errors (syntax issues, indentation)W - Pycodestyle warnings (whitespace, line length)I - Import order (isort compatibility)N - PEP8 naming conventionsUP - Pyupgrade (modernize Python syntax)Check type hints with ty:
# Check all files
uv run ty check .
# Check specific directory
uv run ty check src/
# Check specific files
uv run ty check src/train.py
Output interpretation:
Note: Only run type checking if:
ty is installed in dependenciesAfter running all checks, provide a summary:
Code Quality Report:
✓ Formatting: All files properly formatted (or X files need formatting)
✓ Linting: No issues found (or X issues found)
✓ Type checking: No type errors (or X errors found)
To fix formatting issues: uv run ruff format .
To fix auto-fixable lint issues: uv run ruff check --fix .
If user requests auto-fix:
# Fix formatting
uv run ruff format .
# Fix auto-fixable lint issues
uv run ruff check --fix .
After auto-fixing, re-run checks to verify all issues are resolved.
For stricter checking:
# Format check with diff
uv run ruff format --check --diff .
# Lint with all rules
uv run ruff check --select ALL .
# Type check with strict mode (if ty supports it)
uv run ty check --strict .
For CI or pre-commit checks:
# Exit on first error, no auto-fix
uv run ruff format --check .
uv run ruff check .
uv run ty check .
All commands should fail fast (exit on first error) in CI mode.
If commands fail:
uv add --dev ruff or pixi add ruffuv add --dev ty or pixi add tyml-validate: Comprehensive project validation including code qualityml-setup: Setup development environment with linting tools