From 149fe25a5d430d44aecd7d4560dcc7095df6edba Mon Sep 17 00:00:00 2001 From: Cascade Bot Date: Mon, 23 Mar 2026 13:05:46 +0000 Subject: [PATCH] fix(prompts): fix debug.eta and small partial issues for consistent agent prompts --- src/agents/prompts/templates/debug.eta | 8 +++++++- src/agents/prompts/templates/partials/environment.eta | 2 -- .../prompts/templates/partials/pattern-discovery.eta | 3 ++- src/agents/prompts/templates/splitting.eta | 10 +++++----- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/agents/prompts/templates/debug.eta b/src/agents/prompts/templates/debug.eta index 3766a82e..cbcf43b7 100644 --- a/src/agents/prompts/templates/debug.eta +++ b/src/agents/prompts/templates/debug.eta @@ -40,7 +40,9 @@ You are a debugging expert analyzing CASCADE agent session logs to identify issu ## Available Gadgets - **ReadFile** - Read log files from `<%= it.logDir %>` -- **listDirectory** - List files in the log directory to discover all logs +- **ListDirectory** - List files in the log directory to discover all logs +- **RipGrep** - Search for patterns across log files +- **Tmux** - Run shell commands to read or process log files ## Guidelines @@ -51,4 +53,8 @@ You are a debugging expert analyzing CASCADE agent session logs to identify issu - Keep the analysis concise but thorough - Use code snippets from logs where relevant to illustrate points +<%~ include("partials/environment") %> + +<%~ include("partials/tmux") %> + Start by listing the directory contents to see what logs are available, then read and analyze each log file systematically. diff --git a/src/agents/prompts/templates/partials/environment.eta b/src/agents/prompts/templates/partials/environment.eta index 411dce59..488b13e4 100644 --- a/src/agents/prompts/templates/partials/environment.eta +++ b/src/agents/prompts/templates/partials/environment.eta @@ -20,8 +20,6 @@ Services (databases, caches) may stop running during long sessions. If tests fai - Faster and provides structured output - Example: `RipGrep(pattern="class.*Repository", path="src/", glob="*.ts")` -- **Refactoring**: Use the gadgets available for editing files or use `AstGrep` gadget - - **File finding** (use via Tmux): - `fd` - fast file finder: `command="fd filename src/"` - `grep` - useful also with -r and with -E or as `egrep` diff --git a/src/agents/prompts/templates/partials/pattern-discovery.eta b/src/agents/prompts/templates/partials/pattern-discovery.eta index b04aed5d..d29e6879 100644 --- a/src/agents/prompts/templates/partials/pattern-discovery.eta +++ b/src/agents/prompts/templates/partials/pattern-discovery.eta @@ -1,7 +1,8 @@ ### Pattern Discovery When implementing something new: -1. Find one similar file (component, API endpoint, test) +1. Find one similar file (component, API endpoint, test)<% if (it.squintEnabled) { %> + - Use `squint symbols show --file --json` to understand a similar file's full structure before reading its source<% } %> 2. Note the imports, structure, and conventions 3. Apply the same patterns to your implementation diff --git a/src/agents/prompts/templates/splitting.eta b/src/agents/prompts/templates/splitting.eta index 7d4fbf7b..c0620fa4 100644 --- a/src/agents/prompts/templates/splitting.eta +++ b/src/agents/prompts/templates/splitting.eta @@ -8,11 +8,6 @@ CRITICAL: 5. WHEN BLOCKED OR WHEN DONE WITH YOUR WORK - share an update by commenting on the main <%= it.workItemNoun || 'card' %> with info what you've done. 6. DO NOT MANAGE LABELS - Labels (PROCESSING, PROCESSED, etc.) are handled automatically by the system. -## Context Variables - -- BACKLOG_LIST_ID: <%= it.backlogListId || 'NOT_CONFIGURED' %> -- PROCESSED_LABEL_ID: <%= it.processedLabelId || 'NOT_CONFIGURED' %> - ## INVEST User Story Framework Each story you create must be: @@ -91,6 +86,11 @@ You are running in a cloned copy of the project repository. Before creating stor <%~ include("partials/squint-exploration") %> +## Context Variables + +- BACKLOG_LIST_ID: <%= it.backlogListId || 'NOT_CONFIGURED' %> +- PROCESSED_LABEL_ID: <%= it.processedLabelId || 'NOT_CONFIGURED' %> + ## Your Task 1. **Read the <%= it.workItemNoun || 'card' %>** using `ReadWorkItem` (title, description, AND comments)