refactor(prompts): planning prompts read from editable files

This commit is contained in:
mika kuns
2026-06-04 14:09:45 +02:00
parent bd1e3db1d9
commit 1b3c6bdbb4

View File

@@ -363,47 +363,14 @@ public sealed class PlanningSessionManager
} }
"""; """;
private static string BuildSystemPrompt() private static string BuildSystemPrompt() => PromptFiles.ReadOrDefault(PromptKind.Planning);
{
var fromFile = PromptFiles.ReadOrNull(PromptKind.Planning);
if (fromFile is not null) return fromFile;
return private static string BuildInitialPrompt(TaskEntity task) =>
""" PromptFiles.Render(PromptKind.PlanningInitial, new Dictionary<string, string>
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))
{ {
sb.AppendLine(); ["title"] = task.Title,
sb.AppendLine(task.Description); ["description"] = task.Description ?? "",
} });
sb.AppendLine();
sb.AppendLine("---");
sb.AppendLine();
sb.AppendLine("Please analyze this task and break it down into concrete subtasks.");
return sb.ToString();
}
private static string BranchNameFor(string taskId) => private static string BranchNameFor(string taskId) =>
$"claudedo/planning/{taskId.Replace("-", "")}"; $"claudedo/planning/{taskId.Replace("-", "")}";