Write your first story
Status: ShippedA story is a markdown file with a few lines of frontmatter. You can write it yourself or ask your agent to. Either way, it’s a file in your team’s context, and it shows up in the left nav once it’s saved.
This guide adds a story to the Ledgerline sample’s checkout-v2 epic: a refund button in order history, in the web repo.
Before you start
- Your team has at least one source repo on its list (see Attach your repos).
- You know which epic folder the story belongs in. Any folder under the team’s
content/with aREADME.mdis an epic. See The planning model.
1. Create the file
In the epic folder, create a new file. In the app, right-click the folder and choose New file…, or use your editor. Name it after the story, so the file name is readable:
billing/content/planning/checkout-v2/ll-233-refund-button-in-order-history.md2. Add the frontmatter
---type: storystory_id: LL-233title: Refund button in order historystatus: todosource_repo: ledgerline/webdepends_on: [LL-214, LL-231]sprint: sprint-14points: 3assigned_to: sam---What each line does:
type: storymakes this a story. Without it, the file is a plain doc, not a story.bugandspikework too.story_idis the id other stories use to depend on this one. It must be unique.statusis one of your team’s statuses. It sets the status icon in the left nav.source_repois the one repo the story’s worktree opens in, asowner/repo. It must be on your team’s list.depends_onis a list of story ids that must be done first. Always write it as a list, even for one id:[LL-214].sprint,pointsandassigned_toare optional. You can also set them later, or add the story to a sprint from the left nav.
Any other key you add, such as area: refunds, is kept as metadata you can query.
3. Write the body
CodeSense reads the first ## Purpose or ## Story section as the story’s summary, so start with one:
# LL-233 — Refund button in order history
## StoryAs a customer I want a Refund button on a paid order so I don't have to email support.
## Acceptance criteria- [ ] Button shows only for captured payments- [ ] Retrying a refund reuses the same idempotency keyEverything after that is up to you. The agent that picks up the story reads the whole file.
4. Check it
Save the file. LL-233 appears under checkout-v2 in the left nav with a Todo status icon. Hover it to see that it’s blocked by LL-214 and LL-231 until they’re done.
If it doesn’t appear, check the two usual causes: a missing type: line, or frontmatter that isn’t valid YAML (for example depends_on: LL-214, LL-231 without brackets).
Let your agent write it
Agents with the CodeSense MCP tools can write and check stories themselves. A prompt like this works:
Add a story to the checkout-v2 epic for a Refund button in order history, in ledgerline/web, depending on LL-214 and LL-231. Call
get_story_formatfirst, thenvalidate_storyon the file before you finish.
get_story_format gives the agent the story contract and an example. validate_story returns findings with stable codes, including:
| Code | Meaning |
|---|---|
MISSING_SOURCE_REPO | No source_repo, so the story can’t be opened as a workspace |
UNKNOWN_SOURCE_REPO | The repo isn’t on the team’s list |
UNPARSEABLE_FRONTMATTER | The YAML doesn’t parse, so the file reads as a plain doc |
DUPLICATE_STORY_ID | Another story already uses this id |
UNRESOLVABLE_DEPENDS_ON | A depends_on id doesn’t match any story |
MISSING_SUMMARY_HEADING | No ## Purpose or ## Story, so the summary is blank |
OFF_FIBONACCI_POINTS | points isn’t 1, 2, 3, 5, 8 or 13 |
You can also start from New story in the app: a form with a template and a repo picker that writes the same file.
How we know this is accurate 6 sources
Checked against the app at 1b3d5a69d73473db077dfb44f4390b42cded6bd4.
Feature inventory
-
C-1 -
C-2 -
C-4
Code
-
src-tauri/src/commands/pipeline_format/mod.rs -
src-tauri/src/mcp/story_authoring.rs -
src-tauri/src/install/frontmatter_cache.rs