Agent SkillsDetachHead/rebased › registry

registry

GitHub

提供 IntelliJ Registry API 使用指南,涵盖键定义、访问方法及早期启动安全用法。

.claude/skills/registry/SKILL.md DetachHead/rebased

触发场景

需要定义或覆盖 IntelliJ 注册表键 在插件中读取特性标志位 处理 IDE 早期启动时的注册表访问

安装

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

非标准路径

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

不安装直接使用

npx skills use DetachHead/rebased@registry

指定 Agent (Claude Code)

npx skills add DetachHead/rebased --skill registry -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": "registry",
    "description": "Guidelines for using the IntelliJ Registry API. Use when working with registry keys or feature flags."
}

Working with Registry

Guidelines for using the IntelliJ Registry API.

Documentation

Quick Reference

Defining a Registry Key

Always prefer declaring in plugin.xml (not registry.properties):

<registryKey key="my.feature.enabled"
             defaultValue="true"
             description="Enables my feature"
             restartRequired="false"/>

To override in a dependent plugin:

<registryKey key="my.feature.enabled"
             defaultValue="false"
             description="Enables my feature"
             restartRequired="false"
             overrides="true"/>

Accessing the Registry

In suspending code:

val isEnabled = RegistryManager.getInstanceAsync().get("my.key")

In blocking code:

val isEnabled = RegistryManager.getInstance().get("my.key")

Access via Registry.get() or Registry.is() is effectively deprecated, since it might cause problems during early IDE startup. Always prefer the RegistryManager when possible.

Early Startup: Registry.is() with Default Value

When code may run before COMPONENTS_LOADED state (e.g., during EULA dialog, splash screen), you MUST use Registry.is(key, defaultValue) with an explicit default:

// Required for early startup code
Registry.`is`("my.key", false)  // default must match registry.properties

How to find the default value:

  1. Search in community/platform/util/resources/misc/registry.properties
  2. Or check the <registryKey> declaration in plugin.xml

Why: Registry.is(key) without default throws an exception if called before LoadingState.COMPONENTS_LOADED. The safe overload returns the provided default when Registry is not yet initialized.

Override via Command Line

For testing or run configurations:

-Dmy.registry.key=value

Registry in Tests

Use @RegistryKey annotation instead of Registry.get().setValue():

@Test
@RegistryKey(key = "my.registry.key", value = "true")
fun testWithRegistryEnabled() { ... }

See writing-tests.md for more test patterns.

版本历史

  • 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-dependencies/SKILL.md
.claude/skills/module-set-pluginization/SKILL.md
.claude/skills/notebook-for-experiment/SKILL.md
.claude/skills/pseudo-kmp/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
aa28ccee
收录时间
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 $访客地图$