Execution Quality Gate
Activation
- •Activate during final
gatesteps. - •Activate on explicit
$codex-execution-quality-gate. - •Run before saying work is complete.
- •Activate on
$pre-commitor "check before commit". - •Activate on
$smart-testor "which tests to run". - •Activate on
$suggestor "suggest improvements". - •Activate on
$impactor "what will this affect". - •Activate on
$quality-recordto record quality trend snapshot. - •Activate on
$quality-reportto generate trend report. - •Activate on
$ux-audit. - •Activate on
$a11y-check. - •Activate on
$lighthouse <url>. - •Activate on
$e2e check. - •Activate on
$e2e generate <url>. - •Activate on
$e2e run.
Phase X Verification Order
| Priority | Check | Script | Blocking |
|---|---|---|---|
| P-1 | impact predictor (pre-edit advisory) | scripts/predict_impact.py | warning only |
| P0 | security scan | scripts/security_scan.py | yes for critical findings |
| P1 | lint | scripts/run_gate.py | yes when detected lint exits 1 |
| P2 | tests | scripts/run_gate.py | yes when detected tests exit 1 |
| P3 | bundle/dependency check | scripts/bundle_check.py | warning only |
| P4 | tech debt scan | scripts/tech_debt_scan.py | warning only |
| P5 | improvement suggester (post-task) | scripts/suggest_improvements.py | warning only |
| P6 | quality trend tracker (periodic) | scripts/quality_trend.py | warning only |
| P7 | UX static audit (pre-UI delivery) | scripts/ux_audit.py | warning only |
| P8 | accessibility static checker | scripts/accessibility_check.py | warning only |
| P9 | Lighthouse runtime audit | scripts/lighthouse_audit.py | warning only |
| P10 | Playwright setup/run helper | scripts/playwright_runner.py | warning only |
Execution
- •Run
run_gate.pywith project root. - •Run
security_scan.pywith project root. - •Optionally run
bundle_check.pywith project root. - •Optionally run
tech_debt_scan.pywith project root. - •Optionally run
suggest_improvements.pyafter complex tasks. - •Optionally run
predict_impact.pybefore high-risk edits. - •Optionally run
quality_trend.py --recordon periodic cadence. - •Optionally run
ux_audit.pybefore UI handoff. - •Optionally run
accessibility_check.pyfor public-facing surfaces. - •Optionally run
lighthouse_audit.pybefore deploy (requires running server URL). - •Optionally run
playwright_runner.pyfor E2E setup/check/run flows. - •Merge results and decide pass/fail.
Decision Rules
- •Completion allowed only if no blocking failures remain.
- •Blocking failures must be fixed, then checks rerun.
- •Warning-only outcomes may proceed with explicit warning to user.
- •Tech debt scan is advisory in MVP and does not block completion.
- •Improvement suggestions are advisory and do not block completion.
- •Impact prediction is advisory and does not block completion.
- •Quality trend reporting is periodic/advisory and does not block completion.
- •UX static audit is advisory and does not block completion.
- •Accessibility static checker is advisory and does not block completion.
- •Lighthouse wrapper is advisory and must fail gracefully when tool/server is unavailable.
- •Playwright wrapper is advisory and must fail gracefully when tool/setup is unavailable.
Script Paths
- •Windows:
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\<script>.py" --project-root <path> - •macOS/Linux:
python "$HOME/.codex/skills/codex-execution-quality-gate/scripts/<script>.py" --project-root <path>
Tech Debt Command
- •
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\tech_debt_scan.py" --project-root <path>
Pre-Commit Intelligence Command
- •
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\pre_commit_check.py" --project-root <path>
Smart Test Selector Command
- •
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\smart_test_selector.py" --project-root <path> --source staged
Improvement Suggester Command
- •
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\suggest_improvements.py" --project-root <path> --source last-commit - •In proactive mode, run after complex tasks and present top 3 suggestions.
Impact Predictor Command
- •
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\predict_impact.py" --project-root <path> --files <file1,file2> --depth 2
Quality Trend Commands
- •Record:
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\quality_trend.py" --project-root <path> --record - •Report:
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\quality_trend.py" --project-root <path> --report --days 30
UX Audit Command
- •
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\ux_audit.py" --project-root <path>
Accessibility Check Command
- •
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\accessibility_check.py" --project-root <path> --level AA
Lighthouse Audit Command
- •
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\lighthouse_audit.py" --url <http://localhost:3000> --device mobile --runs 1 - •Requires a running URL and Lighthouse availability through
npx.
Playwright Runner Commands
- •Check setup:
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\playwright_runner.py" --project-root <path> --mode check - •Generate skeleton:
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\playwright_runner.py" --project-root <path> --mode generate --url <http://localhost:3000/page> - •Run tests:
python "$env:USERPROFILE\.codex\skills\codex-execution-quality-gate\scripts\playwright_runner.py" --project-root <path> --mode run --browser chromium
Reference Files
- •
references/gate-policy.md: blocking vs warning rules for gate decisions. - •
references/improvement-suggester-spec.md: post-task suggestion behavior and presentation protocol. - •
references/impact-predictor-spec.md: pre-edit blast-radius analysis guidance. - •
references/quality-trend-spec.md: periodic quality trend workflow and interpretation. - •
references/ux-audit-spec.md: static UX audit checks and scoring. - •
references/accessibility-check-spec.md: WCAG static checks and compliance scoring. - •
references/lighthouse-audit-spec.md: Lighthouse wrapper behavior and graceful fallback. - •
references/playwright-runner-spec.md: Playwright check/generate/run behavior.
Override
If user says skip gate or force complete, comply and warn:
"Quality gate skipped. Lint/test/security status is unknown."
Output Handling
For each script:
- •capture output
- •summarize errors/warnings/passes
- •ask whether to fix blocking errors when present
- •rerun after fixes to verify