docs: make icon-jetbrains skill the single source of truth for SVG authoring

Remove duplicated sizing, dark variant, and palette guidance from
packages/kilo-jetbrains/AGENTS.md that conflicted with the skill
(e.g. 13×13 classic vs the correct 16×16 legacy tool-window size).

AGENTS.md now explicitly defers to the skill for all SVG authoring
details and retains only Kotlin/runtime integration guidance.
This commit is contained in:
kiloconnect[bot]
2026-07-30 19:41:53 +00:00
parent fa8d5d1ea1
commit 8e91c315d0
2 changed files with 8 additions and 16 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ description: Create or review IntelliJ New UI SVG icons, theme variants, sizes,
# IntelliJ Platform New UI Icons
Guidance for authoring SVG icons for the New UI.
Guidance for authoring SVG icons for the New UI. This skill is the single source of truth for icon sizing, palette, dark variants, composition rules, and placement. Other docs (including `packages/kilo-jetbrains/AGENTS.md`) defer here for SVG authoring details.
Background: the IDE maintains Classic UI and New UI in parallel. Code branches with `ExperimentalUI.isNewUI()`; icons follow the same split. Old icons stay in their original resource folders for Classic-UI compatibility. New-UI icons live under `expui/` folders and are substituted for the old ones at runtime by icon mappers.
+7 -15
View File
@@ -574,32 +574,24 @@ child.align(HAlign.TRACK, VAlign.TRACK) // fill all available space
### Icons and SVG Assets
When creating, modifying, or reviewing JetBrains plugin icon assets, load and follow the `icon-jetbrains` skill in `.kilo/skills/icon-jetbrains/SKILL.md` for New UI SVG roles, sizing, palette, dark variants, and validation guidance.
The `icon-jetbrains` skill (`.kilo/skills/icon-jetbrains/SKILL.md`) is the single source of truth for SVG icon authoring: canvas sizes, palette colors, dark variants, composition rules, placement, and validation. Always load that skill when creating, modifying, or reviewing icon assets. Do not duplicate its guidance here.
Official references:
- [IntelliJ Platform UI Guidelines](https://jetbrains.design/intellij/)
- [User Interface Components](https://plugins.jetbrains.com/docs/intellij/user-interface-components.html)
- [UI FAQ (colors, borders, icons)](https://plugins.jetbrains.com/docs/intellij/ui-faq.html)
This section covers only the Kotlin/runtime integration side:
- For compact icon-only actions, use `ai.kilocode.client.ui.HoverIcon` so the control gets the standard 24×24 hover treatment. Do not create `JButton(icon)` or wrap a bare icon in a button just to make it clickable.
- **Reuse platform icons**: browse at https://intellij-icons.jetbrains.design. Access via `AllIcons.*` constants.
- Custom icons: SVG files in `resources/icons/`. Load via `IconLoader.getIcon("/icons/foo.svg", MyClass::class.java)`.
- Organize in an `icons` package or a `*Icons` object with `@JvmField` on each constant.
- **Sizing**: actions/nodes = 16×16, tool window = 13×13 (classic) or 20×20 + 16×16 compact (New UI), editor gutter = 12×12 (classic) / 14×14 (New UI).
- **Dark variants**: `icon.svg` + `icon_dark.svg`. HiDPI: `icon@2x.svg` + `icon@2x_dark.svg`.
- **New UI support**: place New UI icons in `expui/` directory, create `*IconMappings.json`, register via `com.intellij.iconMapper` extension point. New UI icon colors: light `#6C707E`, dark `#CED0D6`.
- Register New UI icon mappings via `com.intellij.iconMapper` extension point.
IntelliJ does not theme SVG icons with `currentColor`, CSS classes, CSS variables, `<style>` blocks, or inherited styles. `SVGLoader` patches icon colors by matching literal hex values in `fill` and `stroke` attributes against the active theme palette. Use hardcoded palette hex values in SVG assets and provide dark variants. This exception applies to icon asset files only; runtime Swing UI code must still derive colors from theme APIs.
| Do | Do not |
|---|---|
| `fill="#6E6E6E"` | `fill="currentColor"` |
| `stroke="#3574F0"` | CSS variables or classes |
| `icon.svg` plus `icon_dark.svg` | `<style>` blocks for theming |
| `fill-opacity="0.5"` | Inherited styling |
Themes can override palette colors through `icons.ColorPalette` in the theme JSON.
Official references:
- [IntelliJ Platform UI Guidelines](https://jetbrains.design/intellij/)
- [UI FAQ (colors, borders, icons)](https://plugins.jetbrains.com/docs/intellij/ui-faq.html)
### Before Returning UI Code
Review generated UI code and remove: