actions

GitHub

提供 IntelliJ 平台 AnAction 的实现指南,涵盖最佳实践、配置规范及示例代码。

.agents/skills/actions/SKILL.md DetachHead/rebased

Trigger Scenarios

创建或修改 IntelliJ IDEA 插件中的动作 实现 AnAction 类时参考架构与用法

Install

npx skills add DetachHead/rebased --skill actions -g -y
More Options

Non-standard path

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

Use without installing

npx skills use DetachHead/rebased@actions

指定 Agent (Claude Code)

npx skills add DetachHead/rebased --skill actions -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": "actions",
    "description": "Guidelines for implementing IntelliJ actions (AnAction). Use those rules when you need to create or change an action in the intellij platform."
}

Actions

Guidelines for implementing IntelliJ actions (AnAction).

Documentation

Best Practices

  • NEVER instantiate Presentation in action constructors - Use no-argument constructors
  • Define text, description, and icon in plugin.xml - Not in constructor parameters
  • Use AnActionEvent#getCoroutineScope for launching suspending computations - actionPerformed runs synchronously with event invocation and may freeze the IDE.
  • Follow the convention:
    1. Set the id attribute for the action in plugin.xml
    2. Optionally set the icon attribute if an icon is needed
    3. Set text and description in the message bundle (e.g., GitBundle.properties):
    • action.<action-id>.text=Translated Action Text
    • action.<action-id>.description=Translated Action Description

Good example:

Kotlin:

class MyAction : AnAction()

plugin.xml:

<action id="My.Action.Id"
        class="my.package.MyAction"
        icon="my.package.MyIcons.ICON"/>

Bundle.properties:

action.My.Action.Id.text=My Action
action.My.Action.Id.description=Description of my action

Version History

  • 1f8708d Current 2026-08-16 15:38

Same Skill Collection

.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/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

Metadata

Files
0
Version
1f8708d
Hash
f9dac095
Indexed
2026-08-16 15:38

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-16 22:34
浙ICP备14020137号-1 $mapa de visitantes$