
Python Code Quality
Run Agent Framework Python monorepo lint, format, type-check, and full CI parity from the python/ directory when fixing local or pipeline failures.
Overview
python-code-quality is an agent skill most often used in Ship (also Build) that documents lint, format, type-check, and CI-parity commands for the Agent Framework Python monorepo.
Install
npx skills add https://github.com/microsoft/agent-framework --skill python-code-qualityWhat is this skill?
- uv/poe syntax, typing, check-packages, and full check commands scoped by package (-P core) or samples (-S)
- Parallel Pyright and MyPy fan-out across packages with combined typing shortcut
- Markdown code-block lint via markdown-code-lint for docs consistency
- Lightweight prek pre-commit hooks on changed files with manual run -a and --last-commit
- Clear split between format-only (-F), check-only (-C), and full syntax workflows
- Supports parallel syntax and package-level check fan-out via uv run poe
- Combines Pyright and MyPy under a single poe typing entry point
- Documents prek install and run -a / --last-commit hook workflows
Adoption & trust: 90 installs on skills.sh; 11.2k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are contributing to a multi-package Python agent repo and do not know which poe targets reproduce CI or how to scope checks to one package after a failure.
Who is it for?
Solo builders or agents maintaining Agent Framework Python who need a single cheat sheet for formatting, type checking, and troubleshooting CI.
Skip if: Greenfield Python apps outside this monorepo layout or teams that only need generic Ruff tutorials without uv/poe orchestration.
When should I use this skill?
Running checks, fixing lint errors, or troubleshooting CI failures in the Agent Framework Python codebase.
What do I get? / Deliverables
You run the documented syntax, typing, check-packages, and prek flows from python/ so local results match pipeline expectations before you push.
- Locally passing syntax and typing checks aligned with CI
- Formatted sources and validated markdown code blocks when using full check
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Quality gates and CI troubleshooting belong on the shipping shelf because the skill is invoked right before merge and when pipelines fail, not when designing features. Review is the canonical subphase for static analysis, formatter checks, Pyright/MyPy fan-out, and pre-commit (prek) hooks on changed packages.
Where it fits
After editing agent runtime code in core, run poe syntax -P core and poe typing -P core before opening a PR.
Mirror the full poe check pipeline locally when a GitHub workflow fails on markdown-code-lint or sample packages.
Use check -S to validate samples-only changes without running the entire monorepo matrix.
Re-run prek run --last-commit to verify hook configuration after upgrading tooling in the repo.
How it compares
Use instead of ad-hoc web searches for Ruff or MyPy—this is a repo-specific command map, not a generic linter skill.
Common Questions / FAQ
Who is python-code-quality for?
Contributors and coding agents working in the microsoft/agent-framework python/ tree who must pass syntax, typing, and markdown checks before merge.
When should I use python-code-quality?
During Build while hardening backend agent code, and during Ship when reviewing diffs, running pre-commit hooks, or debugging failed check jobs in CI.
Is python-code-quality safe to install?
It is documentation for local CLI commands; review the Security Audits panel on this Prism page and restrict agent Bash permissions to the python/ workspace.
SKILL.md
READMESKILL.md - Python Code Quality
# Python Code Quality ## Quick Commands 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 uv run poe pyright # Pyright fan-out across packages uv run poe pyright -P core uv run poe pyright -A uv run poe mypy # MyPy fan-out across packages uv run poe mypy -P core uv run poe mypy -A uv run poe typing # Both pyright and mypy 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 ``` ## Pre-commit Hooks (prek) 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. ## Ruff Configuration - Line length: 120 - Target: Python 3.10+ - Auto-fix enabled - Rules: ASYNC, B, CPY, D, E, ERA, F, FIX, I, INP, ISC, Q, RET, RSE, RUF, SIM, T20, TD, W, T100, S - Scripts directory is excluded from checks ## Pyright Configuration - Strict mode enabled - Excludes: tests, .venv, packages/devui/frontend ## Parallel Execution 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 Workflow CI splits into 4 parallel jobs: 1. **Pre-commit hooks** — lightweight hooks (SKIP=poe-check) 2. **Package checks** — syntax/pyright via check-packages 3. **Samples & markdown** — `check -S` plus `markdown-code-lint` 4. **Mypy** — change-detected mypy checks