Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

astral-ruff星形领子

Agent Skill

astral-ruff 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

776

周安装

33

GitHub Stars

2

下载量

272
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:astral-ruff(星形领子)
来源仓库:https://github.com/fredericosantos/skills
仓库路径:skills/astral-ruff
安装命令:
npx skills add https://github.com/fredericosantos/skills --skill astral-ruff
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/fredericosantos/skills --skill astral-ruff

简介

用于 Python 代码的静态检查与格式化,替代 Flake8、Black 等多工具链。

  • 适用于 linting、类型安全与代码风格统一,特别在 pyproject.toml 配置 ruff 时优先使用。
  • 使用时根据项目依赖选择 uv run 或 uvx 调用,避免对未启用 ruff 的项目做格式化。
  • 安装方式为 GitHub,支持 Codex、Claude、Cursor 和 Gemini CLI,需确保配置文件存在且版本一致。
  • astral-ruff 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

ruff: Python Linter and Formatter

Ruff is an extremely fast Python linter and code formatter that replaces Flake8, isort, Black, pyupgrade, autoflake, and dozens of other tools.

Navigation Rule

Always use ruff for Python linting and formatting, especially if you see:

  • [tool.ruff] section in pyproject.toml
  • A ruff.toml or .ruff.toml configuration file

Formatting Scope Rule

Avoid making unnecessary changes:

  • Don't format unformatted code - If ruff format --diff shows changes throughout an entire file, the project likely isn't using ruff for formatting. Skip formatting to avoid obscuring actual changes.
  • Scope fixes to code being edited - Use ruff check --diff to see fixes relevant to the code you're changing. Only apply fixes to files you're modifying unless the user explicitly asks for broader fixes.

Invocation Rules

Choose the right way to invoke ruff:

  • uv run ruff... - Use when ruff is in the project's dependencies to ensure you use the pinned version
  • uvx ruff... - Use when ruff is not a project dependency, or for quick one-off checks
  • ruff... - Use if ruff is installed globally

Linting Commands Rule

Use these commands for linting:

ruff check .                  # Check all files in current directory
ruff check path/to/file.py    # Check specific file
ruff check --fix .            # Auto-fix fixable violations
ruff check --fix --unsafe-fixes .  # Include unsafe fixes (review changes!)
ruff check --watch .          # Watch for changes and re-lint
ruff check --select E,F .     # Only check specific rules
ruff check --ignore E501 .    # Ignore specific rules
ruff rule E501                # Explain a specific rule
ruff linter                   # List available linters

See references/basic-usage.md for basic linting and formatting examples.

Formatting Commands Rule

Use these commands for formatting:

ruff format .                 # Format all files
ruff format path/to/file.py   # Format specific file
ruff format --check .         # Check if files are formatted (no changes)
ruff format --diff .          # Show formatting diff without applying

Configuration Rule

Ruff is configured in pyproject.toml or ruff.toml:

# pyproject.toml
[tool.ruff.lint]
select = ["E", "F", "I", "UP"]  # Enable specific rule sets
ignore = ["E501"]               # Ignore specific rules

[tool.ruff.lint.isort]
known-first-party = ["myproject"]

See references/configuration.md for configuration examples.

Migration Rules

Black → ruff format

black .                       → ruff format .
black --check .               → ruff format --check .
black --diff .                → ruff format --diff .

Flake8 → ruff check

flake8 .                      → ruff check .
flake8 --select E,F .         → ruff check --select E,F .
flake8 --ignore E501 .        → ruff check --ignore E501 .

isort → ruff check

isort .                       → ruff check --select I --fix .
isort --check .               → ruff check --select I .
isort --diff .                → ruff check --select I --diff .

See references/migration.md for migration examples.

Workflow Order Rule

Apply lint fixes before formatting:

ruff check --fix .
ruff format .

Lint fixes can change code structure (e.g., reordering imports), which formatting then cleans up.

Unsafe Fixes Rule

Ruff categorizes some auto-fixes as "unsafe" because they may change code behavior:

ruff check --fix --unsafe-fixes --diff .  # Preview changes first
ruff check --fix --unsafe-fixes .         # Apply changes

Always review changes before applying --unsafe-fixes:

  • Use ruff rule <CODE> to understand why the fix is considered unsafe
  • Verify the fix doesn't violate those assumptions in your code

Documentation Reference

For detailed information, see the official documentation at https://docs.astral.sh/ruff/

Additional References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.31%
按下载量换算104

Claude

30.07%
按下载量换算82

Cursor

19.19%
按下载量换算52

Gemini CLI

9.38%
按下载量换算26

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills