The deterministic, NestJS devtool that catches AI mistakes

An opinionated rule set for an opinionated framework.

A reviewer for your PRs.

Maps your modules, database, and boot in a visual report.

Extends with rules you write yourself.

$ npx -y nestjs-doctor@latest .

your code never leaves your machine · 0 AI calls · same output every run

Fig. 01 — Examination recording$ npx -y nestjs-doctor@latest .
Recording · real scan, real findings · loops

A deterministic code reviewer.

NestJS Doctor reviews a pull request and comments on the findings, using the built-in rules and the custom rules you write. Enforce hexagonal architecture, DDD layers, or any convention your team cares about.

Install it with one command:

$ npx nestjs-doctor@latest ci install

Comments, score only, or hard gate. You choose how much it does on each PR.

CI docs →

Fig. 02 — Pull request reviewdelta vs base branch

Add order payment webhook #412

Openmaria-dev wants to merge 3 commits into main from feat/payment-webhook
Conversation 4Commits 3Files changed 6
ndnestjs-doctorbotcommented 2 minutes ago · edited on every push
8479−5/ 100 · below the 80 gate
SeverityFindingLocation
errorHardcoded JWT secretauth.service.ts:34
warningController injects ORM PrismaService directlyorders.controller.ts:11

2 findings introduced by this PR · 6 pre-existing findings not shown

ndnestjs-doctorbotcommented onsrc/orders/orders.controller.ts
@@ -8,5 +8,7 @@ export class OrdersController {
10+ private readonly prisma: PrismaService,
warning architecture/no-orm-in-controller

Controller injects ORM PrismaService directly. Route data access through OrdersService.

test— 214 passed in 38sDetails
nestjs-doctor / scan— score 79 is below the 80 gateDetails
Merging is blocked1 required check failing
Fig. 03 — Module graph6 modules · 1 cycle
AppModuleAuthModuleUsersModuleOrdersModuleNotificationsModulePrismaModule
cycle · AuthModule → UsersModule → PrismaModule → AuthModule
PrismaServiceonModuleInit812ms
AuthModuleonApplicationBootstrap96ms
CacheServiceonModuleInit41ms

See the architecture your imports actually form.

$ npx nestjs-doctor@latest . --report

Draws the module graph your imports actually form. Add a few lines to main.ts, boot once, and --timings overlays the real construction times.

Module graph docs
Fig. 04 — Entity relation sketchprisma · 12 entities
1:N1:1
User
idpk uuid
emailvarchar
createdAttimestamp
Order
idpk uuid
userIdfk → User
totaldecimal
Payment
orderIdfk → Order
amountdecimal
statusvarchar
3 schema findings · reported against the entity
errorEntity 'Payment' has no primary key column.schema/require-primary-key
warningEntity 'Order' has no timestamp columns.schema/require-timestamps
infoRelation 'order' has no explicit onDelete.schema/require-cascade-rule

An ER diagram from your source code.

$ npx nestjs-doctor@latest . --report

Entities and relations from Prisma, TypeORM, Drizzle, and MikroORM in one diagram, with schema rules reporting against the entity.

Schema rules