Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ralph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,20 @@ echo "Starting Ralph - Tool: $TOOL - Max iterations: $MAX_ITERATIONS"
for i in $(seq 1 $MAX_ITERATIONS); do
echo ""
echo "==============================================================="

# Extract current user story (highest priority with passes: false)
STORY_TITLE=""
STORY_DESC=""
if [ -f "$PRD_FILE" ]; then
STORY_TITLE=$(jq -r '[.userStories[] | select(.passes == false)] | sort_by(.priority) | .[0].title // empty' "$PRD_FILE" 2>/dev/null || echo "")
STORY_DESC=$(jq -r '[.userStories[] | select(.passes == false)] | sort_by(.priority) | .[0].description // empty' "$PRD_FILE" 2>/dev/null || echo "")
fi

echo " Ralph Iteration $i of $MAX_ITERATIONS ($TOOL)"
if [ -n "$STORY_TITLE" ]; then
echo " Story: $STORY_TITLE"
[ -n "$STORY_DESC" ] && echo " $STORY_DESC"
fi
echo "==============================================================="

# Run the selected tool with the ralph prompt
Expand Down