Skip to content

Reading

Appearance

Text size

Bookmarks

    No bookmarks yet. Use “Bookmark chapter” or “Bookmark this section” while reading.

    Your data

    Saved only in this browser on this device. It is not synced to other devices or sent anywhere.

    Chapter 10 of 22 · about 2 min

    10. Step 2: specify

    What it is

    It creates the specification: a description of what one feature should do and why, written for a product person rather than a programmer.

    Write it with user stories

    A user story is one complete thing a person can do, from start to finish:

    As a visitor, I want to register with my name, email and password, so that I can start using the app.

    Give each story a priority:

    • P1: essential. Without it the feature doesn't work at all.
    • P2: important, but the core still works without it.
    • P3: nice to have, can wait.

    Each story needs acceptance scenarios in Given / When / Then form:

    Given a visitor enters a valid name, a valid email and a password of at least 8 characters, When they submit the registration form, Then a new account is created and a success message is shown.

    Given an account already exists with that email, When someone registers with the same email, Then registration is rejected with "Email address is already in use."

    Learning aidAnatomy of a user story and a scenario

    User story P1

    1. As avisitorrole
    2. I wantto register with my name, email and passwordgoal
    3. so thatI can start using the app.benefit

    Acceptance scenario

    1. Givena visitor enters a valid name, a valid email and a password of at least 8 characters,situation
    2. Whenthey submit the registration form,action
    3. Thena new account is created and a success message is shown.outcome
    P1 essentialP2 importantP3 can waitThis story is P1: without it the feature does not work at all.
    The parts are cut from the guide's own examples above, unchanged. A story says who, what and why; a scenario says situation, action and outcome. No technology appears in either.

    Also add an Out of Scope list. It keeps the AI focused:

    Out of scope: login, logout/sessions, viewing/updating/deleting accounts, password reset, email verification.

    How to run it

    /speckit-specify Build a "User Registration" feature.
    User Story 1 (P1): As a visitor I want to register a new account with my name, email
    address and password so that I can start using the application.
    Acceptance scenarios:
    1. Given valid name, valid email and a password of at least 8 characters, when I submit,
    then the account is created and I see a success message.
    2. Given an email that is already registered, when I submit, then I see
    "Email address is already in use" and no account is created.
    3. Given an invalid email format, when I submit, then I see a validation error.
    4. Given a password shorter than 8 characters, when I submit, then I see a validation error.
    Out of scope: login, logout, session management, profile view/update/delete,
    password reset, email verification.

    Notice what's missing: no "controller", no "JPA", no "BCrypt". Those come in plan.

    What it creates

    • specs/001-user-registration/spec.md with user stories, acceptance scenarios, edge cases, functional requirements (numbered like FR-001, FR-002), key entities and success criteria
    • specs/001-user-registration/checklists/requirements.md, a built-in quality checklist for the spec
    • an updated .specify/feature.json
    • a new Git branch, if the git extension is installed

    Where the AI is unsure, it may write [NEEDS CLARIFICATION: …] markers in the spec. That's a good thing: it's flagging the guesses instead of hiding them.

    Learning aidFrom your prompt to spec.md

    /speckit-specify prompt

    • User Story 1 (P1)
    • 4 acceptance scenarios
    • Out of scope

    specs/001-user-registration/spec.md

    • user stories
    • acceptance scenarios
    • edge cases
    • functional requirements (FR-001, FR-002 …)
    • key entities
    • success criteria
    • [NEEDS CLARIFICATION: …] where unsure

    not here: controller · JPA · BCrypt

    Left: the parts of the prompt above. Right: what the guide says spec.md contains. Technology words stay out; they come in plan.

    Your job

    Read spec.md. Is it what you meant? Edit it directly if not. You own this document.

    Optional reviewCheck yourself
    1. In "so that I can start using the app", which part of the story is this?
    2. Which belongs in this spec?