From b4bc682d93cde4828a4424a43c0c81a588e5a413 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sat, 20 Dec 2025 02:38:00 -0800 Subject: [PATCH] feat(create): add require-description config option (GH#596) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add create.require-description config option that enforces descriptions when creating issues. When enabled, bd create will error if no description is provided (except for test issues). - Config in .beads/config.yaml or ~/.config/bd/config.yaml - Also supports BD_CREATE_REQUIRE_DESCRIPTION env var - Default: false (preserves current behavior with warning) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- cmd/bd/create.go | 18 ++++++++++++------ docs/CONFIG.md | 5 +++++ internal/config/config.go | 3 +++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/cmd/bd/create.go b/cmd/bd/create.go index c8d0fdcd..001f99c1 100644 --- a/cmd/bd/create.go +++ b/cmd/bd/create.go @@ -67,12 +67,18 @@ var createCmd = &cobra.Command{ // Get field values description, _ := getDescriptionFlag(cmd) - // Warn if creating an issue without a description (unless it's a test issue or silent mode) - if description == "" && !strings.Contains(strings.ToLower(title), "test") && !silent && !debug.IsQuiet() { - yellow := color.New(color.FgYellow).SprintFunc() - fmt.Fprintf(os.Stderr, "%s Creating issue without description.\n", yellow("⚠")) - fmt.Fprintf(os.Stderr, " Issues without descriptions lack context for future work.\n") - fmt.Fprintf(os.Stderr, " Consider adding --description=\"Why this issue exists and what needs to be done\"\n") + // Check if description is required by config + if description == "" && !strings.Contains(strings.ToLower(title), "test") { + if config.GetBool("create.require-description") { + FatalError("description is required (set create.require-description: false in config.yaml to disable)") + } + // Warn if creating an issue without a description (unless silent mode) + if !silent && !debug.IsQuiet() { + yellow := color.New(color.FgYellow).SprintFunc() + fmt.Fprintf(os.Stderr, "%s Creating issue without description.\n", yellow("⚠")) + fmt.Fprintf(os.Stderr, " Issues without descriptions lack context for future work.\n") + fmt.Fprintf(os.Stderr, " Consider adding --description=\"Why this issue exists and what needs to be done\"\n") + } } design, _ := cmd.Flags().GetString("design") diff --git a/docs/CONFIG.md b/docs/CONFIG.md index e8740e9e..5ade25c5 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -35,6 +35,7 @@ Tool-level settings you can configure: | `no-auto-flush` | `--no-auto-flush` | `BD_NO_AUTO_FLUSH` | `false` | Disable auto JSONL export | | `no-auto-import` | `--no-auto-import` | `BD_NO_AUTO_IMPORT` | `false` | Disable auto JSONL import | | `no-push` | `--no-push` | `BD_NO_PUSH` | `false` | Skip pushing to remote in bd sync | +| `create.require-description` | - | `BD_CREATE_REQUIRE_DESCRIPTION` | `false` | Require description when creating issues | | `db` | `--db` | `BD_DB` | (auto-discover) | Database path | | `actor` | `--actor` | `BD_ACTOR` | `$USER` | Actor name for audit trail | | `flush-debounce` | - | `BEADS_FLUSH_DEBOUNCE` | `5s` | Debounce time for auto-flush | @@ -71,6 +72,10 @@ daemon-log-compress: true # Compress rotated logs (default true) ```yaml # Project team prefers longer flush delay flush-debounce: 15s + +# Require descriptions on all issues (enforces context for future work) +create: + require-description: true ``` ### Why Two Systems? diff --git a/internal/config/config.go b/internal/config/config.go index 443f3bfe..47a9f177 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -109,6 +109,9 @@ func Initialize() error { // Push configuration defaults v.SetDefault("no-push", false) + // Create command defaults + v.SetDefault("create.require-description", false) + // Read config file if it was found if configFileSet { if err := v.ReadInConfig(); err != nil {