重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
code-quality by autumnsgrove/groveengine
npx skills add https://github.com/autumnsgrove/groveengine --skill code-quality在以下情况下激活此技能:
# 使用 Black 格式化
uv run black .
uv run black --check . # 试运行
# 使用 Ruff 检查
uv run ruff check .
uv run ruff check --fix . # 自动修复
# 使用 mypy 进行类型检查
uv run mypy .
# 所有检查
uv run black . && uv run ruff check . && uv run mypy .
| 工具 | 用途 | 速度 | 自动修复 |
|---|---|---|---|
| Black | 代码格式化 | 快 | 是 |
| Ruff | 代码检查与导入排序 | 非常快 | 大部分规则 |
| mypy |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 类型检查 |
| 中等 |
| 否 |
uv add --dev black ruff mypy
零配置格式化,风格统一。
uv run black . # 格式化所有文件
uv run black --check . # 试运行
uv run black --diff . # 显示变更
[tool.black]
line-length = 88
target-version = ['py311']
基于 Rust 的代码检查器,可替代 flake8、isort、pylint 等 50 多种工具。
uv run ruff check . # 检查
uv run ruff check --fix . # 自动修复
uv run ruff check --show-source . # 显示上下文
[tool.ruff]
line-length = 88
target-version = "py311"
select = ["E", "W", "F", "I", "B", "SIM"]
ignore = ["E501"] # 行长度由 Black 处理
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
"tests/*" = ["S101"]
Python 的静态类型检查器。
def greet(name: str) -> str:
return f"Hello, {name}"
greet(123) # mypy 错误: 不兼容的类型 "int"
[tool.mypy]
python_version = "3.11"
warn_return_any = true
disallow_untyped_defs = false # 逐步启用
check_untyped_defs = true
from typing import Optional, List, Dict
def find_user(user_id: int) -> Optional[Dict[str, str]]:
return database.get(user_id)
def process_items(items: List[str]) -> int:
return len(items)
# pyproject.toml
[tool.black]
line-length = 88
target-version = ['py311']
[tool.ruff]
line-length = 88
target-version = "py311"
select = ["E", "W", "F", "I", "B", "SIM"]
[tool.mypy]
python_version = "3.11"
warn_return_any = true
import os # noqa: F401 # 忽略 Ruff 规则
# fmt: off # 禁用 Black
matrix = [[1, 2, 3], [4, 5, 6]]
# fmt: on
uv run black . && uv run ruff check --fix . && uv run mypy .
uv run black --check . && uv run ruff check . && uv run mypy --strict .
# ❌ 巧妙但不清晰
result = [x for x in range(10) if x % 2 == 0 if x > 5]
# ✅ 清晰易读
even_numbers = [x for x in range(10) if x % 2 == 0]
result = [x for x in even_numbers if x > 5]
# ❌ 不清晰
def proc(d, x):
return d[x] if x in d else None
# ✅ 清晰
def get_user_by_id(users_dict, user_id):
return users_dict.get(user_id)
# ❌ 嵌套
def process(amount, user):
if amount > 0:
if user.has_payment():
return charge(user, amount)
# ✅ 提前返回
def process(amount, user):
if amount <= 0:
return "Invalid amount"
if not user.has_payment():
return "No payment method"
return charge(user, amount)
查看 AgentUsage/code_quality.md 和 AgentUsage/code_style_guide.md 以获取:
每周安装次数
52
代码仓库
GitHub 星标数
2
首次出现
2026年1月28日
安全审计
已安装于
opencode52
gemini-cli52
codex52
github-copilot51
cline51
cursor51
Activate this skill when:
# Format with Black
uv run black .
uv run black --check . # Dry run
# Lint with Ruff
uv run ruff check .
uv run ruff check --fix . # Auto-fix
# Type check with mypy
uv run mypy .
# All checks
uv run black . && uv run ruff check . && uv run mypy .
| Tool | Purpose | Speed | Auto-fix |
|---|---|---|---|
| Black | Code formatting | Fast | Yes |
| Ruff | Linting & imports | Very Fast | Most rules |
| mypy | Type checking | Moderate | No |
uv add --dev black ruff mypy
Zero-config formatting with consistent style.
uv run black . # Format all
uv run black --check . # Dry run
uv run black --diff . # Show changes
[tool.black]
line-length = 88
target-version = ['py311']
Rust-based linter replacing flake8, isort, pylint, and 50+ tools.
uv run ruff check . # Check
uv run ruff check --fix . # Auto-fix
uv run ruff check --show-source . # Show context
[tool.ruff]
line-length = 88
target-version = "py311"
select = ["E", "W", "F", "I", "B", "SIM"]
ignore = ["E501"] # Black handles line length
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
"tests/*" = ["S101"]
Static type checker for Python.
def greet(name: str) -> str:
return f"Hello, {name}"
greet(123) # mypy error: incompatible type "int"
[tool.mypy]
python_version = "3.11"
warn_return_any = true
disallow_untyped_defs = false # Enable gradually
check_untyped_defs = true
from typing import Optional, List, Dict
def find_user(user_id: int) -> Optional[Dict[str, str]]:
return database.get(user_id)
def process_items(items: List[str]) -> int:
return len(items)
# pyproject.toml
[tool.black]
line-length = 88
target-version = ['py311']
[tool.ruff]
line-length = 88
target-version = "py311"
select = ["E", "W", "F", "I", "B", "SIM"]
[tool.mypy]
python_version = "3.11"
warn_return_any = true
import os # noqa: F401 # Ignore Ruff rule
# fmt: off # Disable Black
matrix = [[1, 2, 3], [4, 5, 6]]
# fmt: on
uv run black . && uv run ruff check --fix . && uv run mypy .
uv run black --check . && uv run ruff check . && uv run mypy --strict .
# ❌ Clever but unclear
result = [x for x in range(10) if x % 2 == 0 if x > 5]
# ✅ Clear and readable
even_numbers = [x for x in range(10) if x % 2 == 0]
result = [x for x in even_numbers if x > 5]
# ❌ Unclear
def proc(d, x):
return d[x] if x in d else None
# ✅ Clear
def get_user_by_id(users_dict, user_id):
return users_dict.get(user_id)
# ❌ Nested
def process(amount, user):
if amount > 0:
if user.has_payment():
return charge(user, amount)
# ✅ Early returns
def process(amount, user):
if amount <= 0:
return "Invalid amount"
if not user.has_payment():
return "No payment method"
return charge(user, amount)
See AgentUsage/code_quality.md and AgentUsage/code_style_guide.md for:
Weekly Installs
52
Repository
GitHub Stars
2
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode52
gemini-cli52
codex52
github-copilot51
cline51
cursor51
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
169,700 周安装