[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74FW39C72SWJQ293JA2WG9Z":3,"skill-same:01M74FW39C72SWJQ293JA2WG9Z":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M74FW39C72SWJQ293JA2WG9Z","add-notification",null,"在 IDEA 插件中通过统一通知组发送气泡通知（信息 \u002F 警告 \u002F 错误）","dong4j\u002Fskill-inspector","dong4j","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F20341123?v=4","01M74FVQ9QPK760ZRZ7F32AMGN","01M74FVQACEMG56Q0BHA8JB271",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdong4j\u002Fskill-inspector\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fadd-notification\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: add-notification\ndescription: 在 IDEA 插件中通过统一通知组发送气泡通知（信息 \u002F 警告 \u002F 错误）\n---\n\n# \u002Fadd-notification — 发送通知\n\n通过项目统一的 `NotificationUtil` 工具类发送一条气泡通知。**项目惯例**：所有通知共用一个通知组 `Skill Inspector Notifications`，避免在\n`Settings → Notifications` 里散落多个开关。\n\n## Usage\n\n```\n\u002Fadd-notification [type] [message-key]\n```\n\n- `type` — `info` \u002F `warning` \u002F `error`\n- `message-key` — i18n key（不要直接写死字符串）\n\n## Information Needed\n\n1. **触发场景** — Action 完成、Quick Fix 失败、扫描结果汇总……\n2. **严重度** — INFORMATION（绿）\u002F WARNING（黄）\u002F ERROR（红）。\n3. **是否需要操作链接** — 例如\"点击查看详情\"。\n4. **是否在没有 project 时也要发** — 如插件加载失败提示，传 `project=null`。\n\n## Files to Create\u002FModify\n\n### 不需要新建文件，直接调用 `NotificationUtil`\n\n```java\nimport dev.dong4j.idea.skill.inspector.util.NotificationUtil;\nimport dev.dong4j.idea.skill.inspector.util.SkillInspectorBundle;\n\nNotificationUtil.showInfo(project, SkillInspectorBundle.message(\"xxx.completed\"));\nNotificationUtil.showWarning(project, SkillInspectorBundle.message(\"xxx.has.errors\"));\nNotificationUtil.showError(project, SkillInspectorBundle.message(\"xxx.failed\"));\n```\n\n参考：\n\n```49:73:src\u002Fmain\u002Fjava\u002Fdev\u002Fdong4j\u002Fidea\u002Fskill\u002Finspector\u002Futil\u002FNotificationUtil.java\n    public static void showInfo(@Nullable Project project, @NotNull String message) {\n        notify(project, message, NotificationType.INFORMATION);\n    }\n\n    \u002F**\n     * 显示警告通知\n     * \u003Cp> 调用 IntelliJ Platform 的通知系统显示警告信息\n     *\n     * @param project 项目对象, 可以为空\n     * @param message 要显示的警告内容, 不能为空\n     *\u002F\n    public static void showWarning(@Nullable Project project, @NotNull String message) {\n        notify(project, message, NotificationType.WARNING);\n    }\n\n    \u002F**\n     * 显示错误通知\n     * \u003Cp> 在指定的项目中显示错误级别的通知信息\n     *\n     * @param project 项目对象, 可以为空\n     * @param message 错误通知的内容, 不能为空\n     *\u002F\n    public static void showError(@Nullable Project project, @NotNull String message) {\n        notify(project, message, NotificationType.ERROR);\n    }\n```\n\n### 严重度选择指南\n\n| 场景                                | 选哪个                         |\n|-----------------------------------|-----------------------------|\n| 任务成功完成、纯信息提示                      | `showInfo`                  |\n| 任务完成但发现需要用户关注的问题（如扫到 N 个 warning） | `showWarning`               |\n| 任务失败、操作被拦截                        | `showError`                 |\n| 重大异常 \u002F 需要用户立刻处理                   | 用 `showError` 并附操作链接（见下方扩展） |\n\n参考用法：\n\n```174:191:src\u002Fmain\u002Fjava\u002Fdev\u002Fdong4j\u002Fidea\u002Fskill\u002Finspector\u002Faction\u002FSkillInspectorAction.java\n        String message = SkillInspectorBundle.message(\n            \"action.validate.skill.completed\",\n            summary.totalFiles,\n            summary.totalErrors,\n            summary.totalWarnings\n        );\n\n        if (summary.totalErrors > 0 && summary.firstErrorFile != null) {\n            NotificationUtil.showWarning(project, message);\n            \u002F\u002F 自动把第一个有错的 SKILL.md 打到编辑器前台, 方便用户立刻处理.\n            FileEditorManager.getInstance(project).openFile(summary.firstErrorFile, true);\n        } else if (summary.totalErrors > 0) {\n            NotificationUtil.showWarning(project, message);\n        } else if (summary.totalWarnings > 0) {\n            NotificationUtil.showInfo(project, message);\n        } else {\n            NotificationUtil.showInfo(project, message);\n        }\n```\n\n## 通知组（已注册，不要新建）\n\n通知组 ID 在 `plugin.xml` 中注册：\n\n```40:43:src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fplugin.xml\n        \u003C!-- 通知组 -->\n        \u003C!--suppress PluginXmlI18n -->\n        \u003CnotificationGroup id=\"Skill Inspector Notifications\"\n                           displayType=\"BALLOON\"\n                           isLogByDefault=\"true\"\u002F>\n```\n\n**关键约束**：\n\n- **`displayType` 选 `BALLOON`**（项目惯例）：右下角气泡，不阻塞、可被用户在 Settings 里调成 STICKY_BALLOON \u002F TOOL_WINDOW \u002F NONE。\n- **`isLogByDefault=\"true\"`**：确保通知历史可在 `Event Log` 里回看，方便用户查证。\n- **不要为新功能建新通知组**：除非语义完全不同（例如\"自动同步\"vs\"规则检查\"分得很开），否则一律复用 `Skill Inspector Notifications`。\n\n## 扩展：附操作链接\n\n如果通知需要用户点击执行某个 Action（例如\"查看详情\"），用 `Notification.addAction()`：\n\n```java\nNotification notification = NotificationGroupManager.getInstance()\n    .getNotificationGroup(\"Skill Inspector Notifications\")\n    .createNotification(PluginContents.PLUGIN_NAME, message, NotificationType.WARNING);\n\nnotification.addAction(NotificationAction.createSimple(\n    SkillInspectorBundle.message(\"notification.action.open.problems\"),\n    () -> {\n        ToolWindow tw = ToolWindowManager.getInstance(project).getToolWindow(\"Problems View\");\n        if (tw != null) tw.show();\n    }\n));\n\nnotification.notify(project);\n```\n\n> 当前 `NotificationUtil` 只暴露三个无操作链接的便捷方法。**如果某个 skill 一定要带操作链接**，要么在调用处直接用上面的原生 API，要么扩展\n`NotificationUtil` 加一个 `showWithAction(...)` 方法（注意保持 i18n + bundle key 同步）。\n\n## i18n 文案\n\n```properties\nxxx.completed=Operation completed: {0} files processed\nxxx.failed=Operation failed: {0}\nnotification.action.open.problems=Open Problems View\n```\n\n详见 `\u002Fadd-i18n-key`。\n\n## Build & Verify\n\n```bash\n.\u002Fgradlew compileJava\n.\u002Fgradlew runIde\n# 在 IDE 实例触发动作 → 右下角应弹出气泡，且 Event Log 中可见同条记录\n```\n\n## Troubleshooting\n\n- **`Notification group not registered: ...`**：通知组 ID 与 `plugin.xml` 不一致。`NotificationUtil.NOTIFICATION_GROUP_ID` 常量与\n  `\u003CnotificationGroup id=\"...\">` 必须 byte-for-byte 相同。\n- **气泡不出现**：用户可能在 `Settings → Notifications` 把对应组关成了 NONE；可在 Event Log 中确认通知是否真的发出。\n- **`PluginXmlI18n` 警告**：通知组的 `id` 是英文常量，IntelliJ 静态检查会要求加 i18n，本项目已用 `\u003C!--suppress PluginXmlI18n -->`\n  抑制。新增通知组沿用相同抑制即可。\n- **通知里换行不生效**：`message` 用 `\u003Cbr\u002F>` 而不是 `\\n`（IntelliJ 通知支持简单 HTML）。\n- **没有 project 时通知 NPE**：用 `NotificationUtil.showError(null, ...)`，工具类已经处理 nullable。\n\n## 参考代码\n\n- 工具类：`src\u002Fmain\u002Fjava\u002Fdev\u002Fdong4j\u002Fidea\u002Fskill\u002Finspector\u002Futil\u002FNotificationUtil.java`\n- 通知组注册：`src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fplugin.xml`\n- 调用范式：`src\u002Fmain\u002Fjava\u002Fdev\u002Fdong4j\u002Fidea\u002Fskill\u002Finspector\u002Faction\u002FSkillInspectorAction.java`\n- IntelliJ 官方文档：\u003Chttps:\u002F\u002Fplugins.jetbrains.com\u002Fdocs\u002Fintellij\u002Fnotifications.html>\n","# \u002Fadd-notification — 发送通知\n\n通过项目统一的 `NotificationUtil` 工具类发送一条气泡通知。**项目惯例**：所有通知共用一个通知组 `Skill Inspector Notifications`，避免在\n`Settings → Notifications` 里散落多个开关。\n\n## Usage\n\n```\n\u002Fadd-notification [type] [message-key]\n```\n\n- `type` — `info` \u002F `warning` \u002F `error`\n- `message-key` — i18n key（不要直接写死字符串）\n\n## Information Needed\n\n1. **触发场景** — Action 完成、Quick Fix 失败、扫描结果汇总……\n2. **严重度** — INFORMATION（绿）\u002F WARNING（黄）\u002F ERROR（红）。\n3. **是否需要操作链接** — 例如\"点击查看详情\"。\n4. **是否在没有 project 时也要发** — 如插件加载失败提示，传 `project=null`。\n\n## Files to Create\u002FModify\n\n### 不需要新建文件，直接调用 `NotificationUtil`\n\n```java\nimport dev.dong4j.idea.skill.inspector.util.NotificationUtil;\nimport dev.dong4j.idea.skill.inspector.util.SkillInspectorBundle;\n\nNotificationUtil.showInfo(project, SkillInspectorBundle.message(\"xxx.completed\"));\nNotificationUtil.showWarning(project, SkillInspectorBundle.message(\"xxx.has.errors\"));\nNotificationUtil.showError(project, SkillInspectorBundle.message(\"xxx.failed\"));\n```\n\n参考：\n\n```49:73:src\u002Fmain\u002Fjava\u002Fdev\u002Fdong4j\u002Fidea\u002Fskill\u002Finspector\u002Futil\u002FNotificationUtil.java\n    public static void showInfo(@Nullable Project project, @NotNull String message) {\n        notify(project, message, NotificationType.INFORMATION);\n    }\n\n    \u002F**\n     * 显示警告通知\n     * \u003Cp> 调用 IntelliJ Platform 的通知系统显示警告信息\n     *\n     * @param project 项目对象, 可以为空\n     * @param message 要显示的警告内容, 不能为空\n     *\u002F\n    public static void showWarning(@Nullable Project project, @NotNull String message) {\n        notify(project, message, NotificationType.WARNING);\n    }\n\n    \u002F**\n     * 显示错误通知\n     * \u003Cp> 在指定的项目中显示错误级别的通知信息\n     *\n     * @param project 项目对象, 可以为空\n     * @param message 错误通知的内容, 不能为空\n     *\u002F\n    public static void showError(@Nullable Project project, @NotNull String message) {\n        notify(project, message, NotificationType.ERROR);\n    }\n```\n\n### 严重度选择指南\n\n| 场景                                | 选哪个                         |\n|-----------------------------------|-----------------------------|\n| 任务成功完成、纯信息提示                      | `showInfo`                  |\n| 任务完成但发现需要用户关注的问题（如扫到 N 个 warning） | `showWarning`               |\n| 任务失败、操作被拦截                        | `showError`                 |\n| 重大异常 \u002F 需要用户立刻处理                   | 用 `showError` 并附操作链接（见下方扩展） |\n\n参考用法：\n\n```174:191:src\u002Fmain\u002Fjava\u002Fdev\u002Fdong4j\u002Fidea\u002Fskill\u002Finspector\u002Faction\u002FSkillInspectorAction.java\n        String message = SkillInspectorBundle.message(\n            \"action.validate.skill.completed\",\n            summary.totalFiles,\n            summary.totalErrors,\n            summary.totalWarnings\n        );\n\n        if (summary.totalErrors > 0 && summary.firstErrorFile != null) {\n            NotificationUtil.showWarning(project, message);\n            \u002F\u002F 自动把第一个有错的 SKILL.md 打到编辑器前台, 方便用户立刻处理.\n            FileEditorManager.getInstance(project).openFile(summary.firstErrorFile, true);\n        } else if (summary.totalErrors > 0) {\n            NotificationUtil.showWarning(project, message);\n        } else if (summary.totalWarnings > 0) {\n            NotificationUtil.showInfo(project, message);\n        } else {\n            NotificationUtil.showInfo(project, message);\n        }\n```\n\n## 通知组（已注册，不要新建）\n\n通知组 ID 在 `plugin.xml` 中注册：\n\n```40:43:src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fplugin.xml\n        \u003C!-- 通知组 -->\n        \u003C!--suppress PluginXmlI18n -->\n        \u003CnotificationGroup id=\"Skill Inspector Notifications\"\n                           displayType=\"BALLOON\"\n                           isLogByDefault=\"true\"\u002F>\n```\n\n**关键约束**：\n\n- **`displayType` 选 `BALLOON`**（项目惯例）：右下角气泡，不阻塞、可被用户在 Settings 里调成 STICKY_BALLOON \u002F TOOL_WINDOW \u002F NONE。\n- **`isLogByDefault=\"true\"`**：确保通知历史可在 `Event Log` 里回看，方便用户查证。\n- **不要为新功能建新通知组**：除非语义完全不同（例如\"自动同步\"vs\"规则检查\"分得很开），否则一律复用 `Skill Inspector Notifications`。\n\n## 扩展：附操作链接\n\n如果通知需要用户点击执行某个 Action（例如\"查看详情\"），用 `Notification.addAction()`：\n\n```java\nNotification notification = NotificationGroupManager.getInstance()\n    .getNotificationGroup(\"Skill Inspector Notifications\")\n    .createNotification(PluginContents.PLUGIN_NAME, message, NotificationType.WARNING);\n\nnotification.addAction(NotificationAction.createSimple(\n    SkillInspectorBundle.message(\"notification.action.open.problems\"),\n    () -> {\n        ToolWindow tw = ToolWindowManager.getInstance(project).getToolWindow(\"Problems View\");\n        if (tw != null) tw.show();\n    }\n));\n\nnotification.notify(project);\n```\n\n> 当前 `NotificationUtil` 只暴露三个无操作链接的便捷方法。**如果某个 skill 一定要带操作链接**，要么在调用处直接用上面的原生 API，要么扩展\n`NotificationUtil` 加一个 `showWithAction(...)` 方法（注意保持 i18n + bundle key 同步）。\n\n## i18n 文案\n\n```properties\nxxx.completed=Operation completed: {0} files processed\nxxx.failed=Operation failed: {0}\nnotification.action.open.problems=Open Problems View\n```\n\n详见 `\u002Fadd-i18n-key`。\n\n## Build & Verify\n\n```bash\n.\u002Fgradlew compileJava\n.\u002Fgradlew runIde\n# 在 IDE 实例触发动作 → 右下角应弹出气泡，且 Event Log 中可见同条记录\n```\n\n## Troubleshooting\n\n- **`Notification group not registered: ...`**：通知组 ID 与 `plugin.xml` 不一致。`NotificationUtil.NOTIFICATION_GROUP_ID` 常量与\n  `\u003CnotificationGroup id=\"...\">` 必须 byte-for-byte 相同。\n- **气泡不出现**：用户可能在 `Settings → Notifications` 把对应组关成了 NONE；可在 Event Log 中确认通知是否真的发出。\n- **`PluginXmlI18n` 警告**：通知组的 `id` 是英文常量，IntelliJ 静态检查会要求加 i18n，本项目已用 `\u003C!--suppress PluginXmlI18n -->`\n  抑制。新增通知组沿用相同抑制即可。\n- **通知里换行不生效**：`message` 用 `\u003Cbr\u002F>` 而不是 `\\n`（IntelliJ 通知支持简单 HTML）。\n- **没有 project 时通知 NPE**：用 `NotificationUtil.showError(null, ...)`，工具类已经处理 nullable。\n\n## 参考代码\n\n- 工具类：`src\u002Fmain\u002Fjava\u002Fdev\u002Fdong4j\u002Fidea\u002Fskill\u002Finspector\u002Futil\u002FNotificationUtil.java`\n- 通知组注册：`src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fplugin.xml`\n- 调用范式：`src\u002Fmain\u002Fjava\u002Fdev\u002Fdong4j\u002Fidea\u002Fskill\u002Finspector\u002Faction\u002FSkillInspectorAction.java`\n- IntelliJ 官方文档：\u003Chttps:\u002F\u002Fplugins.jetbrains.com\u002Fdocs\u002Fintellij\u002Fnotifications.html>\n",{"name":5,"description":7},"main","c0266b890b58adaa8f53b9f33b11529190898b49",".claude\u002Fskills\u002Fadd-notification","https:\u002F\u002Fgithub.com\u002Fdong4j\u002Fskill-inspector","https:\u002F\u002Fskill-inspector.dong4j.site\u002F","https:\u002F\u002Fgithub.com\u002Fdong4j","dong4j.github.io","Product designer who focuses on simplicity & usability.","2026-08-05 00:38:56",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add dong4j\u002Fskill-inspector --skill add-notification",{"tool":38,"command":39},"bunx","bunx skills add dong4j\u002Fskill-inspector --skill add-notification",{"tool":41,"command":42},"pnpm","pnpm dlx skills add dong4j\u002Fskill-inspector --skill add-notification","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdong4j\u002Fskill-inspector\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fadd-notification\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":18},"01M74FYTATP8V4W018N979431T","unused-reference-resource","Use this skill when `references\u002F` contains files that are never linked from the body.","https:\u002F\u002Fgithub.com\u002Fdong4j\u002Fskill-inspector\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Ffixtures\u002Fskills\u002Funused-reference-resource\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M74FYRN28TF1P34H0X7DKYN9","short-description","too short","https:\u002F\u002Fgithub.com\u002Fdong4j\u002Fskill-inspector\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Ffixtures\u002Fskills\u002Fshort-description\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M74FYPRJBM1QSQQBZYSN31E2","security-sensitive-path","Use this skill when verifying detection of sensitive paths like `.env` or `~\u002F.ssh` in the body.","https:\u002F\u002Fgithub.com\u002Fdong4j\u002Fskill-inspector\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Ffixtures\u002Fskills\u002Fsecurity-sensitive-path\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M74FYMD6NC9Y2PH6MCGR1Z1J","security-secret","Use this skill when verifying detection of leaked secret patterns in the body.","https:\u002F\u002Fgithub.com\u002Fdong4j\u002Fskill-inspector\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Ffixtures\u002Fskills\u002Fsecurity-secret\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M74FYJ5SYAZZ4TTPN74STE1K","security-prompt-injection","Use this skill when verifying detection of prompt-injection phrases such as \"ignore previous instructions\".","https:\u002F\u002Fgithub.com\u002Fdong4j\u002Fskill-inspector\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Ffixtures\u002Fskills\u002Fsecurity-prompt-injection\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M74FYFQH6Q4NHE1K6CXDBARS","security-dangerous-command","Use this skill when verifying detection of dangerous shell commands in the body.","https:\u002F\u002Fgithub.com\u002Fdong4j\u002Fskill-inspector\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Ffixtures\u002Fskills\u002Fsecurity-dangerous-command\u002FSKILL.md",[],[]]