feat(prompts): add editable system/planning/agent prompt files

Introduces ~/.todo-app/prompts/{system,planning,agent}.md as the canonical
location for prompt content. The settings modal exposes "Open in editor"
shortcuts for each, and TaskRunner merges system.md (always) and agent.md
(for "agent"-tagged tasks) into the effective system prompt alongside the
existing global/list/task layers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-04-25 10:10:50 +02:00
parent 6c54759aa0
commit 7f96ae9508
4 changed files with 124 additions and 7 deletions

View File

@@ -38,6 +38,10 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
public string LogsFolderPath { get; } = Path.Combine(Paths.AppDataRoot(), "logs");
public string WorkerConfigPath { get; } = Path.Combine(Paths.AppDataRoot(), "worker.config.json");
public string SystemPromptPath { get; } = PromptFiles.PathFor(PromptKind.System);
public string PlanningPromptPath { get; } = PromptFiles.PathFor(PromptKind.Planning);
public string AgentPromptPath { get; } = PromptFiles.PathFor(PromptKind.Agent);
public Action? CloseAction { get; set; }
public SettingsModalViewModel(WorkerClient worker)
@@ -199,4 +203,20 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
}
catch { /* ignore */ }
}
[RelayCommand]
private void OpenPrompt(string? kindName)
{
if (!Enum.TryParse<PromptKind>(kindName, ignoreCase: true, out var kind)) return;
try
{
PromptFiles.EnsureExists(kind);
var path = PromptFiles.PathFor(kind);
Process.Start(new ProcessStartInfo(path) { UseShellExecute = true });
}
catch (Exception ex)
{
StatusMessage = $"Open failed: {ex.Message}";
}
}
}