shared-otel-sdk-demo
AGENTS.md0 starsChanged 3 months agoApache-2.0View on GitHub
This file describes the conventions that govern this repository. Read it before making any change. This repository holds standalone tools shared across EDOT SDK demo applications. Tools are kept here so consuming repos can reference a released artifact instead of copying source. Each tool is independent: its own directory, its own build, its own release lifecycle. There is no root-level build system. Each tool directory is entirely self-contained. Do not leave the root README out of sync with the actual…
- Commits and pushes
We split this AGENTS.md into the rules it gives an agent
12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
Do not leave the root README out of sync with the actual tool directories.
- Very specific: line 96
Every <tool>/README.md must cover, in order:
- Very specific: line 120
Use a JDK base image, not a JRE.
- Very specific: line 129
All other endpoints under /v1/.
- Distinctive: line 133
Every code change that affects behaviour visible to consumers must be accompanied by a documentation update in the same commit.
- Distinctive: line 146
If a change breaks something that was documented as a convention (e.g.
- Distinctive: line 152
Do not add a root-level build file that aggregates tools.
- Distinctive: line 153
Do not share source or compiled artifacts between tool directories.
- Distinctive: line 154
Do not use a single workflow to release multiple tools.
- Very specific: line 155
Do not update the root README.md tools table without also having the corresponding <tool>/ directory and <tool>/README.md in the same …
- Distinctive: line 156
Do not push a release tag without verifying the build succeeds locally first.
- Distinctive: line 157
Do not make a code change that affects documented behaviour without updating the relevant docs in the same commit.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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
Agent guidelines
This file describes the conventions that govern this repository. Read it before making any change.
Purpose
This repository holds standalone tools shared across EDOT SDK demo applications. Tools are kept here so consuming repos can reference a released artifact instead of copying source. Each tool is independent: its own directory, its own build, its own release lifecycle.
Repository layout
shared-otel-sdk-demo/
├── README.md # root index — one row per tool
├── AGENTS.md # this file
├── .gitignore
├── .github/
│ └── workflows/
│ └── release-<tool>.yml # one workflow per tool
└── <tool>/ # one directory per tool
├── README.md
├── Dockerfile # if the tool ships a Docker image
└── ... # tool-specific build files and sourceThere is no root-level build system. Each tool directory is entirely self-contained.
Adding a new tool
- Create
<tool>/as a self-contained project. It must build and run without depending on any other directory in this repo. - Add
<tool>/README.md— see Tool README requirements. - Add
.github/workflows/release-<tool>.yml— see Release workflow conventions. - Update the root
README.md— add one row to the tools table:
Do not leave the root README out of sync with the actual tool directories.| [<tool>](<tool>/) | One-line description | - Verify the build — run the tool's build locally before committing. For Gradle-based tools:
cd <tool> && ./gradlew build.
Release workflow conventions
Each tool has exactly one workflow file: .github/workflows/release-<tool>.yml.
Trigger — push of a tag matching <tool>/v[0-9]+.[0-9]+.[0-9]+:
on:
push:
tags:
- '<tool>/v[0-9]+.[0-9]+.[0-9]+'Required permissions:
permissions:
contents: write # create GitHub Releases
packages: write # push to ghcr.ioVersion extraction — strip the <tool>/v prefix from the tag:
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF_NAME#<tool>/v}" >> "$GITHUB_ENV"Every release must publish two artifacts:
| Artifact | Location | Example |
| Docker image | ghcr.io/elastic/shared-otel-sdk-demo/<tool>:<version> | ghcr.io/elastic/shared-otel-sdk-demo/backend:1.0.0 |
| Executable archive + SHA-256 | GitHub Release assets | backend-1.0.0.jar, backend-1.0.0.jar.sha256 |
Also push a moving :latest Docker tag alongside the versioned tag for interactive use. Consumers must pin the versioned tag, not :latest.
GitHub Release — use the tag name as the release tag and attach the archive and its checksum:
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
--title "<Tool> v${{ env.VERSION }}" \
--generate-notes \
"<tool>/<tool>-${{ env.VERSION }}.jar" \
"<tool>/<tool>-${{ env.VERSION }}.jar.sha256"Checksum format — generate with sha256sum on Linux CI so the file contains the bare filename (not a full path). Consumers verify with shasum -a 256 -c.
See .github/workflows/release-backend.yml as the reference implementation.
Tool README requirements
Every <tool>/README.md must cover, in order:
- What it is — one paragraph.
- Endpoints / API — a table of exposed HTTP endpoints (for HTTP services).
- Configuration — all supported environment variables, with examples.
- Running with Docker — exact
docker runcommand using a pinned version tag. - Running without Docker — download-and-verify steps using the JAR release asset. Include the
shasumverification step. This is required because GitHub-hosted macOS runners cannot run Docker. - Building locally — minimum steps to build and run from source.
- Releasing — the exact
git tagandgit pushcommands that trigger the workflow.
Build conventions
- Each tool manages its own build toolchain. There is no shared root build.
- Gradle-based tools must ship their own
gradlewandgradle/wrapper/so consumers never need a pre-installed Gradle. - The Gradle
bootJar(or equivalent archive) task must produce a fixed filename (<tool>.jar) regardless of the project version, so the Dockerfile and CI steps do not need to glob or version-match the output path. Set this explicitly — for Spring Boot:tasks.named<org.springframework.boot.gradle.tasks.bundling.BootJar>("bootJar") { archiveFileName.set("<tool>.jar") } - The Dockerfile copies from that fixed path (
build/libs/<tool>.jar). CI then copies the file to the versioned release name (<tool>-1.0.0.jar) before attaching it to the GitHub Release.
Docker conventions
- Use a JDK base image, not a JRE. The
elastic-otel-runtime-attachlibrary uses the JVM attach API at startup, which is only available in a JDK. Example:eclipse-temurin:17-jdk. - Match the base image Java version to the build toolchain version.
- The Docker build context is the tool's own directory. Do not reference files outside it.
HTTP service conventions
HTTP services must expose:
GET /v1/health— returns200 OKwith no body; used by CI to confirm the service started.- All other endpoints under
/v1/.
Keeping documentation in sync
Every code change that affects behaviour visible to consumers must be accompanied by a documentation update in the same commit. Specifically:
- Dockerfile base image changed → update the base image example in the Docker conventions
section of this file and in
<tool>/README.mdif it shows aFROMline. - New or removed environment variable → update the configuration table in
<tool>/README.md. - New or removed HTTP endpoint → update the endpoints table in
<tool>/README.md. - Build task or output filename changed → update the build conventions section of this file and
the "Building locally" section of
<tool>/README.md. - Release workflow logic changed → update the release workflow conventions section of this file.
- New tool added or removed → update the root
README.mdtools table and this file if any shared convention changes.
If a change breaks something that was documented as a convention (e.g. a Docker convention), correct the convention text at the same time as the fix — do not leave the docs describing the wrong approach.
What NOT to do
- Do not add a root-level build file that aggregates tools. Tools are independent.
- Do not share source or compiled artifacts between tool directories.
- Do not use a single workflow to release multiple tools. One workflow per tool.
- Do not update the root
README.mdtools table without also having the corresponding<tool>/directory and<tool>/README.mdin the same commit, and vice versa. - Do not push a release tag without verifying the build succeeds locally first.
- Do not make a code change that affects documented behaviour without updating the relevant docs in the same commit.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

