move-code
БесплатноБез исполняемых скриптовНе проверенMoves a Java class or package to another package in this project with OpenRewrite, so every import, fully qualified reference, Javadoc link, properties value…
от a-pavithraa★ 82 звезды на GitHubОб этом скилле
Move a class or package
Don't move Java files by hand or with text edits: imports and references in other files go stale, and names in resources are missed.
- Decide whether a move is the fix. To clear a module-boundary violation, prefer a facade in the target module's top-level package or an event; moving an internal type into a module's top-level package publishes it to every module. A move fits when the type belongs to another module, or when restructuring into modules.
- Write the recipe to a file in a temporary folder outside the repository, here
$TMPDIR/move.yml, so nothing is left to commit:type: specs.openrewrite.org/v1beta/recipe name: local.Move recipeList: - org.openrewrite.java.ChangeType: # one class oldFullyQualifiedTypeName: {{BASE_PACKAGE}}.orders.internal.Discounts newFullyQualifiedTypeName: {{BASE_PACKAGE}}.catalog.internal.Discounts # or, for a whole package and its subpackages: # - org.openrewrite.java.ChangePackage: # oldPackageName: {{BASE_PACKAGE}}.orders.internal # newPackageName: {{BASE_PACKAGE}}.orders.pricing # recursive: true
- Preview, and read the patch in
target/rewrite/rewrite.patchbefore applying it:./mvnw -q org.openrewrite.maven:rewrite-maven-plugin:6.46.1:dryRun -Drewrite.configLocation=$TMPDIR/move.yml -Drewrite.activeRecipes=local.Move - Apply it with the same command and goal
runinstead ofdryRun.
- Write an init script next to the recipe,
$TMPDIR/rewrite.gradle, so the build files stay unchanged:
Preview, and read the patch ininitscript { repositories { gradlePluginPortal(); mavenCentral() } dependencies { classpath "org.openrewrite:plugin:7.39.0" } } rootProject { plugins.apply(org.openrewrite.gradle.RewritePlugin) rewrite { activeRecipe("local.Move") configFile = new File(System.getProperty("moveRecipe")) } }build/reports/rewrite/rewrite.patchbefore applying it:./gradlew -q rewriteDryRun --init-script $TMPDIR/rewrite.gradle -DmoveRecipe=$TMPDIR/move.yml - Apply it with the same command and task
rewriteRuninstead ofrewriteDryRun.
- Find what the recipe can't see:
git grep -n '<old fully qualified name>'. A class name inside a Java string literal is not updated. Change each hit only if it names the moved type. - Run
{{VERIFY}}. A compile error naming a type from the old package means the moved class used package-private code there: move that code with it (move the whole package instead), or make it reachable on purpose. The module-boundary test reports a move that crosses a module boundary. - Commit the move on its own, with no other edits, so the review is mechanical and
git log --followkeeps the file's history.
Установить move-code в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл move-code?
Moves a Java class or package to another package in this project with OpenRewrite, so every import, fully qualified reference, Javadoc link, properties value and META-INF/services entry follows, the same way each time. Use when the user asks to move, relocate or repackage a class or package, or to rename a package, to restructure code into modules, or when a fix would mean moving a type across modules.
Как установить скилл move-code?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл move-code запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic