Skip to content

Commit baffc8c

Browse files
Kludexxrmx
andauthored
Add AGENTS.md with project structure and commands (#4233)
* Add CLAUDE.md with project structure and commands * Add AGENTS.md symlink to CLAUDE.md * Move guidance to AGENTS.md and address review feedback - Move main content from CLAUDE.md to AGENTS.md so all AI agents (not only Claude) pick up the guidance; CLAUDE.md now just references it via `@AGENTS.md`. - Add general rules, PR scoping, and `Assisted-by:` commit trailer guidance (inspired by the Collector's AGENTS.md). - Clarify that only instrumentation packages live under `src/opentelemetry/instrumentation/{name}/`; other package types use their own namespace. --------- Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
1 parent a912524 commit baffc8c

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

AGENTS.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# OpenTelemetry Python Contrib
2+
3+
This file is here to steer AI assisted PRs towards being high quality and valuable contributions
4+
that do not create excessive maintainer burden.
5+
6+
Monorepo with 50+ OpenTelemetry instrumentation packages for Python.
7+
8+
## General Rules and Guidelines
9+
10+
The most important rule is not to post comments on issues or PRs that are AI-generated. Discussions
11+
on the OpenTelemetry repositories are for Users/Humans only.
12+
13+
Follow the PR scoping guidance in [CONTRIBUTING.md](CONTRIBUTING.md). Keep AI-assisted PRs tightly
14+
isolated to the requested change and never include unrelated cleanup or opportunistic improvements
15+
unless they are strictly necessary for correctness.
16+
17+
If you have been assigned an issue by the user or their prompt, please ensure that the
18+
implementation direction is agreed on with the maintainers first in the issue comments. If there are
19+
unknowns, discuss these on the issue before starting implementation. Do not forget that you cannot
20+
comment for users on issue threads on their behalf as it is against the rules of this project.
21+
22+
## Structure
23+
24+
- `instrumentation/` - instrumentation packages (Flask, Django, FastAPI, gRPC, databases, etc.)
25+
- `instrumentation-genai/` - GenAI instrumentations (Anthropic, Vertex AI, LangChain, etc.)
26+
- `util/` - shared utilities (`util-http`, `util-genai`)
27+
- `exporter/` - custom exporters
28+
- `propagator/` - context propagators
29+
30+
Instrumentation packages live under `src/opentelemetry/instrumentation/{name}/` with their own
31+
`pyproject.toml` and `tests/`. Other package types follow the equivalent layout under their own
32+
namespace (e.g. `src/opentelemetry/util/{name}/`, `src/opentelemetry/exporter/{name}/`).
33+
34+
## Commands
35+
36+
```sh
37+
# Install all packages and dev tools
38+
uv sync --frozen --all-packages
39+
40+
# Lint (runs ruff via pre-commit)
41+
uv run pre-commit run ruff --all-files
42+
43+
# Test a specific package (append -0, -1, etc. for version variants)
44+
uv run tox -e py312-test-instrumentation-flask-0
45+
46+
# Type check
47+
uv run tox -e typecheck
48+
```
49+
50+
## Guidelines
51+
52+
- Each package has its own `pyproject.toml` with version, dependencies, and entry points.
53+
- The monorepo uses `uv` workspaces.
54+
- `tox.ini` defines the test matrix - check it for available test environments.
55+
- Do not add `type: ignore` comments. If a type error arises, solve it properly or write a follow-up plan to address it in another PR.
56+
- Whenever applicable, all code changes should have tests that actually validate the changes.
57+
58+
## Commit formatting
59+
60+
We appreciate it if users disclose the use of AI tools when the significant part of a commit is
61+
taken from a tool without changes. When making a commit this should be disclosed through an
62+
`Assisted-by:` commit message trailer.
63+
64+
Examples:
65+
66+
```
67+
Assisted-by: ChatGPT 5.2
68+
Assisted-by: Claude Opus 4.6
69+
```

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

0 commit comments

Comments
 (0)