
nextjs-chatbot
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 ai-app for scaffolding and ai-sdk for general SDK APIs; multi-platform bots use Chat SDK.
- Installs
- 154
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/laguagu/claude-code-nextjs-skills --skill nextjs-chatbot- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads nextjs-chatbot automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Production Next.js chatbots
Use this skill for web-chat integration: persisted conversations, tool approval,
tool result UI and an embedded widget. Use ai-app for scaffolding,
ai-sdk to resolve the SDK version, and ai-elements for component contracts.
For multi-platform messaging, consult Chat SDK.
Keep the project's stack. Choose the model, reasoning setting, storage and client state from the product's quality, latency and privacy requirements. A chatbot does not inherently need PostgreSQL, Zustand, MCP servers or every message action. When a new project has not decided, the defaults are Bun, ai-elements on shadcn/ui, Drizzle + PostgreSQL for server-side history, and a fast model with low or no reasoning effort, because chat latency is the product.
Read the installed node_modules/ai/docs/04-ai-sdk-ui/ for persistence, tool
usage, errors and resume streams; use the package's types and src/ when
shipped for exact contracts.
The linked ai-sdk.dev pages are the online fallback and describe the newest major.
Integration contracts
- Match
ai,@ai-sdk/reactand provider versions before writing API calls. Useai-sdk-7for v7 andai-sdk-6for existing v6 projects; core callback renames do not imply renaming the separateuseChat.onFinish. - Authenticate conversation access, validate request data and authorize tools on the server. Client history, context, model IDs and consent flags are untrusted; prompts cannot enforce tenant isolation or permissions.
- Store validated UI messages with stable IDs when the full conversation UI must be restored. Convert model history through the installed SDK's helpers; keep required tool-call/result and provider reasoning relationships intact.
- Determine what happens on cancellation, disconnect, reload and retries. Consuming a stream after disconnect still depends on the hosting lifetime; durable execution needs a supported durable runtime.
- Log redacted diagnostics with a correlation ID. Return a safe public error
for failed HTTP requests and in-stream failures; an error after headers have
been sent cannot change the HTTP status. The UI stream masks ordinary errors
by default; provider-executed tool errors can bypass
onError, so check the tool error renderer too. A customonErrorreturn value reaches the browser verbatim, and a non-2xx response reachesuseChatonErrorwith the raw response body as its message. - Verify actual proxy streaming and buffering configuration. SDK UI-message
responses already send
X-Accel-Buffering: no; streams you build yourself (NDJSON/SSE progress) need it andCache-Control: no-store, no-transform. The header helps supported nginx setups; it does not guarantee that every host streams without buffering.
Chat surface
Keep the answer, relevant tool results and useful sources readable. Default
layout: user messages in a right-aligned bg-muted bubble, assistant messages
full width without a background, and the brand carried through to the
scrollbar. Add feedback, regenerate, delete or suggestions when the product
needs them; avoid a repeated “Answer” heading or an action toolbar on every
message by default. Use the icons skill for icon choice and nextjs-shadcn
for the surrounding interface.
Follow streamed output while the reader is at the bottom; preserve their place
when they scroll away or load earlier history. Use an existing compatible
scroll primitive when it fits; shadcn's
Message Scroller is one option;
anchor on the user's message so the reply streams below it.
Render Markdown through the application's
renderer (ai-elements MessageResponse in the default stack)
and style it with shadcn Typeset by default (CSS only, see nextjs-shadcn);
verify nested lists, long links and code blocks.
Derive turn completion from useChat status (submitted/streaming) rather
than a momentary gap between tools. Stop or isolate the generation before
switching conversations. Browser storage must not make the first client render disagree
with server-rendered consent or history.
Read for the feature
- Tool approval: policy, replay security and UI transitions.
- Persistence: IDs, history replay, feedback and resumption.
- Tool rendering: typed states and safe output.
- Popup/embedding: focus, scrolling and host boundaries.
- Retrieval: structured filters and evaluated search choices.
- Suggestions: optional, grounded next actions.
- Web search: source scope, freshness and provider capability.
- Verification: UI transitions and model/retrieval evals.
Exercise a second turn after restoring history, approval and denial, tool failure, cancellation, fast conversation switching and the deployed stream path. Report the behaviors actually checked.
FAQ
What does the nextjs-chatbot skill do?
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 ai-app for scaffolding and ai-sdk for general SDK APIs; multi-platform bots use Chat SDK.
How do I install nextjs-chatbot?
Run npx skills add https://github.com/laguagu/claude-code-nextjs-skills --skill nextjs-chatbot in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/nextjs-chatbot/ (personal) or .claude/skills/nextjs-chatbot/ (project).
Which AI agents can use nextjs-chatbot?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is nextjs-chatbot safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains nextjs-chatbot?
It is published by laguagu in laguagu/claude-code-nextjs-skills. It has 154 recorded installs.
More from laguagu/claude-code-nextjs-skills
nextjs-seo
laguagu/claude-code-nextjs-skills
Next.js App Router SEO implementation and audits. Use for metadata and social images, sitemap/robots, canonicals and localization, structured data, Core Web Vitals evidence, AI crawler policy or search-indexing diagnosis. Not for general Next.js feature work unrelated to SEO.
openai-agents-sdk
laguagu/claude-code-nextjs-skills
OpenAI Agents SDK (Python) development. Use when building AI agents, multi-agent handoffs, function tools, guardrails, sessions, streaming, or tracing with the openai-agents / agents Python package — including Azure OpenAI through its native client or LiteLLM. Triggers on imports from agents, uses of Runner.runsync/Runner.runstreamed, @functiontool, AgentOutputSchema, SQLiteSession, or questions about the openai-agents-python SDK. Python only — not the TypeScript @openai/agents SDK.
nextjs-shadcn
laguagu/claude-code-nextjs-skills
Builds distinctive Next.js interfaces with shadcn/ui, choosing typography, styling and purposeful visual effects for the product. Use when creating or polishing a Next.js + shadcn app, page or component, including themes, presets, backgrounds and design-system lint. Uses frontend-design for substantial visual direction and icons for asset sourcing.
next-best-practices
laguagu/claude-code-nextjs-skills
Next.js App Router best practices covering file conventions, RSC boundaries, async APIs, data patterns, hydration errors, metadata, route handlers, image/font optimization, and bundling. Use when writing or reviewing Next.js code to prevent hydration errors, RSC violations, data waterfalls, and configuration mistakes.
react-best-practices
laguagu/claude-code-nextjs-skills
React and Next.js performance optimization guide from Vercel Engineering (70 rules in 8 categories). Use when writing, reviewing, or refactoring React/Next.js code to eliminate waterfalls, reduce bundle size, prevent re-renders, optimize Server Components, or fix performance bottlenecks. Triggers on data fetching, Promise.all, Suspense, useMemo, dynamic imports, bundle analysis, code-splitting, and rendering performance tasks.
postgres-semantic-search
laguagu/claude-code-nextjs-skills
Builds and tunes PostgreSQL retrieval with pgvector, full-text search, pgtrgm, hybrid fusion, ParadeDB BM25 and reranking. Use for search/RAG implementation, weak results, filtered ANN scans, non-English corpora or retrieval evaluation. For general schema, RLS and query tuning unrelated to retrieval, use supabase-postgres-best-practices.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance 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.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.