From 935096fef34ee9e6e3d83594113a803ea0c2682f Mon Sep 17 00:00:00 2001 From: Gary Date: Thu, 12 Mar 2026 13:15:20 -0500 Subject: [PATCH] Teach bd prime to use atomic claim guidance --- cmd/bd/prime.go | 4 ++-- cmd/bd/prime_test.go | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cmd/bd/prime.go b/cmd/bd/prime.go index a73a3a3160..724ee01be1 100644 --- a/cmd/bd/prime.go +++ b/cmd/bd/prime.go @@ -442,7 +442,7 @@ git push # Push to remote ### Creating & Updating - ` + "`bd create --title=\"Summary of this issue\" --description=\"Why this issue exists and what needs to be done\" --type=task|bug|feature --priority=2`" + ` - New issue - Priority: 0-4 or P0-P4 (0=critical, 2=medium, 4=backlog). NOT "high"/"medium"/"low" -- ` + "`bd update --status=in_progress`" + ` - Claim work +- ` + "`bd update --claim`" + ` - Claim work - ` + "`bd update --assignee=username`" + ` - Assign to someone - ` + "`bd update --title/--description/--notes/--design`" + ` - Update fields inline - ` + "`bd close `" + ` - Mark complete @@ -468,7 +468,7 @@ git push # Push to remote ` + "```bash" + ` bd ready # Find available work bd show # Review issue details -bd update --status=in_progress # Claim it +bd update --claim # Claim it ` + "```" + ` ` + completingWorkflow + ` diff --git a/cmd/bd/prime_test.go b/cmd/bd/prime_test.go index 3d438a255c..7a473d93d6 100644 --- a/cmd/bd/prime_test.go +++ b/cmd/bd/prime_test.go @@ -156,6 +156,24 @@ func TestOutputContextFunction(t *testing.T) { } } +func TestPrimeClaimGuidanceUsesAtomicClaim(t *testing.T) { + defer stubIsEphemeralBranch(false)() + defer stubPrimeHasGitRemote(true)() + + var buf bytes.Buffer + if err := outputPrimeContext(&buf, false, false); err != nil { + t.Fatalf("outputPrimeContext failed: %v", err) + } + + output := buf.String() + if !strings.Contains(output, "bd update --claim") { + t.Fatal("prime output should teach bd update --claim") + } + if strings.Contains(output, "bd update --status=in_progress") { + t.Fatal("prime output should not teach bd update --status=in_progress") + } +} + // stubIsEphemeralBranch temporarily replaces isEphemeralBranch // with a stub returning returnValue. //