agentleFS
laguagulaguagu/claude-code-nextjs-skills/skills/ai-elements/SKILL.md

ai-elements

Skill72 starsChanged 17 days agoMITView on GitHub

Maintains AI chat UI built from elements.ai-sdk.dev AI Elements components already copied into the project. Use when changing or debugging those components (conversations, messages, prompt inputs, attachments, reasoning, tool output, sources). New chat UI uses the shadcn/ui AI Elements patterns (`shadcn` skill).

33 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use dep-refs, feature-boundary-planner and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • betacatslingSkill

    dep-refs

    Use when needs to inspect TypeScript export references in the z-code workspace, list exports from a file, verify whether an export is unused before deletion, investigate who imports a symbol during refactors, or combine pnpm knip unused-export results with pnpm dep:refs symbol-level reference tracing.

    Also in 5 projects that use this

  • betacatslingSkill

    feature-boundary-planner

    Map a ZCode behavior change to current UI surfaces, state owners, protocol commands, persistence, and validation. Use for impact analysis, product-boundary planning, or an implementation handoff grounded in the checked-out source.

    Also in 5 projects that use this

  • Cartograf666Skill

    architecture-governance

    Bootstrap, document, enforce, and review a project's architecture through layer responsibilities, dependency direction, architecture manifests, legacy baselines, Change Envelopes, cross-layer approval policy, and deterministic architecture checks. Use when starting a project, auditing an existing codebase, planning cross-layer work, preventing architecture erosion, reviewing structural changes, or deciding whether implementation may expand into another layer.

    Also in 5 projects that use this

  • ZCodium-projectSkill

    e2e-case-lifecycle

    Plan, maintain, replay, and promote ZCode desktop E2E cases and their fixtures, coverage matrices, and CI admission evidence.

    Also in 3 projects that use this

  • ZCodium-projectSkill

    zcode-large-task-fixture

    Generate, verify, or remove large synthetic ZCode task fixtures in local ~/.zcode persistence for UI/session performance testing. Use when testing big conversation/task rendering, task list performance, snapshot recovery, tool-call rendering, reasoning, patches, todos, and model usage without spending time chatting manually.

    Also in 3 projects that use this

  • crafter-stationSkill

    create-element

    Create new UI elements for tryelements.dev registry. Use when: (1) Adding new UI components (buttons, inputs, cards), (2) Building integration components (Clerk, Stripe, Uploadthing), (3) Creating theme-related elements, (4) Any shadcn-style registry component. IMPORTANT: For logo components with variants (icon/wordmark/logo + dark/light), use the logo-with-variants skill instead. This skill includes scaffolding, registry schema, and component patterns. ALWAYS use Context7 MCP to fetch latest dependency docs before implementing.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use AI Elements where its components fit the interaction.

    line 8
  2. Very specific:

    Follow the project's package manager, aliases, shadcn configuration and AI SDK major.

    line 22
  3. Very specific:

    Read generated components/ai-elements/<component>.tsx first, then the matching references/ file and its scripts/ examples.

    line 27
  4. Distinctive:

    Keep model choice, tools, credentials and authorization on the server.

    line 50
  5. Very specific:

    When rendering fails, inspect the owned component, theme imports, semantic tokens and actual configured aliases.

    line 57
  6. Distinctive:

    Verify the rendered flow with real message states and the project's checks.

    line 62

“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

AI Elements

Use AI Elements where its components fit the interaction. The generated source belongs to the project: inspect it for the actual API and customize it deliberately.

vercel/ai-elements will be deprecated at the end of November 2026 (announced 2026-10-14, CLI 1.9.1). Its replacement is AI Elements from shadcn/ui (https://ui.shadcn.com/docs/ai-elements): copy-in patterns built on Message, Bubble, Message Scroller, Trace and Code Block. Copied files in components/ai-elements/ keep working. To move one onto shadcn/ui, use the 'Migrating from AI SDK Elements' prompt on its pattern page; some elements (artifact, canvas, persona, web-preview, ...) have no replacement. For new chat UI use the shadcn skill, not ai-elements add.

Project and documentation

Follow the project's package manager, aliases, shadcn configuration and AI SDK major. Read ai-sdk to resolve the installed version, then the appropriate ai-sdk-6 or ai-sdk-7 guidance. AI Elements and AI SDK versions can change independently.

Read generated components/ai-elements/<component>.tsx first, then the matching references/ file and its scripts/ examples. Use the AI Elements site for current documentation. Load only relevant references; verify bundled examples against installed source.

To add a missing component to an existing install, use the project's runner with ai-elements@latest add <component> or shadcn@latest add @ai-elements/<component>. Components land in components/ai-elements/ under the alias configured in components.json; that installed source is the offline API reference. Check installed components and review generated files before replacing local customization. Use shadcn for registry, preset and primitive-base details.

AI Elements targets the Radix base (upstream uses style new-york with radix-ui). On Base UI projects expect prop mismatches in prompt-input, attachments, inline-citation and plan (upstream #446, open 2026-10-11); adapt the installed copies.

Integration

Integration covers the UI/SDK boundary, v6 pitfalls and the context.tsx patch that AI SDK 7 needs. Keep stable message IDs and render supported message parts with the generated compound components. Keep model choice, tools, credentials and authorization on the server.

Compose the states the feature needs: streaming, completion, retry, cancellation, attachments, approval or sources. Avoid adding components merely because the library offers them. Preserve keyboard interaction, accessible labels and useful scroll behavior.

When rendering fails, inspect the owned component, theme imports, semantic tokens and actual configured aliases. Do not copy a default tsconfig or replace the project's theme to fix one import. For unstyled markdown, check the MessageResponse setup.

Verify the rendered flow with real message states and the project's checks; type correctness alone does not establish usable streaming or attachment behavior.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.