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:
@@ -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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,6 +201,38 @@
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- PROMPTS -->
|
||||
<StackPanel Spacing="0">
|
||||
<TextBlock Classes="section-label" Text="PROMPTS"/>
|
||||
<Border Classes="section">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="90,*,Auto" RowSpacing="8">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Classes="field-label" Text="System"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Classes="path-mono"
|
||||
Text="{Binding SystemPromptPath}" VerticalAlignment="Center"/>
|
||||
<Button Grid.Row="0" Grid.Column="2" Content="Open in editor"
|
||||
Command="{Binding OpenPromptCommand}"
|
||||
CommandParameter="System"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Classes="field-label" Text="Planning"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Classes="path-mono"
|
||||
Text="{Binding PlanningPromptPath}" VerticalAlignment="Center"/>
|
||||
<Button Grid.Row="1" Grid.Column="2" Content="Open in editor"
|
||||
Command="{Binding OpenPromptCommand}"
|
||||
CommandParameter="Planning"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Classes="field-label" Text="Agent"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Classes="path-mono"
|
||||
Text="{Binding AgentPromptPath}" VerticalAlignment="Center"/>
|
||||
<Button Grid.Row="2" Grid.Column="2" Content="Open in editor"
|
||||
Command="{Binding OpenPromptCommand}"
|
||||
CommandParameter="Agent"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- ABOUT -->
|
||||
<StackPanel Spacing="0">
|
||||
<TextBlock Classes="section-label" Text="ABOUT"/>
|
||||
|
||||
Reference in New Issue
Block a user