[repository-quality] Repository Quality Improvement Report — Cobra Example Field Migration & Help Text Completeness #38844
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-06-13T14:05:23.252Z.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 Repository Quality Improvement Report - Cobra Example Field Migration & Help Text Completeness
Analysis Date: 2026-06-12
Focus Area: Cobra Example Field Migration & Help Text Completeness
Strategy Type: Custom (random=33, 60% tier)
Executive Summary
Auditing the 40+ cobra command definitions across
pkg/cli/reveals that zero commands use the cobra-standardExample:field. All examples are embedded insideLong:as inline prose sections. This is non-idiomatic and blocks futurecobra/docdocumentation generation. A secondary gap:env getandenv updatesubcommands (pkg/cli/env_command.go) have noLong:description at all — users see only a single-sentenceShort:when running--help, with no explanation of default file paths, scope semantics, or flag interaction rules.Both issues carry zero logic risk to fix and have clear acceptance criteria.
Metrics Collected:
pkg/cli/Example:field (cobra standard)Long:envsubcommands missingLong:get,update)cobra/docgenerator present in repoAnalysis Details & Current State
All 22+ commands that include usage examples use an inline hand-written
"Examples:\n"header inside theirLong:field, e.g.:pkg/cli/logs_command.golines 51–97: 30+ annotated example lines inLong:pkg/cli/audit.golines 70–85: 12 example lines mixed with prose inLong:pkg/cli/add_command.golines 62–75: 8 example lines usingCLIExtensionPrefixinLong:The
env getandenv updatesubcommands (pkg/cli/env_command.go:133,161) have only aShort:field. Theupdatecommand has 6 flags (--scope,--dry-run,--yes,--repo,--org,--enterprise) with non-obvious interaction rules, none of which are documented inLong:.Impact:
cobra/doc.GenMarkdownTree()reads fromcmd.Example, not from prose inLong:. If documentation generation is added, all 22+ commands produce empty Examples sections. The inline pattern also makes examples harder to extract and test programmatically.🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: Split the following tasks into individual work items.
Improvement Tasks
Task 1: Add
Long:+Example:toenv getandenv updatePriority: High
Estimated Effort: Small
Focus Area: Help Text Completeness
Description: In
pkg/cli/env_command.go, addLong:descriptions andExample:fields tonewDefaultsGetCommand()andnewDefaultsUpdateCommand(). Forget: explain thefile.ymldefault path, that--scopedefaults torepo, and when--orgis needed. Forupdate: explainfile.ymldefault, that--scopeis required, and what--dry-run/--yesdo. Each command needs ≥3 example invocations in anExample:field usingstring(constants.CLIExtensionPrefix).Acceptance Criteria:
newDefaultsGetCommand()hasLong:(≥3 sentences) andExample:(≥3 invocations)newDefaultsUpdateCommand()hasLong:(≥3 sentences) andExample:(≥3 invocations)go build ./...passesgh aw env get --helpshows prose then a distinctExamples:sectionCode Region:
pkg/cli/env_command.goTask 2: Migrate
logs_command.goExamples fromLong:toExample:FieldPriority: High
Estimated Effort: Small
Focus Area: Cobra Example Field Migration
Description:
pkg/cli/logs_command.gohas 30+ example invocations in itsLong:field (lines ~51–97) under a hand-written"Examples:\n"header. Move the entire examples block into theExample:field on the cobra.Command struct, leaving only prose inLong:.Acceptance Criteria:
Long:contains no"Examples:"header and nogh aw ...example linesExample:field has all examples with two-space indentationgo build ./...passes;gh aw logs --helpshowsExamples:section after flagsCode Region:
pkg/cli/logs_command.go:33-97Task 3: Migrate
audit.goandadd_command.gotoExample:FieldPriority: Medium
Estimated Effort: Small
Focus Area: Cobra Example Field Migration
Description: Apply the same
Long:→Example:migration topkg/cli/audit.go(13 CLIExtensionPrefix refs in Long:, lines ~70–85) andpkg/cli/add_command.go(8 CLIExtensionPrefix refs in Long:, lines ~62–75).Acceptance Criteria:
Long:has prose only,Example:has all example invocationsgo build ./...passes;--helpfor each showsExamples:sectionCode Region:
pkg/cli/audit.go:47-90,pkg/cli/add_command.go:54-145Task 4: Batch-Migrate Remaining ~18 Commands to
Example:FieldPriority: Medium
Estimated Effort: Medium
Focus Area: Cobra Example Field Migration
Description: After Tasks 2 & 3 establish the pattern, apply the same
Long:→Example:refactor to all remaining commands with embedded examples:add_wizard_command.go,audit_diff_command.go,checks_command.go,completion_command.go,deploy_command.go,domains_command.go,experiments_command.go(3 sub-commands),fix_command.go,forecast_command.go,hash_command.go,health_command.go,init_command.go,list_workflows_command.go,outcomes_command.go,tokens_bootstrap.go,update_command.go,upgrade_command.go,validate_command.go,view_command.go.Acceptance Criteria:
grep -rn '"Examples:' pkg/cli/*.go | grep -v _testreturns zero results in Long: stringsgo build ./...andgo test ./pkg/cli/...passCode Region:
pkg/cli/— all *_command.go files listed above📊 Historical Context
Previous Focus Areas (last 5)
🎯 Recommendations
Immediate (This Week)
Long:+Example:toenv get/env update— High priority, small effortShort-term (This Month)
logs_command.go,audit.go,add_command.go— High/MediumLong-term (This Quarter)
cobra/docdocumentation generation target toMakefile— Low priority📈 Success Metrics
Example:field coverage: 0/40+ → 40+/40+ commandsLong:: 2 → 0References: §27419934549
Generated by Repository Quality Improvement Agent
Beta Was this translation helpful? Give feedback.
All reactions