diff --git a/src/ClaudeDo.Data/PromptFiles.cs b/src/ClaudeDo.Data/PromptFiles.cs index 46bb7f55..748b0cf3 100644 --- a/src/ClaudeDo.Data/PromptFiles.cs +++ b/src/ClaudeDo.Data/PromptFiles.cs @@ -260,6 +260,13 @@ public static class PromptFiles - Before claiming done, verify: run the build and relevant tests, confirm they pass, and report what you ran. If you couldn't verify something, say so plainly. - Make focused commits using the repository's existing commit-message convention. + You are on this task's own branch in its own worktree — a commit here is the + deliverable, not an unrequested auto-commit; a rule against auto-committing + protects `main` and shared checkouts, neither of which is this. Still never + push, never commit on `main`, and never `git add -A` or a bare `git commit` + in a checkout other sessions share. + - Report the real outcome, including the commit SHA if you made one. Don't say + no commit was made when there was. ## Safety - Never force-push, hard-reset, or delete branches/files beyond the task's scope @@ -298,7 +305,10 @@ public static class PromptFiles - Touch as few files as possible. Do not restructure unrelated code. - Do NOT file further improvements — improvements are one layer deep. - Verify the build and relevant tests before finishing, and report what you ran. - - Make one focused commit using the repository's commit-message convention. + - Make one focused commit in this task's own worktree using the repository's + commit-message convention — that commit is the deliverable, not an unrequested auto-commit. + Report the real outcome, including the commit SHA; don't say no commit was + made when there was. """; private const string PlanningSystemDefault = """ diff --git a/tests/ClaudeDo.Data.Tests/SystemPromptTests.cs b/tests/ClaudeDo.Data.Tests/SystemPromptTests.cs index 7ebacd4f..a375a7bc 100644 --- a/tests/ClaudeDo.Data.Tests/SystemPromptTests.cs +++ b/tests/ClaudeDo.Data.Tests/SystemPromptTests.cs @@ -21,4 +21,21 @@ public class SystemPromptTests 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); + } }