Stories provide a higher-level workflow for breaking down larger features or epics into executable tasks. A story represents a cohesive piece of work that gets refined, broken into tasks, and executed systematically.
Stories are stored in .mcp-tasks/tasks.ednl as EDN records with :type :story. Story tasks are stored in the same file as regular Task records
with :parent-id linking them to their parent story.
Example story in tasks.ednl:
{:id 13
:status :open
:type :story
:title "User Authentication Story"
:description "## Goal
Implement a complete user authentication system with JWT tokens.
## Requirements
- Email/password login
- JWT token generation and validation
- Password reset flow
- Rate limiting on auth endpoints
- Comprehensive test coverage
## Technical Approach
- Use industry-standard JWT libraries
- Implement bcrypt for password hashing
- Add Redis for rate limiting
- Follow OAuth 2.0 patterns where applicable"
:category "large"
:design ""
:meta {}
:relations []}
Example story tasks in tasks.ednl:
{:id 35
:parent-id 13
:status :open
:type :task
:title "Set up JWT library dependencies"
:description "Add JWT library to deps.edn, configure for HS256 algorithm"
:category "simple"
:design ""
:meta {}
:relations []}
{:id 36
:parent-id 13
:status :open
:type :task
:title "Implement password hashing utilities"
:description "Create namespace for bcrypt password hashing"
:category "medium"
:design ""
:meta {}
:relations []}
Refine a rough story idea into a detailed specification:
/mcp-tasks:refine-task <story-name>
Process:
.mcp-tasks/tasks.ednl by title pattern:description field in tasks.ednlExample interaction:
User: /mcp-tasks:refine-task user-auth
Agent: I've found your user-auth story. Let me ask some clarifying questions:
1. Which JWT library should we use?
2. What's the token expiration policy?
3. Should we support refresh tokens?
...
User: [Provides answers]
Agent: Based on your answers, here's the refined story...
[Shows updated story description]
User: Looks good!
Agent: Story updated in .mcp-tasks/tasks.ednl
Break the refined story into executable tasks:
/mcp-tasks:create-story-tasks <story-name>
Process:
.mcp-tasks/tasks.ednladd-task tool to create each task with :parent-id linking to the story.mcp-tasks/tasks.ednl in dependency orderExample tasks created:
{:id 40
:parent-id 13
:status :open
:type :task
:title "Set up JWT library dependencies"
:description "Add JWT library to deps.edn, configure for HS256 algorithm, add test dependencies for token validation testing."
:category "simple"
:design ""
:meta {}
:relations []}
{:id 41
:parent-id 13
:status :open
:type :task
:title "Implement password hashing utilities"
:description "Create namespace for bcrypt password hashing with functions for hash generation and verification. Include edge case handling for invalid inputs."
:category "medium"
:design ""
:meta {}
:relations []}
{:id 42
:parent-id 13
:status :open
:type :task
:title "Build JWT token generation endpoint"
:description "Implement /api/auth/login endpoint that validates credentials, generates JWT token with user claims, returns token and expiry. Handle invalid credentials gracefully."
:category "medium"
:design ""
:meta {}
:relations []}
Key elements:
:parent-id field linking it to the story.mcp-tasks/tasks.ednl fileselect-tasks with parent-id filter to query story tasksExecute story tasks one at a time:
/mcp-tasks:execute-story-task <story-name>
Process:
select-tasks with title-pattern and :unique? trueselect-tasks with parent-id filter and :limit 1complete-task tool:status :closedExample execution:
User: /mcp-tasks:execute-story-task user-auth
Agent: Found story: User Authentication Story (ID: 13)
Found next task: "Set up JWT library dependencies" (ID: 40)
Category: simple
[Executes task using simple workflow...]
[After completion...]
Task completed successfully and moved to complete.ednl
Repeat this command until all story tasks are complete.
Track story progress by asking the agent questions. The agent will query the task system and provide clear summaries.
Example queries:
The agent uses the select-tasks tool with filters like parent-id: 13 to find story child tasks, status: "closed" to filter completed tasks, and combines results into readable summaries.
This agent-first approach means you don't need to learn EDN query syntax or file locations.
When :branch-management? true is configured in .mcp-tasks.edn,
the system automatically manages git branches for stories:
Automatic branch operations:
<story-name> branch from the default branch when starting story workManual branch workflow (default when :branch-management? false):
Example with branch management enabled:
# Configure story branch management
echo '{:use-git? true :branch-management? true}' > .mcp-tasks.edn
# Start story work - automatically creates/switches to user-auth branch
# Run: /mcp-tasks:execute-story-task user-auth
# All subsequent task executions stay on user-auth branch until story is complete
# 1. Create initial story using add-task tool
# Use the MCP add-task tool or manually add to tasks.ednl:
# {:id 50 :status :open :type :story :title "User Authentication"
# :description "We need user authentication with JWT tokens."
# :category "large" :design "" :meta {} :relations []}
# 2. Refine the story
# Run: /mcp-tasks:refine-task "User Authentication"
# [Interactive refinement with agent]
# 3. Break into tasks
# Run: /mcp-tasks:create-story-tasks "User Authentication"
# [Agent proposes task breakdown, you approve]
# Tasks are created in tasks.ednl with :parent-id 50
# 4. Execute tasks one by one
# Run: /mcp-tasks:execute-story-task "User Authentication"
# [First task executes and moves to complete.ednl]
# Run: /mcp-tasks:execute-story-task "User Authentication"
# [Second task executes and moves to complete.ednl]
# ... repeat until all tasks complete
# 5. Review the completed work
grep ":parent-id 50" .mcp-tasks/complete.ednl
# All story tasks with :status :closed
# 6. Merge story branch (if using branch management)
git checkout master
git merge user-authentication
Override the default story prompts by creating files in
.mcp-tasks/story/prompts/:
Available prompts to override:
refine-task.md - Task refinement instructionscreate-story-tasks.md - Task breakdown instructionsexecute-story-task.md - Task execution workflowOverride files must include YAML frontmatter delimited by --- markers:
Supported fields:
title (string) - Human-readable prompt name shown in listingsdescription (string) - Brief explanation of the prompt's purposeFormat requirements:
key: value format (simple YAML)--- delimiters are requiredBasic override file structure:
---
title: Custom Story Refinement
description: My team's story refinement process
---
[Your custom instructions here]
Use {story-name} as a placeholder for the story name argument.
The system checks for story prompt overrides in this order:
Project override: .mcp-tasks/story/prompts/<prompt-name>.md
Built-in default: Resource files in the MCP server
Create a custom task breakdown prompt with strict category rules:
File: .mcp-tasks/story/prompts/create-story-tasks.md
---
title: Strict Category Task Breakdown
description: Break down stories with strict 2-hour task limits
---
Break down the story into tasks following these rules:
1. Find the story in `.mcp-tasks/tasks.ednl` by title pattern
2. If the story doesn't exist, inform the user and stop
3. Analyze the story and create specific, actionable tasks
4. Apply strict category rules:
- simple: Must complete in under 2 hours, no external dependencies
- medium: 2-4 hours, may involve API integration
- large: Over 4 hours, requires design discussion first
5. Each task must have:
- Clear acceptance criteria
- Estimated time in task description
- Explicit dependencies listed
6. Present the breakdown with time estimates
7. Get user approval before creating tasks using the add-task tool
Task creation:
For each task, use add-task with:
- category: <category>
- title
- parent-id: {id of story}
- type: "task"
This override enforces time-based categorization and explicit dependency tracking that may not be in the default prompt.
Story prompts and category prompts serve different purposes:
Story prompts (.mcp-tasks/story/prompts/*.md):
Category prompts (.mcp-tasks/prompts/<category>.md):
Interaction:
When you run /mcp-tasks:execute-story-task user-auth:
execute-story-task story prompt finds the next story tasksimple category prompt from
.mcp-tasks/prompts/simple.mdCustomization strategy:
Story sizing:
Task descriptions:
Category selection:
simple: Straightforward tasks, < 30 minutesmedium: Moderate complexity, involves planninglarge: Complex tasks requiring design and iterationWorkflow integration:
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |