AI coding assistants write 300 lines in 5 seconds — and bypass all your layers. RepoGuard scans your stack, generates strict guardrails, and audits violations in real-time.
Run npx repoguard audit to scan your entire codebase and receive an instant architecture report card.
RepoGuard monitors your codebase against the most destructive anti-patterns generated by AI coding assistants.
| Rule ID | Category | Severity | Enforced Guardrail |
|---|---|---|---|
| RULE-01 | Architecture | Error | Blocks raw ORM/DB calls inside Controllers and UI components. |
| RULE-02 | Security | Critical | Flags hardcoded secrets, API tokens, and credentials in code. |
| RULE-03 | Type Safety | Warning | Forbids lazy : any and as any escape hatches. |
| RULE-04 | Code Quality | Info | Replaces raw console.log with structured loggers. |
| RULE-05 | Next.js / SSR | Error | Prevents SSR hydration mismatch from browser globals (window/localStorage). |
| RULE-06 | Security | Critical | Detects dangerous SQL injection risks in raw query interpolations. |
| RULE-07 | API Design | Warning | Enforces Zod schema validation on incoming request body payloads. |
| RULE-08 | DRY Principle | Info | Prevents AI assistants from duplicating existing common utility helpers. |
Without strict repo-level context, AI assistants invent duplicate utilities, break architectural boundaries, and drown tech leads in review debt.
AI loves doing database mutations directly inside React components or API route handlers, completely ignoring your domain services.
Instead of importing your existing helper, the AI writes a slightly different 20-line copy with zero reuse.
800-line AI-generated PRs that compile, but slowly poison the maintainability of your repository over time.
For public repositories and solo builders
For independent engineers & freelancers
For startups & scaling tech teams
⚠️ Layering Violation (`RULE-01`): Controllers must not access the Prisma client directly. Encapsulate queries inside
/services/user.service.ts.