Format Code
Format Python sources in the repository with ruff and apply its safe lint fixes (pre-commit enforced).
от CERTCC★ 22 звезды на GitHub
Установить Format Code в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Skill: Format code with ruff
Purpose
Format Python source files with ruff format and apply ruff's safe lint fixes
(import sorting among them). This keeps a consistent code style and avoids
pre-commit failures.
Inputs
repo_root(string, default.): repository root where the command should be executed.
Outputs
formatted_files(string): stdout from ruff listing files fixed or reformatted.
Procedure
From the repository root, run:
uv run ruff check --fix uv run ruff formatInspect the output and stage changes if any files were rewritten.
Constraints / Rules
- Do not pass paths. Scope is declared in
[tool.ruff]inpyproject.toml(IMPLTS-07-021);ruff formatexcludes Markdown there, so fenced Python in docs, notes andplan/history/is never rewritten. - Use
markdownlint-cli2for Markdown. - Formatting can rewrap a line and strand an inline pragma.
run-lintersrunsruff checkandpyright-changedafter formatting; use it before committing. A stranded# pyright: ignore[...]in a changed file is reported there, and in any other file by CI's whole-project pyright job (PAD-18-027).
Rationale
One formatter, whose import sorting and lint fixes share one configuration,
keeps the pre-commit hook, the CI lint-ruff job and local runs in agreement
(ADR-0221).
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Format Code?
Format Python sources in the repository with ruff and apply its safe lint fixes (pre-commit enforced).
Как установить скилл Format Code?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Format Code запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…