Cursor Prompt Techniques
A repository task needs an objective, exclusions, change scope and observable completion criteria. Ambiguity can produce incorrect edits rather than just a weak answer.
#State the goal and boundary
textAdd a forgot-password entry to the existing login page. Do not add dependencies. Keep the current design system. Change only the related components.
#Plan coordinated work
textList the implementation steps and affected file paths first. Explain what each step changes.
Refine an incorrect plan before implementation instead of repeatedly patching a drifting result.
#Let the agent locate unknown context
textIf the entry file is unclear, locate the relevant module and propose a bounded change before editing.
Attach a known key file when useful; do not flood the conversation with unrelated material.
#Define a testable finish
For a behavior change, a meaningful failing test can establish the expected result before implementation. Where tests are not appropriate, specify another observable acceptance check. “Almost done” is not a criterion.
#Reset stale conversations
Start again with a concise handover when the module changes, misunderstandings repeat or old context overwhelms the current task.
#Reusable review structure
textReport: 1. Change summary 2. Affected files 3. Important risks 4. Suggested validation
#Task examples
textFeature: add course difficulty filtering. Keep the API contract and synchronize filter state to the URL. Show affected files and key patches.
textBug: a mobile button does not respond. Relevant code: @src/components/xxx.tsx. Identify the cause and propose the smallest effective fix.
textReview this diff for logic errors, regressions and missing behavior tests.
Clear scope, inspectable results and reversible changes are more useful than elaborate phrasing.