Code review

From josstei/maestro-orchestrate · View interactive version

Code review is an AI agent skill from the GitHub repository josstei/maestro-orchestrate. Standalone code review methodology for structured, severity-classified code assessment

How to use this skill

Skill file

Code Review Skill

Activate this skill when performing standalone code reviews via the runtime-specific Maestro review entrypoint or during orchestration quality gates (the final completion gate). This skill provides the methodology for scoping, executing, and reporting code reviews.

Scope Detection Protocol

Determine review scope using the following priority order:

  1. User-specified paths: If the user provides file paths or glob patterns, expand glob patterns using the glob tool to resolve them to concrete file paths before delegating to the code-reviewer agent
  2. Staged changes: If git diff --staged produces output, review staged changes
  3. Last commit diff: If no staged changes exist, review the last commit via git diff HEAD~1
  4. Fallback: If none of the above yield content, ask the user to specify scope

Always confirm the detected scope with the user before proceeding.

If scope is provided as file paths and a git diff is empty for some paths (for example, new unstaged files), include those files' current contents directly in review context so they are still reviewed.

Review Orchestration

Delegation Flow

  1. Detect review scope using the protocol above
  2. Gather the full diff content for the detected scope, and include current file contents when diff content is unavailable for scoped files
  3. Delegate to the code-reviewer agent with:
  1. Process the agent's Task Report
  2. Present findings to the user in the structured output format below

Context Enrichment

When delegating to the code-reviewer agent, include:

Severity Classification

Critical

Issues that could cause security vulnerabilities, data loss, or system crashes:

Major

Issues that cause bugs, design flaws, or significant maintainability problems:

Minor

Issues related to style, naming, or minor convention violations:

Suggestion

Optional improvements that enhance readability or maintainability:

Output Format

Present findings in a structured table followed by a summary:

## Code Review Results

**Scope**: [description of what was reviewed]
**Files Reviewed**: [count]
**Total Findings**: [count by severity]

### Findings

| # | Severity | File | Line | Description | Suggested Fix |
|---|----------|------|------|-------------|---------------|
| 1 | Critical | path/to/file.ts | 42 | [description] | [fix] |
| 2 | Major | path/to/file.ts | 87 | [description] | [fix] |

### Summary

[1-2 paragraph summary of overall code quality, patterns observed, and priority actions]

Verification Rule

Every finding must:

Do NOT report:

Review Scope Calibration

Calibrate the depth and focus of review based on the type of change being reviewed:

Calibration Rules

Application

When reviewing a diff that contains multiple change types (new files + modifications + deletions), apply the appropriate calibration to each file independently. Do not apply "new file" depth to a file that only had a minor modification.

Finding Deduplication Protocol

When reviewing multiple files, identify and consolidate findings that share the same root cause.

Deduplication Rules

Deduplication Format

### Systemic Finding: [Pattern Violation Name]
- **Severity**: [Critical | Major | Minor | Suggestion]
- **Description**: [What the pattern violation is and why it matters]
- **Affected Locations**:
  - `path/to/file1.ext:line` — [brief context]
  - `path/to/file2.ext:line` — [brief context]
  - `path/to/file3.ext:line` — [brief context]
- **Remediation**: [Single recommendation that addresses all instances]

This produces cleaner, more actionable review output by surfacing systemic issues as patterns rather than repeating the same finding across multiple files.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.