Create Next Story Task
When to Use
- When ready to start the next development story
- After completing the current story (status: Done)
- When preparing stories for sprint planning
- When creating comprehensive context for Dev agents
Quick Start
- Load
core-config.yaml for project settings
- Find highest story file and check completion status
- Identify next sequential story/task number
- Gather requirements and previous story context
- Generate story file with full technical context
Purpose
To identify the next logical story based on project progress and task definitions, and then to prepare a comprehensive, self-contained, and actionable story file using the Story Template. This task ensures the story is enriched with all necessary technical context, requirements, and acceptance criteria, making it ready for efficient implementation by a Developer Agent with minimal need for additional research or finding its own context.
SEQUENTIAL Task Execution (Do not proceed until current Task is complete)
0. Load Core Configuration and Check Workflow
- Load
../core-config.yaml (relative to tasks folder)
- If the file does not exist, HALT and inform the user: "core-config.yaml not found. This file is required for story creation. You can either: 1) Copy it from GITHUB prism-devtools and configure it for your project OR 2) Run the Prism installer against your project to upgrade and add the file automatically. Please add and configure core-config.yaml before proceeding."
- Extract key configurations:
devStoryLocation, prd.*, architecture.*, workflow.*
1. Identify Next Story for Preparation
1.1 Locate Task Files and Review Existing Stories
- Based on
prdSharded from config, locate task files (sharded location/pattern or monolithic PRD sections)
- If
devStoryLocation has story files, load the highest {storyNum}.{taskNum}.story.md file
- If highest story exists:
- Verify status is 'Done'. If not, alert user: "ALERT: Found incomplete story! File: {lastStoryNum}.{lastTaskNum}.story.md Status: [current status] You should fix this story first, but would you like to accept risk & override to create the next story in draft?"
- If proceeding, select next sequential task in the current story
- If story is complete, prompt user: "Story {storyNum} Complete: All tasks in Story {storyNum} have been completed. Would you like to: 1) Begin Story {storyNum + 1} with task 1 2) Select a specific task to work on 3) Cancel story creation"
- CRITICAL: NEVER automatically skip to another story. User MUST explicitly instruct which story to create.
- If no story files exist: The next story is ALWAYS 1.1 (first task of first story)
- Announce the identified story to the user: "Identified next story for preparation: {storyNum}.{taskNum} - {Story Title}"
2. Gather Story Requirements and Previous Story Context
- Extract story requirements from the identified task file
- If previous story exists, review Dev Agent Record sections for:
- Completion Notes and Debug Log References
- Implementation deviations and technical decisions
- Challenges encountered and lessons learned
- Extract relevant insights that inform the current story's preparation
3. Gather Architecture Context
3.1 Determine Architecture Reading Strategy
- If
architectureVersion: >= v4 and architectureSharded: true: Read {architectureShardedLocation}/index.md then follow structured reading order below
- Else: Use monolithic
architectureFile for similar sections
3.2 Read Architecture Documents Based on Story Type
For ALL Stories: tech-stack.md, unified-project-structure.md, coding-standards.md, testing-strategy.md
For Backend/API Stories, additionally: data-models.md, database-schema.md, backend-architecture.md, rest-api-spec.md, external-apis.md
For Frontend/UI Stories, additionally: frontend-architecture.md, components.md, core-workflows.md, data-models.md
For Full-Stack Stories: Read both Backend and Frontend sections above
3.3 Extract Story-Specific Technical Details
Extract ONLY information directly relevant to implementing the current story. Do NOT invent new libraries, patterns, or standards not in the source documents.
Extract:
- Specific data models, schemas, or structures the story will use
- API endpoints the story must implement or consume
- Component specifications for UI elements in the story
- File paths and naming conventions for new code
- Testing requirements specific to the story's features
- Security or performance considerations affecting the story
ALWAYS cite source documents: [Source: architecture/{filename}.md#{section}]
4. Verify Project Structure Alignment
- Cross-reference story requirements with Project Structure Guide from
docs/architecture/unified-project-structure.md
- Ensure file paths, component locations, or module names align with defined structures
- Document any structural conflicts in "Project Structure Notes" section within the story draft
5. Apply PROBE Estimation
- Execute the
probe-estimation task to:
- Analyze story complexity and assign size category
- Find similar historical stories as proxies
- Calculate time estimates using PROBE method
- Generate estimation data for story file
6. Populate Story Template with Full Context
- Create new story file:
{devStoryLocation}/{storyNum}.{storyNum}.story.md using Story Template
- Fill in basic story information: Title, Status (Draft), Story statement, Acceptance Criteria from Story
PSP Estimation section:
- Include PROBE estimation results from Step 5
- Set tracking fields to null (to be filled during execution)
Dev Notes section (CRITICAL):
- CRITICAL: This section MUST contain ONLY information extracted from architecture documents. NEVER invent or assume technical details.
- Include ALL relevant technical details from Steps 2-3, organized by category:
- Previous Story Insights: Key learnings from previous story
- Data Models: Specific schemas, validation rules, relationships [with source references]
- API Specifications: Endpoint details, request/response formats, auth requirements [with source references]
- Component Specifications: UI component details, props, state management [with source references]
- File Locations: Exact paths where new code should be created based on project structure
- Testing Requirements: Specific test cases or strategies from testing-strategy.md
- Technical Constraints: Version requirements, performance considerations, security rules
- Every technical detail MUST include its source reference:
[Source: architecture/{filename}.md#{section}]
- If information for a category is not found in the architecture docs, explicitly state: "No specific guidance found in architecture docs"
Tasks / Subtasks section:
- Generate detailed, sequential list of technical tasks based ONLY on: Story Requirements, Story AC, Reviewed Architecture Information
- Each task must reference relevant architecture documentation
- Include unit testing as explicit subtasks based on the Testing Strategy
- Link tasks to ACs where applicable (e.g.,
Task 1 (AC: 1, 3))
- Add notes on project structure alignment or discrepancies found in Step 4
7. Story Draft Completion and Review
- Review all sections for completeness and accuracy
- Verify all source references are included for technical details
- Ensure tasks align with both story requirements and architecture constraints
- Update status to "Draft" and save the story file
- Execute
execute-checklist task with ../checklists/story-draft-checklist
- Provide summary to user including:
- Story created:
{devStoryLocation}/{storyNum}.{storyNum}.story.md
- Status: Draft
- Key technical components included from architecture docs
- Any deviations or conflicts noted between story and architecture
- Checklist Results
- Next steps: For Complex stories, suggest the user carefully review the story draft and also optionally have the PO run the
validate-next-story task
1---2name: create-next-story3description: Use to identify and prepare the next logical story based on project progress. Creates comprehensive story files with full technical context.4---5<!-- Powered by PRISMâ„¢ System -->
6
7# Create Next Story Task
8
9## When to Use
10
11- When ready to start the next development story
12- After completing the current story (status: Done)
13- When preparing stories for sprint planning
14- When creating comprehensive context for Dev agents
15
16## Quick Start
17
181. Load `core-config.yaml` for project settings
192. Find highest story file and check completion status
203. Identify next sequential story/task number
214. Gather requirements and previous story context
225. Generate story file with full technical context
23
24## Purpose
25
26To identify the next logical story based on project progress and task definitions, and then to prepare a comprehensive, self-contained, and actionable story file using the `Story Template`. This task ensures the story is enriched with all necessary technical context, requirements, and acceptance criteria, making it ready for efficient implementation by a Developer Agent with minimal need for additional research or finding its own context.
27
28## SEQUENTIAL Task Execution (Do not proceed until current Task is complete)
29
30### 0. Load Core Configuration and Check Workflow
31
32- Load `../core-config.yaml` (relative to tasks folder)
33- If the file does not exist, HALT and inform the user: "core-config.yaml not found. This file is required for story creation. You can either: 1) Copy it from GITHUB prism-devtools and configure it for your project OR 2) Run the Prism installer against your project to upgrade and add the file automatically. Please add and configure core-config.yaml before proceeding."
34- Extract key configurations: `devStoryLocation`, `prd.*`, `architecture.*`, `workflow.*`
35
36### 1. Identify Next Story for Preparation
37
38#### 1.1 Locate Task Files and Review Existing Stories
39
40- Based on `prdSharded` from config, locate task files (sharded location/pattern or monolithic PRD sections)
41- If `devStoryLocation` has story files, load the highest `{storyNum}.{taskNum}.story.md` file
42- **If highest story exists:**
43 - Verify status is 'Done'. If not, alert user: "ALERT: Found incomplete story! File: {lastStoryNum}.{lastTaskNum}.story.md Status: [current status] You should fix this story first, but would you like to accept risk & override to create the next story in draft?"
44 - If proceeding, select next sequential task in the current story
45 - If story is complete, prompt user: "Story {storyNum} Complete: All tasks in Story {storyNum} have been completed. Would you like to: 1) Begin Story {storyNum + 1} with task 1 2) Select a specific task to work on 3) Cancel story creation"
46 - **CRITICAL**: NEVER automatically skip to another story. User MUST explicitly instruct which story to create.
47- **If no story files exist:** The next story is ALWAYS 1.1 (first task of first story)
48- Announce the identified story to the user: "Identified next story for preparation: {storyNum}.{taskNum} - {Story Title}"
49
50### 2. Gather Story Requirements and Previous Story Context
51
52- Extract story requirements from the identified task file
53- If previous story exists, review Dev Agent Record sections for:
54 - Completion Notes and Debug Log References
55 - Implementation deviations and technical decisions
56 - Challenges encountered and lessons learned
57- Extract relevant insights that inform the current story's preparation
58
59### 3. Gather Architecture Context
60
61#### 3.1 Determine Architecture Reading Strategy
62
63- **If `architectureVersion: >= v4` and `architectureSharded: true`**: Read `{architectureShardedLocation}/index.md` then follow structured reading order below
64- **Else**: Use monolithic `architectureFile` for similar sections
65
66#### 3.2 Read Architecture Documents Based on Story Type
67
68**For ALL Stories:** tech-stack.md, unified-project-structure.md, coding-standards.md, testing-strategy.md
69
70**For Backend/API Stories, additionally:** data-models.md, database-schema.md, backend-architecture.md, rest-api-spec.md, external-apis.md
71
72**For Frontend/UI Stories, additionally:** frontend-architecture.md, components.md, core-workflows.md, data-models.md
73
74**For Full-Stack Stories:** Read both Backend and Frontend sections above
75
76#### 3.3 Extract Story-Specific Technical Details
77
78Extract ONLY information directly relevant to implementing the current story. Do NOT invent new libraries, patterns, or standards not in the source documents.
79
80Extract:
81
82- Specific data models, schemas, or structures the story will use
83- API endpoints the story must implement or consume
84- Component specifications for UI elements in the story
85- File paths and naming conventions for new code
86- Testing requirements specific to the story's features
87- Security or performance considerations affecting the story
88
89ALWAYS cite source documents: `[Source: architecture/{filename}.md#{section}]`
90
91### 4. Verify Project Structure Alignment
92
93- Cross-reference story requirements with Project Structure Guide from `docs/architecture/unified-project-structure.md`
94- Ensure file paths, component locations, or module names align with defined structures
95- Document any structural conflicts in "Project Structure Notes" section within the story draft
96
97### 5. Apply PROBE Estimation
98
99- Execute the `probe-estimation` task to:
100 - Analyze story complexity and assign size category
101 - Find similar historical stories as proxies
102 - Calculate time estimates using PROBE method
103 - Generate estimation data for story file
104
105### 6. Populate Story Template with Full Context
106
107- Create new story file: `{devStoryLocation}/{storyNum}.{storyNum}.story.md` using Story Template
108- Fill in basic story information: Title, Status (Draft), Story statement, Acceptance Criteria from Story
109- **`PSP Estimation` section:**
110 - Include PROBE estimation results from Step 5
111 - Set tracking fields to null (to be filled during execution)
112- **`Dev Notes` section (CRITICAL):**
113 - CRITICAL: This section MUST contain ONLY information extracted from architecture documents. NEVER invent or assume technical details.
114 - Include ALL relevant technical details from Steps 2-3, organized by category:
115 - **Previous Story Insights**: Key learnings from previous story
116 - **Data Models**: Specific schemas, validation rules, relationships [with source references]
117 - **API Specifications**: Endpoint details, request/response formats, auth requirements [with source references]
118 - **Component Specifications**: UI component details, props, state management [with source references]
119 - **File Locations**: Exact paths where new code should be created based on project structure
120 - **Testing Requirements**: Specific test cases or strategies from testing-strategy.md
121 - **Technical Constraints**: Version requirements, performance considerations, security rules
122 - Every technical detail MUST include its source reference: `[Source: architecture/{filename}.md#{section}]`
123 - If information for a category is not found in the architecture docs, explicitly state: "No specific guidance found in architecture docs"
124- **`Tasks / Subtasks` section:**
125 - Generate detailed, sequential list of technical tasks based ONLY on: Story Requirements, Story AC, Reviewed Architecture Information
126 - Each task must reference relevant architecture documentation
127 - Include unit testing as explicit subtasks based on the Testing Strategy
128 - Link tasks to ACs where applicable (e.g., `Task 1 (AC: 1, 3)`)
129- Add notes on project structure alignment or discrepancies found in Step 4
130
131### 7. Story Draft Completion and Review
132
133- Review all sections for completeness and accuracy
134- Verify all source references are included for technical details
135- Ensure tasks align with both story requirements and architecture constraints
136- Update status to "Draft" and save the story file
137- Execute `execute-checklist` task with `../checklists/story-draft-checklist`
138- Provide summary to user including:
139 - Story created: `{devStoryLocation}/{storyNum}.{storyNum}.story.md`
140 - Status: Draft
141 - Key technical components included from architecture docs
142 - Any deviations or conflicts noted between story and architecture
143 - Checklist Results
144 - Next steps: For Complex stories, suggest the user carefully review the story draft and also optionally have the PO run the `validate-next-story` task
145