After a larger stage and at the end, give the work to an independent agent. For this review, choose a stronger model and give it fresh context with requirements and evidence. Check that the tool is available and can receive project data; choosing a different model alone does not guarantee a better assessment.
First, review without editing. The reviewer receives requirements, the code version, the difference from the base, instructions, and check results. It checks good practices for the technologies used, agreement with architecture and requirements, duplication, dead code, needless complexity, readability, errors, security, permissions, tests, and maintenance. Every finding needs a location, evidence, consequence, and priority.
Then, a justified refactor. Refactoring tidies code structure while preserving agreed behavior. The reviewer or another agent completes the accepted correction scope; it does not rewrite everything to suit its own taste. Behavior and regression tests and a repeated review apply to the new version. The agent that fixed code is not the only reviewer of its own fix. Human acceptance remains where required.
Conduct an independent review without editing. Scope and criteria: [link]. Base and assessed version: [versions]. Instructions and test evidence: [files]. Check requirements, good practices, duplication, dead code, complexity, error handling, security, and maintenance within the change boundary. Consider existing rationale. For every problem, give location, evidence, consequence, priority, and the smallest fix. Separate blockers from suggestions and unverified areas. Propose a refactor scope; do not change or publish anything.
Make the accepted corrections: [list and scope]. Preserve agreed behavior; if it must change, show it before expanding work. Check the actual version and instructions. Do the smallest justified refactor, run appropriate checks and regression tests, record evidence for the resulting version, and prepare it for independent checking. Do not deploy or send changes without separate approval.