/gradle-dagp:gradle-dagpfrom gradle-dagp
Use when analyzing or fixing Gradle module dependencies with the autonomousapps dependency-analysis-gradle-plugin (DAGP) — buildHealth, projectHealth, fixDependencies, reason, advice.json. Trigger on unused dependencies, api-vs-implementation, transitive / misused-transitive dependencies, redundant plugins (kapt / kotlin-jvm / java-library), or any request to clean up Gradle module dependencies for a JVM or Android project. Do not pipe advice straight through fixDependencies — this skill guides investigative triage, convention-plugin awareness, batched reviewable PRs, and upstream bug filing when DAGP is wrong.
Ships in gradle-dagp. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill applies the autonomousapps dependency-analysis-gradle-plugin to clean up Gradle module dependencies. DAGP outputs precise, structured advice — but blindly applying it can make a codebase worse, not better.
The point of this skill is to use DAGP's advice as a starting point for thinking, not as a script to run.
DAGP tells you what is technically unused, misused, or misconfigured. It does not know the code's intent. Three guardrails:
implementation → api is not always the right fix. DAGP flags a type from a dependency as part of the module's public ABI. The right response is often to not expose that type (refactor callers, wrap it, change the return type), not to promote the dep to api. Exposing third-party types creates upgrade coupling across every consumer.Class.forName, Android resources, service loaders, and some build-script DSL can all confuse the analysis. If applying advice breaks the build and investigation shows DAGP is at fault, file an upstream issue — but draft it and get user approval before submitting (it posts under the user's identity). See references/upstream-issue.md.When in doubt, run :module:reason --id <coord> and read. DAGP's reason output is the best debugging tool this plugin ships.
Follow the stages below in order. Each stage has a detailed reference — pull them in only when you need them, so context stays lean.
Look for com.autonomousapps.dependency-analysis in the root build.gradle[.kts], settings.gradle[.kts], or buildSrc / build-logic convention plugins. If it's missing, ask before adding (see references/apply-dagp.md).
If applied, compare the declared version against the latest stable on the Gradle plugin portal or the GitHub releases / tags (ignore variant-artifacts-* tags — those are a separate artifact, not the core plugin). Always look this up live rather than relying on a version in this file — newer DAGP versions fix analysis bugs and can change what advice is produced. If behind, propose the version bump as its own small PR first, re-run buildHealth, and diff the advice before continuing.
./gradlew buildHealth
Outputs to inspect:
build/reports/dependency-analysis/build-health-report.txt — human-readablebuild/reports/dependency-analysis/advice.json — structured, machine-parseableFor a single module: ./gradlew :module:projectHealth.
Don't run fixDependencies yet. Read the report first.
Each Advice entry has coordinates, optional fromConfiguration, toConfiguration. The shape of the advice tells you what kind of change it is. Don't treat all advice equally — each category has different risk and a different best response.
Pull references/advice-interpretation.md for the full decision tree (including what to do when :mod:reason and buildHealth seem to disagree — usually stale state, occasionally a DAGP bug). In summary:
toConfiguration = null, remove) — usually safe. Check reason for annotation-only, reflection, or resource-only usage before removing.api-like (isToApiLike) — investigate. Often the right fix is to stop exposing the type, not to promote the dep. reason shows exactly which class is leaking.api (demotion) — usually safe and good; shrinks public ABI.PluginAdvice: redundantKapt, redundantKotlinJvm, redundantJavaLibrary) — generally precise. Remove.If the project uses buildSrc/, build-logic/, or applies plugins { id("my-team.convention.*") }, the same advice repeating across many modules is often a signal that the convention plugin is over-applying dependencies — adding them for every module even when most don't need them.
Fix at the convention-plugin level when the dep genuinely belongs to a small set of modules; fix at the consumer level when the convention plugin correctly applies a dep for most modules and this one is an outlier. Cross-cutting changes at the convention level need extra care because they affect many modules at once.
See references/convention-plugins.md for detection and decision guidance.
Do not open a single PR that applies all advice at once. It's unreviewable, unbisectable, and partial-rollback-hostile.
Propose a batching plan and confirm with the user before creating PRs. Reasonable cuts (pick one, or combine):
api/implementation demotions in another; convention-plugin changes in their own PR.Rule of thumb: a reviewer should be able to load the PR and hold the whole diff in their head. See references/batching.md for concrete strategies.
For each batch:
./gradlew :mod1:compile<Variant> :mod1:test :mod2:compile<Variant> :mod2:test (Android: compileDebugKotlin, testDebugUnitTest or similar)../gradlew buildHealth (or :mod:projectHealth) and confirm the targeted advice entries are gone and no new ones appeared.fixDependencies is a tool in the toolbox — it is suitable for the boring cases you've already investigated and classified as safe (typically: pure unused-removal batches). Prefer manual edits anywhere judgment is involved. Never run a project-wide ./gradlew fixDependencies as a default.
If a verified-safe batch breaks compilation or tests and :mod:reason --id <coord> doesn't reveal the real cause, you may have hit a DAGP bug. Don't rush to file upstream. Isolate:
If it's a real DAGP bug, follow references/upstream-issue.md to draft the report. Show the draft to the user and wait for approval before filing — the issue posts under their GitHub identity.
./gradlew fixDependencies (project-wide) as a default action. Prefer manual, per-module, per-batch edits.implementation to api without reading :mod:reason and confirming the exposure is intentional.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub premex-ab/claude-marketplace --plugin gradle-dagp