Maven to Gradle KTS Migration — Claude Code Skill
A Claude Code skill that migrates Maven projects to Gradle Kotlin DSL (KTS) with version catalogs (libs.versions.toml).
What It Does
- Parses
pom.xml files (single-module and multi-module, with nested module recursion)
- Generates
build.gradle.kts, settings.gradle.kts, gradle/libs.versions.toml, and gradle.properties
- Handles Spring Boot starter-parent conversion, scope mapping, BOM imports, annotation processors, Kotlin detection, and plugin mapping
- Supports full migration or dual-build overlay mode (Gradle alongside Maven)
- Provides reference guides for profiles, multi-module patterns, plugin mappings, and common gotchas
Install
This skill uses the open Agent Skills format (a folder with SKILL.md), which all major coding agents read. They just look in different folders.
One command, any agent (recommended)
npx skills (Node 22.20+) detects the agents you have installed and links one copy into each agent's folder:
npx skills add adityamparikh/maven-to-gradle -g
Drop -g to install into the current project only. Use -a claude-code -a codex … to choose agents, and npx skills update to pull new versions.
Manual install with git
Codex, GitHub Copilot (CLI and cloud agent), Cursor, Gemini CLI, Junie, OpenCode, Goose, Amp, Cline, Roo Code and Devin Desktop read the shared ~/.agents/skills/ folder:
git clone https://github.com/adityamparikh/maven-to-gradle ~/.agents/skills/maven-to-gradle
Claude Code and Kiro don't read ~/.agents/skills/, so link the same copy into their folders:
mkdir -p ~/.claude/skills && ln -s ~/.agents/skills/maven-to-gradle ~/.claude/skills/maven-to-gradle
mkdir -p ~/.kiro/skills && ln -s ~/.agents/skills/maven-to-gradle ~/.kiro/skills/maven-to-gradle
For a single project, clone into the project's .agents/skills/maven-to-gradle folder (or .claude/skills/maven-to-gradle for Claude Code). Update with git -C ~/.agents/skills/maven-to-gradle pull. Keep the folder named maven-to-gradle: VS Code Copilot, Cursor, Kiro, Cline and Roo Code require it to match the skill's name.
Claude Code plugin
/plugin marketplace add adityamparikh/maven-to-gradle
/plugin install maven-to-gradle@maven-to-gradle
Installed as a plugin, the skill is namespaced as /maven-to-gradle:maven-to-gradle.
Usage
In a Claude Code session, the skill is triggered automatically when you ask to:
- "Migrate this Maven project to Gradle"
- "Convert my pom.xml to build.gradle.kts"
- "Switch to Gradle"
- "Add Gradle to my Maven project" (dual-build mode)
The skill guides Claude through a 5-step workflow:
- Analyze the Maven project structure
- Run the migration script to generate Gradle files
- Review and refine the generated output
- Handle profiles and custom plugin configurations
- Verify the build compiles and tests pass
Standalone Script Usage
The migration script can also be run independently:
# Full migration (dry-run first)
python3 scripts/migrate.py /path/to/maven-project --dry-run
# Full migration (write files)
python3 scripts/migrate.py /path/to/maven-project
# Dual-build overlay (keeps Maven, adds Gradle alongside)
python3 scripts/migrate.py /path/to/maven-project --mode overlay
# Write output to a separate directory
python3 scripts/migrate.py /path/to/maven-project --output /path/to/output
Repository Structure