Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计通过

frontend-ui前端用户界面

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

1,722

周安装

69

GitHub Stars

12

下载量

558
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/scientiacapital/skills --skill frontend-ui

简介

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合处理 React、Next.js、Vue、Tailwind、CSS 等主流技术栈的代码生成与审查。
  • 可整理组件结构、定位布局问题,并建议性能优化方案。
  • 需结合项目现有设计系统和构建流程使用,避免生成孤立代码片段。
  • 涉及页面改动时应配合本地预览和构建检查确认实际效果。

SKILL.md

Production SaaS: dashboards, pricing pages, data tables, onboarding, role-based UI — with WCAG 2.1 AA accessibility and Core Web Vitals performance baked in.

<quick_start>

Setup: Tailwind v4 + shadcn/ui

npx create-next-app@latest my-app --typescript --tailwind --eslint --app --src-dir
cd my-app && npx shadcn@latest init
npx shadcn@latest add button card dialog table form

Tailwind v4 — CSS-First (No tailwind.config.js)

/* app/globals.css */
@import "tailwindcss";
@theme inline {
  --color-background: oklch(1 0 0);
  --color-foreground: oklch(0.145 0 0);
  --color-primary: oklch(0.205 0.042 264.695);
  --color-primary-foreground: oklch(0.985 0 0);
  --radius-lg: 0.5rem;
  --radius-md: calc(var(--radius-lg) - 2px);
  --radius-sm: calc(var(--radius-lg) - 4px);
}

Component Anatomy (shadcn/ui 2026)

import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"

const buttonVariants = cva(
  "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
  {
    variants: {
      variant: { default: "bg-primary text-primary-foreground", outline: "border border-input" },
      size: { default: "h-10 px-4 py-2", sm: "h-9 px-3", lg: "h-11 px-8" },
    },
    defaultVariants: { variant: "default", size: "default" },
  }
)

// React 19: ref is a regular prop — no forwardRef
// data-slot: styling hook for parent overrides
function Button({ className, variant, size, ref, ...props }:
  React.ComponentProps<"button"> & VariantProps<typeof buttonVariants>) {
  return <button ref={ref} data-slot="button"
    className={cn(buttonVariants({ variant, size, className }))} {...props} />
}

cn() Utility

import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) }

Vite SPA Alternative

npm create vite@latest my-app -- --template react-ts
cd my-app && npm i -D @tailwindcss/vite && npx shadcn@latest init

Key differences from Next.js:

  • @tailwindcss/vite plugin (not postcss) — faster HMR, native Vite integration
  • VITE_ env prefix (not NEXT_PUBLIC_), accessed via import.meta.env
  • Client-only — no Server Components, use React Query for data fetching
  • React.lazy() + <Suspense> replaces dynamic() for code splitting
  • Routing via React Router v7 or TanStack Router (not file-based)

Tailwind v4, shadcn/ui, component patterns, accessibility, forms, and performance guidance all apply equally to Vite SPAs. Only routing and data fetching genuinely differ.

See reference/vite-react-setup.md and reference/spa-routing.md. </quick_start>

<success_criteria> Enterprise SaaS frontend is production-ready when:

  • Accessible: WCAG 2.1 AA — keyboard nav, screen reader, focus management, 4.5:1 contrast
  • Performant: LCP < 2.5s, INP < 200ms, CLS < 0.1 on 4G mobile
  • Responsive: Mobile-first, works 320px-2560px, container queries for components
  • Secure: No XSS vectors, CSP headers, sanitized user content
  • Themed: Dark mode via CSS, design tokens in @theme, consistent spacing/color
  • Composable: Server Components default, client boundary pushed to leaves
  • Typed: TypeScript strict, Zod validation on all forms, no any </success_criteria>

<core_principles>

  1. Server-First — Default to Server Components. Add "use client" only for interactivity. Push client boundaries to leaf components.
  2. Accessible-by-Default — Semantic HTML first (<nav>, <main>, <article>). ARIA only when native semantics insufficient.
  3. Composition Over Configuration — Small composable components. Compound pattern for complex UI. Context at boundaries.
  4. Progressive Disclosure — Essential info first. Reveal complexity on demand. Reduce cognitive load.
  5. Mobile-First — Design for smallest screen, enhance upward. Container queries for components. Touch targets >= 44px.
  6. Design Tokens — All visual values in CSS @theme. Never hardcode. OKLCH for perceptual uniformity.
  7. Type Safety E2E — Zod schemas shared client/server. React.ComponentProps<> over manual interfaces. </core_principles>

<tailwind_v4>

Tailwind CSS v4 — Key Changes from v3

  • No tailwind.config.js — All config via CSS @theme directive
  • @import "tailwindcss" — Replaces @tailwind base/components/utilities
  • OKLCH colors — Perceptually uniform, replaces hex/HSL
  • Container queries built-in@container, @md:, @lg: prefixes
  • @source — CSS-native file scanning (replaces content array)
  • 70% smaller CSS — Automatic unused style elimination
  • @theme inline — shadcn/ui bridge: tokens without generated utilities
@theme {
  --color-brand-500: oklch(0.55 0.15 250);
  --font-sans: "Inter", system-ui, sans-serif;
  --breakpoint-xs: 475px;
  --animate-slide-in: slide-in 0.2s ease-out;
}
// Container queries — component-level responsive
<div className="@container">
  <div className="grid grid-cols-1 @md:grid-cols-2 @lg:grid-cols-3 gap-4">
    {items.map(item => <Card key={item.id} {...item} />)}
  </div>
</div>

Migration: npx @tailwindcss/upgrade — See reference/tailwind-v4-setup.md. </tailwind_v4>

<shadcn_ui>

shadcn/ui 2026

  • @theme inline — Bridges tokens with Tailwind v4
  • data-slot — Attribute-based styling hooks (replaces className overrides)
  • No forwardRef — React 19 ref as prop
  • tw-animate-css — Replaces tailwindcss-animate for v4 compat
  • Radix or Base UI — Choose primitive library
// data-slot: parent can target child styles
function Card({ className, ref, ...props }: React.ComponentProps<"div">) {
  return <div ref={ref} data-slot="card" className={cn("rounded-xl border bg-card", className)} {...props} />
}

// Style from parent:
<div className="[&_[data-slot=card]]:shadow-lg">
  <Card>...</Card>
</div>

Dark mode: CSS custom property swap with .dark class. See reference/shadcn-setup.md. </shadcn_ui>

<component_architecture>

Server vs Client Components

Server Component (default)Client Component ("use client")
Async data fetching, DB accessuseState, useEffect, event handlers
Zero JS bundle, access to secretsBrowser APIs, third-party client libs

Rule: Push "use client" to smallest leaf possible.

// Server page with client island
export default async function DashboardPage() {
  const metrics = await getMetrics()
  return (
    <main>
      <KPICards data={metrics} />       {/* Server-rendered */}
      <RevenueChart data={metrics} />   {/* Client island */}
    </main>
  )
}

Key Patterns

  • Compound components<Table>/<TableRow>/<TableCell> namespace composition
  • cva variants — Type-safe style variants with class-variance-authority
  • React.ComponentProps — Replace manual interfaces, ref as regular prop
  • data-slot — External styling hooks for parent-child overrides
  • Polymorphic (asChild)Slot pattern for rendering as different elements
  • SPA code splittingReact.lazy() + <Suspense> replaces Next.js dynamic()

See reference/component-patterns.md for complete examples. </component_architecture>

<saas_patterns>

Enterprise SaaS Patterns

Dashboard: Sidebar + Header + Main

<div className="flex h-screen">
  <Sidebar className="w-64 hidden lg:flex" />
  <div className="flex-1 flex flex-col">
    <Header />  {/* Search, user menu, notifications */}
    <main className="flex-1 overflow-auto p-6">
      <KPIGrid metrics={metrics} />
      <div className="grid grid-cols-1 lg:grid-cols-2 gap-6 mt-6">
        <RevenueChart data={revenue} />
        <ActivityFeed items={activities} />
      </div>
    </main>
  </div>
</div>

Pricing (3-Tier Conversion)

Anchor (low) | Conversion target (highlighted, "Most Popular") | Enterprise (custom)

Monthly/annual toggle, feature comparison table, social proof. See templates/pricing-page.tsx.

Data Tables — shadcn Table + TanStack Table for sort/filter/paginate

State Trio — Every data component needs: Loading (Skeleton) | Error (retry action) | Empty (guidance)

Role-Based UI — hasPermission(user, "scope") guard for conditional rendering

See reference/saas-dashboard.md and reference/saas-pricing-checkout.md. </saas_patterns>

Semantic HTML first<header>, <nav>, <main>, <article>, <section>, <footer>

PatternImplementation
Keyboard navTab/Shift+Tab, Arrow keys in menus/tabs, Escape to close
Focus managementTrap in dialogs, restore on close, skip link
ARIA live regionsaria-live="polite" for dynamic content
Form errorsaria-invalid, aria-describedby, role="alert"
Loading statesaria-busy={true} on loading buttons
Contrast4.5:1 text, 3:1 UI components (OKLCH lightness channel)
// Skip link
<a href="#main-content" className="sr-only focus:not-sr-only focus:absolute focus:z-50">
  Skip to main content
</a>

See reference/accessibility-checklist.md for per-component ARIA patterns.

<state_management>

State Decision Tree

State TypeSolutionExample
URL statenuqs / useSearchParamsFilters, pagination, tabs
Server dataReact Query / SWRAPI data, user profile
Local UIuseStateForm inputs, toggles
Shared parent-childLift state / ContextAccordion groups
Complex cross-cuttingZustandCart, wizard, notifications

Prefer URL state — shareable, bookmarkable, survives refresh. </state_management>

<data_fetching>

Data Fetching

PatternWhenHow
Server ComponentsDefaultasync function Page() {const data = await db.query()}
Suspense streamingSlow data<Suspense fallback={<Skeleton/>}><SlowComponent/></Suspense>
Server ActionsMutations"use server" + revalidatePath()
React QueryClient real-timeuseQuery({queryKey, queryFn, refetchInterval})
React Query (SPA)Client-only appsuseQuery({queryKey, queryFn}) with loaders — replaces Server Components
</data_fetching>
  1. Shared Zod schema — Single source of truth for client validation and server action
  2. React Hook FormuseForm with zodResolver, mode: "onBlur"
  3. shadcn Form<Form>/<FormField>/<FormItem>/<FormLabel>/<FormMessage>
  4. Server ActionsafeParse on server, return field errors, revalidatePath
const schema = z.object({
  name: z.string().min(2),
  email: z.string().email(),
})

See reference/form-patterns.md and templates/form-with-server-action.tsx.

MetricTargetQuick Win
LCP < 2.5sMain content visiblenext/image with priority, next/font
INP < 200msResponsive interactionsCode-split heavy components with dynamic()
CLS < 0.1No layout shiftReserve space for images/fonts, Skeleton loaders

Tailwind v4 produces 70% smaller CSS automatically. See reference/performance-optimization.md.

Accessibility

  • Keyboard navigation for all interactive elements
  • Screen reader announces content meaningfully
  • Focus indicators visible, skip link present
  • Color contrast >= 4.5:1 (text), >= 3:1 (UI)

Performance

  • LCP < 2.5s, INP < 200ms, CLS < 0.1
  • Images via next/image, fonts via next/font
  • Heavy components code-split with dynamic()

Responsive

  • Works 320px-2560px, touch targets >= 44px
  • Container queries for reusable components

Security

  • No raw HTML injection without sanitization
  • CSP headers, Zod validation client AND server

UX

  • Loading / error / empty states for all data views
  • Toast for mutations, confirm for destructive actions

Emit Outcome Sidecar

As the final step, write to ~/.claude/skill-analytics/last-outcome-frontend-ui.json:

{"ts":"[UTC ISO8601]","skill":"frontend-ui","version":"1.0.0","variant":"default",
 "status":"[success|partial|error]","runtime_ms":[estimated ms from start],
 "metrics":{"components_built":[n],"pages_created":[n],"a11y_checks_passed":[bool]},
 "error":null,"session_id":"[YYYY-MM-DD]"}

Use status "partial" if some stages failed but results were produced. Use "error" only if no output was generated.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.29%
按下载量换算197

Claude

31.39%
按下载量换算175

Cursor

19.52%
按下载量换算109

Gemini CLI

8.74%
按下载量换算49

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills