comp Cursor Rules — Free Cursor Rules Template
    Neura MarketNeura Market/Cursor
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityExtensionsTrending
    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

    Kechwafflesnew Cursor Rules

    C
    CODEFORYOU69

    AI DRAMA FACTORY Cursor Rules

    R
    Robert0157

    Site Cursor Rules

    R
    RaphaelVitoi

    KindnessBot Cursor Rules

    F
    foodyogi

    Neptunik Cursor Rules

    F
    fjpedrosa

    Cvcraft Cursor Rules

    C
    CedricCT

    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.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this Cursor resource

    • Automate Comprehensive Research Reports to WhatsApp Using Perplexity and Clauden8n · $9.99 · Related topic
    • Build Comprehensive Entity Profiles with GPT-4, Wikipedia & Vector DB for Contentn8n · $24.99 · Related topic
    • Generate 9:16 Images from Content and Brand Guidelinesn8n · $24.99 · Related topic
    • Comprehensive Research Report Generator with Gemini AI, Web Search, & PDF Deliveryn8n · $24.99 · Related topic
    Browse all workflows