Standardized output format for code reviews with severity labels, file:line references, and fix code snippets. Use when generating review reports that need consistent, actionable feedback structure.
Standardized output format for code reviews ensuring consistent, actionable, and prioritized feedback across all reviewer agents.
file:line references| Level | Icon | Criteria | Action Required |
|---|---|---|---|
| CRITICAL | š“ | Security vulnerabilities, data loss risk, system crashes | Must fix before merge |
| HIGH | š | Significant bugs, missing authorization, performance blockers | Should fix before merge |
| MEDIUM | š” | Code quality issues, minor bugs, missing validation | Fix soon, not blocking |
| LOW | š¢ | Style issues, minor improvements, suggestions | Nice to have |
| INFO | š” | Educational comments, alternative approaches | No action required |
Is it a security vulnerability?
āāā Yes ā CRITICAL
āāā No ā Can it cause data loss or corruption?
āāā Yes ā CRITICAL
āāā No ā Can it cause system crash/downtime?
āāā Yes ā HIGH
āāā No ā Does it break functionality?
āāā Yes ā HIGH
āāā No ā Does it affect performance significantly?
āāā Yes ā MEDIUM
āāā No ā Is it a code quality issue?
āāā Yes ā MEDIUM/LOW
āāā No ā LOW/INFO
š“ CRITICAL - Security
- SQL injection vulnerability
- Missing authorization on delete endpoint
- Hardcoded credentials in source code
- PII exposure in logs
š HIGH - Must Fix
- Missing null checks causing NullReferenceException
- N+1 query in frequently called method
- Business logic error causing wrong calculations
- Missing input validation on public API
š” MEDIUM - Should Fix
- Blocking async call (.Result, .Wait())
- Missing error handling
- Inefficient LINQ query
- Duplicate code that should be extracted
š¢ LOW - Nice to Have
- Variable naming improvements
- Missing XML documentation
- Code formatting inconsistencies
- Minor refactoring opportunities
š” INFO - Educational
- Alternative pattern suggestion
- Performance optimization tip
- Best practice recommendation
{FilePath}:{LineNumber}
ā
Good:
- `src/Application/PatientAppService.cs:45`
- `src/Domain/Patient.cs:23-28` (range)
- `src/Application/Validators/CreatePatientDtoValidator.cs:12`
ā Bad:
- `PatientAppService.cs` (missing path)
- `line 45` (missing file)
- `src/Application/` (missing file and line)
When an issue spans multiple files:
**[MEDIUM]** Duplicate validation logic
- `src/Application/PatientAppService.cs:45`
- `src/Application/DoctorAppService.cs:52`
- `src/Application/AppointmentAppService.cs:38`
**Suggestion**: Extract to shared `ValidationHelper` class.
**[{SEVERITY}]** `{file:line}` - {Category}
{Brief description of the issue}
**Problem**:
```{language}
// Current code
{problematic code}
Fix:
// Suggested fix
{corrected code}
Why: {Explanation of impact/risk}
### Compact Issue Format (for tables)
```markdown
| Severity | Location | Category | Issue | Fix |
|----------|----------|----------|-------|-----|
| š“ CRITICAL | `File.cs:42` | Security | Missing `[Authorize]` | Add `[Authorize(Permissions.Delete)]` |
| š HIGH | `File.cs:67` | Performance | N+1 query in loop | Use `.Include()` or batch query |
# Code Review: {PR Title}
**Date**: {YYYY-MM-DD}
**Reviewer**: {agent-name}
**Files Reviewed**: {count}
**Lines Changed**: +{added} / -{removed}
---
## Verdict
{ā
APPROVE | š¬ APPROVE WITH COMMENTS | š REQUEST CHANGES}
**Summary**: {1-2 sentence overview}
---
## Issue Summary
| Severity | Count | Blocking |
|----------|-------|----------|
| š“ CRITICAL | {n} | Yes |
| š HIGH | {n} | Yes |
| š” MEDIUM | {n} | No |
| š¢ LOW | {n} | No |
---
## š“ Critical Issues
{If none: "No critical issues found."}
### [CRITICAL] `{file:line}` - {Title}
{Description}
**Problem**:
```{lang}
{code}
Fix:
{code}
{Issues in same format}
{Issues in same format or table format for brevity}
{file:line} [nit]: {suggestion}{file:line} [style]: {suggestion}| Check | Status | Notes |
|---|---|---|
| Authorization | ā Pass / ā Fail | {details} |
| Input Validation | ā Pass / ā Fail | {details} |
| Data Exposure | ā Pass / ā Fail | {details} |
| Secrets | ā Pass / ā Fail | {details} |
| Check | Status | Notes |
|---|---|---|
| N+1 Queries | ā Pass / ā Fail | {details} |
| Async Patterns | ā Pass / ā Fail | {details} |
| Pagination | ā Pass / ā Fail | {details} |
| Query Optimization | ā Pass / ā Fail | {details} |
Must fix before merge:
Should fix soon:
---
## Category Labels
Use consistent category labels to classify issues:
| Category | Description | Examples |
|----------|-------------|----------|
| **Security** | Vulnerabilities, auth issues | Missing auth, SQL injection, XSS |
| **Performance** | Efficiency issues | N+1, blocking async, missing pagination |
| **DDD** | Domain design issues | Public setters, anemic entities |
| **ABP** | Framework pattern violations | Wrong base class, missing GuidGenerator |
| **Validation** | Input validation issues | Missing validators, weak rules |
| **Error Handling** | Exception handling issues | Silent catch, wrong exception type |
| **Async** | Async/await issues | Blocking calls, missing cancellation |
| **Testing** | Test quality issues | Missing tests, flaky tests |
| **Style** | Code style issues | Naming, formatting |
| **Documentation** | Doc issues | Missing comments, outdated docs |
---
## Feedback Language
### Use Constructive Language
```markdown
ā Bad:
"This is wrong."
"You should know better."
"Why didn't you use X?"
ā
Good:
"Consider using X because..."
"This could cause Y. Here's a fix:"
"Have you considered X? It would improve Y."
š« [blocking]: Must fix before merge
š [suggestion]: Consider for improvement
š [nit]: Minor style preference, not blocking
š [learning]: Educational note, no action needed
Every review output MUST include:
| If you find... | Severity |
|---|---|
| Security vulnerability | š“ CRITICAL |
| Missing authorization | š“ CRITICAL |
| Data corruption risk | š“ CRITICAL |
| Null reference exception | š HIGH |
| N+1 query pattern | š HIGH |
| Blocking async | š” MEDIUM |
| Missing validation | š” MEDIUM |
| Naming issues | š¢ LOW |
| Missing docs | š¢ LOW |
# Code Review: Add Patient CRUD API
**Date**: 2025-12-13
**Reviewer**: abp-code-reviewer
**Files Reviewed**: 5
**Lines Changed**: +245 / -12
---
## Verdict
š REQUEST CHANGES
**Summary**: Good implementation of Patient CRUD with proper ABP patterns. Found 1 critical security issue (missing authorization) and 2 performance concerns that need attention.
---
## Issue Summary
| Severity | Count | Blocking |
|----------|-------|----------|
| š“ CRITICAL | 1 | Yes |
| š HIGH | 2 | Yes |
| š” MEDIUM | 1 | No |
| š¢ LOW | 2 | No |
---
## š“ Critical Issues
### [CRITICAL] `src/Application/PatientAppService.cs:67` - Security
**Missing authorization on DeleteAsync**
**Problem**:
```csharp
public async Task DeleteAsync(Guid id)
{
await _repository.DeleteAsync(id);
}
Fix:
[Authorize(ClinicManagementSystemPermissions.Patients.Delete)]
public async Task DeleteAsync(Guid id)
{
await _repository.DeleteAsync(id);
}
Why: Any authenticated user can delete patients without permission check.
src/Application/PatientAppService.cs:34 - PerformanceN+1 query pattern in GetListAsync
Problem:
foreach (var patient in patients)
{
patient.Appointments = await _appointmentRepository.GetListAsync(a => a.PatientId == patient.Id);
}
Fix:
var patientIds = patients.Select(p => p.Id).ToList();
var appointments = await _appointmentRepository.GetListAsync(a => patientIds.Contains(a.PatientId));
var grouped = appointments.GroupBy(a => a.PatientId).ToDictionary(g => g.Key, g => g.ToList());
foreach (var patient in patients)
{
patient.Appointments = grouped.GetValueOrDefault(patient.Id, new List<Appointment>());
}
| Check | Status | Notes |
|---|---|---|
| Authorization | ā Fail | DeleteAsync missing [Authorize] |
| Input Validation | ā Pass | FluentValidation in place |
| Data Exposure | ā Pass | DTOs properly scoped |
| Secrets | ā Pass | No hardcoded values |
| Check | Status | Notes |
|---|---|---|
| N+1 Queries | ā Fail | Loop in GetListAsync |
| Async Patterns | ā Pass | Proper async/await |
| Pagination | ā Pass | Using PageBy |
| Query Optimization | ā Pass | WhereIf pattern used |
GuidGenerator.Create()Must fix before merge:
[Authorize] to DeleteAsyncShould fix soon: