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
# Retrieval for chatbot answers

Choose retrieval from the data and real questions. Structured application
records often benefit from SQL/FTS/trigram search; semantic search can help
paraphrases and unstructured passages. Neither choice guarantees grounded
answers or should be imposed on every chatbot.

Parse supported structured filters into a validated schema and enforce them
deterministically on the server. Measured on one `gpt-5.4` catalog chatbot: a
free-text `query` tool input with FTS AND-matching and silent "0 rows → drop
filters / shorten the query" retries gave 11 % stability on "What X are
available?" (4-6 different items across 5 runs); `tags: string[]` with array
overlap and no silent fallback gave 100 %.

Keep authorization and tenant predicates independent of model-generated
filters. Return stable record/source IDs and only the fields needed for the
answer.

Parameterize queries. Allowlist columns/operators for dynamic sorting or
filtering, bound result counts and set timeouts. Distinguish no matches,
partial coverage and a failed source; the agent must not interpret an
incomplete result set as proof that an item does not exist.

Ground factual names, prices, dates and availability in authoritative records.
Give the agent concise domain-specific guidance about unsupported claims and
when another lookup is appropriate; avoid a universal “repeat only verbatim
tool text” rule that prevents useful explanation.

Evaluate retrieval and final answer support separately. Include identifiers,
short terms, full questions, target languages and unavailable items. Measure
latency and compare with the simplest useful baseline before adding
embeddings, fusion, query rewriting or a reranker.

Use `postgres-semantic-search` for PostgreSQL retrieval constraints and
[testing.md](testing.md) for model/retrieval evaluation.
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