Ruff Formatter
Ruff Formatter automatically cleans and standardizes code for consistency, boosting readability and reducing errors in your projects.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add ruff-formatter npx -- -y @trustedskills/ruff-formatter
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"ruff-formatter": {
"command": "npx",
"args": [
"-y",
"@trustedskills/ruff-formatter"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
The ruff-formatter skill automatically formats Python code according to the Ruff linter's style guidelines. It can take raw Python code as input and return a properly formatted version, ensuring consistency and readability. This tool helps maintain project coding standards and reduces manual formatting efforts.
When to use it
- Code Cleanup: When you have messy or inconsistently formatted Python code that needs cleaning up quickly.
- Project Standardization: To ensure all Python files within a project adhere to the same style guidelines.
- Automated Formatting in Pipelines: Integrate into CI/CD pipelines to automatically format code before commits or deployments.
- Educational Purposes: To demonstrate and enforce proper coding styles for students or junior developers.
Key capabilities
- Automatic Python code formatting
- Adherence to Ruff linter style guidelines
- Input: Raw Python code
- Output: Formatted Python code
Example prompts
- "Format this Python code:
def my_function(a,b): return a+ b" - "Can you reformat the following code snippet?" [followed by a block of Python code]
- "Please apply your formatting rules to this file:" [followed by a file path or content]
Tips & gotchas
The skill relies on the Ruff linter being configured. Ensure that the desired style guidelines are set up in Ruff before using the skill for consistent results.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.