add-dependency

Resolve Maven coordinates and inject dependencies into Gradle version catalogs.

1|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/mattbobambrose/mattbobambrose-claude-skills --skill add-dependency
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-dependency
Source: https://github.com/mattbobambrose/mattbobambrose-claude-skills/tree/main/plugins/kotlin-tools/skills/add-dependency
Command: npx skills add https://github.com/mattbobambrose/mattbobambrose-claude-skills --skill add-dependency

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adds one or more Maven dependencies to a Kotlin/Gradle project while managing shared versions, maintaining the Gradle version catalog, and ensuring the project still builds, eliminating manual catalog edits and guesswork about versions and aliases.

Core Features & Use Cases

  • Automated Version Resolution: Searches Maven Central or the web for the latest stable release for each provided group:artifact coordinate and avoids pre-release versions unless necessary.
  • Version Catalog Integration: Updates gradle/libs.versions.toml by adding or reusing version aliases and adding corresponding library entries following the project's naming conventions.
  • Build Verification: Inserts catalog-based accessors into build.gradle.kts and runs a Gradle clean build (excluding tests) to validate dependency resolution and compilation.
  • Use Case: Quickly add multiple libraries to a Kotlin project while keeping centralized version control and avoiding inconsistent dependency declarations.

Quick Start

Add org.jetbrains.kotlinx:kotlinx-coroutines-core to the project by running add-dependency org.jetbrains.kotlinx:kotlinx-coroutines-core.

Frequently Asked Questions about add-dependency

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Maven dependencies to a Kotlin Gradle project using a version catalog?

To add Maven dependencies to a Kotlin Gradle project, provide group:artifact coordinates. The Skill resolves the latest stable versions from Maven Central, injects them into gradle/libs.versions.toml, updates build.gradle.kts, and runs a clean build to verify resolution.

What is the best way to manage shared library versions in a Gradle version catalog?

Managing shared library versions in a Gradle version catalog involves adding or reusing version aliases in gradle/libs.versions.toml. This Skill automates that process by finding stable releases and updating the TOML file and build.gradle.kts with appropriate catalog-based accessors.

Does this automated dependency resolution work with pre-release versions from Maven Central?

Automated dependency resolution searches Maven Central for the latest stable release and avoids pre-release versions unless necessary. It ensures your Kotlin Gradle project builds successfully by validating dependency resolution and compilation during the Gradle clean build step.

Can I update multiple Maven dependencies in build.gradle.kts at the same time?

You can update multiple Maven dependencies simultaneously by providing several group:artifact coordinates. The Skill resolves each library, updates the shared version aliases in the Gradle version catalog, and verifies the entire project still compiles.

Why does my Gradle build fail after manually adding new libraries to libs.versions.toml?

A Gradle build may fail after manual catalog edits due to incorrect version aliases or unresolved coordinates. This Skill prevents such errors by automatically injecting valid Maven Central entries into libs.versions.toml and running a clean build to verify compilation.

Do I need to run Gradle tests when verifying newly added dependencies?

You do not need to run tests when verifying newly added dependencies. The Skill runs a Gradle clean build while explicitly excluding tests, ensuring fast validation of dependency resolution and compilation without the overhead of executing your test suite.