docs: add an "add a command" checklist to AGENTS.md#1057
Open
joshrotenberg wants to merge 1 commit into
Open
Conversation
Part of #1049 (Phase 3, CODE-09). The enterprise command groups share one dispatch shape, but it was only discoverable by reading the existing modules. Document it: where the clap enum goes, the handle_x_command free function signature taking &ConnectionManager, the handler bodies in a sibling *_impl.rs, and the mod.rs and main.rs wiring. Records the two placement conventions in the tree (cli/enterprise.rs for database/cluster/node/crdb, commands/enterprise/<name>.rs for logs/module) rather than picking one, and notes the logs dispatch-in-_impl and clone-at-call-site variations as pre-existing.
joshrotenberg
marked this pull request as ready for review
July 25, 2026 21:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1049 (Phase 3, CODE-09). Docs-only; no code touched.
Problem
The enterprise command groups share one dispatch shape, but it is only discoverable by reading an existing module and inferring the convention. #1049 Phase 3 calls for writing it down.
Change
A new
## Adding a Commandsection in AGENTS.md, between the module-organization notes and the conventions section. It covers:commands/enterprise/<name>.rs), implementation module (commands/enterprise/<name>_impl.rs).EnterpriseCommandsvariant, write the dispatch function, write the handlers, register both modules inmod.rs, wire the match arm inmain.rs, run fmt/clippy/test.conn_mgr.create_enterprise_client(profile_name),handle_output,resolve_autoandprint_formatted_output, and where those helpers come from (super::utils::*, re-exportingcrate::output).Placement conventions
Enum placement genuinely varies in the tree and both forms are current, so the checklist records both rather than declaring one wrong:
cli/enterprise.rsasEnterprise<Name>Commandsfordatabase,cluster,node,crdbcommands/enterprise/<name>.rsas<Name>Commandsforlogs,moduleIt suggests
cli/enterprise.rsfor flag-heavy groups, and notes two pre-existing variations that are not worth churning:logskeeps its dispatch function inlogs_impl.rs, and some oldermain.rscall sites pass the command enum by value.Checks
markdownlint AGENTS.md --disable MD013 MD033 MD041(the flags CI uses) reports no errors in the new section. The pre-existing errors elsewhere in the file are unchanged, and that job iscontinue-on-errorindocs.ymlregardless. No Rust changed.Relationship to #1056
Independent. #1056 converts
alerts/license/license_workflowto this pattern; this PR documents the pattern. Either can land first. Together they close #1049 Phase 3.