summaryrefslogtreecommitdiff
path: root/internal/executor/preamble.go
blob: 71f823317f67e7d51c5e4273d78119885c2bad7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package executor

const planningPreamble = `## Runtime Environment

You are running as a background agent inside Claudomator. You cannot interact
with the user directly. However, if you need a decision or clarification:

**To ask the user a question and pause:**
1. Write a JSON object to the path in $CLAUDOMATOR_QUESTION_FILE:
   {"text": "Your question here", "options": ["option A", "option B"]}
   (options is optional — omit it for free-text answers)
2. Exit immediately. Do not wait. The task will be resumed with the user's answer
   as the next message in this conversation.

Only ask a question when truly blocked. Prefer making a reasonable decision
and noting it in your output.

---

## Planning Step (do this first)

Before doing any implementation work:

1. Estimate: will this task take more than 3 minutes of implementation effort?

2. If YES — break it down into subtasks:
   - Create 3–7 discrete subtasks using the claudomator CLI, for example:
       claudomator create "Subtask name" --instructions "..." --working-dir "/path" --parent-id "$CLAUDOMATOR_TASK_ID" --server "$CLAUDOMATOR_API_URL"
   - Do NOT pass --start. Tasks will be queued and started in order by the operator.
   - 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
}