Composer changes
Use it before asking Cursor to edit multiple files or infer implementation from scattered context.
Cursor is strongest when the prompt tells it which behavior matters and which nearby code is off limits. This template turns a vague composer request into a bounded coding task.
Use it before asking Cursor to edit multiple files or infer implementation from scattered context.
Name API, DB, event, and UI contracts that must not change while the agent patches behavior.
Keep the diff small enough that a human reviewer can compare output against acceptance criteria.
Cursor can read a lot of neighboring code, which is useful and risky. The spec should separate read scope from write scope so useful context does not become permission to edit everything.
The prompt should also state what to do when the task needs another file. A good answer is not a creative refactor. It is a question back to the human owner.
Use this with Composer or an inline edit request. Keep the first block short, then make verification explicit.
Cursor task: - Implement: - Preserve: Open context: - Read these files: - May edit these files: - Do not edit: Behavior rules: - Existing contract to preserve: - Existing UI copy or API shape to preserve: - Error, permission, and empty states: Acceptance criteria: - [ ] Given ..., when ..., then ... - [ ] Given ..., when ..., then ... Verification: - Test command: - Manual check or screenshot: - Files changed summary: If implementation requires a file outside "May edit", stop and ask.
This example keeps a notification settings change inside the intended UI and test files.
Cursor task: - Add a "marketing email" toggle to notification preferences. Open context: - Read: src/settings/notifications/* - May edit: - src/settings/notifications/PreferenceForm.tsx - src/settings/notifications/PreferenceForm.test.tsx - Do not edit: - src/api/preferences.ts - src/auth/* Acceptance criteria: - [ ] Given the user disables marketing email, when they save, then the form sends marketingEmail=false. - [ ] Given the save request fails, when the error returns, then the previous toggle state is restored and an error message is shown. - [ ] Given the user lacks preferences.write, when the page loads, then the toggle is disabled. Verification: - npm test -- PreferenceForm - Screenshot: disabled state and error state.
Cursor is strongest when it can see enough context to make a good change, but that same context can tempt it to rewrite nearby abstractions. Treat this template as a workspace boundary: the agent may inspect broadly, edit narrowly, and explain every changed file against the criteria.
Give Cursor read access to the module, tests, API client, and design context it needs, but keep the writable list much smaller. This distinction is especially important in UI folders where shared hooks, generated clients, and theme utilities sit close to feature code.
Before generation, name the props, endpoint shape, event payload, permission rule, or copy string that must remain stable. Cursor can then use those details as guardrails instead of inventing a cleaner contract that breaks callers or tests outside the current change.
After the edit, compare actual changed files with the allowed write scope before reading implementation style. If the diff touched shared utilities, generated files, schemas, or unrelated tests, send it back to the spec instead of accepting the wider change quietly.
Cursor AI Coding Spec Template is not just a prompt for an AI tool. It should help people decide whether the task is ready for implementation, who owns unresolved questions, and which evidence will remain with the pull request. Use these questions in team conventions, PR templates, or pre-implementation review.
Before using Cursor AI Coding Spec Template, name the person or role allowed to approve scope changes. Open questions without an owner become an invitation for the agent to fill gaps, and they make reviewers discover product, data, or permission decisions only after the code exists.
Separate questions that must be answered from questions that can move forward as accepted risk. Blocking items usually include public APIs, data migrations, permission boundaries, payment behavior, rollback paths, and user-facing copy. If these are unclear, do not ask an agent to generate production code yet.
The final pull request should link cursor-spec.md, list changed files, name skipped checks, and map tests, screenshots, logs, or metrics back to acceptance criteria. Without that record, future readers have to reverse-engineer the decision from the diff.
Cursor can inspect a folder, but that should not mean it can rewrite the folder.
Asking for a cleaner implementation invites refactors that are hard to review.
For UI changes, a test command alone is not enough when disabled, empty, or error states matter.
These resources help you move from Cursor prompt to spec packet and review evidence.
Use the same bounded handoff pattern when working in Claude Code.
Compare templateTurn each Cursor task into pass/fail behavior before generating code.
Write criteriaCheck whether Cursor respected the requested scope and evidence bar.
Review diffNo. Give Cursor enough context to understand the task, but separate read scope from write scope so it does not broaden the diff.
The may-edit list. It gives the reviewer a concrete way to reject scope drift.
For copy-only edits, a lighter note is fine. Use the full template when behavior, contracts, permissions, or tests are involved.
Before the next Composer request, write the scope and criteria first. Cursor becomes much easier to review when the spec is already sharp.
Generate spec packet