using ClaudeDo.Data;
using Xunit;

namespace ClaudeDo.Data.Tests;

public class SystemPromptTests
{
    [Fact]
    public void SystemDefault_mentions_SuggestImprovement_offload()
    {
        var prompt = PromptFiles.DefaultFor(PromptKind.System);
        Assert.Contains("Out-of-scope improvements", prompt);
        Assert.Contains("SuggestImprovement", prompt);
    }

    [Fact]
    public void ImprovementChildDefault_is_present_and_scopes_narrow()
    {
        var prompt = PromptFiles.DefaultFor(PromptKind.ImprovementChild);
        Assert.False(string.IsNullOrWhiteSpace(prompt));
        Assert.Contains("follow-up", prompt, StringComparison.OrdinalIgnoreCase);
        Assert.Contains("nothing more", prompt, StringComparison.OrdinalIgnoreCase);
    }

    [Fact]
    public void SystemDefault_clarifies_worktree_commit_is_not_auto_commit()
    {
        var prompt = PromptFiles.DefaultFor(PromptKind.System);
        Assert.Contains("not an unrequested auto-commit", prompt);
        Assert.Contains("never commit on `main`", prompt);
        Assert.Contains("commit SHA", prompt);
    }

    [Fact]
    public void ImprovementChildDefault_clarifies_worktree_commit_is_not_auto_commit()
    {
        var prompt = PromptFiles.DefaultFor(PromptKind.ImprovementChild);
        Assert.Contains("not an unrequested auto-commit", prompt);
        Assert.Contains("commit SHA", prompt);
    }
}
