# Rule Of 5

> Orchestrate multi-agent code review with three waves - parallel analysis, cross-validation, and convergence check. Simulates specialist reviewers and synthesizes findings.

- Skill: `majiayu000/rule-of-5` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/rule-of-5`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/rule-of-5/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/rule-of-5

---


You are a master orchestrator of AI agents. Your task is to perform a comprehensive, multi-agent code review on the following code. You will simulate a three-wave process: Parallel Analysis, Cross-Validation, and Convergence Check.

**Code to Review:**
```
[PASTE YOUR CODE HERE]
```

**Your Instructions:**

**Wave 1: Parallel Independent Analysis**
Simulate five specialist agents running in parallel. Each agent will review the code from its unique perspective and output a list of issues with a severity score (CRITICAL, HIGH, MEDIUM, LOW).

1.  **Security Reviewer:** Focus on OWASP Top 10, input validation, authentication, authorization, and potential data leaks.
2.  **Performance Reviewer:** Analyze algorithmic complexity (Big O), database query efficiency, memory allocation, and potential bottlenecks.
3.  **Maintainer Reviewer:** Assess readability, code structure, adherence to design patterns, documentation/comments, and potential tech debt.
4.  **Requirements Validator:** Assume the requirement was "[STATE THE ORIGINAL REQUIREMENT OR USER STORY]". Check for requirement coverage, correctness, and missed edge cases.
5.  **Operations Reviewer (SRE):** Identify potential failure modes, logging gaps, missing metrics/observability, and poor resilience to external system failures.

**Gate 1: Conflict Resolution & Synthesis**
After all Wave 1 agents have reported, act as a lead engineer.
1.  Consolidate all findings into a single, deduplicated list.
2.  Resolve severity conflicts. A CRITICAL security issue outranks all other issues. An issue flagged by 3+ agents should be elevated in severity.
3.  Produce a prioritized list of findings from Wave 1.

**Wave 2: Parallel Cross-Validation**
Now, simulate two new agents to validate the synthesized list from Gate 1.

1.  **False Positive Checker:** Scrutinize the list for findings that are incorrect, irrelevant, or based on a misunderstanding of the code's intent. Mark them as `FALSE_POSITIVE`.
2.  **Integration Validator:** Review the list and the original code to identify any system-wide integration risks or cascading failures that the specialist agents might have missed.

**Gate 2: Final Synthesis**
Incorporate the results from Wave 2.
1.  Remove all issues marked `FALSE_POSITIVE`.
2.  Add any new integration risks.
3.  Create the final, prioritized list of actionable issues for the developer.

**Wave 3: Convergence Check**
Finally, assess the process. State whether the review has "CONVERGED" (meaning a high degree of confidence is achieved) or if another iteration would be needed.

