Writing a plugin
A plugin is “one directory plus one manifest”, developed in a plugin repo and installed into Kova through a market.1
Create the directory and manifest
.kova-plugin/plugin.json:2
Choose the layers you need
skills/ contributes skills (how the agent does things),
panels.json registers panels (human-facing UI),
.mcp.json contributes MCP servers (tools the agent can call).
There is also hooks.json (lifecycle hooks) and subagents/ (preset subagents).
Do one layer or all of them.3
Install it into a market and debug
Put a
marketplace.json at the market root listing your plugin, then add it in the
app via “Plugins → Add marketplace” as a directory market with linked install —
the cache points at your source, so edits take effect immediately (reopen the session
or refresh the market).docs/plugin-development.md, along with full field docs and a troubleshooting table
for skills, MCP, panels, hooks, and subagents.
Connecting an MCP server
Key points:- Multi-server connection pool: multiple MCP servers connect concurrently without blocking each other;
- Three-layer config merge: the system layer
~/.kova/mcp.json, the workspace standard layer.mcp.json, and the workspace override layer.kova/mcp.json— later layers override earlier ones; - Tools go through the
mcpgateway: MCP tools are not registered directly in the model tool table (that protects prompt prefix caching); they are called through the residentmcpgateway using the full name<server>__<tool>; - Output guards and approvals: MCP responses are treated as untrusted input, and calls go through the same approval flow with an audit trail;
- Secret injection: stdio server environment variables can bind to global secrets; plaintext never lands in the config file — see Security & keys.
mcpServers field —
that’s how ui-design lets the agent drive the design canvas directly.
Adding a skill
Skills live in a plugin’sskills/ directory, or come from user-level configuration.
A skill is a knowledge pack loaded into the agent’s context, managed in Settings → Skills.
A skill is one SKILL.md: name and description are required, and description
decides when it triggers (write trigger scenarios, not a feature list). The bundled
iOS / Material / general-mobile design specs ship as skills, loaded on demand via
use_skill instead of being resident in every context.
Adding a built-in tool
Tools live inapps/sidecar/pi-agent/src/tools/ and register in tools.ts.
A new tool must decide its permission behaviour at the same time:
NDJSON and the cross-surface contract
packages/pi-protocol defines the shared cross-surface contract.
The desktop frontend, the sidecar, and the mobile app all take types from here.
Change the protocol here, never a second copy in any surface.The process protocol between the main process and the sidecar: one JSON object per line.
Business-table access and key decryption go through the host bridge, so logs and
protocol are clearly separated on the channel.
/ws connections, so every change
must consider “multiple surfaces online at once”.
Rebranding
This is a template repo; rebranding is one command:electron-builder.yml
productName / appId, the runtime identifier and window title in main-process
main/paths.ts, and backs up files before changing them.
After renaming, confirm the dev vs production identifier split
(
com.kova.assistant.dev / com.kova.assistant) still behaves as expected — that split
is what keeps the two data directories isolated, and scripts can miss it.Next
How to package and release.
