From apex
9-step pre-PR robustness gate for any AI-assisted branch — force branch explanation, layering, state ownership, concurrency, success/failure/fallback, test quality, consumer-tracing, reviewer simulation, unvalidated gaps. Run this BEFORE you reach `git push`. The skill walks each step's full prompt against an assistant. Fires when a feature branch is ready for review and AI wrote or refactored code. Keywords: pre-review, ai-assisted, pr readiness, reviewer simulation, robustness gate, before push.
How this skill is triggered — by the user, by Claude, or both
Slash command
/apex:ai-pre-review-checklistThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this checklist before opening a PR when AI assistants helped implement,
Use this checklist before opening a PR when AI assistants helped implement, refactor, or review the branch.
It is the final robustness gate between "the code exists" and "this branch is ready for human review."
AI assistants produce locally coherent code but often miss branch-shaping concerns unless asked directly:
This checklist forces those questions before a reviewer has to ask them.
Run this checklist when any of the following are true:
If the branch is non-trivial and AI touched it, use this checklist.
Before starting, have these ready:
python-review, typescript-review skills)If the assistant cannot clearly restate the branch goal, stop there first.
When using an AI assistant for pre-review, explicitly ask for:
Recommended instruction:
Review this branch as if you are preparing it for a strict reviewer.
Prioritize findings, risks, regressions, and missing tests.
Do not start with a summary.
State assumptions explicitly.
Say what you could not validate.
Ask the assistant to explain the branch without hiding behind file names.
Prompt:
Explain what this branch does at a high level in under two minutes.
Then answer:
- why it has this shape
- what state it introduces or changes
- what the user-visible flow is
- what the concurrency assumptions are
- why the transport choice is appropriate
If any of those are unclear from the code, say so explicitly.
Pass condition:
If this fails, improve the design note or PR description before review.
Ask the assistant whether the code is in the right place, not just whether it works.
Prompt:
Review the layering of this branch.
Identify any logic that belongs in a thinner API layer, service, orchestrator,
domain object, or helper.
Call out any abstractions that exist only because the code grew organically.
Flag any module or class that is doing too many jobs.
Pass condition:
Prompt:
List every stateful artifact or persisted record this branch reads or writes.
For each one, classify it as:
- shared/global
- artifact-scoped
- thread-scoped
- request-scoped
- temporary/ephemeral
Then identify any ownership ambiguity, accidental sharing, stale-read risk, or
cleanup risk.
Pass condition:
Prompt:
Review this branch for concurrency and multi-instance risks.
Who are the racing callers?
What happens if two requests touch the same underlying state?
Would this still behave correctly if multiple server instances were running?
Flag any in-memory coordination or hidden shared mutable state.
Pass condition:
Especially important for agentic or multi-stage flows.
Prompt:
Review the success, failure, cancellation, and fallback semantics of this branch.
Do not limit yourself to exceptions.
Identify cases where the code can "complete" without actually achieving the
intended user outcome.
Flag any fallback whose trigger condition is vague or whose state handoff is
risky.
Pass condition:
Prompt:
Review the tests for this branch by layer:
- pure unit tests
- service/integration tests
- endpoint/transport tests
Tell me where mocks are appropriate, where real storage/file-manager should be
used, and what user-visible behavior is still unproven.
Flag any test that mostly verifies mocks rather than behavior.
Pass condition:
Prompt:
For every contract this branch changes — a table column, a function
signature, a payload field, an SQL gate, a status transition — list the
consumers that read or depend on the contract.
For each consumer, answer:
- does the change break it, or is it correctly accounted for?
- is the consumer covered by a test in this branch, or only by indirect
coverage of the legacy path?
For every new code path introduced (a new branch, a new variant, a new
status):
- is there at least one test that exercises it directly, not via fallback
to the legacy path?
For every "mirrors X" claim in the PR description:
- paste X next to the new code, line-by-line, and confirm 1:1 parity.
Pass condition:
If you cannot list 3+ consumers in 5 minutes, the change has more reach than the diff suggests — replan or split the PR.
Prompt:
Simulate a strict reviewer reading this branch cold.
What are the first 5 questions they will ask?
What design choices are likely to trigger pushback?
What should be explained proactively in the PR description?
Pass condition:
Prompt:
What did you not validate in this review?
Separate:
- validated by tests
- validated by code inspection only
- not validated
Pass condition:
If the assistant cannot answer this clearly, the review is not trustworthy.
Treat these as high-risk until proven otherwise:
Before posting the branch, make sure all of the following are true:
pr-review-primer skill)If any of those are missing, the branch is not ready for external review.
Use these skills in this order:
python-review or typescript-review — code-level patterns and
anti-patterns while implementing.protocol-first-workflow — architecture shaping before implementation
grows (Python).ai-pre-review-checklist — this skill, the robustness gate before asking
humans to review AI-assisted code.pr-review-primer — reviewer-facing explanation for the PR body.npx claudepluginhub vancourse/apex --plugin apexGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.