| name | code-review/backend-doctor |
| description | Backend code quality detection. Covers: console.log in backend (forbidden, use Logger service), TypeScript any type (forbidden). All Blocking. Trigger: backend NestJS console.log any type backend code quality.
|
| version | 3 |
backend-doctor — Backend Code Quality
Responsibility
Detect common quality issues in backend code, targeting NestJS projects.
Step 0: Discover Backend Source Directories
Dynamically locate backend source directories so rules are project-agnostic:
search_file: pattern="**/main.ts" target_directory=<workspace_root> recursive=true
From results, extract the parent directories (e.g., apps/backend/app-name/src/). These are the backend source roots. Use them as search paths for Rules 1–2.
Alternatively, search across the entire workspace and filter by backend-specific indicators (@nestjs/* imports, @Module() decorators).
Rules
Rule 1: console.log in backend source
Rule 2: TypeScript any type in backend
Execution
- Run Step 0 first to discover backend source directories.
- Run both
search_content calls in PARALLEL on the discovered paths.
- All violations are ❌ Blocking.
- Report: list each violation with filePath, lineNumber, matched content, and which rule it violates.