Prompt pack: plan a feature before coding (spec, tasks, acceptance tests)

Free template

Three prompts that turn a rough feature idea into a one-page spec, a list of small ordered tasks and failing acceptance tests before the agent writes any code.

Updated Oct 26, 2026 · Free to copy, change and use in your own projects. No sign-up needed. · Jump to the template

When to use this template

You want to add a feature with an AI agent, but when you just say "build it", you get a huge change that misses edge cases and is hard to review.

Tools it works with

Prompts 1 and 2 work in any chat assistant. Prompt 3 works best in a coding agent that can read your code and run your tests.

How to use it

  1. Send Prompt 1 with your feature idea filled in. Read the spec and answer the open questions.
  2. Send Prompt 2 with your answers. Check that every task is small and has a clear way to verify it.
  3. Send Prompt 3. Make sure the new tests fail because the feature is missing, not because the setup is broken.
  4. Approve the plan, then let the agent implement one task at a time. Reply "next" only after you have checked each step.
  5. Save the final spec in your repository (for example docs/specs/feature-name.md) so future sessions can read it.

The template

plan-feature-prompts.md 54 linesDownload file
# Prompt pack: plan a feature before coding (spec → tasks → acceptance tests)

Use these three prompts in order, in the same chat or agent session. Review the output of each one before you send the next.
Ask the agent not to write code until prompt 3 is done and you have approved the plan.

---

## Prompt 1: Write the spec (no code)

I want to add a feature to this project. Do not write or change any code yet.
First, read the parts of the codebase this feature will touch, then write a short spec.

Feature idea: [DESCRIBE THE FEATURE IN 2–5 SENTENCES, IN YOUR OWN WORDS]
Who it is for and why: [USER AND THE PROBLEM IT SOLVES]
Constraints: [e.g. "no new dependencies", "must work on mobile", "keep the free tier limits", "ship in one day"]

Write the spec with these sections:
1. Goal — one sentence.
2. User stories — 2 to 5, in the form "As a [user], I want [action], so that [benefit]".
3. Scope — what is in, and what is explicitly out (non-goals).
4. User flow — numbered steps of what the user sees and does, including empty, loading and error states.
5. Data — new or changed data (fields, types, where it is stored), and any migration needed.
6. Affected code — the files, modules or routes you expect to change, based on what you read. Mark anything you are unsure about.
7. Risks and open questions — edge cases, security or privacy concerns, performance, and the questions I need to answer.

Keep it under one page. Ask me the open questions at the end and wait for my answers.

---

## Prompt 2: Break it into tasks

Thanks. Here are my answers to the open questions: [YOUR ANSWERS]
Update the spec with these answers, then break the work into small tasks. Still no code.

Rules for the task list:
- Each task should be small enough to finish and review in one sitting, and leave the app in a working state.
- Order the tasks so the riskiest or most uncertain part comes first.
- For each task, give: a short title, the files it touches, what "done" means, and how to verify it (a command, a test, or a manual check).
- Mark tasks that need a decision from me, a new dependency, a schema change or a secret/API key.
- Put anything nice-to-have in a separate "Later" list instead of the main plan.

---

## Prompt 3: Write acceptance tests first

Now write acceptance criteria and tests for this feature before implementing it.

1. Write acceptance criteria in Given / When / Then form, covering the main flow, the empty state, at least two error cases and at least one edge case.
2. Turn the criteria into automated tests using the test setup this project already has ([TEST FRAMEWORK, e.g. Vitest, Jest, pytest, Playwright]). If there is no test setup, propose the smallest one and wait for my approval before adding it.
3. Run the new tests and show me that they fail for the right reason (the feature does not exist yet), not because of a typo or a broken setup.
4. List any criteria that are hard to automate, and describe how I should check them by hand.

When I approve the tests, implement the tasks one at a time, in order. After each task: run the tests, show me what changed, and wait for me to say "next".

Tips

We wrote this template from public documentation and common practice; we have not measured its results. Tools change often, so check each tool's own documentation if something does not work as described. Found a mistake? Email [email protected].

More free templates

All templates →

Get new templates in the newsletter

Get new templates in the newsletter: we email you when we add new free templates, together with the daily AI picks. Free, no spam, unsubscribe any time.

We'll send a confirmation email first (double opt-in). Sign-ups are handled by Kit.