Building a "Pet" Plugin for AI Coding Tools: A Guide to Companion-Style Status Visualization
This article explores how to build a companion-style status visualization plugin for AI coding tools. It explains the three-state mapping model (idle, running, done), why errors must return to idle instead of showing success, cross-environment rendering strategies for both GUI and terminal using half-block characters, and configuration-driven customization. Developers will learn the reusable engineering principles behind turning an invisible execution flow into visible emotional feedback.
1. Why a “Non-Working” Plugin Still Gets Used
In the AI coding tool ecosystem, most developer-submitted utilities sell themselves on efficiency: auto-generating scripts, batch refactoring, and completing comments. The problem with these tools is that their value can only be perceived through use, and use itself has a barrier to entry. By contrast, a plugin responsible only for being “cute” and showing status is install-and-go with zero learning cost, making it far easier to accept.
Behind this is a product principle worth abstracting: when tool features become highly homogeneous, interaction experience and emotional design become the source of differentiation. A chibi character hugging a book does no actual work, yet makes “what the coding assistant is currently doing” perceivable. That is the value of status visualization.
This article does not revolve around any specific product. Instead, it abstracts this kind of “companion-style status plugin” into a general engineering problem: how to design and implement a cross-terminal and GUI status visualization component for an AI coding tool with a multi-state execution flow.
2. Core Design: Three-State Mapping and State Machine
The soul of the plugin is state mapping. Abstract the coding session into three primary states:
- Idle: waiting for user input; the character looks down reading a book, with a prompt below saying “waiting for you to speak”;
- Running: the assistant is calling tools or retrieving information; the character switches to a “working” expression, and the tool category used in the current step is shown in real time below;
- Done: the current round of response has ended; the character raises the book and smiles, then automatically returns to idle after about 8 seconds.
Exceptions and interruptions need special handling: when a round is interrupted by the user or errors out during execution, it does not enter the done state but returns directly to idle. This makes the “smile” a trustworthy success signal — only when you see the smile does it mean the round truly finished. This design avoids “false success” prompts interfering with the user’s judgment.
For scenarios where subtasks run in parallel, the principle is to follow only the main conversation flow. Subtask start and stop events do not switch the character’s expression, preventing state jitter.
Illustrative state machine (pseudocode):
state = IDLEon_user_message: state = RUNNINGon_tool_call(t): state = RUNNING; label = ton_round_finish: state = DONE; timer(8s) -> IDLEon_round_error: state = IDLEon_subagent_event: ignore
3. Cross-Environment Rendering: Compatibility Strategy for Terminal and GUI
The same character must appear in two types of environments, and the rendering approach must differ:
- GUI mode: use a full-body pixel-art sprite with high resolution and complete detail;
- Terminal mode: use half-block characters to draw a half-body portrait, fixed at 36 columns wide and 16 rows tall. Half-block characters (combinations of upper and lower half blocks) can approximate a pixel effect with text without relying on color image protocols, offering the best compatibility and working in any terminal.
The terminal layout must also handle width adaptation: when the window is wide enough (for example, 144 columns or more), the character automatically appears in a sidebar; when the window is narrow, it degrades to not showing or a minimal display, avoiding damage to the readability of the main conversation.
Engineering-wise, it is recommended to decouple the “rendering layer” from the “state layer”: the state layer outputs only enums and labels, and the rendering layer chooses pixel art or character art based on the environment. This way, adding a new terminal capability requires no changes to the state logic.
4. Installation, Distribution, and Custom Extensions
Plugin distribution typically relies on the host tool’s plugin mechanism. The general approach is to install from a specified repository address via a plugin install command in a terminal session; if the GUI client does not support that command, go to the plugin management interface, first add the repository as a plugin source, then install the specific plugin. After installation, invoke the character with a short command.
It should be emphasized that this article provides no specific commands, repository addresses, or product names. For actual integration, refer to the official plugin documentation of the tool you are using.
Custom extensions are an important value of this kind of plugin: the character image, prompt text, and state duration should all be made configurable. For example:
{"sprite": "custom.png","idle_text": "waiting for you to speak","done_duration_ms": 8000,"show_tool_label": true}
If you do not want to write the configuration by hand, you can hand the repository instructions to a coding assistant and let it make the modifications for you — which happens to embody the closed loop of “tools building tools.”
5. Reusable Engineering Lessons
- Zero function can still stand on its own: status visualization reduces cognitive load, letting users “glance and know what is going on”;
- Success signals must be trustworthy: use a separate state to express “truly finished,” and never disguise errors as success;
- Separate rendering from logic: the key to cross-terminal compatibility is layering;
- Configuration first: images, text, and durations are all externalized to lower customization costs;
- Distribution depends on host mechanisms: the install path must cover both terminal and GUI users.
In summary, a “non-working” companion plugin essentially turns an invisible execution process into visible emotional feedback. For developers, it is a low-barrier, high-perception practice project; for users, it makes waiting less anxiety-inducing.
