agentleFS
DockerKnown publisherdocker/docker-agent/AGENTS.md

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

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 6 mentionsApr 2026: 5 mentionsMay 2026: 1 mentionJun 2026: 2 mentionsJul 2026: 1 mentionAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the docker/docker-agent repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about docker/docker-agent

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

4 more on GitHub

On Bluesky · 6

1 more on Bluesky
  • 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.

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
  1. Distinctive:

    Write clean, self-documenting code with minimal comments

    line 8
  2. Distinctive:

    Follow existing code style and patterns in the project

    line 9
  3. Distinctive:

    Consider edge cases and failure scenarios

    line 11
  4. Distinctive:

    Ensure code is maintainable and extensible

    line 12
  5. Distinctive:

    Keep comments short and to the point:

    line 22
  6. Distinctive:

    Prefer a single concise line over a multi-line block

    line 24
  7. Distinctive:

    Write terse notes, not prose — assume an experienced reader

    line 26
  8. Distinctive:

    If a comment needs a paragraph, the code probably needs refactoring instead

    line 27
  9. Distinctive:

    Use tools to gather information rather than relying on assumptions

    line 31
  10. Distinctive:

    Ask clarifying questions only when truly necessary

    line 36
  11. Distinctive:

    When possible, call independent tools concurrently — it's faster

    line 37
  12. Distinctive:

    Before marking work as complete:

    line 50
  13. Very specific:

    Run task test to execute the full test suite

    line 105
  14. Very specific:

    Test fixtures and data live in testdata/ subdirectories

    line 107
  15. Very specific:

    Use github.com/stretchr/testify/assert and require for assertions

    line 108
  16. Distinctive:

    When adding new features to the config, only add them to the latest config

    line 118
  17. Distinctive:

    When adding new features to the config:

    line 120
  18. Distinctive:

    Create an example YAML that demonstrates the new feature

    line 122
  19. Distinctive:

    Write clear, descriptive commit messages

    line 126
  20. Very specific:

    Prefer Conventional Commits format, e.g.

    line 127
  21. Distinctive:

    Keep branches focused on single features or fixes

    line 130
  22. Distinctive:

    Ensure your branch is up-to-date before submitting

    line 131
  23. Very specific:

    Every job sets timeout-minutes.

    line 146
  24. Very specific:

    Every PR-triggered workflow declares a concurrency group.

    line 153

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 in serve a2a and serve 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; chatgptAuthMiddleware shows 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.yml configuration)
  • task format — Format code using golangci-lint fmt
  • task dev — Run lint, test, and build in parallel

Docker and Cross-Platform Builds

  • task build-local — Build binary for local platform using Docker Buildx
  • task 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 as docker/docker-agent
  • task 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

  • --debug or -d — Enable debug logging (logs to ~/.cagent/cagent.debug.log)
  • --log-file <path> — Specify custom debug log location
  • --otel or -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 test to 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/assert and require for 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/latest package 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.json accordingly
    • Create an example YAML that demonstrates the new feature

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 / gate is the single required status check on main. It needs every blocking job; to make a new job blocking, add it to gate.needs in .github/workflows/ci.yml — the ruleset does not change. Docs-only PRs (only docs/** changed) skip the Go jobs, and so does a main push whose SHA already passed a merge-queue run; gate treats skipped as passed
  • report-main-failures runs after the test jobs on failed pushes to the canonical repository's main branch. It files deduplicated Bug issues using the required flaky-test label, assigns them to dgageot, and throttles repeat run-link comments to once per 24 hours. The job is diagnostic and intentionally excluded from gate.needs
  • Every job sets timeout-minutes; every checkout sets persist-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.Z comment, and only to versions listed in the org allow list (docker/infra-github-allow-list, terraform/docker/main.tf); actions/*, github/* and docker/* are allowed at any version
  • Every PR-triggered workflow declares a concurrency group. Runs on main and on tags are never queued or cancelled: their group includes github.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.sh enforces the above and runs in the lint job

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.