|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +Instructions for AI agents working on the Docker documentation |
| 4 | +repository. This site builds https://docs.docker.com/ using Hugo. |
| 5 | + |
| 6 | +## Project structure |
| 7 | + |
| 8 | +``` |
| 9 | +content/ # Documentation source (Markdown + Hugo front matter) |
| 10 | +├── manuals/ # Product docs (Engine, Desktop, Hub, etc.) |
| 11 | +├── guides/ # Task-oriented guides |
| 12 | +├── reference/ # API and CLI reference |
| 13 | +└── includes/ # Reusable snippets |
| 14 | +layouts/ # Hugo templates and shortcodes |
| 15 | +data/ # YAML data files (CLI reference, etc.) |
| 16 | +assets/ # CSS (Tailwind v4) and JS (Alpine.js) |
| 17 | +static/ # Images, fonts |
| 18 | +_vendor/ # Vendored Hugo modules (read-only) |
| 19 | +``` |
| 20 | + |
| 21 | +The `/manuals` prefix is stripped from published URLs: |
| 22 | +`content/manuals/desktop/` → `/desktop/` on the live site. |
| 23 | + |
| 24 | +## Writing guidelines |
| 25 | + |
| 26 | +Read and follow [STYLE.md](STYLE.md) and [COMPONENTS.md](COMPONENTS.md). |
| 27 | +These contain all style rules, shortcode syntax, and front matter |
| 28 | +requirements. |
| 29 | + |
| 30 | +## Vendored content (do not edit) |
| 31 | + |
| 32 | +Content in `_vendor/` and CLI reference pages generated from |
| 33 | +`data/cli/` are vendored from upstream repos. Don't edit these |
| 34 | +files — changes must go to the source repository: |
| 35 | + |
| 36 | +- docker/cli, docker/buildx, docker/compose, docker/model-runner → CLI reference YAML in `data/cli/` |
| 37 | +- moby/buildkit → Dockerfile reference in `_vendor/` |
| 38 | +- moby/moby → Engine API docs in `_vendor/` |
| 39 | + |
| 40 | +If a validation failure traces back to vendored content, note the |
| 41 | +upstream repo that needs fixing but don't block on it. |
| 42 | + |
| 43 | +## Commands |
| 44 | + |
| 45 | +```sh |
| 46 | +npx prettier --write <file> # Format before committing |
| 47 | +docker buildx bake validate # Run all validation checks |
| 48 | +docker buildx bake lint # Markdown linting only |
| 49 | +docker buildx bake vale # Style guide checks only |
| 50 | +docker buildx bake test # HTML and link checking |
| 51 | +``` |
| 52 | + |
| 53 | +## Verification loop |
| 54 | + |
| 55 | +1. Make changes |
| 56 | +2. Format with prettier |
| 57 | +3. Run `docker buildx bake lint vale` |
| 58 | +4. Run a full build with `docker buildx bake` |
| 59 | + |
| 60 | +## Self-improvement |
| 61 | + |
| 62 | +After every correction or mistake, update this file with a rule to |
| 63 | +prevent repeating it. End corrections with: "Now update AGENTS.md so |
| 64 | +you don't make that mistake again." |
| 65 | + |
| 66 | +## Mistakes to avoid |
| 67 | + |
| 68 | +- Don't use hedge words: "simply", "easily", "just", "seamlessly" |
| 69 | +- Don't use meta-commentary: "it's worth noting that...", "it's important to understand that..." |
| 70 | +- Don't use "allows you to" or "enables you to" — use "lets you" or rephrase |
| 71 | +- Don't use "we" — use "you" or "Docker" |
| 72 | +- Don't use "click" — use "select" |
| 73 | +- Don't bold product names or for emphasis — only bold UI elements |
| 74 | +- Don't use time-relative language: "currently", "new", "recently", "now" |
| 75 | +- Don't edit vendored content in `_vendor/` or `data/cli/` |
0 commit comments