Python QA Gate
Canonical procedure for the Phase D final quality gate that every Python change must pass before completion is reported.
When to Use This Skill
Use this skill when:
python-typed-engineer is about to declare a change complete.
- An executor has finished applying a planned batch and must verify zero regressions against the baseline captured in Phase A.
- A reviewer needs to confirm the toolchain was actually run and produced a clean pass.
Required Inputs
Before invoking this gate, the agent must have:
- a baseline record produced in Phase A, containing Ruff, Pyright, Pytest, and per-file coverage status for the in-scope files,
- the exact list of touched production and test files,
- a clean working tree (all planned edits committed to the working copy).
Toolchain Execution Sequence
Run the full toolchain in this exact order. If any step fails or modifies files, fix the issue and restart from step 1. Do not stop the loop until all four steps complete without errors in a single pass.
poetry run black .
poetry run ruff check .
poetry run pyright
poetry run pytest --cov --cov-report=term-missing
If the environment prevents running any tool, stop and report the change as unverified. Do not declare completion.
Delta Requirements (Zero-Regression Hard Gate)
Compare the final results to the Phase A baseline. All of the following must hold:
- Ruff delta: 0 new findings across the repository.
- Pyright delta: 0 new diagnostics across the repository.
- Pytest delta: 0 new failing tests.
- Per-file coverage delta: coverage for every touched file is greater than or equal to the baseline for that file.
- Overall coverage delta (when the repo enforces it): overall coverage is greater than or equal to the baseline.
- New modules, classes, or methods: coverage >= 90% for each new unit introduced in the batch.
If any delta check fails, the agent must revert or fix immediately and rerun the full toolchain. Do not proceed to reporting until all deltas are clean.
Required Reporting Block
Every completion response must include the following sections:
- Scope — exact file list touched in this change.
- Baseline — Ruff, Pyright, Pytest, and coverage status recorded in Phase A.
- Plan — design and test-strategy summary, referencing the approved plan.
- Diffs — patch-style or full-file replacements for scoped files only.
- QA Gate Results — Ruff, Pyright, Pytest, and coverage deltas. If any step could not be run, mark the corresponding line unverified and state why.
Evidence Storage
Persist toolchain output according to evidence-and-timestamp-conventions:
- store baseline outputs under
<FEATURE>/evidence/baseline/<timestamp>/,
- store post-change outputs under
<FEATURE>/evidence/qa-gates/<timestamp>/,
- use ISO-8601 UTC timestamps in folder names.
This location is canonical per evidence-and-timestamp-conventions and is not overridable.
See .agents/skills/evidence-and-timestamp-conventions/SKILL.md for the canonical evidence path authority.
The evidence paths must be referenced in the agent's completion message to satisfy the SubagentStop completion-artifact gate.
Prohibited Shortcuts
- Do not disable, skip, or narrow any step of the toolchain to reach a clean result.
- Do not add Ruff
noqa, Pyright # type: ignore, or test skips to suppress new findings introduced by the change.
- Do not report success based on partial or targeted runs alone. Targeted runs are allowed mid-batch, but the final gate requires a full-repo pass.
1---2name: python-qa-gate-23description: Final QA gate for Python changes. Runs Black, Ruff, Pyright, and Pytest; compares a captured baseline, enforces zero-regression deltas, and produces the required reporting block before completion.4---56# Python QA Gate78Canonical procedure for the Phase D final quality gate that every Python change must pass before completion is reported.910## When to Use This Skill1112Use this skill when:1314- `python-typed-engineer` is about to declare a change complete.15- An executor has finished applying a planned batch and must verify zero regressions against the baseline captured in Phase A.16- A reviewer needs to confirm the toolchain was actually run and produced a clean pass.1718## Required Inputs1920Before invoking this gate, the agent must have:2122- a baseline record produced in Phase A, containing Ruff, Pyright, Pytest, and per-file coverage status for the in-scope files,23- the exact list of touched production and test files,24- a clean working tree (all planned edits committed to the working copy).2526## Toolchain Execution Sequence2728Run the full toolchain in this exact order. If any step fails or modifies files, fix the issue and restart from step 1. Do not stop the loop until all four steps complete without errors in a single pass.29301. `poetry run black .`312. `poetry run ruff check .`323. `poetry run pyright`334. `poetry run pytest --cov --cov-report=term-missing`3435If the environment prevents running any tool, stop and report the change as **unverified**. Do not declare completion.3637## Delta Requirements (Zero-Regression Hard Gate)3839Compare the final results to the Phase A baseline. All of the following must hold:4041- **Ruff delta**: 0 new findings across the repository.42- **Pyright delta**: 0 new diagnostics across the repository.43- **Pytest delta**: 0 new failing tests.44- **Per-file coverage delta**: coverage for every touched file is greater than or equal to the baseline for that file.45- **Overall coverage delta** (when the repo enforces it): overall coverage is greater than or equal to the baseline.46- **New modules, classes, or methods**: coverage >= 90% for each new unit introduced in the batch.4748If any delta check fails, the agent must revert or fix immediately and rerun the full toolchain. Do not proceed to reporting until all deltas are clean.4950## Required Reporting Block5152Every completion response must include the following sections:53541. **Scope** — exact file list touched in this change.552. **Baseline** — Ruff, Pyright, Pytest, and coverage status recorded in Phase A.563. **Plan** — design and test-strategy summary, referencing the approved plan.574. **Diffs** — patch-style or full-file replacements for scoped files only.585. **QA Gate Results** — Ruff, Pyright, Pytest, and coverage deltas. If any step could not be run, mark the corresponding line **unverified** and state why.5960## Evidence Storage6162Persist toolchain output according to `evidence-and-timestamp-conventions`:6364- store baseline outputs under `<FEATURE>/evidence/baseline/<timestamp>/`,65- store post-change outputs under `<FEATURE>/evidence/qa-gates/<timestamp>/`,66- use ISO-8601 UTC timestamps in folder names.6768This location is canonical per evidence-and-timestamp-conventions and is not overridable.69See `.agents/skills/evidence-and-timestamp-conventions/SKILL.md` for the canonical evidence path authority.7071The evidence paths must be referenced in the agent's completion message to satisfy the `SubagentStop` completion-artifact gate.7273## Prohibited Shortcuts7475- Do not disable, skip, or narrow any step of the toolchain to reach a clean result.76- Do not add Ruff `noqa`, Pyright `# type: ignore`, or test skips to suppress new findings introduced by the change.77- Do not report success based on partial or targeted runs alone. Targeted runs are allowed mid-batch, but the final gate requires a full-repo pass.