How to write a one-page spec a coding agent can build from

Day 2, 30 minutes · beginner

Goal of this lessonWrite a one-page spec for one small feature with a goal, users, behaviour examples, edge cases, out of scope and a way to know it works.

Why it matters

A coding agent builds what you write down. Where your words leave a gap, it fills the gap with a guess, and it guesses with the same confidence as everything else. A person who builds for you asks a question when something is unclear. An agent may just pick an answer and carry on.

That makes the spec the most important input of the whole flow. A spec (short for specification) is a short description of what a feature must do, for whom, and how you will know it works. It says what, not how. Product people write and judge specs; developers and agents build from them; reviewers check the result against them.

Today you write a one-page spec for one small feature. It has a goal, the users, examples of the behaviour, the unusual cases, what is out of scope and how you will know it works. Every later lesson builds on this page.

What goes on one page

These headings are our suggestion. Each one closes a gap an agent would otherwise fill by guessing.

  • Goal. One or two sentences: what problem this solves and for whom. Not the solution.
  • Users. Who uses the feature, and who must not be able to.
  • Behaviour examples. Three or more short scenes of the feature working. They are the heart of the spec.
  • Edge cases. An edge case is an unusual or extreme situation at the border of normal use: zero, too many, at the same time, too late, the wrong person. Agents and people both forget them.
  • Out of scope. What this feature will not do, even if it seems obvious. This stops an agent from adding things nobody asked for.
  • How we will know it works. What you will look at after release: a number, a complaint that stops, a task that gets faster.
  • Open questions. What is not decided yet, and who decides it.

Writing behaviour examples

A simple form works well: Given a starting situation, When someone does something, Then this is what they see or what happens. One scene per example. Use concrete values ("6 tomato plants") instead of words like "some".

Given an offer of 6 tomato plants with 6 left
When a member claims 2
Then the offer shows 4 left and the member sees "You claimed 2"

You will turn these examples into tests on day 4, so write them so that a person could check them with a yes or a no.

The steps

  1. Pick one small feature. Small means a few days of work at most for a person. If you work on a real product, pick something that is not confidential, or describe it as a stand-in with made-up names and numbers.
  2. Write the goal and the users first, in your own words, before you open your tool. Two sentences are enough.
  3. Let the tool interview you. Pick your tool below and follow the steps. The prompt asks the tool to put questions to you first, one at a time, before it writes anything. Answer them yourself; do not let it decide for you.
  4. Read the draft as the person who has to build it. Underline every word that could mean two things ("soon", "fast", "nearby") and replace it with a number or an example.
  5. Add edge cases until it feels a bit much. At least four. Ask: what if there are none, too many, two at once, too late, or the wrong person?
  6. Cut it to one page. If it does not fit, the feature is too big. Move part of it to Out of scope for now.

Wren's spec for the seedling swap board

Goal: Members with spare seedlings can offer them, and other
members can claim them, so fewer plants end up on the compost.

Users: logged-in members. Visitors who are not logged in see nothing.

Behaviour examples
1. Given I am logged in, when I post 6 tomato plants available
   until Saturday, then the offer appears on the board.
2. Given an offer with 6 left, when another member claims 2,
   then it shows 4 left.
3. Given an offer with 0 left, then it disappears from the board.

Edge cases
- Someone claims more than are left.
- Two members claim the last plants at the same moment.
- A member tries to claim from their own offer.
- The end date has passed.

Out of scope: payments, photos, messages between members,
showing phone numbers or email addresses on the board.

How we will know it works: at least 10 offers in the first month,
and no complaints about claims that were not there.

Open questions: how members arrange the hand-over (Wren decides).

Look at the out of scope line about phone numbers. Wren added it after the interview asked how members get in touch. Without it, an agent might well have shown contact details on the board to be helpful.

Common mistakes

  • Writing the how. "Use a dropdown and a database table" is a design choice for the builder. Write what the member needs to do.
  • Only the happy path. The happy path is the normal case where everything goes right. A spec with no edge cases gets code with no edge cases.
  • Letting the tool invent the feature. The interview is there to draw out your decisions. If it suggests something you did not want, move it to Open questions or Out of scope.

Today's actions

Ticks are not saved without an account

Do it in your tool

Claude

  1. Open your AI-native course project and start a new chat.
  2. Paste the prompt below, fill in your feature and send it. Answer the questions one by one.
    I want to write a one-page spec for one small feature, so a coding agent and a reviewer can work from it. A spec here means a short description of what the feature must do, not how to build it.
    The feature in my words: [two or three sentences]
    Who uses it: [roles]
    First, ask me up to eight short questions, one at a time, about anything you would otherwise have to guess. Wait for each answer.
    Then write the spec with these headings: Goal, Users, Behaviour examples (at least three, each as Given, When, Then, with concrete values), Edge cases (at least four), Out of scope, How we will know it works, Open questions.
    Keep it to one page. Do not add features I did not ask for; put your own ideas under Open questions.
  3. When the draft is ready, select Output in the message box, choose the Docs template and ask: Put the final spec in a doc.
  4. Edit the doc directly where a word could mean two things. To change one part, highlight it, click Edit with Claude and type your request.
  5. Click Export and choose Word or PDF. Then upload the file to the project knowledge with the + button, so later lessons can use it.

Note: Artifacts need Cloud code execution and file creation (called Create and edit files in the updated Settings layout) turned on in Settings > Capabilities; on Team and Enterprise plans an owner controls it. Without it, copy the final spec into a text file instead.

Checked on 4 December 2026 · Source: Claude Help Center: What are artifacts and how do I use them? (opens in a new tab)

Create a free account to save your progress. Sign in or sign up