From fd50a4fb7c994175a042523c395e1464ae95936c Mon Sep 17 00:00:00 2001 From: mika kuns Date: Wed, 5 Aug 2026 08:47:41 +0200 Subject: [PATCH] fix(prompts): only ask list-handler dedupe questions when a candidate exists Phase 1 previously asked the user to confirm the absence of duplicates even when no candidate pair was found. The handler now decides that itself and moves straight to Phase 2; per-pair questions remain when at least one candidate exists. --- src/ClaudeDo.Data/PromptFiles.cs | 8 +++++--- tests/ClaudeDo.Data.Tests/PromptFilesTests.cs | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ClaudeDo.Data/PromptFiles.cs b/src/ClaudeDo.Data/PromptFiles.cs index a1309a6e..d2551f76 100644 --- a/src/ClaudeDo.Data/PromptFiles.cs +++ b/src/ClaudeDo.Data/PromptFiles.cs @@ -229,7 +229,7 @@ public static class PromptFiles """; private const string MergeHelperDefault = """ - You are the ClaudeDo list handler, running as an interactive session with the user watching. Ask them questions whenever you are unsure — that is the point of this session. + You are the ClaudeDo list handler, running as an interactive session with the user watching. Work autonomously and decide things yourself by default. Ask the user only for decisions that are genuinely theirs to make: merging a duplicate task, a task whose intent is too unclear to act on safely, a diff that looks wrong or risky, or a conflict resolution you cannot resolve with confidence. Everything else, decide and keep moving. Your job: take the tasks listed in the brief and drive the whole set to merged, Done work — reading them first, removing duplicates, sharpening what stays, running it, then reviewing and merging each result. You act through the mcp__claudedo__* tools. Read the brief file first (the kickoff message gives its path); it names the list, its repo, and every task's id, title and status. All tasks belong to that one list and one repo. @@ -241,11 +241,13 @@ public static class PromptFiles ## Phase 1 — Dedupe Compare the tasks pairwise for overlap: same goal stated twice, one task fully contained in another, two tasks that would edit the same thing for the same reason. - Print a table of the candidate pairs with, for each, the reason it looks like a duplicate. Then ask the user about EACH pair, one at a time: + If no pair looks like a duplicate, say so in one sentence and move straight to Phase 2 — do not ask the user to confirm the absence of duplicates. + + If at least one pair looks like a duplicate, print a table of the candidate pairs with, for each, the reason it looks like a duplicate. Then ask the user about EACH pair, one at a time: - merge → fold whatever the loser says that the survivor does not into the survivor via update_task, then update_task_status(loserId, "Cancelled"). Cancelled keeps the task visible and resettable; never use delete_task for this. - keep both → note why and move on. - Cancel nothing without an explicit answer. If there are no duplicates, say so and go on. + Cancel nothing without an explicit answer. ## Phase 2 — Enhance for execution Each surviving task is about to be run by an autonomous agent with no further input. Sharpen it so that run can succeed. For each task, rewrite title and description to carry: diff --git a/tests/ClaudeDo.Data.Tests/PromptFilesTests.cs b/tests/ClaudeDo.Data.Tests/PromptFilesTests.cs index 3f202b7e..9f989c5b 100644 --- a/tests/ClaudeDo.Data.Tests/PromptFilesTests.cs +++ b/tests/ClaudeDo.Data.Tests/PromptFilesTests.cs @@ -77,6 +77,16 @@ public class PromptFilesTests Assert.DoesNotContain("run_task_now(", d); // single override slot — must not batch-start } + [Fact] + public void DefaultFor_merge_helper_only_asks_dedupe_questions_when_a_candidate_exists() + { + var d = PromptFiles.DefaultFor(PromptKind.MergeHelper); + Assert.Contains("move straight to Phase 2", d); + Assert.Contains("do not ask the user to confirm the absence of duplicates", d); + Assert.Contains("Cancel nothing without an explicit answer", d); + Assert.DoesNotContain("whenever you are unsure", d); + } + [Fact] public void DefaultFor_merge_helper_initial_has_repo_token() {