---
component: ROOT
version: "2026.2"
slug: ROOT/integrations/develocity-build-caching-optimizer
canonical_url: "https://docs.gradle.com/develocity/2026.2/integrations/agentic-ai/skills/develocity-build-caching-optimizer/"
title: "Develocity Build Caching Optimizer"
description: "The Develocity Build Caching Optimizer is an agent skill that finds and fixes cache misses in Gradle and Maven builds and opens a pull request."
keywords:
  - "build cache"
  - "gradle"
  - "maven"
  - "build acceleration"
status: current
---

<!-- llms-index: https://docs.gradle.com/develocity/llms.txt -->

# Develocity Build Caching Optimizer

<a id="preamble"></a>

The Develocity Build Caching Optimizer is an agent skill that diagnoses why your Gradle or Maven builds miss the Build Cache, applies fixes, and opens a pull request with the results.

The skill runs inside your AI client and works autonomously after you start it. It uses Build Scan data to find the tasks or goals that miss the Build Cache, traces each miss to its root cause, applies a fix, and verifies the result. You review the pull request it produces and decide whether to merge it.

<a id="when-to-use-it"></a>

## When to Use It

The Build Caching Optimizer lets you get the full benefit of the [Build Cache](https://docs.gradle.com/develocity/2026.2/using-develocity/build-cache/) without specialized build-caching expertise or a manual, task-by-task investigation. Common cases:

*   **Rolling out the Build Cache**: After you first enable the Build Cache, tasks or goals often miss it because their inputs depend on the local environment. The skill finds and fixes those misses, so more of your build is served from the cache.
    
*   **Recovering from a cache regression**: When a change introduces a non-deterministic or environment-specific input, your cache hit rate drops and builds slow down. The skill traces the regression to its cause and corrects it.
    
*   **Keeping builds cacheable over time**: Run the skill on a schedule, such as weekly or per release, to catch and fix new cache misses before they slow your builds.
    

<a id="how-it-works"></a>

## How It Works

After you start the skill, it progresses through five phases without further input:

1.  **Prerequisites**: Confirms that a Develocity instance and the Develocity MCP server are reachable, detects your build tool, and verifies that it can publish a Build Scan.
    
2.  **Discover and Prepare**: Inspects your build configuration and runs experiments that produce the Build Scan data used for analysis.
    
3.  **Classify and Investigate**: Classifies each task or goal by its caching behavior and traces every cache miss to a root cause by comparing Build Scan data.
    
4.  **Fix and Validate**: Applies minimum-change fixes on a new branch, then re-runs the build to confirm that the cache hit rate improved.
    
5.  **Report and File a Pull Request**: Opens a pull request that contains the fixes and a before-and-after report.
    

During classification, the skill labels each cache miss by symptom. For example, it separates inputs that change between identical builds from inputs that embed absolute paths, then groups misses that share a root cause so it can fix them together.

<a id="prerequisites"></a>

## Prerequisites

Before you run the skill, confirm the following:

*   A running Develocity instance with the Develocity MCP server enabled. The skill reads Build Scan data through the MCP server and stops when the server is unavailable. See the [MCP Server installation manual](https://docs.gradle.com/develocity/2026.2/integrations/agentic-ai/mcp-servers/installation/#develocity-mcp-server).
    
*   A Develocity access key with the `Access build data via the API and MCP` permission. See [the Develocity API user manual](https://docs.gradle.com/develocity/2026.2/reference/develocity-api/#creating-access-keys).
    
*   The Develocity skills marketplace installed in your AI client. See [Getting Started](https://docs.gradle.com/develocity/2026.2/integrations/agentic-ai/skills/getting-started/).
    
*   The project in a Git repository, with the Gradle wrapper (`./gradlew`) or Maven wrapper (`./mvnw`) present.
    

For Gradle projects, the skill applies the Develocity plugin automatically when the project doesn’t already use it. For Maven projects, configure the Develocity Maven extension before you run the skill.

<a id="run-the-skill"></a>

## Run the Skill

In your AI client, start the Develocity Build Caching Optimizer and describe the project and your goal in plain language. The skill starts only when you invoke it directly, because each run executes several full builds.

Optimize the project in the current directory:

```shell
/develocity-build-caching-optimizer Optimize the Build Cache for this project
```

Scope the run to specific tasks or goals, and skip the pull request:

```shell
/develocity-build-caching-optimizer Optimize the project at ~/acme-app. Analyze the assemble task. Do not open a pull request.
```

Clone and optimize a project from a Git repository:

```shell
/develocity-build-caching-optimizer Optimize the project at https://github.com/acme/acme-app.git
```

Use a specific Develocity server:

```shell
/develocity-build-caching-optimizer Optimize this project using the Develocity server at https://develocity.example.com
```

<a id="run-behind-a-proxy"></a>

## Run Behind a Proxy

The skill runs in networks that require an HTTP or HTTPS proxy. It applies the proxy to every connection it makes: the Develocity API checks, Build Scan publishing, and the experiments that fetch Build Scan data.

Name the proxy in your prompt:

```shell
/develocity-build-caching-optimizer Optimize this project using the proxy http://proxy.example.com:8080
```

Or set the standard `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables before you start your AI client. This suits unattended and CI runs:

```shell
export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY=localhost,127.0.0.1
```

The skill never reads proxy settings from other tools. If it can’t reach Develocity directly while the MCP server can, it stops and asks you to set these variables or name the proxy in your prompt. Any credentials in the proxy URL are masked in its output.

<a id="results"></a>

## Results

By default, the skill opens a pull request on a new branch. The pull request contains:

*   One commit per fix, each a minimum-change edit scoped to the cache miss it resolves.
    
*   A report that lists every finding with its root cause, severity, and affected tasks, along with before-and-after metrics (cache hit rate, build time, and tasks executed compared to tasks served from the cache) and a link to each supporting Build Scan.
    

When you ask the skill not to open a pull request, it leaves the fixes on the branch for you to review locally.

<a id="scope"></a>

## Scope

The skill changes build configuration and build scripts to resolve caching issues. It doesn’t:

*   modify custom Gradle plugins or Maven extensions,
    
*   change build logic that’s unrelated to caching, or
    
*   upgrade your build tool version. The skill reports when a fix requires an upgrade instead of applying it.
    

<a id="considerations"></a>

## Considerations

*   A run executes multiple full builds and typically takes 10 to 20 minutes.
    
*   The skill uses your AI client’s model, so each run consumes model tokens. Set budget and turn limits in your client to bound a run.
    
*   The skill runs autonomously after you start it. Review the pull request before you merge.
    
*   Develocity is required throughout. The skill has no offline or degraded mode.
    

<a id="related-documentation"></a>

## Related Documentation

*   [Getting Started](https://docs.gradle.com/develocity/2026.2/integrations/agentic-ai/skills/getting-started/) explains how to install the skills marketplace in your AI client.
    
*   [MCP Servers](https://docs.gradle.com/develocity/2026.2/integrations/agentic-ai/mcp-servers/) connect your AI client to Develocity build data.
    
*   [Develocity Build Cache](https://docs.gradle.com/develocity/2026.2/using-develocity/build-cache/) describes how the Build Cache works.