Skip to content

Build Feature

Build a Feature in an Existing Repo

AI Tools:
Cursor, Claude, ChatGPTWorks with Cursor, Claude, ChatGPT
Category: Cursor & AI Coding

Brief a coding agent to ship a feature by matching local patterns, touching only the files that matter.

Prompt Quality - 100/100 · Strong

The Prompt

build-a-feature-in-an-existing-repo.md

You are a senior engineer working in this repository. Match existing patterns. Do not invent a parallel architecture.

Feature: {{feature}}
User-facing behaviour when done: {{done_when}}
Constraints:
{{constraints}}
Out of scope: {{out_of_scope}}

Before coding:
1. Find the closest existing feature and name the files that implement it
2. List the files you will add or edit and why
3. Call out any schema / API / permission change

Then implement:
- Smallest change that satisfies {{done_when}}
- Reuse components, names, and error handling already in the repo
- Update or add tests next to similar tests
- No drive-by refactors

When finished, summarise: files changed, how to verify by hand, and anything you skipped because it was out of scope.

Negative prompt

Included when you copy the prompt

Do not invent a parallel architecture, new design system, or unrelated abstractions. Do not drive-by refactor files outside the feature. Do not expand into {{out_of_scope}} work. Do not skip locating an existing similar feature before coding. Do not add dependencies unless {{constraints}} allow them. Do not claim done without matching {{done_when}} and noting how to verify by hand.

The PromptUTF-8

Fill in your details below - this prompt updates as you type, then copy it.

Fill in your details

0 of 4 filled. Preview updates as you type - then copy the finished prompt (negative prompt included when present).

What to build.

Observable behaviour that means you are done.

Stack, libraries, or product rules.

What not to touch.

build-a-feature-in-an-existing-repo.md

Prompt preview

You are a senior engineer working in this repository. Match existing patterns. Do not invent a parallel architecture.

Feature: {{feature}}
User-facing behaviour when done: {{done_when}}
Constraints:
{{constraints}}
Out of scope: {{out_of_scope}}

Before coding:
1. Find the closest existing feature and name the files that implement it
2. List the files you will add or edit and why
3. Call out any schema / API / permission change

Then implement:
- Smallest change that satisfies {{done_when}}
- Reuse components, names, and error handling already in the repo
- Update or add tests next to similar tests
- No drive-by refactors

When finished, summarise: files changed, how to verify by hand, and anything you skipped because it was out of scope.
0 / 4 filledPreview

Examples

Example input

Feature: export a prompt as Markdown. Done when: a button on the prompt page downloads a .md file with title, prompt, and variables.

What you should get

The agent locates similar download/copy UI, adds a small helper plus a button, and skips unrelated refactors.

When to use this prompt

Use it when

  • You need help with engineers.
  • You need help with founders in cursor.
  • You need help with agent users.

Skip it when

  • You only need a one-line ask with no constraints, format, or context.
  • You cannot supply the fill-in details the template asks for.
  • A different category or tool-specific workflow fits the job better.

How to get a good result

Done when

The feature matches {{done_when}}, reuses local patterns, and the summary lists files changed plus how to verify.

Common mistakes

  • Vague {{done_when}} that cannot be verified by hand.
  • Leaving {{out_of_scope}} blank so the agent refactors half the app.
  • Skipping the “find a similar feature” step and inventing a new architecture.

FAQ

What do I fill in before I copy this prompt?
Replace these placeholders with your details: feature, done_when, constraints, out_of_scope. Required fields are marked on the page. The prompt text updates as you type.
Which AI tools is this prompt written for?
It works best with Cursor, Claude, ChatGPT. Copy the filled prompt and paste it into the tool you already use.
What should a good result look like?
The feature matches {{done_when}}, reuses local patterns, and the summary lists files changed plus how to verify.
What are common mistakes with this prompt?
Vague {{done_when}} that cannot be verified by hand. Leaving {{out_of_scope}} blank so the agent refactors half the app. Skipping the “find a similar feature” step and inventing a new architecture.

Best for

  • Engineers
  • Founders in Cursor
  • Agent users

More prompts like this — same topic and style.