Skip to content

laguagu/claude-code-nextjs-skills / skills/nextjs-chatbot

nextjs-chatbot

Verified

Production Next.js web-chat integration: tool approval, persisted conversations, tool result UI, grounded retrieval, follow-up suggestions and embedded widgets. Use when building or debugging a web chatbot that needs these features. Use nextjs-shadcn for scaffolding and ai-sdk for general SDK APIs; multi-platform bots use Chat SDK.

FileKindSize
SKILL.mdskill md5.6 KB
hitl.mdmarkdown4.1 KB
persistence.mdmarkdown4.0 KB
popup-widget.mdmarkdown1.6 KB
search.mdmarkdown1.8 KB
suggestions.mdmarkdown1.4 KB
testing.mdmarkdown2.2 KB
tool-rendering.mdmarkdown1.7 KB
web-search.mdmarkdown1.6 KB

tool-rendering.md

View on GitHub
# Tool result UI

Infer message/tool types from the agent or the installed SDK. Branch on the
typed discriminant and state so partial input is not treated as a completed
result. Dynamic tools require their own runtime validation; avoid loose casts
that claim unknown output is a trusted application record.

Give each useful result a renderer appropriate to its content. A generic tool
accordion can be sufficient for diagnostics; product users need the answer,
action or result they can use. Avoid printing internal names, JSON, database
errors or duplicate summaries when a card already communicates the result.

Handle loading, approval, denial, success and safe failure. A result can be
empty or false-valued, so do not use output truthiness as proof of success.
Stable tool-call IDs keep updates associated with the same operation.

Keep old results readable during later generation and preserve scroll/focus.

A view that renders stored messages (an admin transcript, a history page)
meets parts the live renderer never branches on. Stored `UIMessage.parts`
include `step-start` markers between steps; skip them rather than letting an
"unknown part" fallback print them. Render assistant text with the same
Markdown renderer as the live chat, or the transcript shows raw `**` and `-`.

Validate tool data on the server and at external boundaries. Sanitize rendered
Markdown/HTML and apply application policy to links or attachments; model or
tool output is not automatically safe DOM content.

See [HITL](hitl.md), the `shadcn` skill (`Trace`) for tool rows and the
[UI tool guide](https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-tool-usage) for the
version-matched state and continuation contract.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall