Auto Code Reviewer

Three-pass automated code review that catches error handling gaps, structural issues, and naming problems — then auto-fixes everything before code reaches the user.

Install
cmdop skills install agensi-auto-code-reviewer

Auto Code Reviewer is a skill that acts as an automated quality gate for code produced or modified by an AI agent. Every piece of code passes through three sequential review passes before it is returned to the user, with issues identified and fixed automatically rather than merely flagged.

The first pass focuses on error handling and robustness. It wraps API calls and file I/O in try/catch blocks with descriptive error states, adds null checks, validates inputs, handles empty datasets, and eliminates unhandled promise rejections or silent failures.

The second pass addresses structure and cleanliness. Functions exceeding 30 lines are refactored automatically. Repeated logic is extracted into shared utilities, lookup data is pre-fetched to remove N+1 query patterns, and dead code along with unused imports is stripped out.

The third pass handles naming and simplification. Vague variable names such as data, temp, or result are replaced with intent-revealing names. Complex conditionals are rewritten using well-named booleans, nested logic is simplified, and magic numbers are extracted into named constants.

This skill integrates directly into an AI agent workflow, applying all three passes consistently on every code generation or modification without requiring manual prompting. Unlike a suggestion-only approach, it auto-fixes every issue it identifies. It is a good fit when consistent, automated enforcement of code quality standards across agent-generated output is a priority.

Use cases

  • Automatically add try/catch error handling to AI-generated API integration code
  • Refactor AI-generated functions that exceed 30 lines into smaller, focused units
  • Replace vague variable names in generated code with descriptive, intent-revealing alternatives
  • Eliminate N+1 query patterns introduced by agent-generated database access code
  • Remove dead code and unused imports from every agent code output before delivery
  • Extract repeated logic across agent-generated files into shared utility functions

When to use it

  • When an AI agent generates or modifies code and consistent quality enforcement is required before the code reaches a user
  • When error handling coverage in agent-produced code is inconsistent or missing
  • When function length and structural cleanliness need to be enforced automatically without manual review
  • When naming conventions in generated code are frequently vague or non-descriptive

When not to use it

  • When reviewing human-written code outside of an AI agent workflow, as this skill is scoped to agent-generated output
  • When the codebase uses languages or patterns where the described fixes such as try/catch or promise handling do not apply
  • When a project requires custom lint rules or style guides beyond what the three fixed passes cover