/product-tools:wave-ui-architectfrom product-tools
Expert on Wave Terminal, Tsunami framework, and Go backend patterns for multi-frontend UI architectures. Use when architecting applications that need to integrate with Wave Terminal, deciding between Tsunami VDOM vs traditional web approaches, or designing Go backends that serve multiple frontend types (Wave widgets, standalone web, mobile). Provides deep technical knowledge of Wave's widget system, Tsunami's Go VDOM architecture, and proven patterns for component sharing across frameworks.
Ships in product-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Expert on Wave Terminal integration, Tsunami framework internals, and Go backend architecture for applications that need to work across multiple frontend surfaces (Wave Terminal widgets, standalone web apps, mobile interfaces).
Use this skill when working on:
Trigger phrases: "Wave Terminal", "Tsunami", "Go backend web frontend", "multi-frontend architecture", "component sharing", "VDOM", "should I use Tsunami"
Pattern 1: Tsunami VDOM Server (Tightest Coupling)
Pattern 2: Backend-Driven UI (Medium Coupling)
Pattern 3: Traditional REST/GraphQL API (Loosest Coupling)
Wave Terminal does NOT require Tsunami widgets. It has native WebView support that can load any HTTP server:
// ~/.config/waveterm/widgets.json
{
"my-widget": {
"icon": "zap",
"label": "My Widget",
"blockdef": {
"meta": {
"view": "web",
"url": "http://localhost:8765",
"web:hidenav": true
}
}
}
}
This means standard web apps can integrate with Wave without any Tsunami-specific code.
For Go-core applications wanting web integration:
┌─────────────────────────────────────┐
│ Go Backend (Single Binary) │
│ - Core logic (kernel integration) │
│ - API endpoints (REST + SSE) │
│ - Embedded React build (embed.FS) │
└──────────────┬──────────────────────┘
│
│ HTTP + Server-Sent Events
▼
┌─────────────────────────────────────┐
│ React Frontend (Standard SPA) │
│ - Standard web development │
│ - shadcn/ui, Tailwind, Jotai │
│ - Vite build │
└─────────────────────────────────────┘
│ │
▼ ▼
Wave WebView Browser/Mobile
Why this works:
Ask these questions to guide architecture choice:
Q1: Is Wave Terminal the primary interface?
Q2: Does the team know Go well?
Q3: Need React ecosystem components?
Q4: Is static deployment required?
Q5: How much Wave-specific integration needed?
1. Backend Structure (cmd/cog-chat/main.go):
package main
import (
"embed"
"net/http"
"github.com/gorilla/mux"
)
//go:embed frontend/dist/*
var frontendFS embed.FS
func main() {
r := mux.NewRouter()
// API routes
api := &ChatAPI{}
r.HandleFunc("/api/chat/message", api.SendMessage).Methods("POST")
r.HandleFunc("/api/chat/stream", api.StreamSSE).Methods("GET")
// Serve React frontend
r.PathPrefix("/").Handler(http.FileServer(http.FS(frontendFS)))
http.ListenAndServe(":8765", r)
}
2. Server-Sent Events for Streaming:
func (api *ChatAPI) StreamSSE(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/event-stream")
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive")
flusher := w.(http.Flusher)
for chunk := range api.inference.Stream(message) {
fmt.Fprintf(w, "data: %s\n\n", chunk.JSON())
flusher.Flush()
}
}
3. React Frontend (standard Vite + React):
// src/App.tsx
export function App() {
const [messages, setMessages] = useAtom(messagesAtom)
const sendMessage = async (text: string) => {
const evtSource = new EventSource('/api/chat/stream')
evtSource.onmessage = (e) => {
const chunk = JSON.parse(e.data)
// Handle streaming response
}
}
return <ChatInterface messages={messages} onSend={sendMessage} />
}
4. Wave Integration: Add to ~/.config/waveterm/widgets.json
5. Build & Deploy:
# Frontend
cd frontend && npm run build
# Backend (embeds frontend/dist via embed.FS)
go build -o cog-chat cmd/cog-chat/main.go
# Single binary contains everything
./cog-chat
All research findings are available in the references/ directory:
synthesis.md - Unified recommendations and comparison of all three architecture patterns. Read this first for decision-making framework and trade-off analysis.
wave-terminal-architecture.md - Wave's widget system, block architecture, WebView support, communication protocols. Critical discovery: Wave's WebView support means Tsunami is optional.
tsunami-internals.md - Complete breakdown of Tsunami's Go VDOM architecture, JSON protocol, event handling, atoms/state management. Read when considering Tsunami VDOM approach.
go-backend-patterns.md - Patterns for Go backends serving multiple frontends, Server-Sent Events, multi-client architecture. Essential for backend design.
web-components-integration.md - Cross-framework component strategies, Web Components, React 19 interop, performance analysis. Read when considering component sharing across frameworks.
component-library-patterns.md - Industry patterns (Radix UI, Headless UI, Chakra/Ark/Zag), headless component architecture, monorepo strategies. Read for long-term component library design.
research-brief.md - Original research questions and methodology (historical context).
gorilla/mux or chiembed.FS (built into Go 1.16+)github.com/tkrajina/typescriptify-golang-structs (Go → TS types)air (dev mode live reload)gorilla/websocket (if SSE not sufficient)wsh command (Wave Shell - control Wave from terminal)tsunami run --open (standalone mode)~/.config/waveterm/ (widgets.json, settings)references/wave-terminal-architecture.md for complete API// api/types.go
type Message struct {
ID string `json:"id"`
Role string `json:"role"`
Content string `json:"content"`
Timestamp time.Time `json:"timestamp"`
}
// Generate TypeScript:
// go run github.com/tkrajina/typescriptify-golang-structs/cmd/typescriptify@latest \
// -package=api -target=frontend/src/types/api.ts
//go:embed frontend/dist/*
var frontendFS embed.FS
func main() {
// Serve embedded React app
frontend, _ := fs.Sub(frontendFS, "frontend/dist")
http.Handle("/", http.FileServer(http.FS(frontend)))
// API routes
http.HandleFunc("/api/chat", handleChat)
http.ListenAndServe(":8765", nil)
}
// Backend
func streamResponse(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/event-stream")
flusher := w.(http.Flusher)
for chunk := range generateResponse() {
fmt.Fprintf(w, "data: %s\n\n", chunk)
flusher.Flush()
}
}
// Frontend
const evtSource = new EventSource('/api/stream')
evtSource.onmessage = (event) => {
console.log(event.data)
}
{
"widget-id": {
"icon": "zap",
"label": "Widget Name",
"color": "#fbbf24",
"description": "Widget description",
"display:order": 0,
"blockdef": {
"meta": {
"view": "web",
"url": "http://localhost:PORT",
"web:hidenav": true
}
}
}
}
Icons: Use Lucide icons - e.g., zap, message-square, sparkles, brain
❌ Don't: Try to reuse Tsunami's React frontend with a different backend
❌ Don't: Build separate backends for Wave and web
❌ Don't: Use Tsunami if you just need basic WebView
❌ Don't: Use plain HTTP polling for real-time updates
| Aspect | Traditional Web | Tsunami VDOM |
|---|---|---|
| Go control | Backend only | Full stack |
| React ecosystem | Full access | Limited |
| Wave integration | WebView | Native |
| Deployment | Flexible | Go binary required |
| Talent pool | Large | Small |
| Complexity | Low | Medium |
When asking architecture questions, provide:
With this context, reference the decision framework in synthesis.md for specific recommendations.
Use Case 1: cog-chat
Use Case 2: Wave-native monitoring widget
Use Case 3: Multi-platform dashboard
Wave Terminal paths:
~/.config/waveterm/~/.config/waveterm/widgets.json~/.local/bin/tsunamiCommon commands:
# Launch widget in Wave
wsh launch widget-id
# Build Tsunami widget
tsunami build /path/to/widget -o output
# Run Tsunami standalone
tsunami run /path/to/widget --open
HTTP + SSE stack:
gorilla/mux + http.Flusher for SSEEventSource API (built-in)curl with --no-buffer flagStart with the decision framework in synthesis.md, then dive into specific references as needed. The research is code-backed and based on actual Wave Terminal source analysis, not speculation.
references/component-library-patterns.md (opens in a new tab)references/go-backend-patterns.md (opens in a new tab)references/research-brief.md (opens in a new tab)references/synthesis.md (opens in a new tab)references/tsunami-internals.md (opens in a new tab)references/wave-terminal-architecture.md (opens in a new tab)references/web-components-integration.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/karmaSkill: Karma — Claude Code Session DashboardManage the Claude Code Karma dashboard (session browser, analytics, live monitoring)./openclaw-expertOpenClaw ExpertYou are an expert in the OpenClaw architecture, implementation, and ecosystem. You have comprehensive knowledge of how OpenClaw works, its design decisions, and how to extend it./opencode-expertOpenCode Plugin Development ExpertOther plugins' skills for the same job
npx claudepluginhub chazmaniandinkle/skills --plugin product-tools