code-review
Use when changed source files need review for bugs, security, code quality, or maintainability risks
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when changed source files need review for bugs, security, code quality, or maintainability risks
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when Codex is asked to colonize, plan, build, continue, swarm, or seal an Aether colony and must mirror wrapper orchestration safely
Use when Codex is asked to initialize or set up an Aether colony and should refine intent before running init
Use when Codex is asked to run Aether Oracle or discuss flows and should refine scope before research or clarification
Use when acceptance criteria need unit, integration, or end-to-end tests generated from implementation context
Use when delivered functionality needs acceptance-criteria verification before a phase advances
Use when a phase involves LLMs, AI agents, RAG, ML inference, or prompt/tool integration design
| source | shipped |
| name | code-review |
| description | Use when changed source files need review for bugs, security, code quality, or maintainability risks |
| type | colony |
| domains | ["code-quality","security","maintainability","best-practices"] |
| agent_roles | ["watcher","auditor","probe"] |
| workflow_triggers | ["continue"] |
| task_keywords | ["review","audit","quality","bug","maintainability"] |
| priority | normal |
| version | 1.0 |
Multi-depth code review with severity classification. Scans source files changed during a phase or across specified paths, identifying bugs, security vulnerabilities, style violations, and maintainability concerns. Every finding is classified by severity so maintainers can triage efficiently.
Identify which files to review. Accept any of these inputs:
main..feature-branch)If no scope is given, default to all uncommitted changes (staged + unstaged + untracked).
When findings are fixable, classify them before recommending action:
Group fixable findings into atomic units so each can be implemented, tested, and reverted independently.
The caller may specify a depth level. If not specified, use standard.
| Depth | What It Checks | Typical Use |
|---|---|---|
| quick | Syntax errors, obvious bugs, critical security issues | Pre-commit hook, rapid feedback |
| standard | quick + code smells, naming, missing error handling, test coverage gaps | Phase gate, PR review |
| deep | standard + performance hotspots, concurrency issues, dependency risks, architectural drift | Release readiness, security-sensitive code |
For each file in scope, perform these checks in order:
A. Static analysis layer
B. Bug detection layer
C. Security layer (quick depth stops here)
D. Quality layer (standard depth stops here)
E. Architecture layer (deep only)
Assign one of three severities:
| Severity | Meaning | Action Required |
|---|---|---|
| critical | Will cause failures, data loss, or security breach in production | Must fix before merge |
| warning | Likely to cause problems or degrades maintainability | Should fix soon |
| info | Style preference, minor improvement, or educational note | Optional |
For each finding include:
SEC-001, BUG-003, QUAL-012) from the pattern catalog belowWrite a structured review document:
# Code Review -- {scope description}
**Depth:** {quick|standard|deep}
**Date:** {ISO date}
**Files Reviewed:** {count}
**Findings:** {critical count} critical, {warning count} warning, {info count} info
## Summary
{1-3 sentence overall assessment}
## Findings
### Critical
{list or "None found"}
### Warning
{list or "None found"}
### Info
{list or "None found"}
## Metrics
| Metric | Value |
|--------|-------|
| Files reviewed | N |
| Lines scanned | N |
| Findings per 100 lines | N |
| Critical findings | N |
| ID | Category | Description |
|---|---|---|
| SEC-001 | Security | Hardcoded secret or credential |
| SEC-002 | Security | Missing input validation |
| SEC-003 | Security | Insecure crypto or hashing |
| SEC-004 | Security | SQL/NoSQL injection vector |
| SEC-005 | Security | Overly permissive access control |
| BUG-001 | Bug | Null/undefined dereference risk |
| BUG-002 | Bug | Off-by-one or boundary error |
| BUG-003 | Bug | Resource leak |
| BUG-004 | Bug | Swallowed exception |
| BUG-005 | Bug | Race condition |
| QUAL-001 | Quality | High cyclomatic complexity |
| QUAL-002 | Quality | Unused import or variable |
| QUAL-003 | Quality | Missing error handling |
| QUAL-004 | Quality | Dead or commented-out code |
| QUAL-005 | Quality | Inconsistent naming |
| PERF-001 | Performance | N+1 query pattern |
| PERF-002 | Performance | Unbounded collection growth |
| ARCH-001 | Architecture | Circular dependency |
| ARCH-002 | Architecture | Layer violation |
any type abuse, missing null checks, unhandled promise rejectionsexcept, missing type hints on public functionsunwrap() on user-controlled values, unnecessary .clone(), lifetime issuesProduces REVIEW.md in the current working directory or a specified output path.
Review phase 3 -- standard depth
The skill identifies all files changed since phase 3 began, runs standard-depth checks, and writes REVIEW.md.
Deep review on src/auth/login.ts src/auth/session.ts
Full security + performance + architecture analysis on the two authentication files.
Quick review of staged changes
Rapid scan for syntax errors, critical bugs, and security showstoppers only. Fast enough for a pre-commit hook.
# Code Review -- Phase 3 (standard)
**Depth:** standard
**Date:** 2026-04-22
**Files Reviewed:** 7
**Findings:** 1 critical, 3 warning, 2 info
## Summary
One critical hardcoded API key found in config.ts. Three warnings around
missing error handling in the data layer. Overall quality is good once the
critical finding is resolved.
## Findings
### Critical
- **SEC-001** `src/config.ts:14` -- Hardcoded API key in `const API_KEY = "sk-abc123"`.
Move to environment variable: `const API_KEY = process.env.API_KEY`
### Warning
- **QUAL-003** `src/data/fetch.ts:27` -- `fetchUser` does not handle network errors.
Wrap in try/catch and return a typed error result.
- **BUG-001** `src/data/fetch.ts:45` -- `user.address.street` will throw if `address` is null.
Use optional chaining: `user.address?.street`
- **QUAL-001** `src/data/transform.ts:12-58` -- `normalizeRecord` has cyclomatic complexity of 14.
Extract validation sub-functions to reduce branching.