# User stories

User stories are small stories to describe the users of out app or program and what they want.

When working in software development we want to follow Agile values and principles, and the user stories help us to do just that. There are three Agile principles user stories that we need to keep in mind when we are writing user stories:

* Working software is the primary measure of progress
* Our highest priority is to satisfy the customer through early and continuous delivery of valuable software
* Simplicity - the art of maximizing the amount of work not done - is essential

## What are the benefits of user stories

There are a number of benefits of working with user stories

* They clearly explain the business value of the feature
* They make you stay in scope
* They give you the ability to prioritize the features
* They help you and your team to organize your work

## How do we write user stories?

The stories should focus on the

Who we are building for

What we are building

Why we are building

The format for the user story is the following:

```
As a <stakeholder>            
In order to <requirement>            
I want <result>
```

### Examples of user stories

You have probably seen some user stories in the prep course, these are two examples from the fizzbuzz challenge

```
As a programmer            
So that the game can be played according to the rules            
I want a normal number to return that number
```

```
As a programmer            
So that the game can be played according to the rules            
I want a number divisible by three to return 'fizz'
```

**And here are two other examples**

```
As a user            
In order to get product updates through email            
I want to add my email to my profile page
```

```
As a User            
In order to keep my password safe            
I want to be able to change my password
```

The first line is telling us who the stakeholder is, it could be the user, the programmer, the admin and so on. The second line is giving us the requirement of the story, why should we implement the story. The third line is giving us the result or the output we expect.

### **Some final words on user stories**

From now on you will need user stories for all functionality you want to implement, you will either get some stories provided or you need to write your own. Having user stories is like planning ahead, they also give you small bite size chunks to work with rather than trying to wrap your mind around too much at the same time.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://craftacademy.gitbook.io/coding-as-a-craft-2-0/week-1-programming-basics-rubyt/user-stories.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
