Dev swarm code review

From X-School-Academy/skill-pilot · View interactive version

Dev swarm code review is an AI agent skill from the GitHub repository X-School-Academy/skill-pilot. Review and audit code quality, architecture, and implementation. Verify code meets design specs, find bugs, identify improvements, and create change/bug/improve backlogs. Use when reviewing completed code, auditing implementations, or ensuring quality.

How to use this skill

Skill file

AI Builder - Code Review

This skill performs comprehensive code review and quality audits. As a Senior Code Reviewer expert, you'll examine implementations against design specifications, identify issues, suggest improvements, and create backlogs for necessary changes, bug fixes, or optimizations.

When to Use This Skill

Prerequisites

This skill requires:

Feature-Driven Code Review Workflow

CRITICAL: This skill follows a strict feature-driven approach where feature-name is the index for the entire project:

For Each Backlog:

  1. Read backlog.md from 10-sprints/SPRINT-XX-descriptive-name/[BACKLOG_TYPE]-XX-[feature-name]-<sub-feature>.md
  2. Extract the feature-name from the backlog file name
  3. Read features/features-index.md to find the feature file
  4. Read feature documentation in this order:
  1. Locate source code in {SRC}/ using features/impl/[feature-name].md
  2. Review code against design specs and coding standards
  3. Update backlog.md with review findings

This approach ensures AI reviewers can review large projects without reading all code at once.

Your Roles in This Skill

See dev-swarm/docs/general-dev-stage-rule.md for role selection guidance.

Role Communication

See dev-swarm/docs/general-dev-stage-rule.md for the required role announcement format.

Review Workflow Overview

The code review process:

  1. Read backlog requirements and feature design
  2. Read implementation documentation
  3. Review actual source code files
  4. Verify code meets design and requirements
  5. Identify issues and improvements
  6. Create new backlogs (change/bug/improve) as needed
  7. Provide review feedback to developer

Instructions

Follow these steps in order:

Checklist formatting rule: Any checklist, acceptance criteria, or test plan must use Markdown task lists (e.g., - [ ] item) so QA can mark verification status.

Step 0: Verify Prerequisites and Gather Context (Feature-Driven Approach)

IMPORTANT: Follow this exact order to efficiently locate all relevant context:

  1. Identify the backlog to review:

```

10-sprints/

└── SPRINT-XX-descriptive-name/

└── [BACKLOG_TYPE]-XX-[feature-name]-<sub-feature>.md

```

  1. Read the backlog file:
  1. Read coding standards:
  1. Read PRD and tech specs:
  1. Read feature documentation (using feature-name as index):
  1. Locate source code:
  1. Prepare for deep dive:

DO NOT read the entire codebase. Use feature-name to find only relevant files.

Step 1: Review Code Implementation

Systematically review the code:

  1. Read all modified/created files:
  1. Verify against design:
  1. Check against requirements:

Step 2: Code Quality Assessment

Evaluate code across multiple dimensions:

1. Correctness
2. Security

Review for OWASP Top 10 vulnerabilities:

3. Code Quality
4. Architecture
5. Performance
6. Maintainability
7. Testing

Step 3: Identify Issues and Improvements

Categorize findings into three types:

1. Changes (Code doesn't meet design)

Issues where implementation doesn't match design or requirements:

Action: Create change type backlog

2. Bugs (Defects in code)

Errors that will cause problems:

Action: Create bug type backlog

3. Improvements (Optimization opportunities)

Non-critical enhancements:

Action: Create improve type backlog

Step 4: Create Backlogs for Issues

For each issue found, create a backlog:

  1. Determine severity:
  1. Create backlog file in 10-sprints/:

Backlog Template:

```markdown

# Backlog: [Type] - [Brief Description]

## Type

[change | bug | improve]

## Severity

[critical | high | medium | low]

## Original Feature/Backlog

Reference to original backlog that was reviewed

## Issue Description

Clear description of what's wrong or needs improvement

## Current Behavior

What the code currently does

## Expected Behavior

What the code should do

## Affected Files

## Suggested Fix

How to address this issue

## Reference Features

Related features to consult

## Test Plan

How to verify the fix works

```

  1. Notify Project Management:

Step 5: Provide Review Feedback

  1. Summary of findings:
  1. Positive feedback:
  1. Areas for improvement:
  1. Review decision:

Step 6: Finalize and Commit

CRITICAL: Follow this process to safely commit changes and update tracking:

  1. Update Tracking Files:
  1. Request Human Review:
  1. Commit the Code/Fixes (Content):
  1. Update Backlog with Commit ID:
  1. Commit the Backlog (Metadata):
  1. Notify user:

This two-step commit process ensures history is preserved before the backlog is updated with the commit reference.

Expected Workflow

Code Development Complete
         ↓
Code Review Skill Activated
         ↓
Read: Backlog + Feature Design + Impl Docs
         ↓
Review: All Code Files
         ↓
Assess: Quality, Security, Performance
         ↓
Create Backlogs:
  - Change (doesn't meet design)
  - Bug (defects found)
  - Improve (optimization opportunities)
         ↓
Provide Review Feedback
         ↓
If Approved → Testing
If Changes Required → Back to Development

Integration with Other Skills

From Code Development Skill:

To Project Management Skill:

To Code Development Skill:

To Code Test Skill:

Review Checklists

Security Checklist

Code Quality Checklist

Architecture Checklist

Testing Checklist

Best Practices for Code Review

1. Be Constructive, Not Critical

2. Prioritize Issues

3. Understand Context

4. Be Thorough But Efficient

5. Create Actionable Backlogs

6. Maintain Knowledge Base

Common Review Scenarios

Scenario 1: Feature Implementation Review

1. Read backlog: "User can upload profile picture"
2. Read features/profile-upload.md: Understand design
3. Read features/impl/profile-upload.md: Find changed files
4. Review {SRC}/api/upload.ts: Check implementation
5. Find issue: No file size validation (security risk)
6. Create bug backlog: "Add file size validation to upload"
7. Find improvement: Could use image compression
8. Create improve backlog: "Add image compression to upload"
9. Provide feedback: "Approved with changes required (bug fix needed)"

Scenario 2: Bug Fix Review

1. Read backlog: "Fix login error for special characters"
2. Read features/user-authentication.md: Understand auth system
3. Review {SRC}/auth/validator.ts: Check fix
4. Verify: Fix properly escapes special characters
5. Check: No new vulnerabilities introduced
6. Test: Can verify with test plan
7. Provide feedback: "Approved - ready for testing"

Scenario 3: Performance Improvement Review

1. Read backlog: "Optimize dashboard API response time"
2. Read features/dashboard-api.md: Understand optimization approach
3. Review {SRC}/api/dashboard.ts: Check caching implementation
4. Find issue: Cache invalidation logic missing
5. Create change backlog: "Add cache invalidation to dashboard"
6. Find opportunity: Could optimize database query further
7. Create improve backlog: "Optimize dashboard query with indexes"
8. Provide feedback: "Changes required (cache invalidation needed)"

Key Principles

  1. Thoroughness: Review all code, don't skim
  2. Context Awareness: Understand design before judging
  3. Security First: Security issues are always priority
  4. Constructive: Help developer improve, don't just criticize
  5. Actionable: Create clear, specific backlogs
  6. Efficiency: Use impl docs to guide review
  7. Standards: Enforce coding standards consistently
  8. Learning: Share knowledge through feedback

Deliverables

By the end of using this skill, you should have:

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.