add-tui-tool-renderer

Adds a per-tool block renderer to the Go TUI dispatcher for new core tools.

10|1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/catalystctl/catcode --skill add-tui-tool-renderer-catalystctl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-tui-tool-renderer
Source: https://github.com/catalystctl/catcode/tree/main/.catalyst-code/skills/add-tui-tool-renderer
Command: npx skills add https://github.com/catalystctl/catcode --skill add-tui-tool-renderer-catalystctl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? New built-in tools added to the Rust core render in the terminal UI as a raw JSON blob via the generic fallback, hiding the key information (command, path, pattern) that users need to scan quickly. ## Core Features & Use Cases - Dispatcher Integration: Adds a case arm in tui/blocks.go renderToolBlock that routes the new tool name to a dedicated renderer before the generic default. - Renderer Implementation: Writes a render<Name>Block function in tui/tool_blocks.go reusing shared helpers like renderToolHead, renderOutputPanel, renderNumberedOutput, and renderDiffPanel. - Key Arg Surfacing: Picks the single most relevant argument (path, command, pattern, url) via b.arg(...) so it appears in the header, collapsed view, and approval banner. - Use Case: After adding a count_lines tool to the Rust core, use this Skill to wire up a numbered-output renderer so users see the file path and line count instead of a raw JSON args blob. ## Quick Start Add a TUI block renderer for my new core tool so it shows its key argument and collapsed output instead of the generic JSON blob.

Frequently Asked Questions about add-tui-tool-renderer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a custom tool renderer to a Go terminal UI?

Add a case arm for the tool name in the renderToolBlock switch in tui/blocks.go, then implement a render<Name>Block function in tui/tool_blocks.go that builds a header with renderToolHead and a body with renderOutputPanel or a similar shared helper.

How do I parse tool arguments stored as a raw JSON string in Go?

Use the provided accessor helpers b.arg(key), b.argObjArr(key), and b.argStrArr(key) instead of indexing the raw string directly. These helpers degrade gracefully when the args field is malformed or a bare string.

When should I skip adding a dedicated tool renderer?

Skip it for rarely seen or internal tools, since the generic fallback renderGenericToolBlock always works and renders the name plus raw args. Add a dedicated renderer only for tools the user sees often, like bash, read_file, edit, or grep.

Why does my new tool show a raw JSON blob in the terminal UI?

The tool has no dedicated renderer, so the dispatcher falls through to renderGenericToolBlock, which prints the name and raw args. Add a case arm in renderToolBlock and a matching renderer function to fix it.

How do I verify a new TUI tool renderer works?

Run go vet ./..., go test ./..., and go build . from the tui directory. For non-trivial rendering, add a smoke test next to the existing render_smoke_test.go and tool_blocks test patterns.