✨ (go/v4): Add AGENTS.md to the projects#5273
✨ (go/v4): Add AGENTS.md to the projects#5273k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
Conversation
|
c/c @vitorfloriano could you please give a hand on the review |
33016b1 to
de4eaba
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds AGENTS.md files to Kubebuilder v4 Go projects to provide AI agents with comprehensive guidance about project structure, critical rules, CLI commands, and best practices. The file is automatically generated during project initialization and includes context-aware documentation that adapts to different CLI tools (e.g., kubebuilder vs operator-sdk).
Key Changes
- Added a new template file
agents.gothat scaffolds AGENTS.md with comprehensive documentation for AI agents - Integrated the template into the init scaffolder to generate AGENTS.md at project creation
- Updated all test data directories with generated AGENTS.md files
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
pkg/plugins/golang/v4/scaffolds/internal/templates/agents.go |
New template that generates AGENTS.md with project structure, CLI commands, and best practices |
pkg/plugins/golang/v4/scaffolds/init.go |
Integrated the Agents template into the init scaffolder |
testdata/project-v4/AGENTS.md |
Generated AGENTS.md for project-v4 test data |
testdata/project-v4-with-plugins/AGENTS.md |
Generated AGENTS.md for project-v4-with-plugins test data |
testdata/project-v4-multigroup/AGENTS.md |
Generated AGENTS.md for project-v4-multigroup test data |
docs/book/src/multiversion-tutorial/testdata/project/AGENTS.md |
Generated AGENTS.md for multiversion tutorial test data |
docs/book/src/getting-started/testdata/project/AGENTS.md |
Generated AGENTS.md for getting started tutorial test data |
docs/book/src/cronjob-tutorial/testdata/project/AGENTS.md |
Generated AGENTS.md for cronjob tutorial test data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vitorfloriano
left a comment
There was a problem hiding this comment.
Couldn't we add instructions for building, packaging and deploying the project?
Also, I think it could be useful to add a list with the necessary toolchain for development workflow (kind, kubectl, etc...) just so the agent checks that the user has all the tools needed before trying to work around constraints.
WDYT?
de4eaba to
23d62b5
Compare
|
Hi @vitorfloriano, thanks for the review 🙂 I tried to address your comment in a way that stays generic enough. We need to be careful not to be too opinionated, since users can customize their environments and workflows. About build / package / deploy instructions: I’m not sure this adds much value for AI commands. Packaging and distribution are often project-specific and usually handled by release pipelines. There are many ways to do it, so it’s hard to define something that works well for most cases. We should also avoid adding versions or very specific steps, as those can get outdated quickly. For the toolchain list (kind, kubectl, etc.), it can be useful, but I think we should keep it light. Users may use different tools, and we don’t want to force a single workflow. Overall, I tried to keep things helpful but flexible. WDYT? |
23d62b5 to
d81f8aa
Compare
vitorfloriano
left a comment
There was a problem hiding this comment.
@camilamacedo86 Yeah, giving a second thought, I think keeping it generic is best. The addition of AGENTS.md is already a nice change that checks the "AI" box.
Maybe we could add a comment saying that this file was generated but users can customize it. Also, we could link to agents.md where users can learn more about how to write their instructions.
But it is already good as is.
|
Thank you for checking it out.
It is the default behvaiour for all already. |
d81f8aa to
8ace34d
Compare
Assisted-by: CLAUDE
8ace34d to
c7a03a5
Compare
|
I did some changes to try shape and improve it. |
|
/test pull-kubebuilder-e2e-k8s-1-32-0 |
|
/test pull-kubebuilder-e2e-k8s-1-33-0 |
vitorfloriano
left a comment
There was a problem hiding this comment.
I think this version covers the essential. Users can always adjust this file to their specific needs, if necessary.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, vitorfloriano The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@camilamacedo86: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/test pull-kubebuilder-e2e-k8s-1-34-0 |
Closes: #5229