Description
Multiple files in pkg/cli/ use repeated fmt.Fprintln(os.Stderr, "") calls for spacing between output sections. This pattern is scattered across at least 5 files and repeated many times (e.g., run_interactive.go:78-80,99-103, outcomes_history.go:171, mcp_inspect.go many locations).
A centralized console.Spacing() helper would eliminate the duplication, make intent explicit, and allow future styling (e.g., TTY-adaptive spacing) without touching all call sites.
Suggested Changes
- Add
func Spacing() (and optionally func SpacingN(n int)) to pkg/console/console.go
- Replace all
fmt.Fprintln(os.Stderr, "") spacing calls across pkg/cli/ with console.Spacing()
- Ensure the helper writes to
os.Stderr consistent with existing console helpers
Files Affected
pkg/console/console.go — add Spacing() helper
pkg/cli/run_interactive.go lines 78-80, 99-103
pkg/cli/outcomes_history.go line 171
pkg/cli/mcp_inspect.go (multiple locations)
- Other
pkg/cli/ files with the same pattern
Success Criteria
- No
fmt.Fprintln(os.Stderr, "") calls remain in pkg/cli/ for blank-line spacing
- New
console.Spacing() helper is documented and used consistently
- All existing tests pass with identical output
Source
Extracted from Terminal Stylist Console Output Analysis — 2026-07-14
Priority
Medium — reduces duplication and improves maintainability of console output layer
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 151.8 AIC · ⌖ 7.62 AIC · ⊞ 7K · ◷
Description
Multiple files in
pkg/cli/use repeatedfmt.Fprintln(os.Stderr, "")calls for spacing between output sections. This pattern is scattered across at least 5 files and repeated many times (e.g.,run_interactive.go:78-80,99-103,outcomes_history.go:171,mcp_inspect.gomany locations).A centralized
console.Spacing()helper would eliminate the duplication, make intent explicit, and allow future styling (e.g., TTY-adaptive spacing) without touching all call sites.Suggested Changes
func Spacing()(and optionallyfunc SpacingN(n int)) topkg/console/console.gofmt.Fprintln(os.Stderr, "")spacing calls acrosspkg/cli/withconsole.Spacing()os.Stderrconsistent with existing console helpersFiles Affected
pkg/console/console.go— addSpacing()helperpkg/cli/run_interactive.golines 78-80, 99-103pkg/cli/outcomes_history.goline 171pkg/cli/mcp_inspect.go(multiple locations)pkg/cli/files with the same patternSuccess Criteria
fmt.Fprintln(os.Stderr, "")calls remain inpkg/cli/for blank-line spacingconsole.Spacing()helper is documented and used consistentlySource
Extracted from Terminal Stylist Console Output Analysis — 2026-07-14
Priority
Medium — reduces duplication and improves maintainability of console output layer