From 0e6a48e26866378273bf495cf333bbcef6b4f4d3 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Thu, 1 Oct 2026 12:15:20 +0200 Subject: [PATCH] feat(prompts): merge helper knows company-repo approve ends in a draft PR --- src/ClaudeDo.Data/PromptFiles.cs | 6 +++++- tests/ClaudeDo.Data.Tests/PromptFilesTests.cs | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ClaudeDo.Data/PromptFiles.cs b/src/ClaudeDo.Data/PromptFiles.cs index 5024a539..ee6b01f5 100644 --- a/src/ClaudeDo.Data/PromptFiles.cs +++ b/src/ClaudeDo.Data/PromptFiles.cs @@ -552,6 +552,10 @@ public static class PromptFiles - Prefer the MCP tools whenever they apply. Only if the MCP tools cannot reach an in-progress merge may you finish it by hand: resolve the markers, then `git add -- ` and `git commit` — NEVER `git add -A` or a bare commit, because the checkout is shared with other sessions. - Never use raw `git merge`, `git reset`, or `git checkout` to force a merge. Drive merges through the MCP tools; hand-resolution is only for markers the tools left and cannot finish. + ## Company repos (Azure DevOps) + + If the list's repo is a company repo (origin on the Azure DevOps Server), approve does not merge anything locally: review_task approve runs the verify command in the task's own worktree, pushes its branch and opens a draft PR (or reuses the one already open for that branch). mergeStatus is "pr_created" or "pr_updated" and mergeMessage is the PR URL; the task deliberately stays WaitingForReview until the user merges the PR on Azure DevOps and ticks it Done. There are no merge conflicts to resolve and main does not move, so skip preview_merge_set's merge-order reasoning, do NOT call verify_merges (the verify already ran inside approve, skipVerify is ignored there), and treat "erst mergen, dann neu starten" as harmless. A blocked result names what failed (no Azure DevOps PAT, push rejected, or "gepusht, PR fehlgeschlagen: …" when the push landed but the PR call did not) — report it, do not retry blindly. In the Phase 5 summary, list every PR link. + ## Verify once — after the last merge When every merge above is done (including conflict resolutions), call verify_merges with the ids of ALL tasks that reported merged_verify_pending. It runs the list's verify command a single time and promotes them all to Done on success — that is the per-merge gate you skipped, paid once. @@ -600,7 +604,7 @@ public static class PromptFiles ## Phase 5 — Summary Print one line per task from the brief: - title — final status — merge commit (if any) — conflicts resolved (if any) — verify-failed (yes/no). + title — final status — merge commit or PR link (if any) — conflicts resolved (if any) — verify-failed (yes/no). Then list anything you skipped or left for the user and why, and any follow-ups worth turning into new tasks. """; diff --git a/tests/ClaudeDo.Data.Tests/PromptFilesTests.cs b/tests/ClaudeDo.Data.Tests/PromptFilesTests.cs index ff3d7362..79540936 100644 --- a/tests/ClaudeDo.Data.Tests/PromptFilesTests.cs +++ b/tests/ClaudeDo.Data.Tests/PromptFilesTests.cs @@ -212,6 +212,16 @@ public class PromptFilesTests Assert.Contains("Never use raw `git merge`", d); } + [Fact] + public void DefaultFor_merge_helper_merge_explains_company_repo_draft_prs() + { + var d = PromptFiles.DefaultFor(PromptKind.MergeHelperMerge); + Assert.Contains("pr_created", d); + Assert.Contains("pr_updated", d); + Assert.Contains("do NOT call verify_merges", d); + Assert.Contains("list every PR link", d); + } + [Fact] public void DefaultFor_merge_helper_merge_runs_all_merges_before_any_rerun() {