|
| 1 | +--- |
| 2 | +slug: devoxxgenie-plugin-integrations |
| 3 | +title: "Extending DevoxxGenie: How External Plugins Can Plug Into Your AI Assistant" |
| 4 | +authors: [stephanj] |
| 5 | +tags: [integrations, sonarlint, spotbugs, intellij plugin, api, backlog, spec-driven development, open source] |
| 6 | +date: 2026-02-18 |
| 7 | +description: "Learn how IntelliJ plugins can integrate with DevoxxGenie at runtime — and see it in action with SonarLint and SpotBugs forks that let you fix code-quality findings with a single click." |
| 8 | +keywords: [devoxxgenie, intellij plugin integration, sonarlint, spotbugs, external prompt service, backlog tasks, code quality, ai fix] |
| 9 | +image: /img/integrations/sonarlint-banner.png |
| 10 | +--- |
| 11 | + |
| 12 | +# Extending DevoxxGenie: How External Plugins Can Plug Into Your AI Assistant |
| 13 | + |
| 14 | +DevoxxGenie is not a closed system. It exposes a small but powerful API that other IntelliJ plugins can use to interact with it at runtime — no hard compile-time dependency required. Two real-world forks demonstrate the pattern beautifully: a SonarLint fork and a SpotBugs fork that each detect a code-quality finding and send a rich, context-aware prompt to DevoxxGenie with a single click. |
| 15 | + |
| 16 | +<!-- truncate --> |
| 17 | + |
| 18 | +Whether you maintain an IntelliJ plugin yourself or just want to understand how these integrations work under the hood, this post walks through the full picture: the integration API first, then the two concrete implementations with screenshots. |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## The Integration API |
| 23 | + |
| 24 | +### Detecting DevoxxGenie at Runtime |
| 25 | + |
| 26 | +The first thing any integration needs to do is check whether DevoxxGenie is actually installed in the IDE. You don't want your plugin to blow up or show broken UI when DevoxxGenie isn't present. The check is a two-liner using `PluginManagerCore`: |
| 27 | + |
| 28 | +```java |
| 29 | +import com.intellij.ide.plugins.PluginManagerCore; |
| 30 | +import com.intellij.openapi.extensions.PluginId; |
| 31 | + |
| 32 | +public static boolean isDevoxxGenieAvailable() { |
| 33 | + var plugin = PluginManagerCore.getPlugin(PluginId.getId("com.devoxx.genie")); |
| 34 | + return plugin != null && plugin.isEnabled(); |
| 35 | +} |
| 36 | +``` |
| 37 | + |
| 38 | +Always guard your integration code with this check. If DevoxxGenie is absent, your plugin should degrade gracefully — hide the action, skip the menu item, or silently no-op. |
| 39 | + |
| 40 | +### Sending a Prompt via Reflection |
| 41 | + |
| 42 | +DevoxxGenie exposes `ExternalPromptService` as the entry point for receiving prompt text from other plugins. Rather than requiring a hard compile-time dependency on DevoxxGenie's JAR, you access it via reflection. This means your plugin can be distributed independently and will simply not call the API if DevoxxGenie isn't present: |
| 43 | + |
| 44 | +```java |
| 45 | +public static void sendPrompt(Project project, String promptText) { |
| 46 | + if (!isDevoxxGenieAvailable()) return; |
| 47 | + |
| 48 | + try { |
| 49 | + Class<?> serviceClass = Class.forName( |
| 50 | + "com.devoxx.genie.service.ExternalPromptService" |
| 51 | + ); |
| 52 | + Object instance = serviceClass |
| 53 | + .getMethod("getInstance", Project.class) |
| 54 | + .invoke(null, project); |
| 55 | + |
| 56 | + serviceClass |
| 57 | + .getMethod("setPromptText", String.class) |
| 58 | + .invoke(instance, promptText); |
| 59 | + |
| 60 | + } catch (Exception e) { |
| 61 | + // DevoxxGenie not available or API changed — fail silently |
| 62 | + } |
| 63 | +} |
| 64 | +``` |
| 65 | + |
| 66 | +`setPromptText(String)` populates the DevoxxGenie prompt input and submits it immediately, triggering a full LLM query with the current conversation context. The response appears in the DevoxxGenie chat panel — no polling, no callbacks needed on your side. |
| 67 | + |
| 68 | +### Backlog Task File Integration |
| 69 | + |
| 70 | +Not every finding warrants an immediate AI fix. Sometimes you want to defer resolution to a later session or hand it off to the [Spec-Driven Development](/docs/features/spec-driven-development) workflow. For this, integrations can write `TASK-*.md` files directly into `backlog/tasks/` inside the project root: |
| 71 | + |
| 72 | +```markdown |
| 73 | +--- |
| 74 | +id: TASK-7 |
| 75 | +title: Fix SonarLint java:S2259 in UserService.java:87 |
| 76 | +status: todo |
| 77 | +priority: high |
| 78 | +created: 2026-02-18 |
| 79 | +source: sonarlint |
| 80 | +rule: java:S2259 |
| 81 | +file: src/main/java/com/example/UserService.java |
| 82 | +line: 87 |
| 83 | +--- |
| 84 | + |
| 85 | +## Description |
| 86 | + |
| 87 | +SonarQube rule **java:S2259** (Null pointers should not be dereferenced) triggered at |
| 88 | +`UserService.java:87`. |
| 89 | + |
| 90 | +## Acceptance Criteria |
| 91 | + |
| 92 | +- [ ] Resolve the SonarLint finding without introducing regressions |
| 93 | +- [ ] All existing tests pass |
| 94 | +``` |
| 95 | + |
| 96 | +DevoxxGenie picks these up automatically — they appear in the Spec Browser's task list and Kanban board, ready for an agent to implement. |
| 97 | + |
| 98 | +#### Task ID Synchronisation |
| 99 | + |
| 100 | +To avoid ID collisions across sessions, scan the three task storage locations before allocating a new ID: |
| 101 | + |
| 102 | +| Location | Content | |
| 103 | +|---|---| |
| 104 | +| `backlog/tasks/` | Active tasks | |
| 105 | +| `backlog/completed/` | Completed tasks | |
| 106 | +| `backlog/archive/tasks/` | Archived tasks | |
| 107 | + |
| 108 | +Find the highest existing `id: TASK-N` value across all three, then increment by one. The full Java implementation is in the [API reference](/docs/integrations/overview#task-id-synchronisation). |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +## SonarQube / SonarLint Integration |
| 113 | + |
| 114 | +The **SonarLint DevoxxGenie** plugin is a fork of SonarLint for IntelliJ (v11.13) that adds a DevoxxGenie AI layer on top of standard SonarQube analysis. |
| 115 | + |
| 116 | +<a href="https://www.youtube.com/watch?v=vWEK0jEIU3s" target="_blank" rel="noopener noreferrer" |
| 117 | + style={{display:'block',position:'relative',borderRadius:'8px',overflow:'hidden',boxShadow:'0 4px 8px rgba(0,0,0,0.1)',marginBottom:'1.5rem'}}> |
| 118 | + <img src="/img/integrations/sonarlint-banner.png" alt="SonarLint DevoxxGenie Demo" |
| 119 | + style={{width:'100%',display:'block',borderRadius:'8px'}} /> |
| 120 | + <div style={{position:'absolute',top:'50%',left:'50%',transform:'translate(-50%,-50%)', |
| 121 | + width:'68px',height:'48px',background:'#ff0000',borderRadius:'12px', |
| 122 | + display:'flex',alignItems:'center',justifyContent:'center'}}> |
| 123 | + <svg viewBox="0 0 68 48" width="68" height="48"><polygon points="27,17 27,31 41,24" fill="#fff"/></svg> |
| 124 | + </div> |
| 125 | +</a> |
| 126 | + |
| 127 | +:::info Requirements |
| 128 | +- **DevoxxGenie** v0.9.12 or later |
| 129 | +- **IntelliJ IDEA** 2024.2 or later |
| 130 | +- Both plugins installed and enabled in the same IDE instance |
| 131 | +::: |
| 132 | + |
| 133 | +The fork surfaces three entry points for acting on a SonarLint finding with AI. |
| 134 | + |
| 135 | +### Entry Point 1: Intention Action (Alt+Enter) |
| 136 | + |
| 137 | +Press **Alt+Enter** on any SonarLint-highlighted code and you'll see a "Fix with DevoxxGenie" intention action in the lightbulb menu. Select it and the prompt is assembled and submitted automatically — rule ID, rule description, severity, and ±10 lines of context all included. |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | +### Entry Point 2: Rule Panel Button |
| 142 | + |
| 143 | +Open the SonarLint tool window, select an issue, and look at the rule detail panel. A **"Fix with DevoxxGenie"** button appears in the header. Clicking it sends the same rich context to DevoxxGenie and focuses the chat panel so you can review the response. |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | +### Entry Point 3: Create DevoxxGenie Task(s) |
| 148 | + |
| 149 | +The SonarLint toolbar has a **"Create DevoxxGenie Task(s)"** action that does something different: instead of invoking the LLM immediately, it writes one or more `TASK-*.md` files into `backlog/tasks/`. This is the SDD integration path — defer the fix, let an agent handle it later. |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | +### What Context Gets Sent |
| 154 | + |
| 155 | +All three entry points build the same prompt from the same fields: |
| 156 | + |
| 157 | +| Field | Source | |
| 158 | +|---|---| |
| 159 | +| Rule ID | SonarLint finding metadata | |
| 160 | +| Rule name & description | SonarLint rule database | |
| 161 | +| Severity / type | SonarLint finding metadata | |
| 162 | +| File path & line number | Editor selection | |
| 163 | +| Violating code snippet | ±10 lines around the finding | |
| 164 | +| Project language | IntelliJ project model | |
| 165 | + |
| 166 | +**GitHub:** [github.com/stephanj/sonarlint-devoxxgenie-intellij](https://github.com/stephanj/sonarlint-devoxxgenie-intellij) |
| 167 | +**Full docs:** [/docs/integrations/sonarlint](/docs/integrations/sonarlint) |
| 168 | + |
| 169 | +--- |
| 170 | + |
| 171 | +## SpotBugs Integration |
| 172 | + |
| 173 | +The **SpotBugs DevoxxGenie** plugin is a fork of the JetBrains SpotBugs plugin that adds a DevoxxGenie AI layer for fixing static analysis findings. When SpotBugs detects a potential bug, you send it to DevoxxGenie for an AI-assisted fix — no manual copy-pasting required. |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | +:::info Requirements |
| 178 | +- **IntelliJ IDEA** 2023.3 or later |
| 179 | +- **JDK 17** or later |
| 180 | +- **DevoxxGenie** installed and configured in the same IDE instance |
| 181 | +::: |
| 182 | + |
| 183 | +### Three Entry Points |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | +1. **Intention action** — press **Alt+Enter** on SpotBugs-highlighted code. You'll see a `"DevoxxGenie: Fix '[BugPattern]'"` entry, e.g. `DevoxxGenie: Fix 'NP_NULL_ON_SOME_PATH'`. Selecting it assembles and submits the prompt immediately. |
| 188 | + |
| 189 | +2. **Gutter icon right-click** — SpotBugs annotates flagged lines with a gutter icon. Right-clicking opens a context menu with a "Fix with DevoxxGenie" item alongside the standard SpotBugs actions. Useful when you want to stay in the editor without switching tool windows. |
| 190 | + |
| 191 | +3. **Bug details panel button** — in the SpotBugs tool window, selecting a finding shows a details panel. The **"Fix with DevoxxGenie"** button there sends the full finding to DevoxxGenie with a single click. |
| 192 | + |
| 193 | +### Smart Context |
| 194 | + |
| 195 | +Regardless of which entry point you use, the prompt includes: |
| 196 | + |
| 197 | +| Field | Description | |
| 198 | +|---|---| |
| 199 | +| Bug pattern ID | e.g. `NP_NULL_ON_SOME_PATH` | |
| 200 | +| Bug category | e.g. `CORRECTNESS`, `PERFORMANCE`, `SECURITY` | |
| 201 | +| Priority | `High`, `Medium`, or `Low` | |
| 202 | +| File path | Relative path within the project | |
| 203 | +| Line number | Exact line where the bug was detected | |
| 204 | +| Code snippet | ±10 lines of source code around the finding | |
| 205 | +| Bug description | SpotBugs rule description from the detector | |
| 206 | + |
| 207 | +### Scope Note |
| 208 | + |
| 209 | +SpotBugs DevoxxGenie is a **prompt-sending integration only**. It does not create backlog task files — it sends the finding directly to the active DevoxxGenie conversation for an immediate AI response. If you need deferred task-based resolution with SDD workflow integration, use the SonarLint fork above. |
| 210 | + |
| 211 | +**GitHub:** [github.com/stephanj/spotbugs-devoxxgenie-plugin](https://github.com/stephanj/spotbugs-devoxxgenie-plugin) |
| 212 | +**Full docs:** [/docs/integrations/spotbugs](/docs/integrations/spotbugs) |
| 213 | + |
| 214 | +--- |
| 215 | + |
| 216 | +## Build Your Own Integration |
| 217 | + |
| 218 | +The pattern is deliberately small. Here's what a minimal integration looks like end-to-end: |
| 219 | + |
| 220 | +1. **Check** if DevoxxGenie is installed (`PluginManagerCore.getPlugin("com.devoxx.genie")`) |
| 221 | +2. **Build** a rich prompt string from whatever context your plugin has (rule, file, code snippet, description) |
| 222 | +3. **Choose** your delivery mechanism: |
| 223 | + - Immediate AI response → call `ExternalPromptService.setPromptText()` via reflection |
| 224 | + - Deferred SDD resolution → write a `TASK-*.md` file to `backlog/tasks/` |
| 225 | + |
| 226 | +That's it. No SDK to pull in, no compile-time coupling, no registration required. If DevoxxGenie isn't installed, your code path silently does nothing. |
| 227 | + |
| 228 | +The full API reference — including the `TaskIdAllocator` implementation, filename conventions, and frontmatter field definitions — is at [/docs/integrations/overview](/docs/integrations/overview). |
| 229 | + |
| 230 | +If you build an integration, open an issue or PR on the [DevoxxGenie GitHub repository](https://github.com/devoxx/DevoxxGenieIDEAPlugin) — I'd love to list it in the docs. |
| 231 | + |
| 232 | +Enjoy! |
| 233 | + |
| 234 | +**Links:** |
| 235 | +- [Install DevoxxGenie from JetBrains Marketplace](https://plugins.jetbrains.com/plugin/24169-devoxxgenie) |
| 236 | +- [Plugin Integration API docs](/docs/integrations/overview) |
| 237 | +- [SonarLint DevoxxGenie on GitHub](https://github.com/stephanj/sonarlint-devoxxgenie-intellij) |
| 238 | +- [SpotBugs DevoxxGenie on GitHub](https://github.com/stephanj/spotbugs-devoxxgenie-plugin) |
| 239 | +- [DevoxxGenie GitHub Repository](https://github.com/devoxx/DevoxxGenieIDEAPlugin) |
0 commit comments