Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计异常

generative-ui生成式用户界面

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

4,586

周安装

197

GitHub Stars

11,127

下载量

1,608
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:generative-ui(生成式用户界面)
来源仓库:https://github.com/tambo-ai/tambo
仓库路径:skills/generative-ui
安装命令:
npx skills add https://github.com/tambo-ai/tambo --skill generative-ui
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tambo-ai/tambo --skill generative-ui

简介

generative-ui 用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。

  • 适合让 Agent 根据产品场景生成 UI 方案、检查视觉一致性或改进组件层级。
  • 使用时需结合现有品牌、设计系统和用户任务,避免堆砌装饰元素。
  • 涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Generative UI

Build generative UI apps with Tambo — create rich, interactive React components from natural language.

Reference Guides

Load these when you need deeper implementation details beyond the bootstrap flow:

  • Components - Load when creating custom components. Generative vs interactable, propsSchema, ComponentRenderer.
  • Component Rendering - Streaming props, loading states, persistent state. Load when customizing rendering.
  • Threads and Input - Load when building custom chat UI. useTambo(), useTamboThreadInput(), userKey/userToken auth, suggestions, voice.
  • Tools and Context - Load when adding tools or MCP. defineTool(), MCP servers, contextHelpers.
  • CLI Reference - Load for tambo add components. Component library, non-interactive flags, exit codes.
  • Skills - Mention as a next step after setup. Project-scoped agent skills via CLI and dashboard.

These shared references are duplicated from building-with-tambo so each skill works independently.

One-Prompt Flow

The goal is to get the user from zero to a running app in a single prompt. Ask all questions upfront using AskUserQuestion with multiple questions, then execute everything without stopping.

Step 1: Gather All Non-Sensitive Preferences (Single AskUserQuestion Call)

Use AskUserQuestion with up to 3 questions in ONE call. Authentication is handled by the CLI in a later step.

Question 1: What do you want to build?

Ask the user what kind of app they're building. This drives which starter components to create. Examples: "a dashboard", "a chatbot", "a data visualization tool", "a task manager". If the user already said what they want in their initial message, skip this question.

Question 2: Framework

Options:

  • Next.js (Recommended) - Full-stack React with App Router
  • Vite - Fast, lightweight React setup

Question 3: App name

Let the user pick a name for their project directory. Default suggestion: derive from what they want to build (e.g., "my-dashboard", "my-chatbot"). Use kebab-case (letters, numbers, hyphens only). If the user gives a non-slug name like "Sales Dashboard", propose sales-dashboard instead.

Skip questions when the user already told you the answer. If they said "build me a Next.js dashboard app called analytics", you already know the framework, the app idea, and the name.

Step 2: Execute Everything (No Stopping)

Run all of these sequentially without asking for confirmation between steps. If any command fails, stop the flow, surface the error, and ask the user how to proceed — do not continue to later steps.

All templates (standard, vite, analytics, expo) come with chat UI, TamboProvider wiring, component registry, and starter components already included. You do NOT need to add chat UI or wire up the app — just scaffold, configure the API key, add custom components, and start the server.

2a. Scaffold the project

For Next.js (recommended):

npx tambo create-app <app-name> --template=standard --skip-tambo-init
cd <app-name>

For Vite:

npx tambo create-app <app-name> --template=vite --skip-tambo-init
cd <app-name>

Use --skip-tambo-init since create-app normally tries to run tambo init interactively, which won't work in non-interactive environments like coding agents. We handle authentication in the next step.

2b. Authenticate and initialize Tambo

npx tambo init --project-name=<app-name>

This opens the browser for authentication and polls until the user completes auth (up to 15 minutes). Use a long timeout (at least 15 minutes) when running this command. Once auth completes, the CLI creates the project and writes the API key to .env.local with the correct env var for the framework (NEXT_PUBLIC_TAMBO_API_KEY, VITE_TAMBO_API_KEY, etc.).

IMPORTANT: Do NOT ask the user to paste an API key manually. Always use the CLI auth flow.

2c. Create custom starter components

The template includes basic components, but add 1-2 components tailored to what the user wants to build. Don't use generic examples:

  • Dashboard appStatsCard, DataTable
  • ChatbotBotResponse with markdown support
  • Data visualizationChart with configurable data
  • Task managerTaskCard, TaskBoard
  • Generic / unclearContentCard

Each component needs:

  1. A Zod schema with .describe() on every field
  2. The React component itself
  3. Registration in the existing component registry (lib/tambo.ts — add to the existing components array, don't replace it)

Schema constraints — Tambo will reject invalid schemas at runtime:

  • No z.record() — Record types (objects with dynamic keys) are not supported anywhere in the schema, including nested inside arrays or objects. Use z.object() with explicit named keys instead.
  • No z.map() or z.set() — Use arrays and objects instead.
  • For tabular data like rows, use z.array(z.object({col1: z.string(), col2: z.number()})) with explicit column keys — NOT z.array(z.record(z.string(), z.unknown())).

React best practices for generated components:

  • Always add unique key props when rendering lists (.map()). Use a unique field from the data (like id) — not the array index.
  • Include an id field (e.g., z.string().describe("Unique identifier")) in schemas for array items so there's always a stable key available.

Example:

// src/components/StatsCard.tsx
import { z } from "zod/v4";

export const StatsCardSchema = z.object({
  title: z.string().describe("Metric name"),
  value: z.number().describe("Current value"),
  change: z.number().optional().describe("Percent change from previous period"),
  trend: z.enum(["up", "down", "flat"]).optional().describe("Trend direction"),
});

type StatsCardProps = z.infer<typeof StatsCardSchema>;

export function StatsCard({
  title,
  value,
  change,
  trend = "flat",
}: StatsCardProps) {
  // ... implementation with Tailwind styling
}

Then add to the existing registry in lib/tambo.ts:

// Add to the existing components array — don't replace what's already there
// Next.js: import { StatsCard, StatsCardSchema } from "@/components/StatsCard";
// Vite: import { StatsCard, StatsCardSchema } from "../components/StatsCard";
import { StatsCard, StatsCardSchema } from "@/components/StatsCard";

// ... existing components ...
{
  name: "StatsCard",
  component: StatsCard,
  description: "Displays a metric with value and trend. Use when user asks about stats, metrics, or KPIs.",
  propsSchema: StatsCardSchema,
},

2d. Start the dev server

Only start the dev server after all code changes (scaffolding, init, component creation, registry updates) are complete.

npm run dev

Run this in the background so the user can see their app immediately.

Step 3: Summary

After everything is running, give a brief summary:

  • What was set up
  • What components were created and what they do
  • The URL where the app is running (typically http://localhost:3000 for Next.js, http://localhost:5173 for Vite)
  • If auth was skipped: remind them once to run npx tambo init to authenticate
  • A suggestion for what to try first (e.g., "Try asking it to show you a stats card for monthly revenue")

Technology Stacks Reference

Recommended Stack (Default)

Next.js 14+ (App Router)
├── TypeScript
├── Tailwind CSS
├── Zod (for schemas)
└── @tambo-ai/react
npx tambo create-app my-app --template=standard

Vite Stack

Vite + React
├── TypeScript
├── Tailwind CSS
├── Zod
└── @tambo-ai/react

Minimal Stack (No Tailwind)

Vite + React
├── TypeScript
├── Plain CSS
├── Zod
└── @tambo-ai/react

Component Registry Pattern

Every generative component must be registered:

import { TamboComponent } from "@tambo-ai/react";
import { ComponentName, ComponentNameSchema } from "@/components/ComponentName";

export const components: TamboComponent[] = [
  {
    name: "ComponentName",
    component: ComponentName,
    description: "What it does. When to use it.",
    propsSchema: ComponentNameSchema,
  },
];

Key rules:

  • propsSchema: Zod object with .describe() on every field — this is how the AI knows what to pass
  • description: Tell the AI when to use this component — be specific about trigger phrases
  • Streaming: Props arrive incrementally, so handle undefined gracefully (optional fields or defaults)

Adding More Chat UI (Optional)

Templates already include chat UI. These are only needed if the user wants additional UI primitives beyond what the template provides:

npx tambo add message-thread-full --yes    # Complete chat interface
npx tambo add control-bar --yes            # Controls and actions
npx tambo add thread-history --yes         # Conversation history sidebar

Supported Technologies

TechnologySupport LevelNotes
Next.js 14+FullRecommended, App Router preferred
ViteFullGreat for SPAs
Create React AppPartialWorks but CRA is deprecated
RemixPartialWorks with client components
TypeScriptFullStrongly recommended
JavaScriptFullWorks but less type safety
Tailwind CSSFullDefault for CLI components
Plain CSSFullNeed custom component styling
CSS ModulesFullSupported
ZodRequiredUsed for all schemas

Verification

Have the user verify the app works by:

  1. Opening the app URL in a browser
  2. Typing a prompt that should trigger one of the registered components (e.g., "Show me a stats card for monthly revenue")
  3. Verifying the component renders with AI-generated props

If something doesn't work:

  • Check the registry includes the component
  • Check the description matches the prompt
  • Check the dev server has no console errors

Reporting Bugs & Feedback

If you encounter any of these while helping a user, suggest filing a GitHub issue:

  • A bug in @tambo-ai/react, @tambo-ai/client, or the tambo CLI
  • Documentation that contradicts actual behavior
  • Missing or misleading instructions in this skill

Issue Template

Use this template when drafting an issue for tambo-ai/tambo:

**Title:** [Short description of the problem]

**Expected behavior**
What should happen.

**Actual behavior**
What happens instead, including any error messages or stack traces.

**Repro steps**

1. Run `npx tambo create-app ...` (or whatever command)
2. Add this code:

// minimal code that reproduces the issue


3. Observe the error

**Environment**

- `@tambo-ai/react` version:
- `@tambo-ai/client` version:
- Framework (Next.js / Vite / CRA) and version:
- Node.js version:
- OS:

**Additional context**
Link to relevant docs or skill file path if applicable.

Security: Redact API keys, tokens, and any customer data before including logs or code snippets in the issue.

Suggesting an Issue to the User

When you hit a problem that looks like a Tambo bug, say something like:

This looks like a bug in @tambo-ai/react. Want me to open a GitHub issue on tambo-ai/tambo with the repro steps and environment details?

Always wait for the user to confirm before filing.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.74%
按下载量换算607

Claude

28.43%
按下载量换算457

Cursor

21.1%
按下载量换算339

Gemini CLI

9.48%
按下载量换算152

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills