diff --git a/AGENTS.md b/AGENTS.md index 3f194e403..132ef0829 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,6 +9,8 @@ exist in `cmd/storage/`, `cmd/dns/`, `cmd/dbaas/` and are legacy. Read this file before writing any new command: `cmd/aiservices/deployment/deployment_create.go` +For subcommand placement in an existing group, also read `## Folder layout` below. + Skeleton: ```go @@ -65,6 +67,15 @@ Global alias vars to use for `CmdAliases()`: ## Folder layout +**Anti-pattern: don't extend flat layouts.** `cmd/storage/`, `cmd/dns/`, +`cmd/dbaas/` and similar are legacy flat groups. Adding or refactoring a +subcommand under one of them MUST promote the cluster to its own subpackage +following the layout already used elsewhere in the repo — +`cmd/aiservices/deployment/` is the canonical example (`deployment.go` +declares `var Cmd`; siblings live as `deployment_.go` in the same dir). +Concrete case in flight: `cmd/storage/storage_bucket_lifecycle*.go` -> +`cmd/storage/bucket/lifecycle/{lifecycle,lifecycle_show,lifecycle_set,lifecycle_delete}.go`. + New command group: ``` @@ -89,19 +100,20 @@ setup. See `cmd/aiservices/deployment/deployment_create_test.go`. ## File header on every AI-touched file Add a comment at the top of every file you create or modify. Use the -appropriate syntax for the language, and pick the right verb: +appropriate syntax for the language, and pick the right verb. Substitute +`` with your own identifier (e.g. `claude-sonnet-4.6`, `gpt-5`, etc.): ```go -// AI-generated by claude-sonnet-4.6 - not reviewed yet // new file -// AI-modified by claude-sonnet-4.6 - not reviewed yet // existing file +// AI-generated by - not reviewed yet // new file +// AI-modified by - not reviewed yet // existing file ``` ```yaml -# AI-generated by claude-sonnet-4.6 - not reviewed yet -# AI-modified by claude-sonnet-4.6 - not reviewed yet +# AI-generated by - not reviewed yet +# AI-modified by - not reviewed yet ``` ```html - - + + ``` The reviewer removes the line once they have read and approved the file.