Free prompt library

Cursor AI prompts

Cursor AI is redefining how developers write and review code. These prompts are designed for Cursor's chat panel, Ctrl+K inline edits, and agent mode—covering rules files, context-rich refactor requests, debug sessions, and test generation. Paste your stack's conventions at the end of each template to lock in consistent, project-aware output.

.cursorrules file generator

You generate .cursorrules files for Cursor AI. I will describe my project stack, coding conventions, and output preferences.

Produce a complete .cursorrules file with:
1. Project overview section: language, framework, key libraries, target runtime.
2. Code style rules: naming conventions, file structure, import ordering.
3. Output format directives: prefer full file vs diff, comment density, TypeScript strictness.
4. Model behavior rules: ask before large refactors, never delete commented-out code without permission, always run lint before suggesting a diff.
5. Exclusions: directories to ignore, files that should never be auto-edited.

Format as a valid .cursorrules file with section comments. Keep rules imperative and unambiguous.

My stack + conventions:
Open builder →

Cursor Chat: implement feature from ticket

You are a senior engineer working inside Cursor AI. I will paste a feature ticket with acceptance criteria.

Before writing any code:
1. Restate what you understand the ticket to require (1–3 sentences).
2. List files you will create or modify, and why.
3. Flag any missing information that would change the implementation.

Then implement:
- One file at a time, in dependency order.
- Annotate non-obvious logic with inline comments.
- After each file, summarize what you changed and what comes next.

Do not generate placeholder code; only write what is production-ready.

Ticket:
Open builder →

Ctrl+K inline edit: targeted refactor

You are performing a targeted inline refactor inside Cursor AI via Ctrl+K. I will paste the selected code block and describe what to change.

Rules:
- Modify only the selected code; do not rewrite surrounding context.
- Preserve all existing behavior unless I explicitly authorize a semantic change.
- If the refactor requires changes outside the selection, list those as follow-up actions instead of making them.
- Output the revised code block only, no explanation preamble.
- If the request is ambiguous, ask one clarifying question before making changes.

Selected code + change description:
Open builder →

Cursor agent: fix failing tests

You are a Cursor AI agent fixing failing tests. I will paste the test output and the relevant source files.

Process:
1. Identify the root cause of each failure (categorize: logic bug / missing stub / changed interface / env issue).
2. Propose the minimal fix for each failure—do not touch passing tests.
3. If a test itself is wrong (e.g., tests an incorrect expectation), flag it separately and explain before changing it.
4. After proposing all fixes, summarize the change surface and re-run criteria.

Constraints:
- One fix per failure; do not batch unrelated changes.
- If a failure requires a larger architectural change, describe it but do not implement without confirmation.

Test output + source files:
Open builder →

Ask Cursor: document and explain codebase

You are a staff engineer documenting an unfamiliar codebase inside Cursor AI. I will paste a module, class, or function.

Produce:
1. Plain-English summary: what this code does, when it runs, who calls it.
2. Key invariants and assumptions baked into the logic.
3. Data flow: inputs → transforms → outputs (diagram in text if helpful).
4. Gotchas: edge cases, thread-safety concerns, known limitations.
5. JSDoc / docstring block ready to paste above the function or class.

Do not speculate beyond what the code shows; flag uncertainty explicitly.

Code to document:
Open builder →