From c81bb67ca8db3ae469933a2a650cb398d111d2af Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Sun, 25 Jan 2026 15:06:19 +0000 Subject: [PATCH 1/4] feat: improve session titles to include task descriptions When using /full-loop, /ralph-task, or /ralph-loop with a task ID, the session title now includes the actual task description instead of just the task ID. Changes: - Add Step 0 to full-loop.md for task ID resolution and session naming - Update generate-opencode-commands.sh to include session title guidance - Add examples showing good vs bad session title formats Before: 'Full loop development for t061' After: 't061: Improve session title to include task description' --- .agent/scripts/commands/full-loop.md | 25 ++++++++++++++++++++ .agent/scripts/generate-opencode-commands.sh | 11 +++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.agent/scripts/commands/full-loop.md b/.agent/scripts/commands/full-loop.md index 21e922ac15..39fafcdc11 100644 --- a/.agent/scripts/commands/full-loop.md +++ b/.agent/scripts/commands/full-loop.md @@ -8,6 +8,31 @@ Start a full development loop that chains all phases from task implementation to Task/Prompt: $ARGUMENTS +## Step 0: Resolve Task ID and Set Session Title + +**IMPORTANT**: Before proceeding, check if the argument is a task ID (matches pattern `t\d+` like `t061`). + +If the argument is a task ID: + +1. Look up the task description from TODO.md: + ```bash + grep "^- \[ \] $ARGUMENTS " TODO.md 2>/dev/null | head -1 | sed 's/^- \[ \] [^ ]* //' + ``` + +2. Use the task description (not just the ID) for the session title. Call the `session-rename` tool with a descriptive title like: + - Good: `"t061: Improve session title to include task description"` + - Bad: `"Full loop development for t061"` + +3. Store the full task description for use in subsequent steps. + +If the argument is NOT a task ID (it's a description): +- Use the description directly for the session title +- Call `session-rename` with a concise version if the description is very long (truncate to ~60 chars) + +**Example session titles:** +- Task ID `t061` with description "Improve session title format" → `"t061: Improve session title format"` +- Description "Add JWT authentication" → `"Add JWT authentication"` + ## Full Loop Phases ```text diff --git a/.agent/scripts/generate-opencode-commands.sh b/.agent/scripts/generate-opencode-commands.sh index 0d24f9e9be..b716260f6d 100755 --- a/.agent/scripts/generate-opencode-commands.sh +++ b/.agent/scripts/generate-opencode-commands.sh @@ -1113,6 +1113,8 @@ Start a Ralph loop for iterative development. Arguments: $ARGUMENTS +**Session Title**: Set a descriptive session title using `session-rename` tool. Use a concise version of the prompt (truncate to ~60 chars if needed). + **Usage:** ```bash /ralph-loop "" --max-iterations --completion-promise "" @@ -1358,7 +1360,8 @@ Task ID: $ARGUMENTS **Workflow:** 1. Find task in TODO.md by ID (e.g., t042) 2. Extract ralph metadata (promise, verify command, max iterations) -3. Start Ralph loop with extracted parameters +3. **Set session title** using `session-rename` tool with format: `"t042: Task description here"` +4. Start Ralph loop with extracted parameters **Task format in TODO.md:** ```markdown @@ -1381,7 +1384,8 @@ Task ID: $ARGUMENTS This will: 1. Read TODO.md and find task t042 2. Extract the ralph-promise, ralph-verify, ralph-max values -3. Start: `/ralph-loop "{task description}" --completion-promise "{promise}" --max-iterations {max}` +3. Set session title to `"t042: {task description}"` using `session-rename` tool +4. Start: `/ralph-loop "{task description}" --completion-promise "{promise}" --max-iterations {max}` **Requirements:** - Task must have `#ralph` tag @@ -1405,6 +1409,8 @@ Read ~/.aidevops/agents/scripts/commands/full-loop.md and follow its instruction Start a full development loop for: $ARGUMENTS +**IMPORTANT - Session Title**: If the argument is a task ID (like `t061`), look up the task description from TODO.md and use it for the session title. Call `session-rename` with format: `"t061: Task description here"` instead of just `"Full loop development for t061"`. + **Full Loop Phases:** ```text Task Development → Preflight → PR Create → PR Review → Postflight → Deploy @@ -1414,6 +1420,7 @@ Task Development → Preflight → PR Create → PR Review → Postflight → De ```bash /full-loop "Implement feature X with tests" /full-loop "Fix bug Y" --max-task-iterations 30 +/full-loop t061 # Will look up task description from TODO.md ``` **Options:** From 51116e93284f072953106c24724e63e18dad4437 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Sun, 25 Jan 2026 17:22:53 +0000 Subject: [PATCH 2/4] fix: address review feedback for session title improvements - Use extended regex to match completed/declined tasks (Gemini) - Remove duplicate session title instruction (Gemini) - Clarify to use first positional token, not full args (Augment) - Add fallback behavior when task not found in TODO.md (Augment) - Clarify ralph-loop precedence to not overwrite task titles (Augment) --- .agent/scripts/commands/full-loop.md | 15 +++++++++------ .agent/scripts/generate-opencode-commands.sh | 4 +--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.agent/scripts/commands/full-loop.md b/.agent/scripts/commands/full-loop.md index 39fafcdc11..f1534cc40f 100644 --- a/.agent/scripts/commands/full-loop.md +++ b/.agent/scripts/commands/full-loop.md @@ -10,27 +10,30 @@ Task/Prompt: $ARGUMENTS ## Step 0: Resolve Task ID and Set Session Title -**IMPORTANT**: Before proceeding, check if the argument is a task ID (matches pattern `t\d+` like `t061`). +**IMPORTANT**: Before proceeding, extract the first positional argument (ignoring flags like `--max-task-iterations`) and check if it's a task ID (matches pattern `t\d+` like `t061`). -If the argument is a task ID: +If the first argument is a task ID: -1. Look up the task description from TODO.md: +1. Look up the task description from TODO.md (matches open, completed, or declined tasks): ```bash - grep "^- \[ \] $ARGUMENTS " TODO.md 2>/dev/null | head -1 | sed 's/^- \[ \] [^ ]* //' + grep -E "^- \[( |x|-)\] $TASK_ID " TODO.md 2>/dev/null | head -1 | sed -E 's/^- \[( |x|-)\] [^ ]* //' ``` 2. Use the task description (not just the ID) for the session title. Call the `session-rename` tool with a descriptive title like: - Good: `"t061: Improve session title to include task description"` - Bad: `"Full loop development for t061"` -3. Store the full task description for use in subsequent steps. +3. **Fallback**: If no description is found in TODO.md, use the task ID alone: `"t061: (task not found in TODO.md)"` -If the argument is NOT a task ID (it's a description): +4. Store the full task description for use in subsequent steps. + +If the first argument is NOT a task ID (it's a description): - Use the description directly for the session title - Call `session-rename` with a concise version if the description is very long (truncate to ~60 chars) **Example session titles:** - Task ID `t061` with description "Improve session title format" → `"t061: Improve session title format"` +- Task ID `t999` not found → `"t999: (task not found in TODO.md)"` - Description "Add JWT authentication" → `"Add JWT authentication"` ## Full Loop Phases diff --git a/.agent/scripts/generate-opencode-commands.sh b/.agent/scripts/generate-opencode-commands.sh index b716260f6d..997881e2c6 100755 --- a/.agent/scripts/generate-opencode-commands.sh +++ b/.agent/scripts/generate-opencode-commands.sh @@ -1113,7 +1113,7 @@ Start a Ralph loop for iterative development. Arguments: $ARGUMENTS -**Session Title**: Set a descriptive session title using `session-rename` tool. Use a concise version of the prompt (truncate to ~60 chars if needed). +**Session Title**: Only set a session title if one hasn't been set already (e.g., by `/ralph-task` which sets `"t042: description"`). If no task-prefixed title exists, use `session-rename` with a concise version of the prompt (truncate to ~60 chars if needed). **Usage:** ```bash @@ -1409,8 +1409,6 @@ Read ~/.aidevops/agents/scripts/commands/full-loop.md and follow its instruction Start a full development loop for: $ARGUMENTS -**IMPORTANT - Session Title**: If the argument is a task ID (like `t061`), look up the task description from TODO.md and use it for the session title. Call `session-rename` with format: `"t061: Task description here"` instead of just `"Full loop development for t061"`. - **Full Loop Phases:** ```text Task Development → Preflight → PR Create → PR Review → Postflight → Deploy From 74e9df2e9c0e18d2bf2dc3a2c996fc29fc56af95 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Sun, 25 Jan 2026 17:26:20 +0000 Subject: [PATCH 3/4] style: add blank line before fenced code block (markdown lint) --- .agent/scripts/commands/full-loop.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.agent/scripts/commands/full-loop.md b/.agent/scripts/commands/full-loop.md index f1534cc40f..1958f045b2 100644 --- a/.agent/scripts/commands/full-loop.md +++ b/.agent/scripts/commands/full-loop.md @@ -15,6 +15,7 @@ Task/Prompt: $ARGUMENTS If the first argument is a task ID: 1. Look up the task description from TODO.md (matches open, completed, or declined tasks): + ```bash grep -E "^- \[( |x|-)\] $TASK_ID " TODO.md 2>/dev/null | head -1 | sed -E 's/^- \[( |x|-)\] [^ ]* //' ``` From f20223f981b140085ffc76a7af23b99402642a73 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Sun, 25 Jan 2026 17:34:01 +0000 Subject: [PATCH 4/4] fix: define TASK_ID extraction and session-rename syntax Address CodeRabbit review feedback: - Add explicit bash commands to extract TASK_ID from ARGUMENTS - Show exact session-rename MCP tool invocation syntax - Clarify fallback behavior when TASK_DESC is empty --- .agent/scripts/commands/full-loop.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.agent/scripts/commands/full-loop.md b/.agent/scripts/commands/full-loop.md index 1958f045b2..090e10fceb 100644 --- a/.agent/scripts/commands/full-loop.md +++ b/.agent/scripts/commands/full-loop.md @@ -10,27 +10,37 @@ Task/Prompt: $ARGUMENTS ## Step 0: Resolve Task ID and Set Session Title -**IMPORTANT**: Before proceeding, extract the first positional argument (ignoring flags like `--max-task-iterations`) and check if it's a task ID (matches pattern `t\d+` like `t061`). +**IMPORTANT**: Before proceeding, extract the first positional argument from `$ARGUMENTS` (ignoring flags like `--max-task-iterations`). Check if it matches the task ID pattern `t\d+` (e.g., `t061`). -If the first argument is a task ID: +If the first argument is a task ID (e.g., `t061`): -1. Look up the task description from TODO.md (matches open, completed, or declined tasks): +1. Extract the task ID and look up its description from TODO.md: ```bash - grep -E "^- \[( |x|-)\] $TASK_ID " TODO.md 2>/dev/null | head -1 | sed -E 's/^- \[( |x|-)\] [^ ]* //' + # Extract first argument (the task ID) + TASK_ID=$(echo "$ARGUMENTS" | awk '{print $1}') + + # Look up description (matches open, completed, or declined tasks) + TASK_DESC=$(grep -E "^- \[( |x|-)\] $TASK_ID " TODO.md 2>/dev/null | head -1 | sed -E 's/^- \[( |x|-)\] [^ ]* //') + ``` + +2. Set the session title using the `session-rename` MCP tool: + + ```text + # Call the session-rename tool with the title parameter + session-rename(title: "t061: Improve session title to include task description") ``` -2. Use the task description (not just the ID) for the session title. Call the `session-rename` tool with a descriptive title like: - Good: `"t061: Improve session title to include task description"` - Bad: `"Full loop development for t061"` -3. **Fallback**: If no description is found in TODO.md, use the task ID alone: `"t061: (task not found in TODO.md)"` +3. **Fallback**: If `$TASK_DESC` is empty (task not found in TODO.md), use: `"t061: (task not found in TODO.md)"` 4. Store the full task description for use in subsequent steps. If the first argument is NOT a task ID (it's a description): - Use the description directly for the session title -- Call `session-rename` with a concise version if the description is very long (truncate to ~60 chars) +- Call `session-rename` tool with a concise version if the description is very long (truncate to ~60 chars) **Example session titles:** - Task ID `t061` with description "Improve session title format" → `"t061: Improve session title format"`