From 8e9f09a8e63028229333032742d754ab29723481 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Fri, 24 Apr 2026 18:38:09 +0200 Subject: [PATCH] feat(worker): run planning agent in plan permission mode and enforce brainstorming skill Adds --permission-mode plan to both launch paths (start and resume) so the planning agent cannot perform file-modifying actions during the planning conversation. Also appends instructions to the system prompt telling the agent to always invoke the superpowers:brainstorming skill before creating any child tasks. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/ClaudeDo.Worker/Planning/PlanningSessionManager.cs | 10 ++++++++-- .../Planning/WindowsTerminalPlanningLauncher.cs | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ClaudeDo.Worker/Planning/PlanningSessionManager.cs b/src/ClaudeDo.Worker/Planning/PlanningSessionManager.cs index 1517bed..7f35756 100644 --- a/src/ClaudeDo.Worker/Planning/PlanningSessionManager.cs +++ b/src/ClaudeDo.Worker/Planning/PlanningSessionManager.cs @@ -292,8 +292,14 @@ public sealed class PlanningSessionManager You are a planning assistant for ClaudeDo. Your role is to help break down a task into smaller, actionable subtasks. - Use the available MCP tools (mcp__claudedo__*) to create child tasks. - When you are done planning, finalize the session. + 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. + + 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. """; diff --git a/src/ClaudeDo.Worker/Planning/WindowsTerminalPlanningLauncher.cs b/src/ClaudeDo.Worker/Planning/WindowsTerminalPlanningLauncher.cs index 9cf9af7..9298f77 100644 --- a/src/ClaudeDo.Worker/Planning/WindowsTerminalPlanningLauncher.cs +++ b/src/ClaudeDo.Worker/Planning/WindowsTerminalPlanningLauncher.cs @@ -60,6 +60,8 @@ public sealed class WindowsTerminalPlanningLauncher : IPlanningTerminalLauncher psi.ArgumentList.Add(resolvedClaude); psi.ArgumentList.Add("--model"); psi.ArgumentList.Add(Model); + psi.ArgumentList.Add("--permission-mode"); + psi.ArgumentList.Add("plan"); psi.ArgumentList.Add("--allowedTools"); psi.ArgumentList.Add(AllowedTools); psi.ArgumentList.Add("--append-system-prompt-file"); @@ -97,6 +99,8 @@ public sealed class WindowsTerminalPlanningLauncher : IPlanningTerminalLauncher psi.ArgumentList.Add("-d"); psi.ArgumentList.Add(ctx.WorkingDir); psi.ArgumentList.Add(resolvedClaude); + psi.ArgumentList.Add("--permission-mode"); + psi.ArgumentList.Add("plan"); psi.ArgumentList.Add("--resume"); psi.ArgumentList.Add(ctx.ClaudeSessionId);