Repository navigation
Add AGENTS.md guidance for AI coding agents - #13980
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an AGENTS.md guide to onboard AI coding agents to the containerd repository, including how to build/lint/test, how the project is structured, and how to handle/triage security findings against the published threat model and operator baseline.
Changes:
- Introduces a new
AGENTS.mdwith build, lint, and test workflow guidance. - Summarizes key architecture concepts (modules, plugin system, runtime/CRI integration) to help agents navigate the codebase.
- Establishes security-reporting guidance aligned with
docs/security/*(threat model, triage guide, operator guidelines) and emphasizes private disclosure of suspected vulnerabilities.
Suppressed comments (1)
AGENTS.md:22
-raceis not enabled by default here:TESTFLAGS_RACEis empty in the Makefile unless the caller sets it. As written, this will send readers looking for a non-existent default behavior.
Run `make clean-test` only on a dedicated test host: it sends SIGKILL to every `containerd` and `runc` process, unmounts matching debris, and removes runtime state. `-race` is on by default for amd64 (`TESTFLAGS_RACE`).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (2)
AGENTS.md:63
- This sentence says all new files need the Apache license header, but existing Markdown docs in this repo (e.g., BUILDING.md, README.md) do not have that header. To avoid misleading guidance, please narrow this to "new source files" (or otherwise scope it) rather than implying it applies to documentation files too.
- The org-wide [containerd/project CONTRIBUTING.md](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) applies to all containerd repos: coordinate with maintainers before large or high-impact PRs, commit messages tell the story of the change, and a squashed series gets its message rewritten as one change. New files need the "Copyright The containerd Authors" Apache license header; CI validates it (`containerd/project-checks` in ci.yml).
AGENTS.md:64
- This bullet attributes trailer guidance ("AI tools never appear in Signed-off-by/Co-authored-by" and "Assisted-by is encouraged") to CONTRIBUTING.md, but CONTRIBUTING.md's "Automated and AI-generated contributions" section does not mention trailers. Consider removing the trailer guidance here or citing the document that actually defines that policy.
- CONTRIBUTING.md AI policy: PRs must be opened by a human (automated PR creation requires prior maintainer approval), and all AI-generated or AI-assisted content must be reviewed by its human author, who is responsible for its correctness. AI tools never appear in `Signed-off-by:` or `Co-authored-by:` trailers; an `Assisted-by:` trailer naming the tool is encouraged.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
CONTRIBUTING.md:75
- The wording here diverges from the repo’s established description of
ctr. SCOPE.md describesctras a barebones CLI intended for development/debugging with no stability guarantees, but not as “unsupported”, and it doesn’t state that “new features target the Go client API”. Consider aligning this bullet with the existing wording to avoid overclaiming support policy.
- `cmd` - All Go main packages and the packages used only for that main package; `ctr` is an unsupported debug CLI, and new features target the Go client API
513995d to
0416059
Compare
|
Quick update -- I tested these instructions by having an agent fix an open issue and had it report back the instructions where it stumbled and needed clarifying.
|
make test can succeed while skipping tests that require root. Explain how to enable those tests and where to find CRI test prerequisites. Add pull request expectations for documentation, testing, and CI follow-up. Assisted-by: Claude Code Signed-off-by: Chris Henzie <[email protected]>
3dbefb6 to
c44c465
Compare
There was a problem hiding this comment.
🟢 Approval recommended
Only minor documentation nits were identified; no blocking issue was reported.
Review details
Suppressed comments (2)
BUILDING.md:267
- This is broader than the repository's actual convention: several root-dependent tests use direct UID checks instead of
testutil.RequiresRoot(for exampleplugins/content/local/store_test.go:119andinternal/cri/server/podsandbox/helpers_linux_test.go:70). Those packages are not selected bymake root-test, so an agent following this wording could believe the root suite covered tests that still remain skipped. Limit the statement to tests using the helper and call out the direct-check exceptions.
A test that needs `root` calls `testutil.RequiresRoot`, which skips it unless
`-test.root` is passed. `make test` skips those tests and still succeeds, so check
whether the tests covering your change are among them. `make root-test` selects
the packages that call the helper and runs them with `-test.root`.
BUILDING.md:264
- This description omits the companion
testutil.RequiresRootMhelper, which is used byintegration/client/TestMainto gate an entire package on root. Please mention both helpers so agents do not assume every root-gated test callsRequiresRootdirectly.
A test that needs `root` calls `testutil.RequiresRoot`, which skips it unless
- Files reviewed: 5/5 changed files
- Comments generated: 0 new
- Review effort level: Lite
Give coding agents an entry point to the contribution, build, and subsystem documentation. Require security findings to meet the documented scope and evidence requirements before calling them vulnerabilities. Link CLAUDE.md to AGENTS.md so both filenames provide the same guidance. Assisted-by: Claude Code Signed-off-by: Chris Henzie <[email protected]>
c44c465 to
4659359
Compare
estesp
left a comment
There was a problem hiding this comment.
LGTM, thanks for working on this!
Add AGENTS.md as an entry point to containerd’s docs. Each pointer identifies when an agent should read the linked material. CLAUDE.md is a symlink to the same guidance.
For context, I started with Claude Code's
/initcommand, then revised the draft using the/writing-for-agentsskill to trim it down. The structure uses progressive disclosure: task-specific details stay in the existing docs, with explicit conditions for reading them. For example, public API changes direct the agent to the compatibility policy in RELEASES.md. This keeps the always-loaded guidance small and makes the relevant context easier to find.Before security scans or vulnerability assessments, agents must read the published threat model, triage guide, and operator baseline. Suspected non-public vulnerabilities are raised privately.
The supporting docs adds PR expectations, explains tests that require root, and points CRI tests to their dependency setup instructions.
Assisted-by: Claude Code