comp Cursor Rules — Cursor Rules | Neura Market
    Neura MarketNeura Market/Cursor
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsBlogVideosGuidesCoursesCommunityExtensionsTrendingGenerate
    CursorRulescomp Cursor Rules
    Back to Rules
    Systems Programming

    comp Cursor Rules

    trycompai April 15, 2026
    0 copies 0 downloads

    Read CLAUDE.md in this directory for comprehensive API development guidelines.

    Rule Content
    # API Rules
    
    Read CLAUDE.md in this directory for comprehensive API development guidelines.
    
    ## Quick Reference
    
    - **Auth**: Session-based only (no JWT). `HybridAuthGuard` + `PermissionGuard` on every endpoint.
    - **RBAC**: `@RequirePermission('resource', 'action')` required. Without it, `AuditLogInterceptor` won't log.
    - **Controller**: `@Controller({ path: 'name', version: '1' })`, NOT `@Controller('v1/name')` (double prefix bug).
    - **Tests**: Every feature needs tests. `npx jest src/<module> --passWithNoTests`.
    - **No `as any`**. Max 300 lines per file.
    - **Multi-tenancy**: Always scope DB queries by `organizationId`.
    - **Billing errors**: `HttpException` with `HttpStatus.PAYMENT_REQUIRED` (no PaymentRequiredException).
    - **Webhooks**: Use `@Public()` decorator.
    - **Nested JSON**: Use `@Req() req` + `req.body` instead of DTO when receiving complex nested objects.
    - **Permission resources**: organization, member, control, evidence, policy, risk, vendor, task, framework, audit, finding, questionnaire, integration, apiKey, trust, pentest, app, compliance
    
    ## Testing
    
    **Every new feature MUST include tests.** This is mandatory, not optional.
    
    ```bash
    # Run tests for a specific module
    npx jest src/<module-name> --passWithNoTests
    
    # Run all API tests
    npx turbo run test --filter=@trycompai/api
    
    # Type-check
    npx turbo run typecheck --filter=@trycompai/api
    ```
    
    ### Test File Conventions
    
    - Colocate: `foo.service.ts` → `foo.service.spec.ts`
    - Mock external deps (DB, external APIs)
    - Test success, error, and edge cases
    - Override guards in controller tests with `.overrideGuard(HybridAuthGuard).useValue({ canActivate: () => true })`
    
    ## Code Style
    
    - Use `@AuthContext()` for auth context, `@OrganizationId()` for org ID
    - NestJS exceptions: `BadRequestException`, `NotFoundException`, `ForbiddenException`
    - Prisma via `@trycompai/db`, always scope by `organizationId`
    - Transactions for multi-record operations
    

    Tags

    rustprisma

    Comments

    More Rules

    View all
    Web Development

    Next.js 15 + TypeScript Cursor Rules

    Comprehensive .cursorrules file for Next.js 15 App Router projects with TypeScript, enforcing server components by default, proper use of "use client" directive, and App Router conventions.

    C
    Community
    Backend Development

    Python FastAPI Best Practices Rules

    Cursor rules for Python FastAPI projects enforcing async patterns, Pydantic v2 models, dependency injection, and proper error handling.

    C
    Community
    Frontend Development

    React + TypeScript Component Rules

    Rules for consistent React component development with TypeScript interfaces, proper hook patterns, and component composition.

    C
    Community
    AI/ML

    Cursor Agent Mode Configuration

    Rules optimizing Cursor Agent mode behavior including multi-file editing context, session management, and autonomous task completion patterns.

    C
    Cursor Team
    Frontend Development

    Tailwind CSS + shadcn/ui Rules

    Cursor rules for projects using Tailwind CSS with shadcn/ui component library, enforcing consistent utility class usage and component patterns.

    C
    Community
    Backend Development

    Go Backend Service Rules

    Rules for Go backend services enforcing idiomatic Go patterns, proper error handling, and clean architecture conventions.

    C
    Community

    Stay up to date

    Get the latest Cursor prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Cursor and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.