# Cursor Prompt Library — TrendForge

Copy-paste prompts for common development tasks. Adjust paths and names to match your project.

---

## Bug Fixing

```
There's a bug in [describe symptom]. Search the codebase for the relevant files,
identify the root cause, fix it with minimal changes, and run the existing tests.
Explain what caused the bug before making edits.
```

```
The error "[paste error message]" appears when [describe steps to reproduce].
Trace the call stack, find where the error originates, and fix it without changing
unrelated code.
```

---

## Refactoring

```
Refactor [file/module path] to improve readability and maintainability.
Keep all existing behavior and public APIs unchanged. Run tests after refactoring.
```

```
Extract repeated logic from [files] into a shared utility. Update all call sites.
Do not change functionality — only reduce duplication.
```

---

## New Features

```
Implement [feature description] following our project conventions in .cursor/rules/.
Break the work into steps, search the codebase for similar patterns first, then
implement with tests.
```

```
Add a [ComponentName] component that [behavior]. Use TypeScript, match existing
styling patterns, and include loading/error/empty states.
```

---

## Code Review

```
Review the changes in my working tree. Check for bugs, security issues, missing
error handling, and violations of our project rules. List findings by severity.
```

```
Review [file path] for performance issues, accessibility problems, and TypeScript
type safety. Suggest specific fixes.
```

---

## Testing

```
Write unit tests for [file/function] using our project's test framework.
Cover happy path, error cases, and edge cases. Mock external dependencies.
```

```
The tests in [test file] are failing. Read the failure output, fix the tests or
the implementation (whichever is wrong), and confirm all tests pass.
```

---

## Documentation

```
Generate API documentation for all routes in [directory]. Include request/response
schemas, status codes, and example payloads in Markdown.
```

```
Add JSDoc comments to all exported functions in [file]. Document parameters,
return types, and throw conditions.
```

---

## Database & API

```
Create a migration for [schema change description]. Include rollback. Follow our
existing migration patterns in [migrations directory].
```

```
Add a new API endpoint: [method] [path] that [behavior]. Validate inputs,
return consistent JSON errors, and add a feature test.
```

---

## DevOps & Deployment

```
Review our deployment configuration and suggest improvements for [Cloudflare/Vercel/AWS].
Check environment variables, build commands, and caching.
```

```
Set up a GitHub Actions workflow that runs lint, type-check, and tests on every pull request.
```

---

## Repository Understanding

```
Give me an architecture overview of this repository: folder structure, key modules,
data flow, and tech stack. Point to the most important files to read first.
```

```
Explain how [feature/system name] works in this codebase. Trace the code from
entry point to output.
```

---

## Dependency Updates

```
Update [package name] to the latest compatible version. Check for breaking changes,
update any affected code, and run the test suite.
```

---

## Security

```
Audit [file/directory] for common security issues: SQL injection, XSS, exposed secrets,
insecure dependencies, and missing input validation. Report findings with fixes.
```

---

Part of the [Cursor AI Complete Guide (2026)](https://trendforge.pages.dev/article/ai/cursor-ai-complete-guide-2026) on TrendForge.
