summaryrefslogtreecommitdiff
path: root/makima/src/orchestration
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/orchestration')
-rw-r--r--makima/src/orchestration/directive.rs64
1 files changed, 61 insertions, 3 deletions
diff --git a/makima/src/orchestration/directive.rs b/makima/src/orchestration/directive.rs
index 420b3e1..b91781c 100644
--- a/makima/src/orchestration/directive.rs
+++ b/makima/src/orchestration/directive.rs
@@ -165,7 +165,9 @@ impl DirectiveOrchestrator {
{merge_preamble}\
INSTRUCTIONS:\n{task_plan}\n\
When done, the system will automatically mark this step as completed.\n\
- If you cannot complete the task, report the failure clearly.",
+ If you cannot complete the task, report the failure clearly.\n\n\
+ If you need clarification or encounter a decision that requires user input, you can ask:\n\
+ \x20 makima directive ask \"Your question\" --phaseguard",
directive_title = step.directive_title,
step_name = step.step_name,
description = step.step_description.as_deref().unwrap_or("(none)"),
@@ -1308,7 +1310,9 @@ fn build_planning_prompt(
\x20 makima directive remove-step <step_id>\n\
2. Then, add new steps for the updated goal. Use generation {}.\n\
3. New steps that build on completed work MUST use --depends-on to inherit the worktree.\n\
- 4. Ensure the new plan fully addresses the UPDATED goal.\n\n",
+ 4. Ensure the new plan fully addresses the UPDATED goal.\n\
+ 5. If the updated goal is unclear or ambiguous, ask the user for clarification using:\n\
+ \x20 makima directive ask \"<question>\" --phaseguard\n\n",
generation
));
}
@@ -1359,6 +1363,28 @@ Guidelines:
they should BOTH list that prior step in dependsOn.
IMPORTANT: Each step's taskPlan must be self-contained. The executing instance won't have your planning context.
+
+ASKING QUESTIONS:
+If you need clarification from the user before finalizing the plan, you can ask questions:
+ makima directive ask "Your question here"
+ makima directive ask "Which approach?" --choices "Option A,Option B" --phaseguard
+ makima directive ask "Confirm this approach?" --context "Additional context here" --phaseguard
+
+Use --phaseguard for questions that block progress (the question will wait indefinitely for a response).
+Without --phaseguard, questions timeout based on the directive's reconcile mode:
+- Reconcile ON: questions block indefinitely until answered
+- Reconcile OFF: questions timeout after 30 seconds with no response
+
+When to ask:
+- Requirements are ambiguous and multiple interpretations are valid
+- There are multiple equally valid technical approaches
+- You need domain-specific knowledge that cannot be inferred from the codebase
+- A decision has significant downstream impact and user preference matters
+
+Do NOT ask questions for:
+- Implementation details you can determine from the codebase
+- Standard engineering decisions with clear best practices
+- Trivial choices that do not significantly affect the outcome
"#,
title = directive.title,
goal = directive.goal,
@@ -1480,6 +1506,9 @@ Already-merged branches will be a no-op. If a merge fails with conflicts:
1. First try: `git merge --abort` then retry with `git merge <the-failing-branch> -X theirs --no-edit`
2. If that also fails, manually resolve the conflicts, `git add .`, and `git commit --no-edit`
3. Continue with remaining merges
+
+If you encounter issues you cannot resolve (e.g., persistent merge conflicts, PR update failures), you can ask for help:
+ makima directive ask "Your question" --phaseguard
"#,
title = directive.title,
goal = directive.goal,
@@ -1539,6 +1568,9 @@ For each step branch merge, if a merge fails with conflicts:
1. First try: `git merge --abort` then retry with `git merge <the-failing-branch> -X theirs --no-edit`
2. If that also fails, manually resolve the conflicts, `git add .`, and `git commit --no-edit`
3. Continue with remaining merges
+
+If you encounter issues you cannot resolve (e.g., persistent merge conflicts, PR creation failures), you can ask for help:
+ makima directive ask "Your question" --phaseguard
"#,
title = directive.title,
goal = directive.goal,
@@ -1679,7 +1711,10 @@ makima directive remove-step <step_id>
6. After processing all steps, report a summary of what was cleaned up and what was left.
-IMPORTANT: Only remove steps whose task branches have been verified as merged. Never remove unmerged steps."#,
+IMPORTANT: Only remove steps whose task branches have been verified as merged. Never remove unmerged steps.
+
+If you encounter issues you cannot resolve during cleanup, you can ask for help:
+ makima directive ask "Your question" --phaseguard"#,
title = directive.title,
pr_branch = pr_branch,
base_branch = base_branch,
@@ -1900,6 +1935,29 @@ Guidelines:
they should BOTH list that prior step in dependsOn.
IMPORTANT: Each step's taskPlan must be self-contained. The executing instance won't have your planning context.
+
+## Asking Questions
+
+If you need clarification about the goal, requirements, or implementation approach, you can ask the user:
+```bash
+makima directive ask "Your question here"
+```
+
+Options:
+- `--choices "opt1,opt2,opt3"` - Provide choices
+- `--context "<context>"` - Additional context
+- `--phaseguard` - Block until response (recommended for important questions)
+
+The question will appear in the directive UI. Behavior depends on reconcile mode:
+- Reconcile ON: blocks until user responds
+- Reconcile OFF: times out after 30s (use for non-critical questions)
+
+Use this when:
+- The goal is ambiguous and could be interpreted multiple ways
+- You need to choose between significantly different implementation approaches
+- You discover constraints that affect the plan
+
+Do NOT ask questions for trivial decisions — use your best judgment.
"#,
generation = generation,
));