Skip to content
Agentmart
Submit a tool

ai-native-ui

Skill by Leo-Atienza

IndexedMIT★ 4
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/leo-atienza-ai-native-ui

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

The publisher has not written a description yet.

Use cases: design

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions: not checked yet.

What's inside

Skill name
ai-native-ui
Description
None
License
MIT
Instructions
304 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • missing YAML frontmatter
  • name: missing
  • description: missing

Files (4)

  • SKILL.md
  • generative-ui.md · references/
  • stream-text-patterns.md · references/
  • tool-ui-mapping.md · references/

SKILL.md (first lines)

<!--
id: SK-086
name: ai-native-ui
description: AI-Native UI — Vercel AI SDK patterns for streaming UI. streamText, useChat, tool-to-component mapping, createStreamableValue, generative UI within PPR shells. Load when building AI-powered interfaces.
keywords: ai-sdk, stream-text, use-chat, generative-ui, tool-invocation, streaming-ui, llm, chatbot, ai-native, createStreamableValue, vercel-ai
version: 1.0.0
-->

# AI-Native UI

## When to Use This Skill

Load when building any UI with LLM integration: chat interfaces, AI-generated content, smart search, content generation tools, or any feature that streams AI responses to users.

This is **Tier 4 (Generative)** in the Vanguard architecture. Load `web-l100` (SK-083) for the full tier system.

---

## The Generative Tier

AI streams are a fundamentally different rendering model. Unlike T0-T3 where the final content is known at render time, T4 content builds up token-by-token with structural uncertainty. The UI must:

1. Show useful content immediately (PPR shell + cached content)
2. Progressively reveal AI-generated content as it streams
3. Handle tool invocations mid-stream (AI calls tools → UI renders components)
4. Gracefully handle interruption (user cancels, network drops)

---

## Core Pattern: streamText + Route Handler

### Server: Route Handler

```typescript
// app/api/chat/route.ts
import { streamText } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';

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

  const result = streamText({
    model: anthropic('claude-sonnet-4-5-20250514'),
    system: 'You are a helpful assistant.',
    messages,
    tools: {
      getWeather: {
        description: 'Get weather for a location',
        parameters: z.object({
          location: z.string().describe('City name'),
        }),
        execute: async ({ location }) => {
          const weather = await fetchWeather(location);
          return weather;
        },
      },
    },
  });

  return result.toDataStreamResponse();
}
```

### Client: useChat Hook

```tsx
// components/chat.tsx
'use client';
import { useChat } from '@ai-sdk/react';

export function Chat() {
  const { messages, input, handleInputChange, handleSubmit, isLoading, stop } = useChat({
    api: '/api/chat',
  });

  return (
    <div className="chat">
      <div className="messages">
        {messages.map(message => (
          <div key={message.id} className={`message message--${message.role}`}>
            {message.content}

            {/* Render tool invocations as components */}
            {message.toolInvocations?.map(invocation => (
              <ToolResult key={invocation.toolCallId} invocation={invocation} />
            ))}
          </div>
        ))}
      </div>

      <form onSubmit={handleSubmit}>
        <input value={input} onChange={handleInputChange} placeholder="Ask anything..." />
        {isLoading ? (
          <button type="button" onClick={stop}>Stop</button>
        ) : (
          <button type="submit">Send</button>
        )}
      </form>
    </div>
  );
}
```

---

## Tool Invocations → React Components

The killer pattern: AI calls tools, each tool invocation maps to a React component.

```tsx
// components/tool-result.tsx
function ToolResult({ invocation }: { invocation: ToolInvocation }) {
  // Tool is still being called — show loading state
  if (invocation.state === 'call') {
    return <ToolLoading name={invocation.toolName} />;
  }

  // Tool returned a result — render the appropriate component
  if (invocation.state === 'result') {
    switch (invocation.toolName) {

From Leo-Atienza/atlas-claude, MIT.

More from Leo-Atienza/atlas-claude

Signals

Stars
4
Forks
5
Open issues
0
Last commit (this folder)
Jul 20, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Leo-Atienza

Cite this page

ai-native-ui skill. Agent Mart. https://agentmart.dev/skills/leo-atienza-ai-native-ui (last updated 2026-10-24)