feat(prompts): externalize prompt kinds with defaults and token renderer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
46
tests/ClaudeDo.Data.Tests/PromptFilesTests.cs
Normal file
46
tests/ClaudeDo.Data.Tests/PromptFilesTests.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using ClaudeDo.Data;
|
||||
|
||||
namespace ClaudeDo.Data.Tests;
|
||||
|
||||
public class PromptFilesTests
|
||||
{
|
||||
[Fact]
|
||||
public void RenderTemplate_replaces_known_tokens()
|
||||
{
|
||||
var outp = PromptFiles.RenderTemplate(
|
||||
"Plan for {date}, cap {maxTasks}.",
|
||||
new Dictionary<string, string> { ["date"] = "2026-06-04", ["maxTasks"] = "5" });
|
||||
Assert.Equal("Plan for 2026-06-04, cap 5.", outp);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RenderTemplate_leaves_unknown_braces_intact()
|
||||
{
|
||||
var outp = PromptFiles.RenderTemplate(
|
||||
"## {Wochentag}, {dd.MM.yyyy} — {start}",
|
||||
new Dictionary<string, string> { ["start"] = "01.06.2026" });
|
||||
Assert.Equal("## {Wochentag}, {dd.MM.yyyy} — 01.06.2026", outp);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DefaultFor_system_mentions_blocked_marker_and_scope()
|
||||
{
|
||||
var d = PromptFiles.DefaultFor(PromptKind.System);
|
||||
Assert.Contains("CLAUDEDO_BLOCKED:", d);
|
||||
Assert.Contains("unattended", d, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DefaultFor_planning_initial_has_title_and_description_tokens()
|
||||
{
|
||||
var d = PromptFiles.DefaultFor(PromptKind.PlanningInitial);
|
||||
Assert.Contains("{title}", d);
|
||||
Assert.Contains("{description}", d);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PathFor_planning_is_planning_system_file()
|
||||
{
|
||||
Assert.EndsWith("planning-system.md", PromptFiles.PathFor(PromptKind.Planning));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user