Agent SkillsDetachHead/rebased › module-dependencies

module-dependencies

GitHub

指导在 IntelliJ 代码库中管理模块依赖,包括修改 .iml 文件及运行 JPS 到 Bazel 的生成器以同步构建配置。

.claude/skills/module-dependencies/SKILL.md DetachHead/rebased

触发场景

添加或修改模块依赖 手动同步 .iml 与 Bazel 构建文件

安装

npx skills add DetachHead/rebased --skill module-dependencies -g -y
更多选项

非标准路径

npx skills add https://github.com/DetachHead/rebased/tree/master/.claude/skills/module-dependencies -g -y

不安装直接使用

npx skills use DetachHead/rebased@module-dependencies

指定 Agent (Claude Code)

npx skills add DetachHead/rebased --skill module-dependencies -a claude-code -g -y

安装 repo 全部 skill

npx skills add DetachHead/rebased --all -g -y

预览 repo 内 skill

npx skills add DetachHead/rebased --list

SKILL.md

Frontmatter
{
    "name": "module-dependencies",
    "description": "How to manage module dependencies in IntelliJ codebase. Use when adding or modifying module dependencies in iml files."
}

Module Dependencies Management

This document describes how to manage module dependencies when working with IntelliJ IDEA codebase.

Documentation

Build System Overview

The repository uses a hybrid build system:

  • JPS (*.iml files): Source of truth for module dependencies
  • Bazel (BUILD files): Auto-generated from *.iml files
  • Generator: run build/jpsModelToBazel.cmd after changing .iml files

Running the IML-to-Bazel Generator

To manually run the converter that generates Bazel BUILD files from .iml files:

./build/jpsModelToBazel.cmd

This is useful when:

  • The automatic converter didn't run (e.g., .iml files were modified outside the IDE)
  • You need to regenerate BUILD files after git operations
  • Troubleshooting build system synchronization issues

BUILD.bazel Auto-Generated Sections

BUILD.bazel files have auto-generated sections marked with comments:

### auto-generated section `build module.name` start
... generated content ...
### auto-generated section `build module.name` end

### auto-generated section `test module.name` start
... generated content ...
### auto-generated section `test module.name` end

Key rules:

  • Content inside auto-generated sections is overwritten by the generator
  • Content outside auto-generated sections is preserved during regeneration

Skip Generation Marker

To prevent auto-generation of a section (so you can provide custom content):

### skip generation section `test module.name`

Example - Custom test target with preserved content:

load("@community//build:tests-options.bzl", "jps_test")

# Custom test target (before auto-generated sections)
jps_test(
  name = "my-tests_test",
  runtime_deps = [
    ":my-tests_test_lib",
    "//:main_test_lib",
  ],
)

### skip generation section `test my.module.name`

### auto-generated section `build my.module.name` start
... (let generator handle the build section)

Content Modules and Wrapper Plugins

Product layouts can include content modules directly. If production runtime already gets a dependency from a content module in the product layout, that content-module dependency can be enough and does not automatically require adding a wrapper plugin dependency to a production .iml or plugin descriptor.

Test plugin resolution is different because tests often do not run with the full production product layout or flat classpath. If a test module loads a plugin whose dependencies include content modules owned by a wrapper plugin, add the wrapper plugin as a test/runtime dependency in the test module .iml instead of broadening the production module dependency. For example, a test that needs Problems View content modules may need intellij.platform.problemView.plugin as a runtime dependency even when the production module only depends on Problems View content modules.

Important Notes

⚠️ DO NOT manually edit .iml files via JetBrains MCP - The IDE's automatic converter runs concurrently and can interfere with edits.

When you need to fix missing dependencies:

  1. Use the standard Edit tool (not mcp__jetbrains__replace_text_in_file) for .iml files
  2. The converter will automatically update BUILD.bazel files
  3. Verify compilation with ./bazel-build-all.cmd

版本历史

  • 1f8708d 当前 2026-08-16 15:39

同 Skill 集合

.agents/skills/actions/SKILL.md
.agents/skills/code-style/SKILL.md
.agents/skills/commits/SKILL.md
.agents/skills/debugging/SKILL.md
.agents/skills/driver-ui-tests/SKILL.md
.agents/skills/eel/SKILL.md
.agents/skills/extract-module/SKILL.md
.agents/skills/module-dependencies/SKILL.md
.agents/skills/module-set-pluginization/SKILL.md
.agents/skills/notebook-for-experiment/SKILL.md
.agents/skills/pseudo-kmp/SKILL.md
.agents/skills/registry/SKILL.md
.agents/skills/remote-dev/SKILL.md
.agents/skills/safe-push/SKILL.md
.agents/skills/ssr/SKILL.md
.agents/skills/testing-internals/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/ui-accessibility/SKILL.md
.agents/skills/writing-tests/SKILL.md
.claude/skills/actions/SKILL.md
.claude/skills/code-style/SKILL.md
.claude/skills/commits/SKILL.md
.claude/skills/debugging/SKILL.md
.claude/skills/driver-ui-tests/SKILL.md
.claude/skills/eel/SKILL.md
.claude/skills/extract-module/SKILL.md
.claude/skills/jewel-pr-preparer/SKILL.md
.claude/skills/jewel-release-helper/SKILL.md
.claude/skills/managing-youtrack/SKILL.md
.claude/skills/module-set-pluginization/SKILL.md
.claude/skills/notebook-for-experiment/SKILL.md
.claude/skills/pseudo-kmp/SKILL.md
.claude/skills/registry/SKILL.md
.claude/skills/remote-dev/SKILL.md
.claude/skills/safe-push/SKILL.md
.claude/skills/ssr/SKILL.md
.claude/skills/testing-internals/SKILL.md
.claude/skills/testing/SKILL.md
.claude/skills/ui-accessibility/SKILL.md
.claude/skills/writing-tests/SKILL.md

元信息

文件数
0
版本
1f8708d
Hash
062b4321
收录时间
2026-08-16 15:39

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-17 06:19
浙ICP备14020137号-1 $访客地图$