json-render

Renders AI SDK v6 UIMessage parts, tool calls, and streaming states in React chat interfaces.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill json-render-aarnavbaddam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: json-render
Source: https://github.com/AarnavBaddam/skills/tree/main/json-render
Command: npx skills add https://github.com/AarnavBaddam/skills --skill json-render-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ai, @ai-sdk/react.

What problem does it solve? AI SDK v6 chat responses arrive as UIMessage objects with mixed part types (text, tool calls, reasoning), and rendering them incorrectly produces raw JSON blobs, empty responses, or server errors in React chat UIs. ## Core Features & Use Cases - Part-Based Rendering: Iterate message.parts to correctly display text, tool calls, reasoning, and streaming states instead of dumping raw JSON. - Tool Result Cards: Convert structured tool output into human-readable card components with loading, approval, and denial states. - Server/Client v6 Patterns: Correct usage of convertToModelMessages, toUIMessageStreamResponse, DefaultChatTransport, and sendMessage. - Use Case: You built a chat UI with useChat but tool results show as JSON blobs and messages intermittently fail; this Skill diagnoses the cause and provides the correct rendering and server-response patterns. ## Quick Start Ask the AI to fix your React chat component so AI SDK v6 messages render text and tool results properly instead of raw JSON.

Frequently Asked Questions about json-render

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

FAQPage Schema
How do I render AI SDK v6 messages in a React chat UI?

Iterate over message.parts and handle each part type: render text parts as formatted bubbles, tool parts as status indicators or result cards, and reasoning parts in collapsible sections. Never render message.content directly, as v6 messages use the parts array.

How do I display tool call results instead of raw JSON?

Create a ToolResultCard component that checks the tool output shape and renders known structures like created issues, item lists, or errors as styled cards. Fall back to a simple completion message rather than JSON.stringify for unknown shapes.

Why is my AI SDK v6 chat showing empty responses?

Empty responses usually occur when the server uses toDataStreamResponse instead of toUIMessageStreamResponse. When the client uses useChat with DefaultChatTransport, the route must return result.toUIMessageStreamResponse().

Does useChat in AI SDK v6 still use the api option?

No, v6 replaces the api option with a transport. Use useChat with transport: new DefaultChatTransport({ api: '/api/chat' }), and replace handleSubmit with sendMessage({ text: inputValue }).

Why do I get 'Invalid prompt: messages do not contain' errors?

This error happens when UIMessages are passed directly to the model without conversion. Call await convertToModelMessages(messages) on the server first; note it is asynchronous in v6, and optionally validate input with validateUIMessages.