Cursor

Verified against Cursor · 2026-07-10

Brief Cursor Composer to build a multi-file feature without wandering off

A Composer/Agent-mode brief that names exactly which files are in scope, the data contract between them, and what to leave alone, so a multi-file autonomous build stays inside the feature you actually asked for.

Cursor 2.1Cursor 2.0

The prompt

Ready to copy — highlighted parts are example details you can swap.

You are working in Composer/Agent mode with multi-file edit access in this repo. Build the following feature end to end, but stay inside the scope defined below.

FEATURE
Add a "save search" button on the results page that stores the current filters under a name and lists saved searches in the sidebar for the logged-in user.

FILES YOU MAY TOUCH
app/search/results/page.tsx, app/search/results/SavedSearches.tsx (new), lib/searches/store.ts (new), app/api/searches/route.ts (new)

DATA CONTRACT BETWEEN THESE FILES
SavedSearch = { id: string, name: string, filters: FilterState, createdAt: string }. The API route returns SavedSearch[]; the sidebar component takes searches: SavedSearch[] as a prop.

OUT OF SCOPE — DO NOT TOUCH
Do not touch the existing filter-parsing logic in lib/search/parseFilters.ts, and do not modify the results table component itself.

WORKING RULES
- Before writing any code, list the exact files you will create or modify and the order you'll edit them in. If that plan needs a file outside the list above, stop and name it before touching it — don't expand scope silently.
- After each file edit, state which part of the feature description it satisfies.
- Do not install a new dependency without naming it and the reason first.
- Keep the data contract above literal — if a field name or shape needs to change to make this work, say so and wait rather than quietly adapting it on one side only.

WHEN DONE
List every file changed, one line each, and name anything from the feature description you could not finish and why.
Customize the highlighted detailsoptional — the prompt above already works

Why this works

Composer's agent mode is free to open, semantically search, and edit any file it can find in the index once given an open-ended brief — that's what makes it capable of a real multi-file feature, and also what makes it capable of touching five files you never mentioned. Naming FILES YOU MAY TOUCH gives it a hard boundary instead of asking it to infer scope from the feature description alone, and requiring a file-by-file plan before edits are applied means you see the blast radius while it's still a list, not after it's already a diff spread across the repo. Stating the DATA CONTRACT explicitly matters for a different reason: in a multi-file build the model writes the producer and consumer of a shape in separate turns, and without a literal contract to check against, a field renamed on one side (e.g. filters vs filterState) silently breaks the other side while both files individually look correct.

What you get back

Plan before editing: 1. lib/searches/store.ts (new) — SavedSearch type + in-memory/localStorage adapter 2. app/api/searches/route.ts (new) — GET/POST using the store 3. app/search/results/SavedSearches.tsx (new) — renders searches, calls POST on save 4. app/search/results/page.tsx (edit) — add the Save button, wire it to SavedSearches Proceeding in that order. Nothing outside the listed files will be touched — filter parsing and the results table are untouched. ... Summary: - lib/searches/store.ts: added, satisfies "store the current filters under a name" - app/api/searches/route.ts: added, satisfies "list saved searches" (GET) and save action (POST) - app/search/results/SavedSearches.tsx: added, satisfies "lists saved searches in the sidebar" - app/search/results/page.tsx: edited only to add the Save button and mount the sidebar component Not completed: per-user scoping was described as "for the logged-in user" but no auth context was found wired into this route group — flagging rather than guessing at an auth pattern.

Verified against

Cursor 2.1 · 2026-07-10

Cursor 2.0 · 2026-06-18

Changelog

  • 2026-07-10 Initial publish, verified against Cursor 2.1 Composer/Agent mode.

Need this built into your business?

If a prompt isn't enough — custom software, built and maintained for you — that's Scult's day job.

EXPLORE CUSTOM SOFTWARE
All Cursor prompts

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY