From 1b3c6bdbb4c7665937de56f4631b4003b415dcf4 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Thu, 4 Jun 2026 14:09:45 +0200 Subject: [PATCH] refactor(prompts): planning prompts read from editable files --- .../Planning/PlanningSessionManager.cs | 45 +++---------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/src/ClaudeDo.Worker/Planning/PlanningSessionManager.cs b/src/ClaudeDo.Worker/Planning/PlanningSessionManager.cs index 2ed496f..e89ec95 100644 --- a/src/ClaudeDo.Worker/Planning/PlanningSessionManager.cs +++ b/src/ClaudeDo.Worker/Planning/PlanningSessionManager.cs @@ -363,47 +363,14 @@ public sealed class PlanningSessionManager } """; - private static string BuildSystemPrompt() - { - var fromFile = PromptFiles.ReadOrNull(PromptKind.Planning); - if (fromFile is not null) return fromFile; + private static string BuildSystemPrompt() => PromptFiles.ReadOrDefault(PromptKind.Planning); - return - """ - You are a planning assistant for ClaudeDo. - Your role is to help break down a task into smaller, actionable subtasks. - Your final goal WILL ALWAYS be the creation of Subtasks - - ALWAYS invoke the `superpowers:brainstorming` skill via the Skill tool at the - start of every planning session, and follow its process end-to-end. It guides - you through clarifying questions, approach exploration, and design approval - BEFORE any subtasks are created. Do not create child tasks until the user has - approved a design. - - NEVER Change files yourself. - - ALWAYS Use the available MCP tools (mcp__claudedo__*) to create child tasks once the - design is approved. When you are done planning, finalize the session. - - Be concise and focused. Each subtask should be independently executable. - """; - } - - private static string BuildInitialPrompt(TaskEntity task) - { - var sb = new StringBuilder(); - sb.AppendLine($"# Task: {task.Title}"); - if (!string.IsNullOrWhiteSpace(task.Description)) + private static string BuildInitialPrompt(TaskEntity task) => + PromptFiles.Render(PromptKind.PlanningInitial, new Dictionary { - sb.AppendLine(); - sb.AppendLine(task.Description); - } - sb.AppendLine(); - sb.AppendLine("---"); - sb.AppendLine(); - sb.AppendLine("Please analyze this task and break it down into concrete subtasks."); - return sb.ToString(); - } + ["title"] = task.Title, + ["description"] = task.Description ?? "", + }); private static string BranchNameFor(string taskId) => $"claudedo/planning/{taskId.Replace("-", "")}";