← Cheatsheets / Prompting

Quick Wins: Copy-Paste Prompts

Prompts for common tasks. Copy, paste, customize, ship.

prompts templates quick-reference

20+ ready-to-use prompts. Copy, replace the [BRACKETS], paste, ship.

What’s here:

CategoryPrompts
🔨 BuildingCRUD API, Auth, Components, Schema
🧪 TestingWrite tests, Review code
🐛 DebuggingDebug issues, Error handling
📝 DocumentationAPI docs, README, Commits
⚡ PerformanceOptimize, Refactor

Tip: Cmd/Ctrl+F to find what you need.


Generate CRUD API

Create a REST API for [RESOURCE] with:
- GET /[resource] - list all (with pagination)
- GET /[resource]/:id - get one
- POST /[resource] - create
- PUT /[resource]/:id - update  
- DELETE /[resource]/:id - delete

Tech: [FRAMEWORK], [DATABASE]
Include: validation, error handling, TypeScript types

Add Authentication

Add authentication to this [FRAMEWORK] app:
- Login with email/password
- Session management
- Protected routes middleware
- Logout functionality

Use [AUTH_LIBRARY] with [DATABASE].
Follow patterns in [EXISTING_AUTH_FILE] if present.

Write Tests

Write tests for [FILE_PATH]:
- Framework: [JEST/VITEST/PYTEST]
- Cover: happy path, edge cases, error cases
- Mock: [EXTERNAL_DEPENDENCIES]
- Style: [DESCRIBE_CONVENTIONS]

Refactor Large File

This file is too long ([X] lines). Refactor it:
1. Identify logical groupings
2. Extract into separate modules
3. Keep the same public API
4. Add index file for exports

[PASTE_FILE or REFERENCE_PATH]

Debug Issue

Bug: [WHAT'S_WRONG]
Expected: [SHOULD_HAPPEN]
Actual: [ACTUALLY_HAPPENS]
Code: [RELEVANT_CODE]
Error: [ERROR_MESSAGE]
Tried: [WHAT_YOU_TRIED]

Add Feature

Add [FEATURE] to [COMPONENT/FILE]:
- It should [BEHAVIOR]
- Integrate with existing [RELATED_CODE]
- Handle errors by [ERROR_BEHAVIOR]
- Match style of [EXAMPLE_FILE]

Explain Code

Explain this code:
[PASTE_CODE]

I want to understand:
1. Main purpose
2. How it works step-by-step
3. [SPECIFIC_CONFUSING_PART]

Generate Component

Create a React component for [DESCRIPTION]:
- Props: [LIST_PROPS]
- State: [WHAT_STATE_NEEDED]
- Styling: [TAILWIND/CSS_MODULES/ETC]
- Accessibility: include ARIA labels

Make it [RESPONSIVE/ANIMATED/ETC].

Database Schema

Design a database schema for [APP_TYPE]:
- Entities: [LIST_MAIN_ENTITIES]
- Use [PRISMA/DRIZZLE/RAW_SQL]
- Include: timestamps, soft delete, indexes
- Relationships: [DESCRIBE_RELATIONSHIPS]

API Documentation

Generate API documentation for [FILE_PATH]:
- Format: [OPENAPI/MARKDOWN/JSDOC]
- Include: endpoints, params, responses, errors
- Add examples for each endpoint

Git Commit Message

Write a commit message for these changes:
[GIT_DIFF or DESCRIPTION]

Format: [CONVENTIONAL/SIMPLE]
Include: type, scope, description

Review Code

Review this code for:
- [ ] Security vulnerabilities
- [ ] Performance issues
- [ ] Error handling gaps
- [ ] Code style issues
- [ ] Missing edge cases

[PASTE_CODE]

Be specific. Suggest fixes for each issue.

Optimize Performance

This [FUNCTION/QUERY/COMPONENT] is slow.
Current: [DESCRIBE_CURRENT_BEHAVIOR]
Target: [PERFORMANCE_GOAL]

[PASTE_CODE]

Identify bottlenecks and suggest optimizations.

Add Error Handling

Add comprehensive error handling to [FILE]:
- Catch and log errors
- Return user-friendly messages
- Don't expose internals in production
- Follow pattern: [EXAMPLE_IF_ANY]

Create Migration

Create a database migration to:
[DESCRIBE_CHANGES]

Tool: [PRISMA/KNEX/RAW_SQL]
Make it reversible.
Handle existing data: [HOW_TO_MIGRATE_DATA]

Environment Setup

Create setup instructions for this project:
- Prerequisites
- Installation steps
- Environment variables needed
- How to run dev/test/build
- Common troubleshooting

Convert File Format

Convert this [SOURCE_FORMAT] to [TARGET_FORMAT]:
[PASTE_CONTENT or FILE_PATH]

Preserve: [WHAT_TO_KEEP]
Add: [WHAT_TO_ADD]

Generate Types

Generate TypeScript types for this data:
[PASTE_JSON or API_RESPONSE]

Include: optional fields, enums where appropriate
Export as: [INTERFACE/TYPE]

Code Review Response

Respond to this code review feedback:
Feedback: [REVIEWER_COMMENT]
Current code: [YOUR_CODE]

Options:
1. Explain why current approach is valid
2. Suggest alternative that addresses concern
3. Ask clarifying question

Pro Tips

💡 Tip: Always include example input/output when possible—it clarifies intent better than descriptions.

💡 Tip: If AI misunderstands, don’t rephrase—add context. “I meant X” or “Specifically, I need Y.”

💡 Tip: End complex prompts with “Any questions before you start?” to catch misunderstandings early.


🎯 Use One Now

  1. Find a prompt above that matches what you need
  2. Copy it
  3. Replace the [BRACKETS] with your specifics
  4. Paste into your AI tool
  5. Ship it

Bookmark this page. Come back often.


Cheatsheets:

Guides:

Blog:

✓ Copied to clipboard!