Building a Companion-Type Plugin for AI Coding Assistants: Design and Implementation
This article shares the design and implementation of a companion-type pet plugin for AI coding assistants—a non-functional extension that provides emotional value and status visibility rather than productivity gains. It covers the core state machine design synced to the AI interaction lifecycle, rendering strategies for desktop clients and terminal environments, plugin installation and distribution, and an AI-driven development workflow where the assistant wrote the code while the human defined the vision. Developers and plugin authors will learn how lightweight, emotionally engaging interactions can improve user experience in AI-assisted development tools.
Introduction: Breaking Through with Non-Functional Plugins
In today’s AI-assisted development ecosystem, developers tend to build tools that solve concrete pain points—code review, automated testing, performance analysis. Yet market response is often underwhelming. I have built several purely functional helper tools that were logically rigorous and targeted real needs, but they received a lukewarm reception in the open source community.
An accidental experiment changed my perspective. I developed a plugin for an open source large model framework whose only function was replacing background images. It offered no productivity benefit whatsoever, yet unexpectedly earned a large number of favorites and code clones on code hosting platforms. This stark contrast raised a question: in the developer tools ecosystem, beyond pure efficiency gains, are “emotional value” and “lightweight companionship” also genuine user needs? Based on this insight, I decided to build a companion-type pet plugin for a mainstream AI coding assistant.
Design Philosophy: From Tool Utility to Emotional Value
The plugin’s core positioning is “non-functional companionship with status indication.” It does not write code or execute business logic. Instead, a chibi-style character holding a book stays beside the chat box. When the user sends a prompt, it looks down and flips through its book; when the AI finishes responding, it holds up the book and smiles.
This design strips away the “work anxiety” of tools and brings a sense of warmth to an otherwise cold command line or code editor. Developers using AI coding assistants often have to wait for model responses, and this idle period easily breeds anxiety. A cute character that reflects the current state effectively relieves the tedium of waiting and provides psychological companionship.
Core Implementation: State Machine-Based Dynamic Interaction
The key to this dynamic companionship is a state machine fully synchronized with the AI interaction lifecycle. The plugin’s runtime logic revolves around three core states:
Idle state
When the AI has no task to process, the character stands holding its book, with the caption “waiting for you to speak.” This is a low-power static display phase that does not distract the developer.Working state
When the AI is processing a request, the character switches to a book-flipping animation. For added practicality, the caption not only shows the status but also switches in real time to the name of the underlying tool the AI is currently invoking (such as code search, file read/write, or terminal command execution). This gives the pet a dual role: companionship plus transparency into task execution. Developers can tell at a glance which step the AI is on.Done state and error state
When the AI finishes answering, the character holds up its book and smiles; after 8 seconds the expression automatically falls back to the idle state. There is also strict error-handling logic: if the turn is interrupted or a runtime error occurs, the character skips the smile and returns directly to the idle state. This design keeps the “smile” behavior strongly correlated with task success, giving users clear success feedback.
In addition, since AI coding assistants may spawn subtasks, when the main conversation dispatches an Agent to perform underlying operations, the character’s expression remains unchanged—it strictly follows the main conversation’s state transitions—avoiding visual distraction caused by frequent flickering.
Multi-Environment Rendering: Graceful Degradation from Pixel Art to ASCII Art
Because AI coding assistants run in both desktop clients and terminal (CLI) environments, the plugin’s rendering layer needs differentiated adaptation to handle the constraints of each environment.
- Desktop client adaptation: With full graphical rendering available, the plugin displays full-body pixel art. Colors and animations are richer here, allowing the visual design to shine.
- Terminal adaptation: Constrained by a pure text interface, the plugin assembles a half-body portrait from half-block characters. The render area is strictly limited to 36 columns wide by 16 rows tall, ensuring compatibility with most standard terminal windows regardless of terminal type. The plugin also includes dynamic layout detection: when the terminal is at least 144 columns wide, the character automatically appears in the sidebar; if the width is insufficient, it is hidden or collapsed so it never interferes with reading the main code flow.
Installation and Distribution
The plugin is distributed through the standard plugin marketplace mechanism and open source repositories. In a terminal session, users can integrate it in one step by pointing a standard package manager command or the built-in plugin install command at the open source repository path. In the desktop client, users simply open the extension menu next to the input box, add the repository address as a marketplace source, and select the plugin from the list to install. Once installed, a simple invocation command pins it to the side. The whole process requires no complex configuration—install and go.
AIGC-Driven Development: AI Writes the Code, Humans Set the Direction
Notably, this plugin’s code was not written line by line by hand—it was generated entirely by the AI coding assistant. As the developer, my main responsibilities were defining the character design, planning the state machine logic, and performing final acceptance testing. This “AI writes code, humans set the direction” collaboration model dramatically lowers the barrier to building non-functional extensions. It also indirectly confirms how mature current AI coding assistants have become at handling specific logic modules, state mapping, and ASCII art rendering.
Conclusion
In an era where AI empowers software development, we need to care not only about underlying compute and model orchestration capabilities (such as the general-purpose AI infrastructure services offered by vendors like Baidu AI Cloud), but also about the emotional dimension of developer experience. The popularity of companion-type plugins reveals a latent demand in the developer community for “lightweight, fun, burden-free” interactions. The takeaway for building technical products: appropriately introducing emotional value—solving “hard needs” while attending to “soft experience”—can often deliver surprising reach and user stickiness.
