npx claudepluginhub notiriel/reforgeLLM-directed refactoring engine — orchestrate large-scale Java/Kotlin architectural refactorings using IntelliJ's refactoring engine via CLI + YAML config.
An IntelliJ IDEA plugin that executes large-scale architectural refactorings headlessly via CLI + YAML config. Designed to be orchestrated by an LLM (via Claude Code skill) for refactorings that would otherwise burn tokens on individual file edits.
operations:
# Move classes to new packages
- type: move
target: com.example.app.task.model
sources:
- com.example.app.model.Task* # Task, TaskStatus, TaskPriority + tests
- type: move
target: com.example.app.task.service
sources:
- com.example.app.service.TaskService* # TaskService + TaskServiceTest
# Extract interface from a class
- type: extract-interface
class: com.example.app.task.service.TaskService
interface: com.example.app.task.port.TaskPort
methods: [findAll, findById, createTask]
# Replace a concrete dependency with an interface
- type: replace-dependency
in: com.example.app.task.controller.TaskController
replace: com.example.app.task.service.TaskService
with: com.example.app.task.port.TaskPort
| Type | Description | Fields |
|---|---|---|
move | Move classes to a target package | target, sources (list of patterns) |
extract-interface | Create interface from class methods | class, interface, methods |
replace-dependency | Replace type references in a class | in, replace, with |
* — matches within a single segment (e.g., Task* matches Task, TaskStatus)** — matches zero or more package segmentsOperations execute in listed order. Consecutive same-type operations are batched automatically. Recommended order:
move — restructure packages firstextract-interface — create abstractionsreplace-dependency — wire up interfaces./gradlew buildPlugin
The plugin ZIP is built to build/distributions/.
The reforge wrapper script (scripts/reforge.sh) launches IntelliJ headlessly — no window, no dock icon, no conflict with a running IDE. Supports macOS and Linux.
# Real run
./scripts/reforge.sh /path/to/project /path/to/reforge.yaml
# Dry run
./scripts/reforge.sh /path/to/project /path/to/reforge.yaml --dry-run
Set IDEA_HOME to override IntelliJ location if auto-detection doesn't work.
./gradlew runIde --args="reforge /path/to/project /path/to/reforge.yaml"
idea CLI (alternative)idea reforge /path/to/project /path/to/reforge.yaml [--dry-run]
Note: This uses macOS open -na which shows a dock icon and may conflict with a running IDE instance. Prefer the wrapper script.
Install the IntelliJ plugin:
idea installPlugins ch.riesennet.reforge https://raw.githubusercontent.com/notiriel/reforge/main/updatePlugins.xml
Install the Claude Code plugin:
/plugin marketplace add https://github.com/notiriel/reforge.git
/plugin install reforge@notiriel-reforge
Then use in any project:
/reforge restructure the project into domain-driven packages
The skill analyzes the codebase, generates the YAML config, executes Reforge, and validates by running tests.
./gradlew test # Run 59 unit tests
./gradlew koverLog # Print line coverage summary
./gradlew koverHtmlReport # HTML report → build/reports/kover/html/