ml-format

Format Python source code with ruff and optionally auto-fix lint issues.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/nishide-dev/claude-code-ml-research --skill ml-format
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ml-format
Source: https://github.com/nishide-dev/claude-code-ml-research/tree/main/skills/ml-format
Command: npx skills add https://github.com/nishide-dev/claude-code-ml-research --skill ml-format

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents code-style drift and reduces lint noise by automatically applying consistent formatting and optional auto-fixes across your Python codebase.

Core Features & Use Cases

  • Ruff formatting: Rewrites Python files into a uniform style using ruff format for entire projects, directories, or selected files.
  • Auto-fix lint issues (optional): Runs ruff check with --fix to apply auto-fixable lint and import-related improvements after formatting.
  • Dry-run and verification: Supports check-only mode with diffs and follows up with format-check and lint-check to ensure results are correct.
  • Git-friendly workflow: Helps you review changes via git status and git diff before committing, and supports formatting changed files only.

Quick Start

Tell the AI to format the entire project and then auto-fix only the safe, auto-fixable ruff issues before you review the git diff.

Frequently Asked Questions about ml-format

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format Python code with ruff before a git commit?

You can format Python code with ruff by running it on specific files, directories, or git-changed files to ensure consistent style for your pre-commit workflow.

Can I run a ruff format dry-run to preview changes without writing files?

Yes, you can run a ruff format dry-run using check-only mode with diffs to preview changes without modifying files, followed by format-check and lint-check to verify results.

Does ruff auto-fix import and lint issues during code formatting?

Yes, ruff optionally runs ruff check --fix after formatting to apply auto-fixable lint and import-related improvements across your Python source code.

What is the best way to enforce consistent Python style in a CI pipeline?

Enforce consistent Python style in CI by running ruff format to rewrite files uniformly, then using format --check and ruff check to verify compliance without altering code.

How do I format only git-changed files instead of the full project?

You can scope ruff formatting to git-changed files only, enabling targeted formatting for pre-commit workflows instead of running ruff format across the full project.