docker-agent
AGENTS.md3.4k starsChanged 7 months agoApache-2.0View on GitHub
This document provides guidance for AI agents and contributors working on the docker-agent codebase. Comments are only added when the code's purpose or logic is not immediately evident. Never write comments that merely restate what the code does (e.g. // increment counter above counter++). Comments should explain why something is done a certain way, document non-obvious edge cases, or clarify complex algorithms that cannot be simplified further. Keep comments short and to the point: - Use tools to gather information…
Trending
Quiet since July.about the whole repository
Who's talking about docker/docker-agent
- @aheritier.net“2.9K ⭐️ Thank you! 🙏 github.com/docker/docker-agent www.star-history.com?repos=docker... #starhistory …”Bluesky · May 17, 2026 · 7 likes
- @dgageot.bsky.social“You like cagent? You'll love github.com/docker/docke...! We renamed cagent to Docker Agent to show our …”Bluesky · Mar 6, 2026 · 6 likes
- @aheritier.net“Docker Agent is moving fast. In addition of many stability and performances improvements recent versions …”Bluesky · Jul 6, 2026 · 4 likes
- MH0386/aur“chore(deps): update dependency docker/docker-agent to v1.86.0”GitHub · Jun 23, 2026 · 2 reactions
- MH0386/aur“chore(deps): update dependency docker/docker-agent to v1.83.0”GitHub · Jun 19, 2026 · 2 reactions
The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 15
Talked about on GitHub and Bluesky (15 times).
On GitHub · 9
- Jun 23, 2026chore(deps): update dependency docker/docker-agent to v1.86.0 — MH0386/aur2 reactions · 5 comments
- Jun 19, 2026chore(deps): update dependency docker/docker-agent to v1.83.0 — MH0386/aur2 reactions · 4 comments
- Apr 23, 2026chore(deps): update dependency docker/docker-agent to v1.50.0 — MH0386/aur2 reactions · 10 comments
- Apr 16, 2026chore(deps): update dependency docker/docker-agent to v1.46.0 — MH0386/aur2 reactions · 8 comments
- Apr 15, 2026chore(deps): update dependency docker/docker-agent to v1.45.0 — MH0386/aur2 reactions · 7 comments
4 more on GitHub
- Apr 3, 2026chore(deps): update dependency docker/docker-agent to v1.42.0 — MH0386/aur2 reactions · 4 comments
- Mar 30, 2026chore(deps): update dependency docker/docker-agent to v1.40.0 - autoclosed — MH0386/aur2 reactions · 5 comments
- Mar 26, 2026chore(deps): update dependency docker/docker-agent to v1.38.0 — MH0386/aur2 reactions · 4 comments
- Mar 11, 2026chore(deps): update dependency docker/docker-agent to v1.31.0 — MH0386/aur2 reactions · 5 comments
On Bluesky · 6
- May 17, 20262.9K ⭐️ Thank you! 🙏 github.com/docker/docker-agent www.star-history.com?repos=docker... #starhistory #GitHub #OpenSource via… — @aheritier.net7 likes and reposts
- Mar 6, 2026You like cagent? You'll love github.com/docker/docke...! We renamed cagent to Docker Agent to show our commitment. Gordon, our AI assistant… — @dgageot.bsky.social6 likes and reposts
- Jul 6, 2026Docker Agent is moving fast. In addition of many stability and performances improvements recent versions added many providers to simplify… — @aheritier.net4 likes and reposts
- Apr 7, 2026github.com/docker/docke... - cAgent is now #Docker #Agent, a way to orchestrate #AI #Agents. — @robrich.bsky.social2 likes and reposts
- Mar 9, 2026>docker/docker-agent: AI Agent Builder and Runtime by Docker Engineering https://github.com/docker/docker-agent >docker-agent lets you… — @mstdn.baldanders.info1 likes and repost
1 more on Bluesky
- Mar 9, 2026>docker/docker-agent: AI Agent Builder and Runtime by Docker Engineering github.com/docker/docke... >docker-agent lets you create and run… — @baldanders.info1 likes and repost
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- bump-config-versionSkill
- bump-go-dependenciesSkill
- triage-prsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
24 rules. About 0 are common, 18 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Write clean, self-documenting code with minimal comments
- Distinctive: line 9
Follow existing code style and patterns in the project
- Distinctive: line 11
Consider edge cases and failure scenarios
- Distinctive: line 12
Ensure code is maintainable and extensible
- Distinctive: line 22
Keep comments short and to the point:
- Distinctive: line 24
Prefer a single concise line over a multi-line block
- Distinctive: line 26
Write terse notes, not prose — assume an experienced reader
- Distinctive: line 27
If a comment needs a paragraph, the code probably needs refactoring instead
- Distinctive: line 31
Use tools to gather information rather than relying on assumptions
- Distinctive: line 36
Ask clarifying questions only when truly necessary
- Distinctive: line 37
When possible, call independent tools concurrently — it's faster
- Distinctive: line 50
Before marking work as complete:
- Very specific: line 105
Run task test to execute the full test suite
- Very specific: line 107
Test fixtures and data live in testdata/ subdirectories
- Very specific: line 108
Use github.com/stretchr/testify/assert and require for assertions
- Distinctive: line 118
When adding new features to the config, only add them to the latest config
- Distinctive: line 120
When adding new features to the config:
- Distinctive: line 122
Create an example YAML that demonstrates the new feature
- Distinctive: line 126
Write clear, descriptive commit messages
- Very specific: line 127
Prefer Conventional Commits format, e.g.
- Distinctive: line 130
Keep branches focused on single features or fixes
- Distinctive: line 131
Ensure your branch is up-to-date before submitting
- Very specific: line 146
Every job sets timeout-minutes.
- Very specific: line 153
Every PR-triggered workflow declares a concurrency group.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project Agent Guidelines
This document provides guidance for AI agents and contributors working on the docker-agent codebase.
Code Quality Standards
- Write clean, self-documenting code with minimal comments
- Follow existing code style and patterns in the project
- Implement proper error handling and validation
- Consider edge cases and failure scenarios
- Ensure code is maintainable and extensible
Code Comments Philosophy
Comments are only added when the code's purpose or logic is not immediately
evident. Never write comments that merely restate what the code does (e.g.
// increment counter above counter++). Comments should explain why
something is done a certain way, document non-obvious edge cases, or clarify
complex algorithms that cannot be simplified further.
Keep comments short and to the point:
- Prefer a single concise line over a multi-line block
- Cut filler words, restated context, and obvious explanations
- Write terse notes, not prose — assume an experienced reader
- If a comment needs a paragraph, the code probably needs refactoring instead
Working Approach
- Use tools to gather information rather than relying on assumptions
- Examine existing code before making changes
- Grep for existing plumbing before adding a mechanism, and before calling something unavailable
- Validate all changes before considering tasks complete
- Ask clarifying questions only when truly necessary
- When possible, call independent tools concurrently — it's faster
Client and Session Lifetimes
- Provider clients are built per team load: once per session in
serve api, once at startup inserve a2aandserve mcp - Anything that must vary per conversation belongs in a request middleware, not in client construction
- The session ID is on the request context via
httpclient.SessionIDFromContext;chatgptAuthMiddlewareshows the shape
Validation Requirements
Before marking work as complete:
- Code builds successfully (
task build) - All tests pass (
task test) - Linter shows no new issues (
task lint) - Changes meet acceptance criteria
- Code follows project patterns and conventions
- Proper error handling is implemented
- Edge cases are considered
Development Commands
Canonical setup, commands and style guide: the contributing guide. The list below is a quick reference.
Build and Development
task build— Build the application binary (outputs to./bin/docker-agent)task test— Run Go tests (clears API keys to ensure deterministic tests)task lint— Run golangci-lint (uses.golangci.ymlconfiguration)task format— Format code using golangci-lint fmttask dev— Run lint, test, and build in parallel
Docker and Cross-Platform Builds
task build-local— Build binary for local platform using Docker Buildxtask cross— Build binaries for multiple platforms (linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64, windows/arm64)task build-image— Build Docker image tagged asdocker/docker-agenttask push-image— Build and push multi-platform Docker image to registry
Running docker-agent
./bin/docker-agent run <config.yaml>— Run agent with configuration (launches TUI by default)./bin/docker-agent run <config.yaml> -a <agent_name>— Run specific agent from multi-agent config./bin/docker-agent run myorg/agent:tag— Run agent directly from OCI registry./bin/docker-agent run --exec <config.yaml>— Execute agent without TUI (non-interactive)./bin/docker-agent new— Generate new agent configuration interactively./bin/docker-agent new --model openai/gpt-5— Generate with specific model./bin/docker-agent share push ./agent.yaml namespace/repo— Push agent to OCI registry./bin/docker-agent share pull namespace/repo— Pull agent from OCI registry./bin/docker agent serve mcp ./agent.yaml— Expose agents as MCP tools./bin/docker agent serve a2a <config.yaml>— Start agent as A2A server./bin/docker agent serve api— Start docker-agent API server
Debug and Development Flags
--debugor-d— Enable debug logging (logs to~/.cagent/cagent.debug.log)--log-file <path>— Specify custom debug log location--otelor-o— Enable OpenTelemetry tracing- Example:
./bin/docker-agent run config.yaml --debug --log-file ./debug.log
Testing
- Tests are located alongside source files (
*_test.go) - Run
task testto execute the full test suite - E2E tests live in the
e2e/directory - Test fixtures and data live in
testdata/subdirectories - Use
github.com/stretchr/testify/assertandrequirefor assertions - Cover edge cases and error conditions
- Mock external dependencies for unit tests
Agent Config YAML
- Agent config files follow a strict schema:
./agent-schema.json - The schema is versioned
./pkg/config/v0,./pkg/config/v1, ... packages handle older versions of the config./pkg/config/latestpackage handles the current, work-in-progress config format- When adding new features to the config, only add them to the latest config
- Older config types are frozen — do not modify them
- When adding new features to the config:
- Update
./agent-schema.jsonaccordingly - Create an example YAML that demonstrates the new feature
- Update
Git Practices
- Write clear, descriptive commit messages
- Prefer Conventional Commits format, e.g.
feat:,fix:,docs:,chore:,refactor:,test: - Make commits logical and atomic
- Group related changes together; avoid mixing unrelated changes
- Keep branches focused on single features or fixes
- Ensure your branch is up-to-date before submitting
- Sign commits with a GPG or SSH key (
git commit -S)
GitHub Actions
ci / gateis the single required status check onmain. It needs every blocking job; to make a new job blocking, add it togate.needsin.github/workflows/ci.yml— the ruleset does not change. Docs-only PRs (onlydocs/**changed) skip the Go jobs, and so does amainpush whose SHA already passed a merge-queue run;gatetreats skipped as passedreport-main-failuresruns after the test jobs on failed pushes to the canonical repository'smainbranch. It files deduplicated Bug issues using the requiredflaky-testlabel, assigns them todgageot, and throttles repeat run-link comments to once per 24 hours. The job is diagnostic and intentionally excluded fromgate.needs- Every job sets
timeout-minutes; every checkout setspersist-credentials: false. zizmor (.github/zizmor.yml) and Dependabot (.github/dependabot.yml, GitHub Actions only) keep both honest - Pin every third-party action by 40-character SHA with a
# vX.Y.Zcomment, and only to versions listed in the org allow list (docker/infra-github-allow-list,terraform/docker/main.tf);actions/*,github/*anddocker/*are allowed at any version - Every PR-triggered workflow declares a
concurrencygroup. Runs onmainand on tags are never queued or cancelled: their group includesgithub.run_id - Shared setup lives in
.github/actions/, referenced as$/.github/actions/<name>(no checkout needed):setup-go(Go, Task, per-job cache),setup-hugo,setup-buildx(Hub OIDC login and builder). Pin tool versions there, not in workflows scripts/workflow-lint.shenforces the above and runs in thelintjob
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

