Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .agents/shared-module-guardrails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Shared module guardrails

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❔ question: ‏ Is this a common place for agent documentation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do have the same question, I don't know yet, I need to look that up.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some other dd-trace-* repos have a /doc/for-agent/ folder or similar.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand there's no real conventions there. Another place could be docs/agents/shared-module-guardrails.md if we want humans to read it. I'll ask other teams.


These rules apply in directories whose `AGENTS.md` links here.

- Leave these modules untouched by default. Implement product features in their own modules using existing
contracts. Do not implement product specific feature into shared modules.
- Change a shared module only for a concrete goal in that module. Language Platform @DataDog/apm-lang-platform-java should lead such work.
Outside that team, keep changes tactical and specific to this module. Put them in a separate PR from broader
product work.
- Before editing, tell the user the goal for the module and why an exception is needed. If that rationale is
unclear, leave the module untouched. Warn that Language Platform @DataDog/apm-lang-platform-java review is needed.
- Under `# Motivation` in the PR, add `## Shared module change` apart from any product motivation. Explain
the goal for this module, why the work belongs here, affected consumers, and compatibility risks. When
prompted by product work, explain why product code and existing contracts cannot meet the need.
- Check [CODEOWNERS](../.github/CODEOWNERS) for the current area owner. Put this GitHub alert at the very start
of the PR description, before `# What Does This Do`:

```markdown
> [!IMPORTANT]
> Language Platform review is needed for this shared module change. Please involve @DataDog/apm-lang-platform-java.
```
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# Shared communication
/communication/*.* @DataDog/apm-java
/communication/*.md @DataDog/apm-lang-platform-java
/communication/src/*/*/datadog/communication/*.* @DataDog/apm-java
/communication/src/*/*/datadog/communication/ddagent/ @DataDog/apm-java
/communication/src/*/*/datadog/communication/http/ @DataDog/apm-java
Expand All @@ -29,6 +30,7 @@
/communication/src/test/resources/ @DataDog/apm-java

# Shared utility modules
/utils/*.md @DataDog/apm-lang-platform-java
/utils/filesystem-utils/ @DataDog/apm-java
/utils/logging-utils/ @DataDog/apm-java
/utils/queue-utils/ @DataDog/apm-java
Expand All @@ -47,6 +49,7 @@
/dd-java-agent/load-generator/ @DataDog/apm-java

# Core tracing API
/dd-trace-api/*.md @DataDog/apm-lang-platform-java
/dd-trace-api/src/*/*/datadog/trace/api/*.* @DataDog/apm-java
/dd-trace-api/**/config/CwsConfig* @DataDog/apm-java
/dd-trace-api/**/config/GeneralConfig* @DataDog/apm-java
Expand All @@ -58,6 +61,7 @@
/dd-trace-api/src/*/*/datadog/trace/payloadtags/ @DataDog/apm-java

# Core tracer
/dd-trace-core/*.md @DataDog/apm-lang-platform-java
/dd-trace-core/src/test @DataDog/apm-java
/dd-trace-core/src/*/*/datadog/context/*.* @DataDog/apm-java
/dd-trace-core/src/*/*/datadog/trace/api/naming/ @DataDog/apm-java
Expand All @@ -80,6 +84,7 @@
/dd-trace-core/src/traceAgentTest/ @DataDog/apm-java

# Core internal API
/internal-api/*.md @DataDog/apm-lang-platform-java
/internal-api/internal-api-9/ @DataDog/apm-java
/internal-api/src/test @DataDog/apm-java
/internal-api/src/*/*/datadog/trace/advice/ @DataDog/apm-java
Expand Down
5 changes: 5 additions & 0 deletions communication/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# communication

Module described in [ARCHITECTURE.md](../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../.agents/shared-module-guardrails.md).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 suggestion: ‏ I would check if the @ annotation to include a document is more useful / has chance to be applied

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can take a look, the advantage here is that this also work as a link when browsing github.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a link when browsing github.

We would never read this part. It's for bot only. Could be binary or sparse english words, that would be the same to me. As soon as it's the most efficient for the tool 🤷

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a bit grim, @path is Claude Code's import syntax, the AGENTS.md format does not define it as a portable import mechanism. I.e. @path is not recognized by codex, and looking at opencode it's not either; it is stated explicitly, and instead recommend to give explicit instructions.

I'd propose to keep Read and follow ... links to give agents the explicit instruction.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, definitely if it's not supported widely… I thought it was a more common mechanism 😢

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get you 🥺

1 change: 1 addition & 0 deletions communication/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
5 changes: 5 additions & 0 deletions components/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# components

Module described in [ARCHITECTURE.md](../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions components/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
5 changes: 5 additions & 0 deletions dd-java-agent/agent-bootstrap/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# agent-bootstrap

Module described in [ARCHITECTURE.md](../../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions dd-java-agent/agent-bootstrap/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
5 changes: 5 additions & 0 deletions dd-java-agent/agent-installer/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# agent-installer

Module described in [ARCHITECTURE.md](../../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions dd-java-agent/agent-installer/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
5 changes: 5 additions & 0 deletions dd-java-agent/agent-tooling/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# agent-tooling

Module described in [ARCHITECTURE.md](../../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions dd-java-agent/agent-tooling/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
12 changes: 12 additions & 0 deletions dd-java-agent/src/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# dd-java-agent/src

Module described in [ARCHITECTURE.md](../../ARCHITECTURE.md).

> [!NOTE]
> `dd-java-agent` both assembles the agent jar and owns startup code under `src`.
> This layout does not follow Idiomatic Gradle's separation of code modules and aggregation projects:
> startup code lives in the parent project rather than in a dedicated subproject.
> These instructions therefore live under `src` to cover startup code and its tests without applying
> the same guardrails to every product and instrumentation subproject.

Read and follow the [shared module guardrails](../../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions dd-java-agent/src/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
5 changes: 5 additions & 0 deletions dd-trace-api/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# dd-trace-api

Module described in [ARCHITECTURE.md](../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions dd-trace-api/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
5 changes: 5 additions & 0 deletions dd-trace-core/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# dd-trace-core

Module described in [ARCHITECTURE.md](../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions dd-trace-core/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
5 changes: 5 additions & 0 deletions internal-api/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# internal-api

Module described in [ARCHITECTURE.md](../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions internal-api/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
5 changes: 5 additions & 0 deletions remote-config/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# remote-config

Module described in [ARCHITECTURE.md](../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions remote-config/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
5 changes: 5 additions & 0 deletions telemetry/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# telemetry

Module described in [ARCHITECTURE.md](../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions telemetry/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
5 changes: 5 additions & 0 deletions utils/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# utils

Module described in [ARCHITECTURE.md](../ARCHITECTURE.md).

Read and follow the [shared module guardrails](../.agents/shared-module-guardrails.md).
1 change: 1 addition & 0 deletions utils/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
Loading