patriceckhart/zot/write-zot-extension
Claude Code and agent skill by patriceckhart/zot
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Help the user create a new zot extension (slash command, LLM tool, or guard) in any language.
Install
npx vskill@latest install patriceckhart/zot/write-zot-extensionSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Writing a zot extension
Use this skill when the user asks for help building a zot extension — a new slash command, a new tool the LLM can call, an audit hook, or a permission gate. Skim this whole skill first, then collaborate with the user on the specific extension they want.
What an extension is
A zot extension is an external executable that zot launches as a subprocess and talks to over its stdin/stdout in newline-delimited JSON. It can be written in any language that can read/write JSON lines from stdio: Go, TypeScript (via tsx), Python, Rust, shell with jq, anything. Crash isolation is automatic; one bad extension never takes down zot.
Three things an extension can do (any combination):
- Slash commands — register
/fooso the user can run it from
the input. The handler returns a "prompt" (submitted to the agent), an "insert" (text dropped into the editor), a "display" (one-shot styled note in the chat), or a "noop".
- Tools — register tools the LLM itself calls. Schema is
JSON Schema; zot routes the model's tool_call to the extension's tool_result. Same lifecycle as built-in tools (read/write/edit/bash/skill).
- Lifecycle hooks — subscribe to events
(session_start, turn_start, tool_call, turn_end, assistant_message) for telemetry / audit / custom UI, or intercept tool calls before execution to refuse dangerous patterns.
On-disk layout
Each extension lives in its own directory:
Or project-local: <project>/.zot/extensions/<name>/. Project-local wins on name conflict.
For ad-hoc use during development, skip the install step entirely and run zot --ext PATH (repeatable: -e PATH -e PATH).
Manifest
Field rules:
name(required, unique) — id zot uses internally; matches the
hello frame. Slash commands & tools live in the same name space as built-ins; conflicts are silently shadowed by built-ins.
exec(required) — the executable path. Resolution:- absolute: as-is
- starts with
./or../: relative to the manifest's directory - bare name (no separator): looked up via
$PATH(e.g.node,
python3, npx, tsx)
args— extra argv passed toexec(e.g.["index.js"])language— informational only ("go","typescript",
"python", etc.)
enabled— defaults to true; set false to keep installed but skip
Wire format
Newline-delimited JSON in both directions. Top-level type is the discriminator. Optional id correlates command/tool requests with their responses.
Required handshake
The very first frame the extension sends is hello:
Capabilities are advisory; current values are commands, tools, events. Send all that apply.
zot replies with hello_ack:
Registration (after hello_ack)
The canonical startup order is hello, wait for hello_ack, send registration frames in any order, then send a single ready sentinel so zot can finalize the agent's tool registry:
If you don't send ready, zot's idle watchdog auto-treats you as ready after 250ms of no frames, but always send it explicitly when you can. Newer extensions on faster hosts shave that 250ms off.
Use hello_ack.cwd for the user's project directory. The extension process itself runs from the extension directory, so do not use os.Getwd() or process.cwd() when you need the project path.
Runtime frames
zot → extension:
extension → zot (replies + spontaneous notifications):
notify notes are one-shot: they clear when the user sends their next prompt (and on esc / /clear). Send clear_notes to retract every note this extension pushed earlier (e.g. a transient approval prompt) without waiting for the next turn; other extensions' notes are kept.
command_response.action values:
"prompt"— submitpromptas a fresh user message"insert"— dropinsertinto the editor at the cursor"display"— appenddisplayto chat as a one-shot note (no
model call, not in transcript)
"noop"— handled internally; zot doesn't change the UI
tool_result.content[] blocks: {"type":"text","text":"..."} or {"type":"image","mime_type":"image/png","data":"<base64>"}.
Per-tool timeout: 60s. Per-intercept timeout: 5s. Missing the intercept timeout is treated as "allow" so an unresponsive guard never stalls the agent.
Important rules
- stdout is reserved for the protocol. Anything you print to
stdout that isn't a JSON frame breaks the wire. The first stdout frame must be hello; do not send notify, logs, or registration frames before that handshake starts. Use stderr for logs / debug output (zot captures stderr to $ZOT_HOME/logs/ext-<name>.log).
- One JSON object per line. No multi-line JSON. Always end
every frame with \n.
- Flush after writing. Most stdout writes are line-buffered when
piped, which is fine, but explicitly flushing avoids surprise buffering on slow handlers.
- Extension processes inherit the user's permissions. A bad
extension can do anything the user can.
Recommended layout per language
Go (use the built-in SDK at packages/agent/ext)
Build: go build -o weather .
OnHello is optional. Use it when configuration or registrations need host metadata such as HostInfo.CWD, Provider, Model, ZotVersion, ExtensionDir, or DataDir. The SDK sends hello, waits for hello_ack, runs OnHello, announces registrations, then sends ready.
extension.json:
TypeScript (no SDK; handles the protocol directly)
Run via tsx, which executes .ts files without a build step.
tsx install: npm install -g tsx. Without global tsx, fall back to "exec":"npx","args":["--yes","tsx","index.ts"] (slower startup; npx checks the registry every launch).
Python
chmod +x hello.py.
Install / dev workflow
For TS / Python extensions, no build step is needed — edit the source in place and relaunch zot.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/agent/skills/builtin/write-zot-extension/SKILL.md
Popularity
- Repository stars
- 351
- Repository forks
- 42
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/patriceckhart/zot/write-zot-extension)