[repository-quality] Repository Quality Improvement Report - CLI Output Consistency (2026-05-14) #32125
Replies: 3 comments 1 reply
-
|
💥 WHOOSH! 🦸♂️ The Smoke Test Agent crashes through the wall... KA-POW! Just zoomed by to leave my mark on this discussion! 💨 ...and just like that, off into the sunset! 🌅✨
Warning Firewall blocked 6 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "accounts.google.com"
- "android.clients.google.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "safebrowsingohttpgateway.googleapis.com"
- "www.google.com"See Network Configuration for more information.
|
Beta Was this translation helpful? Give feedback.
-
|
/plan |
Beta Was this translation helpful? Give feedback.
-
|
This discussion has been marked as outdated by Repository Quality Improvement Agent. A newer discussion is available at Discussion #32379. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 Repository Quality Improvement Report - CLI Output Consistency
Analysis Date: 2026-05-14
Focus Area: Code Quality — CLI Output Consistency
Strategy Type: Standard
Custom Area: No
Executive Summary
Analysis of the
pkg/cli/package reveals a significant inconsistency in how diagnostic messages are written to stderr. Of the ~2,238 stderr write calls, approximately 699 (31%) bypass the establishedconsole.Format*helpers and write raw text viafmt.Fprintf/fmt.Fprintln. This breaks the visual language of the CLI — users see some messages with colour, icons, and formatting while others appear as plain text in the same session.The
pkg/consolepackage provides a complete set of formatting helpers (FormatInfoMessage,FormatSuccessMessage,FormatWarningMessage,FormatErrorMessage,FormatProgressMessage,FormatCommandMessage, etc.) that are already heavily used (1,539 calls). The AGENTS.md development guide mandates their use for all diagnostic output. The gap is concentrated in older or less-reviewed files:mcp_inspect_mcp.go(68 unformatted message writes),audit_report_render.go(52),audit_report_render_findings.go(35),enable.go(24), andengine_secrets.go/preconditions.go.Fixing this will improve the user experience, make the codebase consistent with documented conventions, and reduce friction for future contributors who look to existing code as examples.
Full Analysis Report
Focus Area: CLI Output Consistency
Current State Assessment
Metrics Collected:
pkg/cli/Top Files by Unformatted Writes (excluding blank-line spacers):
mcp_inspect_mcp.goaudit_report_render.goaudit_report_render_findings.goenable.goengine_secrets.gopreconditions.goshell_completion.godeps_report.goFindings
Strengths
pkg/consolepackage is comprehensive with 15+ formatting helpersaudit_report_render.goblank-line spacers (fmt.Fprintln(os.Stderr)) are intentional and acceptableAreas for Improvement
enable.go: 24 raw writes for user-facing workflow enable/disable feedback messages — e.g.,"Workflow %s is already enabled\n"should beFormatInfoMessage/FormatSuccessMessagemcp_inspect_mcp.go: 68 raw writes for MCP server inspection output — server names, tool listings, connection statusengine_secrets.go: ~28 raw writes for PAT setup instructions — ideal forFormatInfoMessageandFormatCommandMessagepreconditions.go: ~22 raw writes for authentication and GitHub Actions setup guidancedeps_report.go/shell_completion.go: ~20 raw writes eachDetailed Analysis
enable.goexample violations:engine_secrets.goexample violations:preconditions.goexample violations:🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: Split the following tasks into individual work items.
Improvement Tasks
Task 1: Migrate
enable.goto Console FormattingPriority: High
Estimated Effort: Small
Focus Area: Code Quality — CLI Output Consistency
Description: Replace all raw
fmt.Fprintf(os.Stderr, ...)andfmt.Fprintln(os.Stderr, ...)diagnostic message writes inpkg/cli/enable.gowith the appropriateconsole.Format*helpers. UseFormatInfoMessagefor status messages,FormatSuccessMessagefor completed actions,FormatWarningMessagefor already-done-nothing states, andFormatProgressMessagefor in-progress messages. Blank-line spacers (fmt.Fprintln(os.Stderr)) are acceptable and should remain.Acceptance Criteria:
enable.gouseconsole.Format*helpersfmt.Fprintf(os.Stderr, ...)with a message body is replaced; blank-linefmt.Fprintln(os.Stderr)may remainmake build && make fmt && make lintpasses with zero errorsCode Region:
pkg/cli/enable.goTask 2: Migrate
engine_secrets.goto Console FormattingPriority: High
Estimated Effort: Small
Focus Area: Code Quality — CLI Output Consistency
Description: Replace all raw stderr writes in
pkg/cli/engine_secrets.gowith appropriateconsole.Format*helpers. This file outputs PAT setup instructions and token configuration guidance — currently all plain text. UsingFormatInfoMessage,FormatPromptMessage, andFormatCommandMessagewill make these instructions visually consistent with the rest of the CLI.Acceptance Criteria:
engine_secrets.gouseconsole.Format*helpersFormatCommandMessageorFormatInfoMessagemake build && make fmt && make lintpasses with zero errorsCode Region:
pkg/cli/engine_secrets.goTask 3: Migrate
preconditions.goto Console FormattingPriority: Medium
Estimated Effort: Small
Focus Area: Code Quality — CLI Output Consistency
Description: Replace all raw stderr writes in
pkg/cli/preconditions.gowithconsole.Format*helpers. This file outputs authentication guidance and GitHub Actions enablement instructions — these are the first messages many users see when something is misconfigured, so visual polish here is high-impact.Acceptance Criteria:
preconditions.gouseconsole.Format*helpersFormatWarningMessageorFormatPromptMessageFormatCommandMessagemake build && make fmt && make lintpasses with zero errorsCode Region:
pkg/cli/preconditions.goTask 4: Migrate
mcp_inspect_mcp.goto Console FormattingPriority: Medium
Estimated Effort: Medium
Focus Area: Code Quality — CLI Output Consistency
Description:
pkg/cli/mcp_inspect_mcp.gohas ~68 unformatted message writes — the highest count of any CLI file. This file outputs MCP server inspection output including server names, tool listings, and connection status. Replace raw writes withconsole.Format*helpers throughout.Acceptance Criteria:
console.Format*helpers or are intentional structured outputFormatInfoMessageFormatListItemwhere appropriatemake build && make fmt && make lintpasses with zero errorsCode Region:
pkg/cli/mcp_inspect_mcp.goTask 5: Migrate
deps_report.goandshell_completion.goto Console FormattingPriority: Low
Estimated Effort: Small
Focus Area: Code Quality — CLI Output Consistency
Description: Migrate the remaining ~20 raw stderr writes in
pkg/cli/deps_report.goandpkg/cli/shell_completion.goto useconsole.Format*helpers. These are lower-priority files but completing them will bring the overall raw-write rate below 20%.Acceptance Criteria:
console.Format*helpersmake build && make fmt && make lintpasses with zero errorspkg/cli/drops below 25%Code Region:
pkg/cli/deps_report.go,pkg/cli/shell_completion.go📊 Historical Context
Previous Focus Areas
🎯 Recommendations
Immediate Actions (This Week)
enable.goto console formatting — Priority: Highengine_secrets.goto console formatting — Priority: HighShort-term Actions (This Month)
preconditions.goto console formatting — Priority: Mediummcp_inspect_mcp.goto console formatting — Priority: MediumLong-term Actions (This Quarter)
linters/) to enforceconsole.Format*usage and prevent regressions — Priority: Low📈 Success Metrics
Next Steps
References:
Beta Was this translation helpful? Give feedback.
All reactions