跳到正文
cccskills
免费在 GitHub 公开中文介绍

module-set-pluginization

协助将 Product DSL `ModuleSet` 中的平台模块迁移为独立的内置插件,涵盖包装模块、产品布局、依赖关系、生成文件和测试验证,适用于维护 IntelliJ Platform 构建配置的开发者。

原文查看原文说明

Convert Product DSL module sets into bundled wrapper plugins.

JetBrains/intellij-community星标 20,685(GitHub 20,685 + cccskills 0)

实测评分 未实测

查看安装方法

适用场景

  • 将 ModuleSet 迁移为内置插件
  • 梳理产品布局变更
  • 检查缺失的插件依赖
  • 迁移时核对生成文件和测试

中文介绍

功能

本技能指导将 Product DSL 聚合 ModuleSet 中的平台模块迁移到独立的内置插件。它说明如何在功能模块旁创建手写的 JPS 包装模块,并在 plugin.xml 中注册内容模块;还介绍如何从产品布局中移除已迁移模块并加入内置插件、检查模块描述文件和使用方依赖,以及验证生成文件和测试。内容也涉及插件加载条件,以及如何排查测试运行时缺失的依赖。

适用场景

当需要将 ModuleSet 中的一组模块作为独立插件分发时,可以使用本技能。它有助于检查迁移涉及的产品专属布局、模块依赖和生成文件。该流程面向维护 IntelliJ Platform 构建配置的开发者。

使用示例

  • “整理将这些 ModuleSet 模块迁移到内置插件的步骤。”
  • “确认插件化后需要修改哪些 Product DSL 和依赖关系。”
  • “根据这份测试日志中缺失的模块查找运行时依赖。”

注意事项

文档中的流程依赖仓库内的构建和测试环境,包括 JPS、Bazel 和 ./tests.cmd。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
B部分不足会运行构建命令并更新生成文件,但确认细节并未全部给出。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足需要仓库环境,包括 JPS、Bazel 和 `./tests.cmd`。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月28日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(1)

  • SKILL.md17.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

Module Set Pluginization

Use this workflow when a group of platform modules that currently live inside an aggregate Product DSL ModuleSet (typically essential, one of the feature sets that essential nests, or ide.common) should become a standalone bundled plugin wrapper.

New canonical pattern: the wrapper is a hand-written JPS module placed next to the feature modules — not auto-generated under community/module-set-plugins/generated/. Auto-generation is being phased out; legacy wrappers stay in place until migrated. Reference example: community/platform/navbar/plugin/ (IJPL-245430, commit 9d61ae6803221).

Before Editing

  • Look at community/platform/navbar/plugin/ as the reference: a sibling plugin/ directory of the feature modules with its own .iml and resources/META-INF/plugin.xml.
  • Decide whether the modules should still be inlined inside a parent module set in any product. Pluginized wrappers usually stop being emitted through the aggregate intellij.moduleSets.<name>.xml and become a bundled plugin instead.
  • For library modules with only a small closed consumer set, do not create or keep a shared wrapper just to make the library available. Prefer visibility="private" on the library descriptor and register the module as unnamed <content> in each consuming plugin, so each copy lives in that plugin's implicit private namespace.

Create the Wrapper Plugin Module

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

  • intellij.platform.<feature>.plugin.iml under community/platform/ — resources-only JAVA_MODULE inheriting JDK; for example:

    <?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>
    

    After creating the .iml, register it with the project-file helper instead of editing modules.xml by hand:

    bun build/jps-module.mjs register community/platform/<feature>/plugin/intellij.platform.<feature>.plugin.iml --fix-iml-eof
    
  • resources/META-INF/plugin.xml — a minimal <idea-plugin> listing the content modules. Mirror the wrapper shape from navbar and use the canonical com.intellij.* plugin id (replace FEATURE with the actual short name; the description must be at least 40 characters):

    <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 — that is the auto-generated wrapper convention being phased out, kept only on existing wrappers under community/module-set-plugins/generated/. The plugin name is a short human-readable label (e.g. Tasks and Contexts).

    No wrapper-specific descriptor marker is needed. Add the JPS wrapper module name to HAND_WRITTEN_MODULE_SET_PLUGIN_MODULES in community/platform/build-scripts/product-dsl/src/ModuleSetPlugins.kt. Generation intersects that build-time registry with each product's ProductModulesLayout.bundledPluginModules, avoiding changes to the runtime plugin descriptor model while keeping complete generated dependencies for wrapper content.

    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' depends on plugin 'IDEA CORE' which failed to load".

  • No JAR-layout file. The dev distribution derives each member's jar from the plugin's <content>. It uses the loading rule, and the member's package attribute. A conventional wrapper needs no separate packaging file. After you register the module, run ./build/jpsModelToBazel.cmd, then bazel run //platform/buildScripts:plugin-model-tool.

    The 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 build/dev-dist/packaging/<product>.yaml. Packaging tests report changes as patches for review. These YAML files are test expectations, not generator or assembly inputs.

  • Suppress SplitModeMixedDependencies and PluginXmlPluginLogo in plugin.xml only if the inspection actually flags the wrapper.

Update the Product DSL

Remove the now-pluginized modules from the aggregate ModuleSet:

  • In community/platform/build-scripts/src/org/jetbrains/intellij/build/productLayout/CommunityModuleSets.kt (and any product-specific layout file that listed them), delete the module("intellij.platform.<feature>.…") / embeddedModule(...) calls that the wrapper now owns.
  • Add the wrapper JPS module name to DEFAULT_BUNDLED_PLUGINS in community/platform/build-scripts/src/org/jetbrains/intellij/build/productLayout/ProductModulesLayout.kt, e.g. "intellij.platform.<feature>.plugin".
  • Add the wrapper JPS module name to HAND_WRITTEN_MODULE_SET_PLUGIN_MODULES in community/platform/build-scripts/product-dsl/src/ModuleSetPlugins.kt.
  • Check products that override or reset default bundled plugins (Rider's ReSharperExternalProductProperties, Gateway, JetBrains Client product-modules XML under remote-dev/, etc.) and add the wrapper module name where appropriate.

Do not create a new plugin("<feature>") DSL block under the old generator path. The wrapper exists as a standalone JPS module instead.

Re-trim Content Module Descriptors

Pluginization is a good moment to verify that each former direct module declares only the dependencies it really needs:

  • Trim intellij.platform.<feature>.<backend|frontend|monolith>.xml so it declares the actual runtime dependencies (e.g. intellij.platform.backend, intellij.platform.frontend, the shared intellij.platform.<feature> module).
  • If any extension point was renamed/qualified, grep the repo for the old short name and update every <extensionPoint …> reference accordingly.
  • If a downstream consumer used a module that the new wrapper now hides, switch the consumer's descriptor to depend on the wrapper plugin: <plugin id="com.intellij.platform.<feature>"/> instead of <module name="intellij.platform.<feature>.frontend"/>. Existing references to legacy com.intellij.moduleSet.<feature> ids stay valid for the auto-generated wrappers that have not yet been migrated.

Re-run Code Generation

After the source edits, run the generators so the platform descriptors, Bazel files, and .idea/modules.xml are updated to match:

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

Expected diffs:

  • community/platform/platform-resources/generated/META-INF/intellij.moduleSets.essential.xml, …ide.common.xml, and licenseCommon/generated/META-INF/intellij.moduleSets.ide.ultimate.xml no longer list the pluginized modules.
  • community/.idea/modules.xml and .idea/modules.xml gain the new intellij.platform.<feature>.plugin.iml module in helper-generated canonical order.
  • build/bazel-generated-file-list.txt and community/build/bazel-generated-file-list.txt gain the new plugin directory.
  • The wrapper plugin's BUILD.bazel gains a dev section with its dev_dist_plugin call, written by plugin-model-tool. The platform layout derives from sources; no platform jar table needs an update.
  • tests/ideaProjectStructure/testResources/com/intellij/ideaProjectStructure/fast/available-in-idea-free-mode.txt gains the new module if it is free-mode available.
  • Existing wrappers under community/module-set-plugins/generated/intellij.moduleSet.plugin.<name>/ are unrelated — do not touch them unless you are migrating one to the new pattern.

Fix Ordering Bugs When Validation Runs Before Generation

Hand-written wrappers usually do not hit the pre-generation-on-disk ordering trap, since the descriptor exists in source from the first build. The cache path remains relevant only for the legacy generated wrappers:

  • PluginContentCache injects PluginContentInfo objects for already-generated wrappers during the model-building stage. If you migrate one of those to the new pattern, drop the corresponding cache entry along with the generated directory.

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.

  • Inspect Plugin set resolution and Problems found loading plugins in local or TeamCity test logs.
  • Treat messages such as missing intellij.platform.structureView.impl, intellij.platform.execution.serviceView, or intellij.platform.navbar.frontend as a missing wrapper-plugin runtime dependency (intellij.moduleSet.plugin.structureView, intellij.moduleSet.plugin.servicesView, or the new intellij.platform.<feature>.plugin).
  • Add the wrapper dep only to the affected test module with scope="RUNTIME". Do not add it to broad shared modules such as intellij.platform.testFramework or aggregate/global test infrastructure.
  • After changing .iml, run ./build/jpsModelToBazel.cmd and verify the generated BUILD.bazel runtime deps are updated.
  • For TeamCity, read the published test log artifact when needed: /app/rest/builds/id:<buildId>/artifacts/content/testlog.zip!.../idea.log.

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}'
  2. Product DSL module-set validation: ./tests.cmd --module intellij.platform.buildScripts.productDsl.tests --test org.jetbrains.intellij.build.productLayout.validator.ProductModuleSetValidatorTest
  3. Fast project structure/root packages: ./tests.cmd --module intellij.projectStructureTests --test com.intellij.ideaProjectStructure.fast.IntelliJProjectPackageNamesTest
  4. Product packaging baseline: ./bazel.cmd test //build:all-products-packaging_test
  5. CLion packaging baseline: ./tests.cmd --module intellij.clion.build.tests --test org.jetbrains.intellij.build.clion.CLionPackagingTest
  6. Rider packaging baseline: ./tests.cmd --module intellij.rider.build.tests --test com.jetbrains.rider.build.RiderPackagingTest
  7. Database and SQL plugin loading: ./tests.cmd --module intellij.database.tests --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
  8. 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
  9. Package Checker plugin loading: ./tests.cmd --module intellij.packageChecker.tests --test com.intellij.packageChecker.model.VulnerabilitiesRepositoryServerTest
  10. Grazie and spellchecker plugin loading: ./community/tests.cmd --module intellij.grazie.tests --test com.intellij.grazie.spellchecker.inspector.SuggestionTest ./community/tests.cmd --module intellij.grazie.tests --test com.intellij.grazie.spellchecker.inspection.CommentsWithMistakesInspectionTest
  11. Shell plus Markdown plugin loading: ./community/tests.cmd --module intellij.sh.tests --test com.intellij.sh.highlighting.ShHighlightUsagesInMarkdownTest
  12. 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
  13. 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
  14. ReSharper external services/DataGrip bridge: ./tests.cmd --module intellij.resharper.external.services.test.cases.rd --test com.jetbrains.resharper.external.services.test.cases.ReSharperDataGripRdTest
  15. 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

  • Run lint_files() on every changed Kotlin source and test file.

  • Run the Pre-TeamCity Canary Suite after generated files and narrow test dependencies are updated.

  • Keep CLion and Rider packaging tests in the standard suite: wrapper plugins and DEFAULT_BUNDLED_PLUGINS changes can affect those product baselines even when AllProductsPackagingTest is green.

  • Run at least one representative test from each affected test module via ./tests.cmd --module <module> --test <FQN or FQN#method>. Prefer a small smoke test that exercises plugin loading without external fixtures.

  • If the original CI test needs unavailable data or services, run a nearby smoke test and document the local blocker. Confirm idea.log no longer reports the original missing wrapper plugin.

  • Re-render the skill mirrors:

bazel run //.ai:render-guides

The renderer copies this file to community/.claude/skills/module-set-pluginization/SKILL.md, .agents/skills/module-set-pluginization/SKILL.md, .claude/skills/module-set-pluginization/SKILL.md, and .junie/skills/module-set-pluginization/SKILL.md. Confirm git status shows only this source file and those generated mirrors diverging.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

actions

免费有简介

实现或修改 IntelliJ `AnAction`,并在 `plugin.xml` 中注册。将显示名称和说明写入消息资源文件,按需设置图标,并通过事件协程作用域启动挂起任务,避免同步处理阻塞 IDE。

  • 为 IDE 菜单添加操作
  • 修改操作注册或图标
  • 整理操作名称和说明
JetBrains/intellij-community2.1万2026年10月29日 更新

bazel-test-migration

免费有简介

将 IntelliJ JPS 测试模块迁移到 Bazel,并排查仅在 Bazel 中出现的失败。根据症状检查依赖、插件、测试数据和 runfiles,重新生成并验证目标。

  • 将 JPS 测试模块迁移到 Bazel
  • 排查仅在 Bazel 中失败的测试
  • 检查测试依赖和数据配置
JetBrains/intellij-community2.1万2026年10月29日 更新

code-style

免费有简介

按 IntelliJ 项目规范编写或审查 Kotlin 和 Java 代码,涵盖语言选择、格式、密封类型、线程注解及控制流异常处理。

  • 按 IntelliJ 规范编写 Kotlin
  • 审查 Java 代码
  • 检查异常处理和密封类型分支
JetBrains/intellij-community2.1万2026年10月29日 更新

commits

免费有简介

本指南帮助您按 IntelliJ 项目规则拆分更改并撰写提交信息:有工单时使用编号和变更说明,无工单时使用标签与子系统名,并在需要时说明原因和决定。

  • 按项目格式编写带工单号的提交信息
  • 整理测试或文档提交并选择合适标签
  • 按规则修改已有提交信息
JetBrains/intellij-community2.1万2026年10月29日 更新

使用多个 Python 类型检查器比较代码片段或文件的类型推断和报错判断,并汇总各工具的结论、耗时与诊断信息,可保存为 Markdown 报告。

  • 比较不同检查器的类型推断
  • 确认代码是否会被判为类型错误
  • 查看多个工具的诊断差异
JetBrains/intellij-community2.1万2026年10月29日 更新

整理 Compose Desktop 界面中的状态和副作用,让可组合函数负责绘制,由展示器或协调器处理应用决策。了解状态归属、Effect、可复用组件接口、延迟列表键、动画和性能,适用于单项界面修改。

  • 分离界面绘制与展示器决策
  • 整理界面状态的归属
  • 检查 Effect 键和协程用法
JetBrains/intellij-community2.1万2026年10月29日 更新

查看 JetBrains 的全部技能

报告此技能的问题