用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill python-code-quality命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
基于 SOC 职业分类
正在显示 SKILL.md
| name | python-code-quality |
| description | >- Use when this capability is needed. |
This project enforces code quality through five tools:
| Tool | Role | Config location |
|---|---|---|
| ruff | Lint + format (replaces flake8 / isort / black) | [tool.ruff] in pyproject.toml |
| pre-commit | Git hook runner — gates every commit | .pre-commit-config.yaml |
| basedpyright | Static type checker (strict pyright fork) | [tool.basedpyright] in pyproject.toml |
| bandit | Security linter — fixed Python vulnerability patterns | [tool.bandit] in pyproject.toml |
| semgrep | Pattern-based scanner + custom rules | .semgrep.yml |
pre-commit run --all-files # run all hooks on every file (recommended)
# Or run each tool individually:
ruff format . # auto-format
ruff check --fix . # lint + auto-fix safe issues
basedpyright # type-check
bandit -c pyproject.toml -r src/ # security lint
semgrep --config .semgrep.yml src/ # pattern scan
| Symptom | Likely cause | Fix |
|---|---|---|
ruff fails on unused import | F401 rule | Remove import or # noqa: F401 for intentional re-exports |
ruff format changes file | File not formatted | Run ruff format . and re-stage |
| pre-commit hook not running | Hook not installed | Run pre-commit install |
| pre-commit passes locally, fails in CI | Staged-only vs all-files mismatch | Run pre-commit run --all-files before pushing |
basedpyright reportUnknownVariableType | Missing annotation | Add type annotation; see references/basedpyright.md |
basedpyright reportMissingImports | Package not in venv | Install package or add stub; see references/basedpyright.md |
bandit B[code] finding | Security anti-pattern | Fix or add # nosec B<code> with explanation |
| semgrep finding | Code matches security pattern | Fix or add # nosemgrep: <rule-id> inline |
Run cheapest checks first so failures surface quickly without wasting time on later stages:
ruff format --check → ruff check → bandit → semgrep → basedpyright → pytest
| Stage | Why here |
|---|---|
ruff format --check | Instant — no point type-checking badly formatted code |
ruff check | Fast Rust linter — catches style and logic issues cheaply |
bandit | Fast fixed-rule security scan — pure AST analysis |
semgrep | Slower than bandit (fetches registry rules); runs after fast checks |
basedpyright | Needs full import graph resolved — slower, but before tests |
pytest | Most expensive — only run when everything above passes |
| If the task involves… | Load |
|---|---|
| Configuring or debugging ruff | references/ruff.md |
| Setting up or fixing pre-commit hooks | references/pre-commit.md |
| Type errors or basedpyright config | references/basedpyright.md |
| Security scan findings (bandit) | references/bandit.md |
| Custom semgrep rules | references/semgrep.md |
| Complete config file examples | references/complete-configs.md |
Running just lint/just fix (default) | No reference needed — use inline |
Read the relevant reference file for configuration details, error code explanations, or CI integration specifics:
| Topic | Reference file |
|---|---|
| ruff (lint + format) | references/ruff.md |
| pre-commit hooks | references/pre-commit.md |
| basedpyright (type checking) | references/basedpyright.md |
| bandit (security linting) | references/bandit.md |
| semgrep (pattern scanning) | references/semgrep.md |
| Complete config files | references/complete-configs.md |
ruff check, basedpyright,
bandit) in parallel as separate tool calls in a single message.references/<toolname>.md using the template below..pre-commit-config.yaml (see references/pre-commit.md).pyproject.toml section to references/complete-configs.md.# <ToolName>
## What it does
## Installation
## pyproject.toml config (annotated)
## Common error codes and fixes
## Running <toolname>
## CI step
## Pre-commit hook entry
## Gotchas
Source: buddingengineers12345/python_project_template — distributed by TomeVault.