nestjs-anti-hallucination-cursorrules-prompt-file

nestjs-anti-hallucination-cursorrules-prompt-file is a cursor rule for Cursor from PatrickJS/awesome-cursorrules. It costs 1,738 tokens per session, scanned A, original, CC0-1.0.

A set of NestJS rules that flags outdated or nonexistent imports, decorators, packages, and testing patterns, with corrected examples for common integrations.

In plain words
What is it for?
Use it when writing or reviewing NestJS modules, Swagger documentation, database access, queues, configuration, logging, authentication, or tests.
Why use it?
It helps prevent generated NestJS code from referencing APIs that do not exist, have moved, or have been replaced by newer packages.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: positional $N argument; mentions Cursor.

Good fit Use it when writing or reviewing NestJS modules, Swagger documentation, database access, queues, configuration, logging, authentication, or tests.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/nestjs-anti-hallucination-cursorrules-prompt-file
About the project

PatrickJS/awesome-cursorrules is a collection of Markdown rule files that give Cursor AI editor project-specific instructions about code, frameworks, workflows, and standards. Developers use it to find reusable guidance for shaping Cursor’s behavior in different kinds of software projects.

PatrickJS/awesome-cursorrules · 41,029 stars · on GitHub

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.

Clone the repo
git clone --depth 1 https://github.com/PatrickJS/awesome-cursorrules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nestjs-anti-hallucination-cursorrules-prompt-file

README.md
[![agentmods](https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/nestjs-anti-hallucination-cursorrules-prompt-file/github.svg)](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/nestjs-anti-hallucination-cursorrules-prompt-file)
Your own site
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/nestjs-anti-hallucination-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/nestjs-anti-hallucination-cursorrules-prompt-file/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nestjs-anti-hallucination-cursorrules-prompt-file

Your own site · 80×15
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/nestjs-anti-hallucination-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/nestjs-anti-hallucination-cursorrules-prompt-file.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,738 This file is loaded in full into every session.
When invoked 1,738 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01738 $0.01738
Opus 5.5 $0.00695 $0.00695
Sonnet 5.5 $0.00348 $0.00348
Haiku 4.5 $0.00174 $0.00174

Measured 1mo ago against content hash 60bbf6e67d22, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nestjs-anti-hallucination-cursorrules-prompt-file 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 1mo 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.

rules/nestjs-anti-hallucination-cursorrules-prompt-file.mdc · 254 lines

How it starts

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

NestJS Anti-Hallucination Rules

These rules OVERRIDE all other generation behavior. Check EVERY line of generated code against these rules.

Banned Imports & Phantom Packages

NEVER import these — they don't exist or are deprecated:

❌ @nestjs/core/decorators    — not a real export path
❌ @nestjs/swagger/decorators — import from @nestjs/swagger directly
❌ @nestjs/typeorm/repository — not a real export path
❌ @nestjs/passport/strategies — import from passport-jwt, passport-local, etc.
❌ @nestjs/bull/decorators     — import from @nestjs/bullmq (bull is legacy)
❌ nestjs-redis               — use @nestjs-modules/ioredis or ioredis directly
❌ @nestjs/cqrs/decorators    — import from @nestjs/cqrs directly
❌ nestjs-config              — use @nestjs/config (official)
❌ nestjs-pino/logger          — import from nestjs-pino directly

Correct import paths:

// ✅ Swagger
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';

// ✅ TypeORM
import { InjectRepository } from '@nestjs/typeorm';
import { Repository, DataSource } from 'typeorm';

// ✅ BullMQ (NOT Bull)
import { InjectQueue, Processor, WorkerHost } from '@nestjs/bullmq';

// ✅ Config
import { ConfigService, ConfigModule } from '@nestjs/config';

// ✅ Passport
import { AuthGuard } from '@nestjs/passport';
import { Strategy as JwtStrategy, ExtractJwt } from 'passport-jwt';

// ✅ CQRS
import { CommandHandler, ICommandHandler, EventBus } from '@nestjs/cqrs';

Deprecated Patterns — NEVER Generate These

1. getRepository() outside providers

// ❌ DEPRECATED — removed in TypeORM 0.3+
const repo = getRepository(User);
const user = await getConnection().getRepository(User).find();

// ✅ CORRECT — inject via constructor
constructor(
  @InjectRepository(User)
  private readonly userRepo: Repository<User>,
) {}

2. @nestjs/bull (use @nestjs/bullmq)

// ❌ OLD — @nestjs/bull with @Process decorator
import { Process, Processor } from '@nestjs/bull';
@Processor('queue')
class MyProcessor {
  @Process() async handle(job: Job) {}
}

// ✅ CURRENT — @nestjs/bullmq with WorkerHost
import { Processor, WorkerHost } from '@nestjs/bullmq';
@Processor('queue')
class MyProcessor extends WorkerHost {
  async process(job: Job): Promise<void> {}
}

Read the full file on GitHub · 254 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. 1mo ago First seen · 254 lines · 1,738 tokens per session scan A 60bbf6e67d22

Subscribe to this mod's changes

nestjs-anti-hallucination-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (41,029 stars, last pushed 5mo ago), licensed CC0-1.0. It adds 1,738 tokens to every session, about $0.0070 per session on Opus 5.5. 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-09-03.

Related

Other cursor rules, from other repositories

fastapi-dependency-injection

Guidelines for using dependency injection in FastAPI. Dependency injection lets a function receive services such as database sessions, settings, or the current user instead of creating them itself.

holtwood/awesome-cursorrules-zh · 7 tokens

graphql-apollo-client-usage

A usage guide for fetching, changing, and subscribing to GraphQL data with Apollo Client in React. It covers loading and error states, cache updates, refetching, and reusable GraphQL fragments.

holtwood/awesome-cursorrules-zh · 0 tokens

karen-repo-reviewer

Use Karen for brutally honest repository reviews with market-aware Karen Scores. Analyzes entire codebases for over-engineering, completion honesty, and whether the project actually solves a real problem.

pr-pm/prpm · 37 tokens

apollo-provider-setup

A setup rule for placing ApolloProvider at the root of a React application. ApolloProvider makes one configured Apollo Client available to all child components.

holtwood/awesome-cursorrules-zh · 0 tokens

python-django-general

General coding guidance for Python and Django projects, including naming, formatting, modular apps, built-in tools, and maintainable structure. Python is a programming language, and Django is a Python web framework.

holtwood/awesome-cursorrules-zh · 195 tokens

django-middleware

Guidelines for using Django middleware to handle shared web tasks such as authentication, logging, caching, and security. Middleware is code that runs around web requests and responses.

holtwood/awesome-cursorrules-zh · 71 tokens