Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Code quality checks, linting, formatting, and type checking commands for the Agent Framework Python codebase. Use this when running checks, fixing lint errors, or troubleshooting CI failures.
.claude/skills/microsoft-python-code-quality/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 187% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 59% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -18% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 9% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -15% | 0% |
All commands run from the python/ directory:
bash# Syntax formatting + checks (parallel across packages by default) uv run poe syntax uv run poe syntax -P core uv run poe syntax -F # Format only uv run poe syntax -C # Check only uv run poe syntax -S # Samples only # Type checking # # Division of labor (see "Type checking architecture" below): # - Pyright (strict) is the source-code type checker. # - Pyright (relaxed `basic`), mypy, pyrefly, ty, zuban all check the TESTS; # pyright/pyrefly/ty also check the SAMPLES (mypy/zuban skip script-style samples). uv run poe pyright # Pyright (strict) over SOURCE, fan-out across packages uv run poe pyright -P core uv run poe pyright -A uv run poe test-typing # mypy + pyrefly + ty + zuban + pyright over each package's TESTS uv run poe test-typing -P core uv run poe test-typing -S # samples (pyrefly + ty + pyright) uv run poe test-typing -P core --checker mypy # narrow to one checker (repeatable) uv run poe test-typing -P core --checker pyright # relaxed pyright over the tests uv run poe mypy # alias: MyPy over the tests only uv run poe mypy -P core uv run poe typing # Pyright (source) + the tests checkers uv run poe typing -P core uv run poe typing -A # All package-level checks in parallel (syntax + pyright) uv run poe check-packages # Full check (packages + samples + tests + markdown) uv run poe check uv run poe check -P core # Samples only uv run poe check -S uv run poe pyright -S # Markdown code blocks uv run poe markdown-code-lint
Prek hooks run automatically on commit. They stay lightweight and only check changed files.
bash# Install hooks uv run poe prek-install # Run all hooks manually uv run prek run -a # Run on last commit uv run prek run --last-commit
They run changed-package syntax formatting/checking, markdown code lint only when markdown files change, and sample syntax lint/pyright only when files under samples/ change. They intentionally do not run workspace pyright or mypy by default.
Following the "too many type checkers" approach, type checkers are split by target:
| Target | Checker(s) | Mode | Config | |--------|-----------|------|--------| | Source (agent_framework*) | pyright | strict | [tool.pyright] in pyproject.toml | | Tests | pyright, mypy, pyrefly, ty, zuban | relaxed/basic | pyrightconfig.tests.json, [tool.mypy], pyrefly.toml, ty rules | | Samples | pyright, pyrefly, ty | basic | pyrightconfig.samples.json, pyrefly.samples.toml, ty.samples.toml |
basic profile over the tests and samples (so the surfaces customers copy from are validated by every checker, including pyright). MyPy was removed from source; its [tool.mypy] block is now a relaxed profile used only for tests/samples.
users do. The profile is intentionally relaxed (private access allowed, untyped test bodies allowed) so authors aren't forced into ugly over-annotation.
pyright, mypy, pyrefly, ty, and zuban — all five run bydefault and gate CI. zuban is the strictest of the mypy-compatible pair, so the same [tool.mypy] config yields more findings; suppress zuban-only friction with shared # type: ignore[code]. Suppress relaxed-pyright friction with # pyright: ignore[rule].
pyright to pyrefly + ty — mypy/zuban can't resolve script-stylesample layouts (numeric-prefixed dirs, duplicate main.py), but pyright handles them.
[tool.pyright]) enforces reportUnnecessaryTypeIgnoreCommentand excludes tests/samples; the relaxed test/sample pyright configs do not flag unnecessary ignores.
[tool.pyright]), reportUnnecessaryTypeIgnoreComment = "error",excludes tests, samples, .venv, packages/devui/frontend.
basic profile (pyrightconfig.tests.json) — private import/usage andnot-required TypedDict access allowed; runs as the pyright checker in test-typing.
basic profile (pyrightconfig.samples.json, with a py310 variant) —runs as the pyright checker in test-typing -S.
The task runner (scripts/task_runner.py) executes the cross-product of (package × task) in parallel using ThreadPoolExecutor. Single items run in-process with streaming output.
CI splits into 4 parallel jobs:
check -S plus markdown-code-lintci-test-typing)| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 4,331 | 4,391 | +1% | 1 | 1 | 0% | 689 | 1,975 | +187% | 0 | 0 | — |
case-02 | fail→pass | 6,499 | 1,766 | -73% | 1 | 1 | 0% | 1,163 | 1,848 | +59% | 0 | 0 | — |
case-03 | fail→pass | 16,250 | 2,547 | -84% | 1 | 1 | 0% | 2,410 | 1,970 | -18% | 0 | 0 | — |
case-04 | fail→fail | 14,090 | 12,335 | -12% | 1 | 1 | 0% | 2,328 | 3,734 | +60% | 0 | 0 | — |
case-05 | fail→pass | 14,645 | 6,191 | -58% | 1 | 1 | 0% | 2,397 | 2,621 | +9% | 0 | 0 | — |
case-06 | fail→pass | 14,641 | 2,263 | -85% | 1 | 1 | 0% | 2,213 | 1,877 | -15% | 0 | 0 | — |
case-07 | fail→pass | 13,519 | 2,789 | -79% | 1 | 1 | 0% | 2,189 | 2,029 | -7% | 0 | 0 | — |
case-08 | pass→pass | 13,537 | 3,405 | -75% | 1 | 1 | 0% | 2,245 | 2,173 | -3% | 0 | 0 | — |
case-09 | fail→pass | 13,213 | 1,734 | -87% | 1 | 1 | 0% | 2,311 | 1,817 | -21% | 0 | 0 | — |
case-10 | fail→pass | 11,764 | 2,070 | -82% | 1 | 1 | 0% | 1,912 | 1,830 | -4% | 0 | 0 | — |
case-11 | pass→pass | 11,315 | 4,783 | -58% | 1 | 1 | 0% | 1,813 | 2,395 | +32% | 0 | 0 | — |
case-12 | fail→pass | 8,011 | 1,972 | -75% | 1 | 1 | 0% | 1,478 | 1,845 | +25% | 0 | 0 | — |
case-13 | fail→pass | 6,411 | 3,709 | -42% | 1 | 1 | 0% | 1,164 | 2,209 | +90% | 0 | 0 | — |
case-14 | pass→pass | 19,692 | 2,381 | -88% | 1 | 1 | 0% | 2,989 | 1,934 | -35% | 0 | 0 | — |
case-15 | fail→pass | 12,950 | 7,198 | -44% | 1 | 1 | 0% | 1,911 | 2,659 | +39% | 0 | 0 | — |
case-16 | pass→pass | 11,682 | 5,279 | -55% | 1 | 1 | 0% | 1,793 | 2,406 | +34% | 0 | 0 | — |
case-17 | fail→pass | 17,590 | 2,754 | -84% | 1 | 1 | 0% | 2,812 | 2,041 | -27% | 0 | 0 | — |
case-18 | fail→pass | 2,618 | 2,158 | -18% | 1 | 1 | 0% | 407 | 1,814 | +346% | 0 | 0 | — |
case-19 | fail→pass | 20,456 | 2,718 | -87% | 1 | 1 | 0% | 3,551 | 1,978 | -44% | 0 | 0 | — |
case-20 | pass→pass | 4,722 | 2,930 | -38% | 1 | 1 | 0% | 734 | 2,023 | +176% | 0 | 0 | — |
case-21 | pass→pass | 2,764 | 2,309 | -16% | 1 | 1 | 0% | 428 | 1,904 | +345% | 0 | 0 | — |
case-22 | pass→pass | 3,779 | 3,567 | -6% | 1 | 1 | 0% | 656 | 2,173 | +231% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +64 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.