nestjs-probe-coverage

Annotate NestJS endpoints with Swagger decorators so OpenAPI docs and probe flows achieve full coverage.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/hontauadrian/sfx-app-empty-test --skill nestjs-probe-coverage-hontauadrian
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nestjs-probe-coverage
Source: https://github.com/hontauadrian/sfx-app-empty-test/tree/main/.overstory/claude-profiles/reviewer/skills/nestjs-probe-coverage
Command: npx skills add https://github.com/hontauadrian/sfx-app-empty-test --skill nestjs-probe-coverage-hontauadrian

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? NestJS endpoints without proper Swagger annotations produce an empty or misleading /api/docs page and cause the contract probe to silently skip branches, so 401/403/409/422 paths ship untested. This Skill provides the complete annotation ruleset that makes every endpoint self-documenting and probe-coverable. ## Core Features & Use Cases - Mandatory per-handler checklist: Enforces @ApiTags, @ApiOperation, @ApiBearerAuth, @ApiBody with zodToOpenApi refs, @ApiParam/@ApiQuery, and an explicit @ApiResponse for every status a handler can return. - Zod-to-OpenAPI integration: Requires .openapi({ example, description }) on every Zod field plus examples blocks on @ApiBody so Swagger UI never degrades to "Unknown Type: object". - Auth flow detection: Defines canonical operationIds (authLogin, authRegister, authLogout, authRefresh, authMe) so the probe can generate the auth-bootstrap chain without path or shape heuristics. - Use Case: After pnpm probe:smoke reports CONTRACT_STATUS_UNREACHABLE_UNGENERATABLE or a 401 on a protected route, apply the status-audit procedure to declare every reachable status and re-run the probe until all flows generate. ## Quick Start Annotate my NestJS auth controller with the full Swagger decorator set including canonical operationIds and per-status @ApiResponse declarations.

Frequently Asked Questions about nestjs-probe-coverage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make NestJS Swagger UI show request body examples instead of Unknown Type: object?▼

Add .openapi({ example, description }) to every field in the exported Zod schema and include an examples block with a named example in @ApiBody. Both are required; missing either one causes the UI to collapse the body preview to Unknown Type: object.

How do I declare all response statuses for a NestJS endpoint?▼

Grep the handler and its service for thrown exceptions and HttpStatus literals, then add one @ApiResponse({ status, description }) per unique status including the success code. Every declared status needs a description, and undeclared 5xx responses are flagged as contract drift.

Why does the probe fail with auth-bootstrap or register-with-auto-login errors?▼

The probe detects login, register, logout, refresh, and me endpoints only by canonical operationId (authLogin, authRegister, etc.) or x-auth-* extension flags, never by path or response shape. Add exactly one canonical declaration per role on the auth controller.

Can I use class-validator DTOs with @ApiBody instead of Zod schemas?▼

No, class-validator DTOs emit endpoint-stub-untyped diagnostics. Use zodToOpenApi(schema, { ref: 'Name' }) with schemas exported from the validation package, or the zodApiBody helper which pairs registration and $ref in one call.

What causes a dangling $ref in the generated OpenAPI spec?▼

Hand-writing $ref inside allOf/oneOf composition without calling zodToOpenApi first means the schema is never registered, so NestJS Swagger emits an empty operation. Register the schema explicitly or use the zodApiBody helper before composing.