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."
User story P1
- As avisitorrole
- I wantto register with my name, email and passwordgoal
- so thatI can start using the app.benefit
Acceptance scenario
- Givena visitor enters a valid name, a valid email and a password of at least 8 characters,situation
- Whenthey submit the registration form,action
- Thena new account is created and a success message is shown.outcome
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, emailaddress 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.mdwith user stories, acceptance scenarios, edge cases, functional requirements (numbered likeFR-001,FR-002), key entities and success criteriaspecs/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.
/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
Your job
Read spec.md. Is it what you meant? Edit it directly if not. You own this document.