The prime_schedules.prompt_override column existed end-to-end but was never populated or read. DailyPrepPrompt.BuildPrompt now takes an optional override and appends it as an extra paragraph after the fixed prompt (additive, never a replacement, so a user can't disable the required get_daily_prep_candidates/set_my_day flow). PrimeRunner passes schedule.PromptOverride through. The Prime tab in Settings now has a multiline field per schedule wired to a new PromptOverride property on PrimeScheduleRowViewModel (blank persists as null).
34 lines
1.3 KiB
C#
34 lines
1.3 KiB
C#
namespace ClaudeDo.Worker.Prime;
|
|
|
|
public static class DailyPrepPrompt
|
|
{
|
|
public const string CandidatesTool = "mcp__claudedo__get_daily_prep_candidates";
|
|
public const string SetMyDayTool = "mcp__claudedo__set_my_day";
|
|
|
|
public static string LogPath() =>
|
|
System.IO.Path.Combine(ClaudeDo.Data.Paths.AppDataRoot(), "logs", "daily-prep.log");
|
|
|
|
public static IReadOnlyList<string> BuildArgs(int maxTurns) =>
|
|
[
|
|
"-p", "--output-format", "stream-json", "--verbose",
|
|
"--permission-mode", "acceptEdits",
|
|
"--max-turns", maxTurns.ToString(),
|
|
"--allowedTools", CandidatesTool, SetMyDayTool,
|
|
];
|
|
|
|
public static string BuildPrompt(int maxTasks, DateOnly today, string? promptOverride = null)
|
|
{
|
|
var prompt = ClaudeDo.Data.PromptFiles.Render(
|
|
ClaudeDo.Data.PromptKind.DailyPrep,
|
|
new Dictionary<string, string>
|
|
{
|
|
["date"] = today.ToString("yyyy-MM-dd"),
|
|
["maxTasks"] = maxTasks.ToString(),
|
|
});
|
|
|
|
// Additive by design: a schedule's override is appended, never substituted, so a user
|
|
// can't accidentally break the mcp__claudedo__get_daily_prep_candidates/set_my_day flow.
|
|
return string.IsNullOrWhiteSpace(promptOverride) ? prompt : $"{prompt}\n\n{promptOverride}";
|
|
}
|
|
}
|