Agent SkillsDetachHead/rebased › plugin-model-analyzer

plugin-model-analyzer

GitHub

通过 Bazel 查询 IntelliJ 产品 DSL 模块、产品及插件依赖图,支持模块概览、依赖路径、所有者及重构建议等分析,辅助代码结构理解与决策。

.agents/skills/plugin-model-analyzer/SKILL.md DetachHead/rebased

Trigger Scenarios

查询模块或产品的依赖关系 分析插件架构和模块所有权 查找重构候选项或验证加载规则

Install

npx skills add DetachHead/rebased --skill plugin-model-analyzer -g -y
More Options

Non-standard path

npx skills add https://github.com/DetachHead/rebased/tree/master/.agents/skills/plugin-model-analyzer -g -y

Use without installing

npx skills use DetachHead/rebased@plugin-model-analyzer

指定 Agent (Claude Code)

npx skills add DetachHead/rebased --skill plugin-model-analyzer -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": "plugin-model-analyzer",
    "description": "Query IntelliJ Product DSL modules, products, and plugin graphs."
}

Plugin Model Analyzer

Use the Product DSL analyzer directly through Bazel. Do not call the retired PluginModelAnalyzer MCP server.

Command Shape

Run from the repository root:

bazel run --ui_event_filters=-info --noshow_progress //platform/buildScripts:plugin-model-tool -- --json='<request-json>'

The output is JSON with a timestamp plus one result property named after the requested filter.

Prefer small, typed JSON requests. Avoid unfiltered --json: it emits the full model and is usually too large for agent context. Use JSON fields, not extra CLI flags, to describe the query. Treat the single top-level result property as the answer.

Transport options:

  • Short request: --json='{"filter":"summary","limit":5}'
  • Stdin request: --json=-
  • File request: --json=@/private/tmp/plugin-model-query.json

Common Requests

Module overview:

{"filter":"moduleInfo","module":"intellij.platform.vcs.impl","limit":20}

Module dependencies:

{"filter":"moduleDependencies","module":"intellij.platform.vcs.impl","includeTransitive":false,"includeTestDependencies":false}

Dependency path:

{"filter":"dependencyPath","fromModule":"intellij.platform.vcs.impl","toModule":"intellij.platform.projectModel.impl","includeTestDependencies":true,"includeScopes":true}

Module owners:

{"filter":"moduleOwners","module":"intellij.platform.vcs.impl","includeTestSources":true}

Module-set details or search:

{"filter":"moduleSetQuery","moduleSet":"ide.common","details":false,"limit":50}
{"filter":"moduleSetQuery","name":"vcs","location":"COMMUNITY","minModuleCount":3,"limit":20}

Product details or search:

{"filter":"productQuery","product":"idea","details":false,"limit":50}
{"filter":"productQuery","usesModuleSet":"ide.common","limit":30}

Product comparison and trace path:

{"filter":"productCompare","product":"idea","product2":"Idea","limit":50}
{"filter":"productTracePath","product":"idea","moduleSet":"ide.common","limit":20}

Embedded dependency closure:

{"filter":"embeddedDependencyClosure","value":"idea","moduleSet":"ide.common","pluginSourceOnly":true}

Merge or inline impact:

{"filter":"mergeImpact","source":"some.module.set","target":"target.module.set","operation":"merge"}
{"filter":"mergeImpact","source":"some.module.set","operation":"inline"}

Validation and loading-rule checks:

{"filter":"validation","check":"community_products"}
{"filter":"validation","check":"module_set_locations"}
{"filter":"validation","check":"loading_inconsistencies"}
{"filter":"validation","check":"embedded_dependency_closure","product":"idea","pluginSourceOnly":true}
{"filter":"moduleLoading","loading":"EMBEDDED","limit":100}

Refactoring candidates:

{"filter":"moduleSetOverlap","minOverlapPercent":70,"limit":20}
{"filter":"productSimilarity","threshold":0.8,"limit":20}
{"filter":"unificationSuggestions","strategy":"merge","limit":10}
{"filter":"redundantModuleSetRefs","product":"idea","limit":50}
{"filter":"suggestModuleSetsForModules","modules":["intellij.platform.vcs.impl","intellij.platform.vcs.log.impl"],"limit":20}

Deprecated xi:include usage:

{"filter":"deprecatedIncludes","product":"idea","limit":100}

Old MCP Operation Map

Use this map when a prompt or older instruction mentions the retired PluginModelAnalyzer MCP operation names.

Old operation JSON request
analyze_module_structure {"filter":"summary"}
module info {"filter":"moduleInfo","module":"<module>"}
module dependencies {"filter":"moduleDependencies","module":"<module>"}
module paths {"filter":"modulePaths","module":"<module>"}
module reachability {"filter":"moduleReachability","module":"<module>","moduleSet":"<set>"}
module find_by_loading {"filter":"moduleLoading","loading":"EMBEDDED","details":true}
module dependency_path {"filter":"dependencyPath","fromModule":"<from>","toModule":"<to>","includeScopes":true}
module-set info {"filter":"moduleSetQuery","moduleSet":"<set>"}
module-set search {"filter":"moduleSetQuery","name":"<name>","location":"COMMUNITY","limit":20}
module-set hierarchy {"filter":"moduleSetQuery","moduleSet":"<set>","details":true}
module-set overlap {"filter":"moduleSetOverlap","minOverlapPercent":70,"limit":20}
module-set graph No ASCII graph output; use moduleSetQuery plus productTracePath or productUsage for structured edges.
module-set suggest_for_modules {"filter":"suggestModuleSetsForModules","modules":["<module>"]}
product info {"filter":"productQuery","product":"<product>"}
product search {"filter":"productQuery","name":"<name>","limit":20}
product compare {"filter":"productCompare","product":"<product1>","product2":"<product2>"}
product similar {"filter":"productSimilarity","threshold":0.8,"limit":20}
product composition {"filter":"composition"} for all products; use productQuery for one product.
product trace_path {"filter":"productTracePath","product":"<product>","moduleSet":"<set>"}
product deprecated_includes {"filter":"deprecatedIncludes","product":"<product>"}
product full_analysis Avoid unless explicitly needed; omit the filter only when the full raw model is required.
validation community_products {"filter":"validation","check":"community_products"}
validation module_set_locations {"filter":"validation","check":"module_set_locations"}
validation loading_inconsistencies {"filter":"validation","check":"loading_inconsistencies"}

Fast Recipes

Where is a module included?

{"filter":"moduleInfo","module":"<module>","limit":50}
{"filter":"modulePaths","module":"<module>"}

What depends on what, and why?

{"filter":"moduleDependencies","module":"<module>","includeTransitive":false,"includeTestDependencies":false}
{"filter":"dependencyPath","fromModule":"<from>","toModule":"<to>","includeTestDependencies":true,"includeScopes":true}

Who owns a module?

{"filter":"moduleOwners","module":"<module>","includeTestSources":true}

Which products or module sets use something?

{"filter":"moduleInfo","module":"<module>","limit":50}
{"filter":"productQuery","usesModuleSet":"<module-set>","limit":50}
{"filter":"productUsage","moduleSet":"<module-set>"}

Can a module stop being embedded?

{"filter":"moduleInfo","module":"<module>","limit":50}
{"filter":"moduleLoading","loading":"EMBEDDED","details":true,"limit":200}
{"filter":"validation","check":"embedded_dependency_closure","module":"<module>","pluginSourceOnly":true}

For the loading query, inspect moduleLoading.result.entries.items for the target module; moduleLoading filters by loading rule, not by module name. The embedded closure check answers whether an embedded source module has dependencies that are not also supplied by embedded sources in affected products.

Did a Product DSL edit introduce placement or loading problems?

{"filter":"validation","check":"community_products"}
{"filter":"validation","check":"module_set_locations"}
{"filter":"validation","check":"loading_inconsistencies"}
{"filter":"validation","check":"embedded_dependency_closure","pluginSourceOnly":true}

Which module set should contain these modules?

{"filter":"suggestModuleSetsForModules","modules":["<module1>","<module2>"],"limit":20}

Reading Output

  • Compact list fields use count, items, and truncated; increase limit or set details:true only when needed.
  • Some focused filters return an error field in JSON for missing selectors or unknown names; a successful process exit does not always mean the query matched.
  • For direct embeddedDependencyClosure, use value for the product selector. The validation wrapper accepts product or value.
  • location values are COMMUNITY or ULTIMATE. loading values are EMBEDDED, REQUIRED, OPTIONAL, ON_DEMAND, or UNSPECIFIED.

Request Fields

Use only fields relevant to the filter. Omit false, null, and default values unless they are semantically important.

Core selectors: filter, value, module, moduleSet, product, product2, name, location, usesModuleSet, modules, fromModule, toModule, source, target.

Options: operation, graph, check, loading, strategy, limit, minModuleCount, details, threshold, minOverlapPercent, includeTransitive, includeTestDependencies, includeTestSources, includeScopes, pluginSourceOnly.

Practical Rules

  • Start with summary, moduleInfo, moduleSetQuery, or productQuery when exploring.
  • Use details:false and a small limit until you know the exact module set or product.
  • Use the legacy precise filters (moduleDependencies, dependencyPath, moduleOwners, moduleReachability, productUsage, embeddedDependencyClosure, mergeImpact) when you need the full typed analysis for one target.
  • Use --json=- or --json=@file for complex requests instead of adding more CLI flags.
  • If the command fails before producing JSON, treat stderr as the source of truth; invalid JSON requests exit nonzero.

Version History

  • 2af32ff Current 2026-09-22 01:03

Same Skill Collection

.agents/skills/actions/SKILL.md
.agents/skills/bazel-test-migration/SKILL.md
.agents/skills/code-style/SKILL.md
.agents/skills/commits/SKILL.md
.agents/skills/compare-python-typecheckers/SKILL.md
.agents/skills/conda-env-tests/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/fix-project-leak-from-tc-report/SKILL.md
.agents/skills/icon-resources/SKILL.md
.agents/skills/icons/SKILL.md
.agents/skills/ide-diagnostics-mcp/SKILL.md
.agents/skills/jewel-markdown/SKILL.md
.agents/skills/jewel-pr-preparer/SKILL.md
.agents/skills/jewel-release-helper/SKILL.md
.agents/skills/jna/SKILL.md
.agents/skills/kotlin-ui-dsl/SKILL.md
.agents/skills/kotlin-ui-swing-component-architecture/SKILL.md
.agents/skills/module-dependencies/SKILL.md
.agents/skills/module-set-pluginization/SKILL.md
.agents/skills/notebook-for-experiment/SKILL.md
.agents/skills/platform-coroutines-structured-concurrency/SKILL.md
.agents/skills/poly-context/SKILL.md
.agents/skills/poly-symbols/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/symbols-api/SKILL.md
.agents/skills/testing-internals/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/treehouse/SKILL.md
.agents/skills/ui-accessibility/SKILL.md
.agents/skills/writing-tests/SKILL.md
.agents/skills/youtrack-community/SKILL.md
.claude/skills/actions/SKILL.md
.claude/skills/bazel-test-migration/SKILL.md
.claude/skills/code-style/SKILL.md
.claude/skills/commits/SKILL.md
.claude/skills/compare-python-typecheckers/SKILL.md
.claude/skills/conda-env-tests/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/fix-project-leak-from-tc-report/SKILL.md

Metadata

Files
0
Version
2af32ff
Hash
b2e22934
Indexed
2026-09-22 01:03

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 01:09
浙ICP备14020137号-1