Agent SkillsAgent Skills
laguagu

ai-app

@laguagu/ai-app
laguagu
19
6 forks
Updated 3/31/2026
View on GitHub

Full-stack AI application generator with Next.js, AI SDK, and ai-elements. Use when creating chatbots, agent dashboards, or custom AI applications. Triggers: chatbot, chat app, agent dashboard, AI application, Next.js AI, useChat, streamText, ai-elements, build AI app, create chatbot

Installation

$npx agent-skills-cli install @laguagu/ai-app
Claude Code
Cursor
Copilot
Codex
Antigravity

Details

Pathskills/ai-app/SKILL.md
Branchmain
Scoped Name@laguagu/ai-app

Usage

After installing, this skill will be available to your AI coding assistant.

Verify installation:

npx agent-skills-cli list

Skill Instructions


name: ai-app description: | Full-stack AI application generator with Next.js, AI SDK, and ai-elements. Use when creating chatbots, agent dashboards, or custom AI applications.

Triggers: chatbot, chat app, agent dashboard, AI application, Next.js AI, useChat, streamText, ai-elements, build AI app, create chatbot argument-hint: "[app-type or description]"

AI App Generator

Build full-stack AI applications with Next.js, AI SDK, and ai-elements.

Quick Start

1. Scaffold Project

bunx --bun shadcn@latest create --preset "https://ui.shadcn.com/init?base=radix&style=nova&baseColor=neutral&theme=neutral&iconLibrary=lucide&font=geist-sans&menuAccent=subtle&menuColor=default&radius=default" --template next my-ai-app
cd my-ai-app

2. Install Dependencies

bun add ai @ai-sdk/react @ai-sdk/anthropic zod
bunx --bun ai-elements@latest

3. Configure Environment

# .env.local - Choose your provider
ANTHROPIC_API_KEY=sk-ant-...
# OPENAI_API_KEY=sk-...
# GOOGLE_GENERATIVE_AI_API_KEY=...

4. Generate Application

Based on user requirements, generate:

Application Types

Chatbot

Simple conversational AI with streaming responses.

FeatureImplementation
Chat UIConversation + Message + PromptInput
APIstreamText + toUIMessageStreamResponse
ExtrasReasoning, Sources, File attachments

Agent Dashboard

Multi-agent interface with tool visualization.

FeatureImplementation
AgentsToolLoopAgent with tools
UIDashboard layout + Tool components
APIcreateAgentUIStreamResponse
ExtrasStatus monitoring, tool approval

Custom AI App

Mix and match based on user needs:

  • Web search chatbot
  • Code generation assistant
  • Document analyzer
  • Multi-modal chat

Project Structure

my-ai-app/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ page.tsx                 # Main UI
β”‚   β”œβ”€β”€ layout.tsx               # Root layout
β”‚   β”œβ”€β”€ globals.css              # Theme
β”‚   └── api/
β”‚       └── chat/
β”‚           └── route.ts         # AI endpoint
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ai-elements/             # AI Elements components
β”‚   β”œβ”€β”€ ui/                      # shadcn/ui components
β”‚   └── chat.tsx                 # Chat component (if extracted)
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ utils.ts                 # Utilities
β”‚   └── ai.ts                    # AI configuration (optional)
β”œβ”€β”€ ai/                          # Agent definitions (if needed)
β”‚   └── assistant.ts
└── .env.local                   # API keys

See references/project-structure.md for details.

Core Patterns

API Route

// app/api/chat/route.ts
import { streamText, UIMessage, convertToModelMessages } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';

export const maxDuration = 30;

export async function POST(req: Request) {
  const { messages }: { messages: UIMessage[] } = await req.json();

  const result = streamText({
    model: anthropic('claude-sonnet-4-6'),
    messages: await convertToModelMessages(messages),
    system: 'You are a helpful assistant.',
  });

  return result.toUIMessageStreamResponse({
    sendSources: true,
    sendReasoning: true,
  });
}

Chat Page

// app/page.tsx
'use client';
import { useChat } from '@ai-sdk/react';
import { DefaultChatTransport } from 'ai';
import {
  Conversation,
  ConversationContent,
  ConversationScrollButton,
} from '@/components/ai-elements/conversation';
import {
  Message,
  MessageContent,
  MessageResponse,
} from '@/components/ai-elements/message';
import {
  PromptInput,
  PromptInputBody,
  PromptInputTextarea,
  PromptInputFooter,
  PromptInputSubmit,
  type PromptInputMessage,
} from '@/components/ai-elements/prompt-input';
import { Loader } from '@/components/ai-elements/loader';
import { useState } from 'react';

export default function ChatPage() {
  const [input, setInput] = useState('');
  const { messages, sendMessage, status } = useChat({
    transport: new DefaultChatTransport({ api: '/api/chat' }),
  });

  const handleSubmit = (message: PromptInputMessage) => {
    if (!message.text.trim()) return;
    sendMessage({ text: message.text, files: message.files });
    setInput('');
  };

  return (
    <div className="flex h-screen flex-col p-4">
      <Conversation className="flex-1">
        <ConversationContent>
          {messages.map((message) => (
            <div key={message.id}>
              {message.parts.map((part, i) => {
                if (part.type === 'text') {
                  return (
                    <Message key={i} from={message.role}>
                      <MessageContent>
                        <MessageResponse>{part.text}</MessageResponse>
                      </MessageContent>
                    </Message>
                  );
                }
                return null;
              })}
            </div>
          ))}
          {status === 'submitted' && <Loader />}
        </ConversationContent>
        <ConversationScrollButton />
      </Conversation>

      <PromptInput onSubmit={handleSubmit} className="mt-4">
        <PromptInputBody>
          <PromptInputTextarea
            value={input}
            onChange={(e) => setInput(e.target.value)}
          />
        </PromptInputBody>
        <PromptInputFooter>
          <div />
          <PromptInputSubmit status={status} />
        </PromptInputFooter>
      </PromptInput>
    </div>
  );
}

Skill References

For detailed patterns, see:

NeedSkillReference
Chat UI components/ai-elementschatbot.md
Next.js patterns/nextjs-shadcnarchitecture.md
AI SDK functions/ai-sdk-6core-functions.md
Agents & tools/ai-sdk-6agents.md
Caching/cache-componentsREFERENCE.md
Production patterns/nextjs-chatbotDB persistence, HITL approval, consent, feedback, search
Code review & cleanup/code-simplifierDRY/KISS/YAGNI validation

Workflow

Phase 1: Understand Requirements

Ask user:

  • What type of AI app? (chatbot, agent, custom)
  • What features? (reasoning, sources, tools, file upload)
  • What style? (vega=classic, nova=compact, maia=soft/rounded, lyra=boxy/sharp, mira=dense) β€” default: nova
  • What font? (geist-sans, inter, jetbrains-mono, figtree, dm-sans, outfit, noto-sans, nunito-sans, roboto, raleway, public-sans) β€” default: geist-sans
  • What base color? (neutral, zinc, slate, gray, stone) β€” default: neutral
  • What theme accent? (neutral, blue, green, orange, red, rose, violet) β€” default: neutral
  • What border radius style? (default, sm, md, lg, xl)
  • Component library? (radix=default, base-ui)

Phase 2: Scaffold Project

Run scaffolding commands based on requirements.

Phase 3: Generate Files

Create files based on application type:

  • API route (app/api/chat/route.ts)
  • Main page (app/page.tsx)
  • Components (if needed)
  • Agents (if needed)

Phase 4: Configure

  • Set up .env.local
  • Configure next.config.ts if needed
  • Add any additional dependencies

Phase 5: Verify

bun dev

Test the application works correctly.

References

Package Manager

Always use bun, never npm:

  • bun add (not npm install)
  • bunx --bun (not npx)
  • bun dev (not npm run dev)

More by laguagu

View all
nextjs-shadcn
19

Creates Next.js 16 frontends with shadcn/ui. Use when building React UIs, components, pages, or applications with shadcn, Tailwind, or modern frontend patterns. Also use when the user asks to create a new Next.js project, add UI components, style pages, or build any web interface β€” even if they don't mention shadcn explicitly.

ai-elements
19

Create new AI chat interface components for the ai-elements library following established composable patterns, shadcn/ui integration, and Vercel AI SDK conventions. Use when creating new components in packages/elements/src or when the user asks to add a new component to ai-elements.

skill-creator
19

Creates new skills, modifies and improves existing skills, and measures skill performance. Use when users want to create a skill from scratch, update or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

postgres-semantic-search
19

PostgreSQL-based semantic and hybrid search with pgvector and ParadeDB. Use when implementing vector search, semantic search, hybrid search, or full-text search in PostgreSQL. Covers pgvector setup, indexing (HNSW, IVFFlat), hybrid search (FTS + BM25 + RRF), ParadeDB as Elasticsearch alternative, and re-ranking with Cohere/cross-encoders. Supports vector(1536) and halfvec(3072) types for OpenAI embeddings. Triggers: pgvector, vector search, semantic search, hybrid search, embedding search, PostgreSQL RAG, BM25, RRF, HNSW index, similarity search, ParadeDB, pg_search, reranking, Cohere rerank, pg_trgm, trigram, fuzzy search, LIKE, ILIKE, autocomplete, typo tolerance, fuzzystrmatch