summaryrefslogtreecommitdiff
path: root/internal/executor/preamble.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-03 21:15:06 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-03 21:15:06 +0000
commitf527972f4d8311a09e639ede6c4da4ca669cfd5e (patch)
tree58ee5c97fd7dea71cdff0ffca7ccd36af562c640 /internal/executor/preamble.go
parent704d007a26cac804148a51d35e129beaea382fb0 (diff)
Executor: dependency waiting and planning preamble
- Pool.waitForDependencies polls depends_on task states before running - ClaudeRunner prepends planningPreamble to task instructions to prompt a plan-then-implement approach - Rate-limit test helper updated to match new ClaudeRunner signature Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/preamble.go')
-rw-r--r--internal/executor/preamble.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/executor/preamble.go b/internal/executor/preamble.go
new file mode 100644
index 0000000..cd1a2cc
--- /dev/null
+++ b/internal/executor/preamble.go
@@ -0,0 +1,23 @@
+package executor
+
+const planningPreamble = `## Planning Step (do this first)
+
+Before doing any implementation work:
+
+1. Estimate: will this task take more than 5 minutes of implementation effort?
+
+2. If YES — break it down:
+ - Create 3–7 discrete subtasks by POSTing to $CLAUDOMATOR_API_URL/api/tasks
+ - Each subtask POST body should be JSON with: name, claude.instructions, claude.working_dir (copy from current task), claude.model, claude.allowed_tools, and claude.skip_planning set to true
+ - Set parent_task_id to $CLAUDOMATOR_TASK_ID in each POST body
+ - After creating all subtasks, output a brief summary and STOP. Do not implement anything.
+
+3. If NO — proceed with the task instructions below.
+
+---
+
+`
+
+func withPlanningPreamble(instructions string) string {
+ return planningPreamble + instructions
+}