From 50c85635c8ab1030a4976ec49e0d2da8fd290a58 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Tue, 14 Oct 2025 16:15:14 -0700 Subject: [PATCH] feat: Normalize prefix by stripping trailing hyphens in bd init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensures exactly one hyphen between prefix and issue number regardless of whether user provides trailing hyphen. Before: bd init --prefix wy- → Issues: wy--1, wy--2 (double hyphen) bd init --prefix wy → Issues: wy-1, wy-2 (single hyphen) After: bd init --prefix wy- → Issues: wy-1, wy-2 (single hyphen) bd init --prefix wy → Issues: wy-1, wy-2 (single hyphen) The hyphen is added automatically during ID generation in CreateIssue(), so the stored prefix should never include trailing hyphens. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- cmd/bd/init.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/bd/init.go b/cmd/bd/init.go index d19ecbbd..b52389a5 100644 --- a/cmd/bd/init.go +++ b/cmd/bd/init.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "github.com/fatih/color" "github.com/spf13/cobra" @@ -28,6 +29,10 @@ and database file. Optionally specify a custom issue prefix.`, prefix = filepath.Base(cwd) } + // Normalize prefix: strip trailing hyphens + // The hyphen is added automatically during ID generation + prefix = strings.TrimRight(prefix, "-") + // Create .beads directory beadsDir := ".beads" if err := os.MkdirAll(beadsDir, 0750); err != nil {