mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-30 07:14:20 +00:00
- Use REJECT/REQUIRE/PREFER keywords for clear action items - Remove verbose explanations - Use bullet points instead of paragraphs - Add clear section separators - Condense rules to single lines where possible
1.9 KiB
1.9 KiB
Code Review Rules
References
- UI details:
ui/AGENTS.md - SDK details:
prowler/AGENTS.md - MCP details:
mcp_server/AGENTS.md
ALL FILES
REJECT if:
- Hardcoded secrets/credentials
anytype (TypeScript) or missing type hints (Python)- Code duplication (violates DRY)
- Silent error handling (no logging)
TypeScript/React (ui/)
REJECT if:
import Reactorimport * as React→ useimport { useState }- Union types
type X = "a" | "b"→ useconst X = {...} as const var()or hex colors in className → use Tailwind classesuseMemooruseCallbackwithout justification (React 19 Compiler)z.string().email()→ usez.email()(Zod v4)z.string().nonempty()→ usez.string().min(1)(Zod v4)- Missing
"use client"in client components - Missing
"use server"in server actions - Images without
altattribute - Interactive elements without
arialabels - Non-semantic HTML when semantic exists
PREFER:
components/shadcn/over custom componentscn()for conditional/merged classes- Local files if used 1 place,
components/shared/if 2+ - Responsive classes:
sm:,md:,lg:,xl:
EXCEPTION:
var()allowed in chart/graph component props (not className)
Python (prowler/, mcp_server/)
REJECT if:
- Missing type hints on public functions
- Missing docstrings on classes/public methods
- Bare
except:without specific exception print()instead oflogger
REQUIRE for SDK checks:
- Inherit from
Check execute()returnslist[CheckReport]report.status="PASS"|"FAIL".metadata.jsonfile exists
REQUIRE for MCP tools:
- Extend
BaseTool(auto-registration) MinimalSerializerMixinfor responsesfrom_api_response()for API transforms
Response Format
FIRST LINE must be exactly:
STATUS: PASSED
or
STATUS: FAILED
If FAILED, list: file:line - rule - issue