debug

A command that investigates and diagnoses problems in a NestJS project, a Node.js framework for building server applications.

In plain words
What is it for?
It helps trace NestJS module errors, Prisma database failures, missing environment variables, unreachable services, and migration problems.
Why use it?
It directs debugging toward common causes such as module dependency wiring, database configuration, Docker connection settings, and unapplied migrations.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/hmake98/nestjs-starter/debug
Clone the repo
git clone --depth 1 https://github.com/hmake98/nestjs-starter

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 710 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00710
Opus 5 $0.00000 $0.00355
Sonnet 5 $0.00000 $0.00142
Haiku 4.5 $0.00000 $0.00071

Measured 2d ago against content hash c1a89ebcc954, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/debug.md · 44 lines

How it starts

The opening of the file, as written. The whole thing — 44 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Debug the following issue in this NestJS project: $ARGUMENTS

Read the relevant files and diagnose the root cause. Use the knowledge below to guide your investigation.


Common issues and where to look

Dependency Injection / Module errors

UnknownExportException — a provider is in exports but not in providers of the same module. UnknownDependenciesException — a provider's dependency is not in scope. Check:

  1. Is the dependency's module imported?
  2. Is the dependency in that module's providers?
  3. Is that module in exports so it's visible here?

Key rule in this repo: AuthModule and UserModule both import DatabaseModule directly. Feature modules never import each other. Read src/modules/auth/auth.module.ts and src/modules/user/user.module.ts.

Prisma / database errors

PrismaClientInitializationErrorDATABASE_URL not set or unreachable. In Docker, the URL must point to the postgres service name, not localhost. PrismaConfigEnvErrorDATABASE_URL not set at build time. prisma generate uses prisma/prisma.config.ts which reads process.env.DATABASE_URL (no throw on undefined — safe at build time). Migration not applied — run npm run db:migrate-prod or check docker-entrypoint.sh ran successfully.

Docker / container errors

Cannot find module '...'npm prune --omit=dev removed a package that should be in dependencies not devDependencies. Check package.json. App binding to 127.0.0.1HTTP_HOST must be 0.0.0.0 in Docker. Set in docker-compose.yml environment block. Stale dist/ — volume mount .:/app overwrites the built dist. The docker-compose.yml in this repo uses the dev stage with nest start --watch, not a pre-built dist.

JWT / Auth errors

401 Unauthorized on a protected route — check the Authorization: Bearer <token> header is present and the token is not expired. 401 on a public route — check @PublicRoute() decorator is applied. Read src/common/request/guards/jwt-access.guard.ts to see how it checks the metadata. 403 ForbiddenRolesGuard blocked the request. Check @AllowedRoles on the route matches the user's role field.

Read the full file on GitHub · 44 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 44 lines · 0 tokens per session scan A c1a89ebcc954

Subscribe to this mod's changes

debug is a command published in the GitHub repository hmake98/nestjs-starter (61 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 710 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.