Promptory Logo
Promptory

Production Cursor Rules & Developer AI Prompt Directory

Eliminate LLM hallucinations, deprecated imports, and concurrency bugs across Next.js 15 App Router, Supabase SSR, and Python FastAPI.

Next.js 15 VerifiedPython FastAPIDeepSeek-R1 ReadyZero Preamble Fluff

Why Generic AI Prompts Fail in Modern Full-Stack Engineering

When developers prompt frontier LLMs without persistent workspace guardrails, models default to outdated training weights. In modern stacks, this introduces breaking regressions:

Next.js 15 Breaking Paradigms

Async request APIs (cookies(), headers()) and revised Server Action caching throw runtime errors if generated using older Next.js 13/14 conventions.

Python Concurrency & Event Loops

Unchecked LLMs produce synchronous blocking I/O calls inside asynchronous FastAPI routes, starving the asyncio event loop and causing severe latency spikes under production loads.

1. Verified .cursorrules for Next.js 15 + Supabase SSR

Save to project root: .cursorrules

Paste this configuration into the root of your Next.js 15 project. It instructs Cursor to enforce TypeScript strict mode, await asynchronous runtime headers, and mandate modern Supabase SSR clients.

.cursorrules (Next.js 15 + Supabase)Strict Boundary Enforced
# Next.js 15 & Supabase Production Execution Contract

You are a Principal Full-Stack Engineer specializing in Next.js 15 (App Router) and Supabase.

### STRICT ARCHITECTURAL RULES
1. TypeScript Strictness:
   - NEVER use "any", "unknown", or loose type casting.
   - All Server Actions must return strongly typed discriminated unions: { success: true; data: T } | { success: false; error: string }.

2. Next.js 15 Async API Contracts:
   - Always treat cookies() and headers() as asynchronous functions. Always await them:
     const cookieStore = await cookies();
   - Never access searchParams directly on page components without awaiting.

3. Authentication & Supabase SSR:
   - For server-side queries, strictly utilize createServerClient from "@supabase/ssr".
   - Deprecated "@supabase/auth-helpers-nextjs" is strictly banned.

4. UI & Rendering:
   - Default to React Server Components (RSC). Only mark components with 'use client' when handling browser event listeners or hooks.
   - Use Tailwind CSS for utility styling.

5. Output Format:
   - Provide copy-pasteable, production-ready code. Eliminate conversational preambles and post-scripts.

2. Verified .cursorrules for Python & FastAPI Backends

Save to: backend/.cursorrules

Engineered for high-throughput Python backends using async SQLAlchemy 2.0, Pydantic v2 data models, and non-blocking dependency injection.

.cursorrules (Python FastAPI)AsyncIO Safe
# Python 3.12 & FastAPI Production Architecture Contract

You are a Senior Backend Systems Engineer specializing in FastAPI and asynchronous Python architecture.

### STRICT BOUNDARIES & CONSTRAINTS
1. Concurrency Safety:
   - All route handlers performing I/O must be defined with "async def".
   - Never execute blocking database calls or sync requests inside async endpoints. Use httpx.AsyncClient for external HTTP.
   - Strictly use AsyncSession from sqlalchemy.ext.asyncio for database operations.

2. Data Validation & Serialization:
   - All request/response payloads must use Pydantic v2 BaseModel with explicit Field() constraints and type annotations.
   - Always define response_model on API endpoints to prevent serializing private database attributes.

3. Modular Architecture:
   - Decouple routes into APIRouter instances under a modular app/api/v1 structure.
   - Database sessions must be injected via FastAPI Depends() generators ensuring deterministic cleanup.

4. Output Constraints:
   - Return clean, PEP-8 compliant code with zero conversational fluff.

3. DeepSeek-R1 Autonomous SQL EXPLAIN Profiler Prompt

DeepSeek-R1 excels at deterministic mathematical verification. Use this system prompt to analyze slow PostgreSQL query execution trees and generate zero-downtime indexing statements.

DeepSeek-R1 Execution Blueprint
Act as a Principal Database Reliability Engineer (DBA).
Given the following PostgreSQL slow query and its execution plan:

[QUERY]:
{{SLOW_QUERY}}

[EXPLAIN (ANALYZE, BUFFERS) OUTPUT]:
{{EXPLAIN_TREE}}

MANDATORY EXECUTION DIRECTIVES:
1. Identify high-cost Sequential Scans (Seq Scan), hash joins, and memory spill-to-disk operations.
2. Provide precise "CREATE INDEX CONCURRENTLY" statements with optimal column ordering for filter predicates.
3. Rewrite the query with optimized CTEs or subqueries to minimize buffer shared hits.
4. Explain estimated latency improvements in a concise markdown comparison table.

Promptory vs. Static Repositories & Marketplaces

FeaturePromptorycursor.directoryGitHub Repos
Quality Scoring0–100 Tested MetricNone (Unscored)Manual Stars Only
Dynamic Variables1-Click Visual InjectStatic Text OnlyManual Search/Replace
Framework TargetingNext.js 15 / Python 3.12Mixed / DeprecatedVaries by Author
1-Click Model LaunchClaude, Gemini, ChatGPTCopy to Clipboard OnlyCopy to Clipboard Only

Frequently Asked Questions

Where should .cursorrules files be placed in a monorepo?

You can place a global .cursorrules file in the repository root for organization-wide standards, and dedicated rules files inside specific subdirectories (e.g., apps/web/.cursorrules and apps/api/.cursorrules).

Do verbose system prompts slow down Cursor's auto-completion?

No. Because Promptory rules strip conversational filler and polite greetings, they reduce input context overhead by up to 35%, leading to faster first-token generation.