nestjs-anti-hallucination-cursorrules-prompt-file
Cursor rules that block deprecated, phantom, or incorrect NestJS imports, decorators, providers, modules, and testing patterns.
Install / Use
npx skills add PatrickJS/awesome-cursorrulesInstalls into whichever agent you are using.
Other
Other agent config
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of nestjs-anti-hallucination-cursorrules-prompt-file
nestjs-anti-hallucination-cursorrules-prompt-file scores 94/100 on our quality scale, 155th of 965 AI & Machine Learning skills we index (top 17%).
Its Other is 7.0 KB long, well organised into 20 sections with 12 code examples: a thorough specification that gives an agent plenty to work with.
With 41,108 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 5 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-10-17 found the source still online.
- It is released under the CC0-1.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 98/100, with no cautions. These come from repository metadata, not a code audit ā read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk ā read a skill before letting an agent act on it.
nestjs-anti-hallucination-cursorrules-prompt-file compared with similar skills
All 4 of these similar skills score higher than nestjs-anti-hallucination-cursorrules-prompt-file; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| nestjs-anti-hallucination-cursorrules-prompt-file (this skill)by PatrickJS | 94 | 41.1k | 5mo ago | Other |
| claude-memby thedotmack | 100 | 113.5k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 109.2k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 90.9k | 10d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.9k | today | CLAUDE.md |
Frequently asked questions
- How do I install nestjs-anti-hallucination-cursorrules-prompt-file?
- Run
npx skills add PatrickJS/awesome-cursorrules. The install tabs above show the steps for each supported agent. - Which AI agents does nestjs-anti-hallucination-cursorrules-prompt-file work with?
- It is written for Cursor and Zed, as a Other file. Other agents that read the same format can often use it too.
- Is nestjs-anti-hallucination-cursorrules-prompt-file safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is CC0-1.0-licensed and scores 98/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is nestjs-anti-hallucination-cursorrules-prompt-file still maintained?
- The repository was last updated about 5 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubdescription: "Cursor rules that block deprecated, phantom, or incorrect NestJS imports, decorators, providers, modules, and testing patterns." globs: */ alwaysApply: false
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> {}
}
3. Express-specific middleware mistakes
// ā WRONG ā Express req/res types in NestJS
import { Request, Response } from 'express';
@Get()
async findAll(@Req() req: Request, @Res() res: Response) {
res.json(data); // Bypasses interceptors, serialization, exception filters
}
// ā
CORRECT ā Use NestJS decorators, return values
@Get()
async findAll(@Query() query: FindAllQueryDto): Promise<UserResponseDto[]> {
return this.usersService.findAll(query);
}
// Only use @Res() when streaming files or SSE ā add { passthrough: true }
@Get('download')
async download(@Res({ passthrough: true }) res: Response) {
res.set('Content-Type', 'application/octet-stream');
return new StreamableFile(stream);
}
4. Wrong decorator combinations
// ā WRONG ā @Injectable() on a controller
@Injectable()
@Controller('users')
export class UsersController {}
// ā WRONG ā @Controller() on a service
@Controller()
@Injectable()
export class UsersService {}
// ā WRONG ā @Body() in a GET handler
@Get()
async findAll(@Body() body: any) {} // GET requests should not have a body
// ā WRONG ā Both @Param and @Query with same name
@Get(':id')
async findOne(@Param('id') paramId: string, @Query('id') queryId: string) {}
5. class-validator / class-transformer mistakes
// ā WRONG ā Validation without enabling in main.ts
// (AI often forgets this critical line)
// main.ts MUST have:
app.useGlobalPipes(new ValidationPipe({
whitelist: true, // Strip unknown properties
forbidNonWhitelisted: true, // Throw on unknown properties
transform: true, // Auto-transform payloads to DTO instances
transformOptions: {
enableImplicitConversion: true,
},
}));
// ā WRONG ā Mixing validation decorators with wrong transform
export class CreateUserDto {
@IsString()
name: string;
@IsNumber()
age: string; // Type mismatch! Decorator says number, type says string
}
// ā
CORRECT ā Types match decorators
export class CreateUserDto {
@IsString()
@IsNotEmpty()
name: string;
@IsInt()
@Min(0)
age: number;
}
6. Async module pitfalls
// ā WRONG ā useFactory without async when awaiting
TypeOrmModule.forRootAsync({
useFactory: (config: ConfigService) => ({
type: 'postgres',
url: config.get('DATABASE_URL'), // Not awaited, no inject
}),
})
// ā
CORRECT
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: async (config: ConfigService) => ({
type: 'postgres',
url: config.getOrThrow<string>('DATABASE_URL'),
autoLoadEntities: true,
synchronize: false, // NEVER true in production
}),
})
Type Safety Rules
NEVER generate any
// ā BANNED
catch (error: any) { ... }
const data: any = await response.json();
private cache = new Map<string, any>();
// ā
REQUIRED
catch (error: unknown) {
if (error instanceof DomainError) { ... }
throw error;
}
const data = await response.json() as PaymentGatewayResponse;
private cache = new Map<string, CachedSession>();
NEVER generate untyped event payloads
// ā WRONG
eventBus.emit('order.created', { order });
// ā
CORRECT ā Typed events
export class OrderCreatedEvent {
constructor(
public readonly orderId: string,
public readonly userId: string,
public readonly totalAmount: number,
public readonly occurredAt: Date = new Date(),
) {}
}
eventBus.emit(new OrderCreatedEvent(order.id, order.userId, order.total));
Configuration Safety
NEVER generate hardcoded values for:
- Database connection strings
- API keys or secrets
- Port numbers
- Feature flags
- External service URLs
ALWAYS use ConfigService with getOrThrow:
// ā WRONG
const port = process.env.PORT || 3000;
const dbUrl = process.env.DATABASE_URL;
// ā
CORRECT
const port = this.configService.getOrThrow<number>('app.port');
const dbUrl = this.configService.getOrThrow<string>('database.url');
Database Safety
NEVER generate:
// ā synchronize: true in production config
// ā DROP TABLE or TRUNCATE in migration files
// ā Raw SQL without parameterized queries
await this.dataSource.query(`SELECT * FROM users WHERE id = '${userId}'`); // SQL injection!
// ā
CORRECT
await this.dataSource.query(`SELECT * FROM users WHERE id = $1`, [userId]);
Remember
- If you're unsure whether a package exists, DO NOT import it. Ask or check.
- If you're generating a NestJS pattern you haven't seen in the official docs, STOP and reconsider.
- When in doubt, generate LESS code with correct patterns rather than MORE code with guesses.
Related Skills
claude-mem
113.5kPersistent Context Across Sessions for Every Agent ā Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
109.2kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu ā one CLI, zero API fees.
Understand-Anything
90.9kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
78.9kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit ā see the Safety scan above for what the skill file itself contains.
