CU

cursor-custom-prompts

A guide for writing better prompts in Cursor AI using structure, context, and templates.

Install

mkdir -p .claude/skills/cursor-custom-prompts && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8794" && unzip -o skill.zip -d .claude/skills/cursor-custom-prompts && rm skill.zip

Installs to .claude/skills/cursor-custom-prompts

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Create effective custom prompts for Cursor AI using project rules, prompt
73 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Define context using @-mentions to relevant code
  • Specify tasks for AI code generation
  • Set constraints like rules and limitations
  • Format AI output using specific structures
  • Store prompts as project rules for automatic injection
  • Apply advanced techniques like Chain of Thought and Few-Shot Examples

How it works

The skill structures AI prompts into four parts: context, task, constraints, and format. It uses project rules to store and automatically inject frequently used prompts.

Inputs & outputs

You give it
A prompt structured with context, task, constraints, and format, or a prompt template
You get back
Higher quality AI code output based on the structured prompt

When to use cursor-custom-prompts

  • Creating reusable feature templates
  • Structuring complex refactoring prompts
  • Defining project-wide rules

About this skill

Cursor Custom Prompts

Create effective prompts for Cursor AI. Covers prompt engineering fundamentals, reusable templates stored in project rules, and advanced techniques for consistent, high-quality code generation.

Prompt Anatomy

A well-structured Cursor prompt has four parts:

1. CONTEXT   → @-mentions pointing to relevant code
2. TASK      → What you want done (specific, actionable)
3. CONSTRAINTS → Rules, patterns, limitations
4. FORMAT    → How the output should look

Example: All Four Parts

@src/api/users/route.ts @src/types/user.ts         ← CONTEXT

Create a new API endpoint for updating user profiles. ← TASK

Constraints:                                         ← CONSTRAINTS
- Follow the same pattern as the users route
- Use Zod for input validation
- Return 400 for invalid input, 404 for missing user
- Only allow updating: name, email, avatarUrl

Return the endpoint code and the Zod schema as       ← FORMAT
separate code blocks.

Prompt Templates

Template: Feature Implementation

@[existing-similar-feature] @[relevant-types]

Implement [feature name] following the pattern in [reference file].

Requirements:
- [requirement 1]
- [requirement 2]
- [requirement 3]

Constraints:
- Same error handling pattern as [reference]
- Same file structure as [reference]
- Include TypeScript types for all public interfaces

Template: Bug Fix

@[buggy-file] @Lint Errors

Bug: [describe the incorrect behavior]
Expected: [describe correct behavior]
Steps to reproduce: [1, 2, 3]

The error message is: [paste error]

Find the root cause and suggest a fix. Do not change
the public API surface.

Template: Code Review

@[file-to-review]

Review this code for:
1. Logic errors or edge cases
2. Security vulnerabilities (injection, XSS, auth bypass)
3. Performance issues (N+1 queries, unnecessary re-renders)
4. TypeScript type safety (any casts, missing generics)
5. Naming and readability

List issues as: [severity] [line/area] [description] [suggestion]

Template: Test Generation

@[source-file] @[existing-test-file]

Generate tests for [function/class name] covering:
- Happy path with valid inputs
- Edge cases: empty input, null, undefined, max values
- Error cases: invalid input, missing required fields
- Async behavior: success and failure scenarios

Follow the same test structure as [existing-test-file].
Use [vitest/jest/pytest] assertions.

Template: Refactoring

@[file-to-refactor]

Refactor this code to [goal]:
- [specific change 1]
- [specific change 2]

Do NOT change:
- The public API (function signatures, return types)
- The test behavior (existing tests must still pass)
- External imports

Storing Prompts as Project Rules

Convert frequently used prompts into .cursor/rules/ for automatic injection:

# .cursor/rules/code-generation.mdc
---
description: "Standards for AI-generated code"
globs: ""
alwaysApply: true
---
When generating code, always:
1. Add JSDoc comments on all exported functions
2. Include error handling (never let functions throw unhandled)
3. Use named exports (never default exports)
4. Add `import type` for type-only imports
5. Prefer const arrow functions for pure utilities
6. Use discriminated unions over boolean flags

When generating TypeScript:
- Strict mode: no `any`, no `as` casts without justification
- Prefer `unknown` over `any` for unknown types
- Use `satisfies` operator for type narrowing
- Infer types where TypeScript can; annotate where it cannot
# .cursor/rules/test-patterns.mdc
---
description: "Test generation standards"
globs: "**/*.test.ts,**/*.spec.ts"
alwaysApply: false
---
When generating tests:
- Use describe/it blocks with readable descriptions
- Arrange/Act/Assert pattern (AAA)
- One assertion per test (prefer multiple focused tests)
- Mock external dependencies, not internal utilities
- Use factory functions for test data (not inline objects)
- Name test files: {module}.test.ts colocated with source

Advanced Prompting Techniques

Chain of Thought

Force the AI to reason before generating:

@src/services/billing.service.ts

I need to add proration logic for subscription upgrades.

Before writing code, first:
1. List the variables involved (current plan, new plan, billing cycle)
2. Show the proration formula with a concrete example
3. Identify edge cases (upgrade on last day, downgrade, free trial)

Then implement based on your analysis.

Few-Shot Examples

Provide examples of what you want:

Convert these function signatures to the Result pattern:

Example input:
  async function getUser(id: string): Promise<User>

Example output:
  async function getUser(id: string): Promise<Result<User, NotFoundError>>

Now convert these:
- async function createOrder(input: CreateOrderInput): Promise<Order>
- async function deleteAccount(userId: string): Promise<void>
- async function sendEmail(to: string, body: string): Promise<boolean>

Negative Constraints

Tell the AI what NOT to do:

Create a React form component for user registration.

DO NOT:
- Use class components
- Use any CSS-in-JS library
- Add client-side validation (server validates)
- Use controlled inputs for every field (use react-hook-form)
- Import anything not already in package.json

Iterative Refinement

Build up complexity in steps:

Turn 1: "Create a basic Express route for GET /api/products"
Turn 2: "Add pagination with page and limit query params"
Turn 3: "Add filtering by category and price range"
Turn 4: "Add sorting by any field with asc/desc direction"
Turn 5: "Add input validation and comprehensive error responses"

Each turn adds one layer. The AI maintains context from previous turns.

Common Prompt Anti-Patterns

Anti-PatternProblemBetter Approach
"Make it better"Too vague"Add error handling for network failures"
"Rewrite everything"Scope too large"Refactor the validation logic in lines 40-80"
No context filesAI guesses patternsAlways add @Files references
Wall of text promptAI misses key pointsUse numbered lists and headers
"Do what you think is best"AI makes assumptionsSpecify requirements explicitly

Enterprise Considerations

  • Prompt libraries: Maintain a team-shared library of effective prompts in a wiki or docs/ directory
  • Standardization: Use .cursor/rules/ to encode team prompt standards so all developers get consistent behavior
  • Security: Never include real credentials, PII, or regulated data in prompts
  • Reproducibility: Document effective prompts alongside their output for knowledge sharing

Resources

When not to use it

  • When the prompt is too vague, like 'Make it better'
  • When the scope is too large, like 'Rewrite everything'
  • When no context files are provided for the AI

Limitations

  • AI may miss key points in a 'wall of text' prompt
  • AI makes assumptions if requirements are not specified explicitly

How it compares

This skill standardizes prompt structure using defined components and templates, unlike manual prompting which can be inconsistent.

Compared to similar skills

cursor-custom-prompts side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
cursor-custom-prompts (this skill)027dReviewIntermediate
command-development169moReviewIntermediate
frontend-prompt-generator69moReviewIntermediate
guidance37moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

command-development

anthropics

This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.

16133

frontend-prompt-generator

gharam1234

Generate structured prompts for frontend development tasks following established patterns. Use when the user requests prompts for wireframes, UI implementation, data binding, or routing functionality in React/Next.js projects with specific formatting requirements (Cursor rules, file paths, test-driven development).

679

guidance

davila7

Control LLM output with regex and grammars, guarantee valid JSON/XML/code generation, enforce structured formats, and build multi-step workflows with Guidance - Microsoft Research's constrained generation framework

348

cursor-model-selection

jeremylongshore

Configure and select AI models in Cursor. Triggers on "cursor model", "cursor gpt", "cursor claude", "change cursor model", "cursor ai model". Use when working with cursor model selection functionality. Trigger with phrases like "cursor model selection", "cursor selection", "cursor".

526

slash-command-factory

alirezarezvani

Generate custom Claude Code slash commands through intelligent 5-7 question flow. Creates powerful commands for business research, content analysis, healthcare compliance, API integration, documentation automation, and workflow optimization. Outputs organized commands to generated-commands/ with validation and installation guidance.

14

agentica-prompts

parcadei

Write reliable prompts for Agentica/REPL agents that avoid LLM instruction ambiguity

12

Search skills

Search the agent skills registry