DevPilot: AI Productivity Accelerator — Devpost Submission


Inspiration

Developers context-switch constantly. You're deep in flow, hit a messy function, and suddenly you're spending 10 minutes reformatting code, googling an error, or trying to understand what a colleague's cryptic function does, all before you can get back to what you were actually building.

We wanted to eliminate that friction entirely. Not by opening a new tab, not by copy-pasting into ChatGPT, but by making AI assistance available in a single button press, without ever leaving your editor.

The Logitech MX Creative Console is designed exactly for this: programmable hardware actions that fit into your physical workflow. DevPilot makes it an AI co-pilot that's always within reach.


What it does

DevPilot gives developers three AI superpowers, triggered by a single Logitech button press:

Improve Code - Select messy, unreadable code. Press the button. DevPilot shows a preview of the improved version with better naming, structure, and patterns. Click Apply and the original selection is replaced, right in your editor, no copy-paste needed.

Debug Error - Select an error message or broken code. Press the button. DevPilot returns a structured breakdown: root cause, step-by-step fix, and corrected code.

Explain Code - Select any unfamiliar code. Press the button. Get a plain-English explanation under 150 words, perfect for onboarding or reading legacy code.

The entire flow takes under 10 seconds. Select -> Press -> Done.


How we built it

DevPilot has three layers that work together:

Logitech Actions SDK Plugin (C# / .NET 8) A native Loupedeck plugin built with the official Logitech Actions SDK. It registers three commands -Improve Code, Debug Error, Explain Code - that appear in the Loupedeck UI and can be mapped to any button on the MX Creative Console. When a button is pressed, the plugin fires an HTTP request to the local Electron app.

Electron App (Node.js) The orchestration layer. It listens on port 7734 for triggers from the Loupedeck plugin, and also registers a global keyboard shortcut (Ctrl+Alt+Space) as a fallback. When triggered, it uses PowerShell Win32 API calls to capture the active editor window handle, automatically sends Ctrl+C to copy the current selection, then opens a floating popup UI near the cursor. For Improve Code, it shows a side-by-side preview before applying changes - using SetForegroundWindow + SendKeys to paste the result directly back into the editor, replacing the original selection.

FastAPI Backend (Python) A lightweight AI backend with three endpoints (/improve, /debug, /explain). Each uses a carefully crafted prompt template and calls the OpenRouter API for AI inference. Responses are structured and returned as JSON to the Electron popup.


Challenges we ran into

Window focus and clipboard management on Windows was the hardest problem. When Electron opens a popup, it steals focus from the editor which means the user's text selection is lost before we can copy it. We solved this by capturing the editor's window handle (HWND) via PowerShell's Win32 API before the popup opens, then programmatically sending Ctrl+C to the editor while it's still focused. On Apply, we reactivate the editor window (which still has the selection active on Windows) and send Ctrl+V to replace it.

Logitech SDK integration required understanding the full plugin lifecycle, namespace conventions, the difference between bin\Debug\ and bin\Debug\bin\ paths, metadata requirements for the .loupedeck package format, and how CopyLocalLockFileAssemblies affects runtime DLL conflicts. The SDK documentation is thin in places, so we did a lot of reverse-engineering from the generated template.


Accomplishments that we're proud of

  • Seamless in-editor replacement : the selected text is replaced with AI-improved code without the user ever manually copying or pasting. This required reliable HWND capture and PowerShell window management that works across different editors.

  • Real Logitech Actions SDK integration : a fully registered, installable .loupedeck plugin with three commands that appear natively in the Loupedeck UI, ready to map to any hardware button.

  • Sub-10-second end-to-end flow : from button press to applied code change, the entire workflow is faster than opening a browser tab.

  • Zero workflow disruption : the popup appears near the cursor, the editor never loses its content, and the result is applied without switching windows.


What we learned

  • The Logitech Actions SDK uses the Loupedeck plugin architecture under the hood, understanding PluginDynamicCommand, Plugin base class, and the metadata/bin directory structure is essential for a working plugin.
  • Windows window management is surprisingly reliable via PowerShell + Win32 APIs, without needing native Node.js addons.
  • AI prompt engineering matters enormously , the difference between "improve this code" and a structured prompt that returns only the improved code (no explanation, no markdown) was the difference between a usable tool and an annoying one.
  • Shipping a working demo is more valuable than a perfect codebase. We made pragmatic decisions (curl over HttpClient, PowerShell over robotjs) to keep the stack stable and the demo reliable.

What's next for DevPilot: AI Productivity Accelerator

  • Per-language optimization: detect Python, JavaScript, Go etc. and use language-specific prompt templates for better results
  • Custom actions : let users define their own AI actions and map them to additional buttons (refactor, add tests, add docstrings)
  • Haptic feedback: use the MX Creative Console's haptics API to give tactile confirmation when AI processing completes
  • Streaming responses: show AI output word-by-word in the popup instead of waiting for the full response
  • Marketplace release: publish to the official Loupedeck Marketplace so any MX Creative Console user can install DevPilot in one click
  • Multi-model support: let users choose their preferred AI model (GPT-4, Claude, Gemini) from the plugin settings
Share this project:

Updates