Agent SkillsDetachHead/rebased › compare-python-typecheckers

compare-python-typecheckers

GitHub

对比分析Python类型推断工具(ty, pyrefly, basedpyright等)的输出结果。通过运行代码片段或文件,生成包含各工具诊断差异、退出码和耗时的汇总报告,辅助开发者理解类型检查行为及分歧。

.claude/skills/compare-python-typecheckers/SKILL.md DetachHead/rebased

Trigger Scenarios

需要对比不同Python类型检查器的行为 排查类型推断不一致的问题 验证代码片段在不同工具下的类型错误判定

Install

npx skills add DetachHead/rebased --skill compare-python-typecheckers -g -y
More Options

Non-standard path

npx skills add https://github.com/DetachHead/rebased/tree/master/.claude/skills/compare-python-typecheckers -g -y

Use without installing

npx skills use DetachHead/rebased@compare-python-typecheckers

指定 Agent (Claude Code)

npx skills add DetachHead/rebased --skill compare-python-typecheckers -a claude-code -g -y

安装 repo 全部 skill

npx skills add DetachHead/rebased --all -g -y

预览 repo 内 skill

npx skills add DetachHead/rebased --list

SKILL.md

Frontmatter
{
    "name": "compare-python-typecheckers",
    "description": "Compare Python type inference with ty, pyrefly, and basedpyright."
}

Compare Python type checkers

When reasoning about how PyCharm should infer a type or whether something ought to be a type error, cross-checking against the real third-party checkers is the fastest way to gain insight — and to see where they disagree. This skill runs them all on a scratch file or snippet and collates the output into a single report.

Run it

${CLAUDE_SKILL_DIR}/scripts/compare_typecheckers.py invokes each checker through uvx (fetched on demand — no install; the network is used on first run) and prints a Markdown report: a summary table (exit code / verdict / timing per tool) followed by each tool's raw output.

# Inline snippet:
uv run ${CLAUDE_SKILL_DIR}/scripts/compare_typecheckers.py -c 'def f(x: int) -> int:
    return x

f("a")'

# An existing file:
uv run ${CLAUDE_SKILL_DIR}/scripts/compare_typecheckers.py path/to/test.py

# A subset, written to a file:
uv run ${CLAUDE_SKILL_DIR}/scripts/compare_typecheckers.py test.py --tools ty,mypy -o /tmp/report.md

Flags: -c/--code (inline snippet), -t/--tools ty,mypy,… (subset), -o/--output (write to file), --timeout (per-checker seconds, default 180). The script exits 0 whenever it produced a report — findings live in the report, not the exit code.

Reading the result

  • The summary table shows each tool's exit code (0 = nothing flagged, non-zero = the checker reported an issue or failed to run), a verdict, and time.
  • Output formats differ per tool, so read each section, not just the table:
    • ty (Astral) and pyrefly (Meta) each have their own diagnostic style.
    • basedpyright is pyright-based and also emits extra diagnostics such as reportUnusedCallResult.
    • mypy and zuban share the same message format (zuban is mypy-compatible).
  • The checkers track their latest releases through uvx, so behaviour can shift over time — record the date when capturing results in a YouTrack issue or test.

Manual one-offs

The exact per-tool invocations, if you want to run just one by hand (note basedpyright takes the file positionally — no check subcommand):

Tool Command
ty uvx ty check test.py
pyrefly uvx pyrefly check test.py
basedpyright uvx basedpyright test.py
mypy uvx mypy test.py
zuban uvx zuban check test.py

Version History

  • 2af32ff Current 2026-09-22 01:04

Same Skill Collection

.agents/skills/actions/SKILL.md
.agents/skills/bazel-test-migration/SKILL.md
.agents/skills/code-style/SKILL.md
.agents/skills/commits/SKILL.md
.agents/skills/compare-python-typecheckers/SKILL.md
.agents/skills/conda-env-tests/SKILL.md
.agents/skills/debugging/SKILL.md
.agents/skills/driver-ui-tests/SKILL.md
.agents/skills/eel/SKILL.md
.agents/skills/extract-module/SKILL.md
.agents/skills/fix-project-leak-from-tc-report/SKILL.md
.agents/skills/icon-resources/SKILL.md
.agents/skills/icons/SKILL.md
.agents/skills/ide-diagnostics-mcp/SKILL.md
.agents/skills/jewel-markdown/SKILL.md
.agents/skills/jewel-pr-preparer/SKILL.md
.agents/skills/jewel-release-helper/SKILL.md
.agents/skills/jna/SKILL.md
.agents/skills/kotlin-ui-dsl/SKILL.md
.agents/skills/kotlin-ui-swing-component-architecture/SKILL.md
.agents/skills/module-dependencies/SKILL.md
.agents/skills/module-set-pluginization/SKILL.md
.agents/skills/notebook-for-experiment/SKILL.md
.agents/skills/platform-coroutines-structured-concurrency/SKILL.md
.agents/skills/plugin-model-analyzer/SKILL.md
.agents/skills/poly-context/SKILL.md
.agents/skills/poly-symbols/SKILL.md
.agents/skills/pseudo-kmp/SKILL.md
.agents/skills/registry/SKILL.md
.agents/skills/remote-dev/SKILL.md
.agents/skills/safe-push/SKILL.md
.agents/skills/ssr/SKILL.md
.agents/skills/symbols-api/SKILL.md
.agents/skills/testing-internals/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/treehouse/SKILL.md
.agents/skills/ui-accessibility/SKILL.md
.agents/skills/writing-tests/SKILL.md
.agents/skills/youtrack-community/SKILL.md
.claude/skills/actions/SKILL.md
.claude/skills/bazel-test-migration/SKILL.md
.claude/skills/code-style/SKILL.md
.claude/skills/commits/SKILL.md
.claude/skills/conda-env-tests/SKILL.md
.claude/skills/debugging/SKILL.md
.claude/skills/driver-ui-tests/SKILL.md
.claude/skills/eel/SKILL.md
.claude/skills/extract-module/SKILL.md
.claude/skills/fix-project-leak-from-tc-report/SKILL.md

Metadata

Files
0
Version
2af32ff
Hash
125b7a9e
Indexed
2026-09-22 01:04

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 00:42
浙ICP备14020137号-1