User Story Writing | Format, INVEST, and Examples
Write user stories that communicate value and enable estimation. Learn the standard format, INVEST criteria, and acceptance criteria with GitScrum.
7 min read
User stories capture what users need in a format teams can act on. Good stories communicate value clearly and enable good planning. Poor stories create confusion and missed expectations. This guide covers practical story writing techniques.
Story Structure
| Component | Purpose | Required |
|---|---|---|
| User role | Who benefits | Yes |
| Goal | What they want | Yes |
| Benefit | Why it matters | Yes |
| Acceptance criteria | How to verify | Yes |
Story Format
Standard Template
USER STORY FORMAT
βββββββββββββββββ
THE TEMPLATE:
βββββββββββββββββββββββββββββββββββββ
As a [type of user]
I want [goal/capability]
So that [benefit/value]
Acceptance Criteria:
βββ Given [context]
βββ When [action]
βββ Then [expected result]
βββ (multiple criteria)
GOOD EXAMPLE:
βββββββββββββββββββββββββββββββββββββ
As a logged-in customer
I want to save my shopping cart
So that I can return later to complete my purchase
Acceptance Criteria:
βββ Given I have items in my cart
β When I navigate away and return
β Then my cart items are preserved
βββ Given I am logged out
β When I log back in
β Then my cart is restored
βββ Given my cart has been saved for 30 days
β When I log in
β Then I see a message that expired items were removed
BAD EXAMPLE:
βββββββββββββββββββββββββββββββββββββ
"Implement cart persistence"
βββ No user perspective
βββ No value statement
βββ No acceptance criteria
βββ Just a task
βββ Not a story
INVEST Criteria
Quality Checklist
INVEST CRITERIA
βββββββββββββββ
I - INDEPENDENT:
βββββββββββββββββββββββββββββββββββββ
βββ Can be done without other stories
βββ Order can be changed
βββ Team can pick any from sprint
βββ No blocking dependencies
N - NEGOTIABLE:
βββββββββββββββββββββββββββββββββββββ
βββ Details can be discussed
βββ Not a contract
βββ Conversation starter
βββ Implementation flexible
βββ Collaborate on solution
V - VALUABLE:
βββββββββββββββββββββββββββββββββββββ
βββ Delivers value to user/business
βββ Clear benefit
βββ Worth doing
βββ Not just technical task
βββ User-centric
E - ESTIMABLE:
βββββββββββββββββββββββββββββββββββββ
βββ Team can size it
βββ Understood enough
βββ If can't estimate, needs refinement
βββ Questions answered
βββ Clarity for planning
S - SMALL:
βββββββββββββββββββββββββββββββββββββ
βββ Fits in one sprint
βββ Ideally 1-3 days work
βββ Large stories = split
βββ Completable
βββ Manageable scope
T - TESTABLE:
βββββββββββββββββββββββββββββββββββββ
βββ Clear acceptance criteria
βββ Can verify when done
βββ Objective completion
βββ Not subjective
βββ Know when finished
INVESTMENT CHECK:
βββββββββββββββββββββββββββββββββββββ
For each story ask:
βββ Can it stand alone? (I)
βββ Can we discuss details? (N)
βββ Does it deliver value? (V)
βββ Can we estimate it? (E)
βββ Does it fit in a sprint? (S)
βββ Can we test completion? (T)
βββ All yes = ready for sprint
Acceptance Criteria
Defining Done
ACCEPTANCE CRITERIA
βββββββββββββββββββ
GHERKIN FORMAT:
βββββββββββββββββββββββββββββββββββββ
Given [precondition/context]
When [action/trigger]
Then [expected outcome]
EXAMPLE:
βββββββββββββββββββββββββββββββββββββ
Story: User login
AC1: Successful login
βββ Given I am on the login page
βββ When I enter valid email and password
βββ Then I am redirected to the dashboard
βββ And I see my name in the header
AC2: Invalid credentials
βββ Given I am on the login page
βββ When I enter invalid password
βββ Then I see "Invalid credentials" error
βββ And I remain on the login page
AC3: Account locked
βββ Given I have failed login 5 times
βββ When I try to login again
βββ Then I see "Account locked" message
βββ And I receive email with unlock link
GOOD CRITERIA:
βββββββββββββββββββββββββββββββββββββ
βββ Specific and testable
βββ Cover main scenarios
βββ Include edge cases
βββ Clear expected behavior
βββ No ambiguity
βββ Team can verify
BAD CRITERIA:
βββββββββββββββββββββββββββββββββββββ
βββ "Works correctly"
βββ "Looks good"
βββ "Fast performance"
βββ "Easy to use"
βββ Vague and untestable
βββ No clear verification
Story Splitting
Breaking Down Large Stories
STORY SPLITTING TECHNIQUES
ββββββββββββββββββββββββββ
BY WORKFLOW STEPS:
βββββββββββββββββββββββββββββββββββββ
Large: "User can checkout"
Split:
βββ User can view cart
βββ User can enter shipping address
βββ User can enter payment details
βββ User can review and confirm order
βββ User receives confirmation
βββ Each step is valuable
BY USER TYPE:
βββββββββββββββββββββββββββββββββββββ
Large: "Users can manage subscriptions"
Split:
βββ Free users can view plans
βββ Premium users can change plan
βββ Admin can manage all subscriptions
βββ Different user, different story
BY DATA VARIATIONS:
βββββββββββββββββββββββββββββββββββββ
Large: "Support multiple payment methods"
Split:
βββ User can pay with credit card
βββ User can pay with PayPal
βββ User can pay with bank transfer
βββ One method at a time
BY OPERATIONS:
βββββββββββββββββββββββββββββββββββββ
Large: "User can manage profile"
Split:
βββ User can view profile
βββ User can edit profile
βββ User can upload avatar
βββ User can delete account
βββ CRUD operations
BY HAPPY PATH VS EDGE CASES:
βββββββββββββββββββββββββββββββββββββ
Large: "Robust file upload"
Split:
βββ User can upload valid image (happy path)
βββ System validates file type
βββ System handles large files
βββ System handles upload failure
βββ Start with happy path
SPLITTING RULES:
βββββββββββββββββββββββββββββββββββββ
Good splits:
βββ Each slice delivers value
βββ Each is testable
βββ Each fits in sprint
βββ User would recognize it
βββ Valuable increment
Bad splits:
βββ "Design the UI"
βββ "Build the API"
βββ "Write tests"
βββ Technical layers
βββ Not user value
Story Refinement
Preparing Stories
STORY REFINEMENT
ββββββββββββββββ
REFINEMENT SESSION:
βββββββββββββββββββββββββββββββββββββ
Purpose:
βββ Clarify stories
βββ Add acceptance criteria
βββ Estimate
βββ Split if needed
βββ Identify dependencies
βββ Sprint-ready
DISCUSSION POINTS:
βββββββββββββββββββββββββββββββββββββ
For each story:
βββ What does this mean?
βββ Who is the user?
βββ What is the value?
βββ What are the acceptance criteria?
βββ Any edge cases?
βββ Dependencies?
βββ Estimate?
βββ Shared understanding
READY FOR SPRINT:
βββββββββββββββββββββββββββββββββββββ
Story is ready when:
βββ β Clear user and value
βββ β Acceptance criteria defined
βββ β Estimated by team
βββ β Small enough for sprint
βββ β Dependencies identified
βββ β Team understands it
βββ Definition of ready
GitScrum Stories
Tool Usage
GITSCRUM FOR STORIES
ββββββββββββββββββββ
STORY CREATION:
βββββββββββββββββββββββββββββββββββββ
βββ Use user story template
βββ Fill in user, want, so that
βββ Add acceptance criteria
βββ Add estimate
βββ Assign to sprint
βββ Structured format
ACCEPTANCE CRITERIA:
βββββββββββββββββββββββββββββββββββββ
βββ Checklist format
βββ Given/When/Then in description
βββ Check off during development
βββ Verify before closing
βββ Clear completion
LABELS:
βββββββββββββββββββββββββββββββββββββ
βββ user-story
βββ needs-refinement
βββ ready
βββ Category labels
βββ Clear status
BACKLOG:
βββββββββββββββββββββββββββββββββββββ
βββ Prioritized backlog
βββ Refined stories at top
βββ Rough stories below
βββ Continuous refinement
βββ Always have sprint-ready stories
Best Practices
For User Stories
Anti-Patterns
USER STORY MISTAKES:
β Technical tasks as stories
β Missing acceptance criteria
β Stories too large
β No value statement
β Vague language
β Solution in story (should be problem)
β Skip refinement
β Treat as contract