Module set pluginization

From JetBrains/intellij-community · View interactive version

Module set pluginization is an AI agent skill from the GitHub repository JetBrains/intellij-community. Convert Product DSL module sets into bundled wrapper plugins.

How to use this skill

Skill file

<!-- Generated by community/.ai/render-guides.mjs; edit community/.agents/skills/module-set-pluginization/SKILL.md -->

Module Set Pluginization

The platform modules to pluginize live inside an aggregate Product DSL ModuleSet, typically essential, one of the feature sets that essential nests, or ide.common.

The wrapper is a hand-written JPS module next to the feature modules. It is not auto-generated under community/module-set-plugins/generated/. Reference example: community/platform/navbar/plugin/ (IJPL-245430, commit 9d61ae6803221).

Before Editing

Create the Wrapper Plugin Module

Create a new JPS module at <feature-root>/plugin/, e.g. community/platform/<feature>/plugin/:

```xml

<?xml version="1.0" encoding="UTF-8"?>

<module type="JAVA_MODULE" version="4">

<component name="NewModuleRootManager" inherit-compiler-output="true">

<exclude-output />

<content url="file://$MODULE_DIR$">

<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />

</content>

<orderEntry type="inheritedJdk" />

<orderEntry type="sourceFolder" forTests="false" />

</component>

</module>

```

```text

<idea-plugin>

<id>com.intellij.platform.FEATURE</id>

<name>FEATURE</name>

<description>Provides FEATURE platform modules for the IDE.</description>

<vendor>JetBrains</vendor>

<content namespace="jetbrains">

<module name="intellij.platform.FEATURE" loading="required"/>

<module name="intellij.platform.FEATURE.backend"/>

<module name="intellij.platform.FEATURE.frontend"/>

<module name="intellij.platform.FEATURE.monolith"/>

</content>

</idea-plugin>

```

Naming: the plugin id follows the com.intellij.* scheme and is not the JPS module name. Use com.intellij.platform.FEATURE when the wrapper is platform infrastructure that does nothing on its own and other plugins build on top of it (for example com.intellij.platform.vcs, com.intellij.platform.ssh, com.intellij.platform.testRunner), and com.intellij.FEATURE when it is a self-sufficient user-facing feature (for example com.intellij.bookmarks, com.intellij.todo, com.intellij.navbar). Check that the id is free first, it could've been used for another plugin. Do not use module-name-style ids (intellij.platform.FEATURE.plugin, intellij.FEATURE.plugin). Once an id has shipped in a release, any rename must keep the old id as an alias. Do not reuse the legacy com.intellij.moduleSet.FEATURE prefix. The plugin name is a short human-readable label (e.g. Tasks and Contexts).

Mark only the shared/anchor module (the one that loads in every product mode) as loading="required" — intellij.platform.FEATURE in the example. Plugin-XML inspection requires at least one required/embedded/required-if-available content module per wrapper, so the anchor satisfies that. Do not add loading="required" to backend / frontend / monolith modules: in frontend product mode (JetBrains Client) the platform's backend module is unavailable, so a required FEATURE.backend excludes itself and takes the whole wrapper plugin down — producing a confusing cascade like "Plugin 'FEATURE' cannot be loaded because it depends on plugin 'IDEA CORE' which failed to load".

plugin-model-tool derives the platform layout and compatible published plugins from sources. It writes the plugin's jars, members, and libraries into the dev section of the plugin's BUILD.bazel. Do not edit generated sections or plan files. AllProductsPackagingTest compares the derivation with the build layout and packed jars. Closed-product dist-file observations live in ultimate, at each product's PackagingTargetSpec.contentYamlPath, for example dbe/build/datagrip-content.yaml. Packaging tests report changes as patches for review. These YAML files are test expectations, not generator or assembly inputs.

Update the Product DSL

Remove the now-pluginized modules from the aggregate ModuleSet:

Re-trim Content Module Descriptors

Re-run Code Generation

After the source edits, run the generators so the platform descriptors and Bazel files are updated to match:

./build/jpsModelToBazel.cmd
./bazel.cmd run //platform/buildScripts:plugin-model-tool

Expected diffs:

Downstream Test Runtime Dependencies

Pluginization can break narrow test modules even when product packaging tests pass. Test runtime classpaths may still include a plugin module whose extracted platform dependency is no longer embedded. Catch this from idea.log, not from test assertion text alone.

Pre-TeamCity Canary Suite

Run this suite before relying on TeamCity after pluginization or plugin dependency changes. Run the listed commands in parallel when resources allow; the order is diagnostic priority, not execution order. Fix failures in checks 1-6 before interpreting downstream canary failures.

  1. Embedded dependency closure:

./bazel.cmd run //platform/buildScripts:plugin-model-tool -- --json='{"filter":"embeddedDependencyClosure","pluginSourceOnly":true}'

  1. Product DSL module-set validation:

./community/tools/bt.cmd --module intellij.platform.buildScripts.productDsl.tests --filter org.jetbrains.intellij.build.productLayout.validator.ProductModuleSetValidatorTest

  1. Fast project structure/root packages:

./tests.cmd --module intellij.projectStructureTests --test com.intellij.ideaProjectStructure.fast.IntelliJProjectPackageNamesTest

  1. Product packaging baseline:

./bazel.cmd test //build/tests/smoke:all-products-packaging_test

  1. CLion packaging baseline:

./tests.cmd --module intellij.clion.build.tests --test org.jetbrains.intellij.build.clion.CLionPackagingTest

  1. Rider packaging baseline:

./tests.cmd --module intellij.rider.build.tests --test com.jetbrains.rider.build.RiderPackagingTest

  1. Database and SQL plugin loading:

./tests.cmd --module intellij.database.tests.aggregator --test com.intellij.database.DatabaseTestSuite

./tests.cmd --module intellij.database.sql.tests --test com.intellij.sql.SqlFileStructureViewTest

./tests.cmd --module intellij.database.sql.tests --test com.intellij.sql.editor.SqlMultiLineTodoTest

  1. Code Server DB plugin loading:

./tests.cmd --module intellij.codeServer.db.sql.tests --test com.intellij.database.SqlCompletionTest

./tests.cmd --module intellij.codeServer.db.csv.datagrid.tests --test com.intellij.codeServer.db.csv.datagrid.tests.CsvCoreGridTest

  1. Package Checker plugin loading:

./tests.cmd --module intellij.packageChecker.tests --test com.intellij.packageChecker.model.VulnerabilitiesRepositoryServerTest

  1. Grazie and spellchecker plugin loading:

./community/tools/bt.cmd --module intellij.grazie.tests --filter com.intellij.grazie.spellchecker.inspector.SuggestionTest

./community/tools/bt.cmd --module intellij.grazie.tests --filter com.intellij.grazie.spellchecker.inspection.CommentsWithMistakesInspectionTest

  1. Shell plus Markdown plugin loading:

./community/tools/bt.cmd --module intellij.sh.tests --filter com.intellij.sh.highlighting.ShHighlightUsagesInMarkdownTest

  1. Ruby plugin loading:

./tests.cmd --module intellij.ruby.tests --test org.jetbrains.plugins.ruby.gem.GemsProviderTest

./tests.cmd --module intellij.ruby.tests --test org.jetbrains.plugins.ruby.ruby.psi.RubyHeredocInjectorTest#testSqlHeredoc

  1. RustRover structure and SQL loading:

./tests.cmd --module intellij.rustrover.core.test --test org.rust.ide.structure.RsStructureViewModelTest

./tests.cmd --module intellij.rustrover.sql.tests --test com.jetbrains.rust.sql.SqlInjectorTest

  1. ReSharper external services/DataGrip bridge:

./tests.cmd --module intellij.resharper.external.services.test.cases.rd --test com.jetbrains.resharper.external.services.test.cases.ReSharperDataGripRdTest

  1. AI Assistant plugin loading:

./tests.cmd --module intellij.ml.llm.chat.tests --test com.intellij.ml.llm.core.chat.ui.chat.navigation.FilePathMatcherTest

./tests.cmd --module intellij.ml.llm.completion.tests --test com.intellij.ml.llm.completion.cloud.context.mainEditor.RecentLocationsContextCollectorTest

./tests.cmd --module intellij.ml.llm.devkit.tests --test com.intellij.ml.llm.devkit.context.DevKitChatContextProviderTest

./tests.cmd --module intellij.ml.llm.java.embeddings.tests --test com.intellij.ml.llm.java.embeddings.JavaEmbeddingParsingTest

./tests.cmd --module intellij.ml.llm.java.inlinePromptDetector.tests --test com.intellij.ml.llm.java.inlinePromptDetector.JavaInlinePromptHighlightingTest

./tests.cmd --module intellij.ml.llm.nextEdits.tests --test 'com.intellij.ml.llm.nextEdits.tests.history.NextEditFileHistoryTest;com.intellij.ml.llm.nextEdits.tests.diff.CheckFileRangesSyntaxCorrectTest'

./tests.cmd --module intellij.ml.llm.ruby.test --test com.intellij.ml.llm.ruby.testGeneration.RubyLLMGenerateTestsSupportPromptTest

./tests.cmd --module intellij.ml.llm.ruby.test --test com.intellij.ml.llm.ruby.testGeneration.rails.RailsGenerateTestsPromptTest

./tests.cmd --module intellij.ml.llm.sql.tests --test com.intellij.ml.llm.sql.SqlObjectChatInputTest

Verification

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.