Skip to content

Agent guidance for Gradle build logic - #12872

Draft
bric3 wants to merge 5 commits into
masterfrom
bdu/gradle-agent-guidance
Draft

bric3 wants to merge 5 commits into
masterfrom
bdu/gradle-agent-guidance

Conversation

@bric3

@bric3 bric3 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Add folder-specific agent instructions for buildSrc and build-logic, with small Claude Code imports. Keep the shared Gradle advice, skill installation steps and guidance on updating the guide in docs/how_to_work_with_gradle.md.

Motivation

Explain general practices once, and let the folder instructions focus on local constraints. The Gradle guide now covers plugin independence, task dependencies and cache checks alongside the existing advice.

Additional Notes

Contributors install the required skill using the steps in the guide. The provider example was run in an isolated build, including configuration-cache reuse. Repository tests and live Codex/Claude instruction-loading sessions were not run.

Tip

Claude Code v2.1.277+ supports AGENTS.md natively, but its default prefers CLAUDE.md when one exists on the project path, see Claude Code instruction loading.

Contributor Checklist

@bric3 bric3 added type: documentation tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM labels Oct 14, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.94 s 13.90 s [-0.5%; +0.9%] (no difference)
startup:insecure-bank:tracing:Agent 12.86 s 12.90 s [-1.0%; +0.4%] (no difference)
startup:petclinic:appsec:Agent 17.19 s 17.07 s [-0.2%; +1.6%] (no difference)
startup:petclinic:iast:Agent 17.06 s 17.01 s [-0.5%; +1.1%] (no difference)
startup:petclinic:profiling:Agent 16.80 s 16.89 s [-1.6%; +0.7%] (no difference)
startup:petclinic:sca:Agent 17.09 s 16.83 s [+0.6%; +2.5%] (maybe worse)
startup:petclinic:tracing:Agent 16.13 s 16.13 s [-0.9%; +0.9%] (no difference)

Commit: a26719e0 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@bric3 bric3 changed the title Add guardrails for Gradle build agents Add agents guardrails for Gradle build logic Oct 15, 2026
@bric3 bric3 changed the title Add agents guardrails for Gradle build logic Add agent guidance for Gradle build logic Oct 15, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 59.54% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a26719e | Docs | Give us feedback!

@sarahchen6 sarahchen6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few small suggestions, but otherwise looks good! I didn't approve, as this PR is still in draft mode. I support the gradle-best-practices recommendations though 👍

Comment thread build-logic/AGENTS.md
Comment on lines +3 to +4
Use `gradle-best-practices` before changing Gradle code here. If it is missing or incomplete,
follow the [skill setup](../docs/how_to_work_with_gradle.md#gradle-skills) before editing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: with the addition in the root AGENTS.md, this and the similar lines in buildSrc/AGENTS.md shouldn't be necessary

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'd rather have it in the two places, precisely because they're in two distinct folders. That way an agent working only in buildSrc can see the link to the gradle doc.

Also, I'd rather avoid adding it to the root AGENTS.md, as it's somewhat specific to gradle folder. And this reinforce the intent for the AGENT there: read this doc, AI!.

Comment thread buildSrc/AGENTS.md Outdated
Comment on lines +6 to +8
New project-facing conventions usually belong in `build-logic`. This folder still holds
plugins and shared types that need the `buildSrc` classloader. Keep changes to existing
plugins where they are unless the task includes moving them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This could be put in the how_to_work_with_gradle.md doc? I think it's mostly covered in the table under the What are Gradle Files? section

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 wanted to reinforce this for humans as well. But you're right maybe I can just point to the right doc section.

Comment thread docs/how_to_work_with_gradle.md Outdated
Comment on lines +3 to +8
This guide covers Gradle practices and how they apply in this repository, including where
our current build cannot yet follow a best practice. The project-specific sections explain
conventions used across the build.

Update this guide when a change affects that shared advice. Keep implementation notes,
workarounds and procedures for a single plugin or task with its source or local documentation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: simplify to

Suggested change
This guide covers Gradle practices and how they apply in this repository, including where
our current build cannot yet follow a best practice. The project-specific sections explain
conventions used across the build.
Update this guide when a change affects that shared advice. Keep implementation notes,
workarounds and procedures for a single plugin or task with its source or local documentation.
This guide covers shared Gradle practices, repository conventions, and current exceptions. Update it when shared guidance changes; keep guidance specific to one plugin or task beside its source or local documentation.

Comment thread docs/how_to_work_with_gradle.md Outdated
Comment on lines +49 to +74
### Codex

Ask the built-in [skill installer](https://learn.chatgpt.com/docs/build-skills#install-curated-skills-for-local-use)
to install the skill from Gradle's repository:

```text
$skill-installer install https://github.com/gradle/gradle-skills/tree/main/skills/gradle-best-practices
```

Then invoke it with `$gradle-best-practices`. If it does not appear after installation,
restart the session.

### Claude Code

Install Gradle's plugin:

```text
/plugin marketplace add gradle/gradle-skills
/plugin install gradle-skills@gradle-skills
```

Invoke the skill with `/gradle-skills:gradle-best-practices`. Each contributor installs the
plugin for their own setup; naming it in repository instructions does not fetch it.
See the [upstream installation guide](https://github.com/gradle/gradle-skills#installation)
for other agents and installation options.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we probably don't need to list these instructions ourselves since it's already included in the skill's README? and the agent should already go through that

@bric3 bric3 changed the title Add agent guidance for Gradle build logic Agent guidance for Gradle build logic Oct 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants