Reviews and adjusts PRD plans based on research findings. Use after completing research to evaluate story modifications. Triggers on: review plan, adjust stories, update prd based on research.
Evaluate research findings and decide whether to adjust upcoming stories in the PRD.
prd.json with changeschangeLogMODIFY stories when research reveals:
Update acceptance criteria, description, or research topics.
{
"timestamp": "2026-01-29T12:00:00Z",
"storyId": "US-002",
"action": "modified",
"reason": "Research found that existing badge component supports priority colors, simplifying implementation",
"changes": {
"acceptanceCriteria": {
"removed": ["Create new PriorityBadge component"],
"added": ["Reuse Badge component with priority color variant"]
}
}
}
Insert a prerequisite or follow-up story.
{
"timestamp": "2026-01-29T12:00:00Z",
"storyId": "US-001.5",
"action": "added",
"reason": "Research revealed need for database index on priority column for filter performance",
"insertAfter": "US-001"
}
Break a story into smaller pieces.
{
"timestamp": "2026-01-29T12:00:00Z",
"storyId": "US-003",
"action": "split",
"reason": "Story too large - separating dropdown component from save logic",
"splitInto": ["US-003a", "US-003b"]
}
Change priority/order based on new dependencies.
{
"timestamp": "2026-01-29T12:00:00Z",
"storyId": "US-004",
"action": "reordered",
"reason": "URL state management needed before filter implementation",
"newPriority": 2,
"previousPriority": 4
}
Mark a story as unnecessary (cannot remove completed stories).
{
"timestamp": "2026-01-29T12:00:00Z",
"storyId": "US-005",
"action": "removed",
"reason": "Research found this functionality already exists in the codebase"
}
Load the research report from scripts/aha-loop/research/[story-id]-research.md
Focus on:
For each finding, ask:
Does this affect the current story?
Does this affect future stories?
Does this reveal scope issues?
Before modifying prd.json:
Backup first (automatic via aha-loop.sh, but verify).
Apply changes to prd.json:
// Example: Adding a story
{
"id": "US-001.5",
"title": "Add database index for priority filtering",
"description": "As a developer, I need an index on priority column for efficient filtering.",
"acceptanceCriteria": [
"Create index on tasks.priority column",
"Migration runs without errors",
"Typecheck passes"
],
"priority": 1.5, // Will be normalized later
"passes": false,
"researchTopics": [],
"researchCompleted": true, // No research needed for simple index
"learnings": "",
"implementationNotes": "Discovered during US-001 research that filter queries will need this index",
"notes": ""
}
Add to changeLog:
{
"changeLog": [
// ... existing entries
{
"timestamp": "2026-01-29T12:00:00Z",
"storyId": "US-001.5",
"action": "added",
"reason": "Research for US-001 revealed need for index to support efficient priority filtering (US-004)",
"researchSource": "scripts/aha-loop/research/US-001-research.md"
}
]
}
After modifications, ensure priorities are sequential:
// Before: [1, 1.5, 2, 3, 4]
// After: [1, 2, 3, 4, 5]
passes: truechangeLogAfter plan review, append to progress.txt:
## Plan Review - [Date/Time]
### Research Analyzed
- [Story ID]: [Research report path]
### Changes Made
**[Action Type]: [Story ID]**
- Reason: [Why this change was needed]
- Impact: [What this affects]
### No Changes Made (If Applicable)
- Research findings do not require plan modifications
- Reason: [Why no changes needed]
### Updated Story Order
1. US-001: [Title] ✓ (completed)
2. US-001.5: [Title] (new)
3. US-002: [Title]
...
---
Scenario: Research for US-001 (Add priority to database) revealed:
Changes:
Add US-001.5 - Create index on priority column
Modify US-002 - Update acceptance criteria
Modify US-004 - Add implementation note
No reordering needed - dependencies unchanged.
Before completing plan review:
changeLogprogress.txt