Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)107k · #772

frontend-ui-engineering

Skill này làm gì

Công cụ này giúp xây dựng giao diện người dùng (màn hình và thành phần) cho website và ứng dụng, trông như được làm bởi các kỹ sư giàu kinh nghiệm. Nó đảm bảo mọi thứ dễ tiếp cận với tất cả mọi người, hoạt động tốt trên các kích thước màn hình khác nhau và có diện mạo chuyên nghiệp.

Khi nào nên dùng

  • ✓Khi bạn tạo màn hình hoặc nút mới.
  • ✓Khi bạn điều chỉnh diện mạo của một trang có sẵn.
  • ✓Khi bạn cần website hoạt động tốt trên điện thoại và máy tính.

Liên kết skill

https://github.com/addyosmani/agent-skills/blob/main/skills/frontend-ui-engineering/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/addyosmani/agent-skills/blob/main/skills/frontend-ui-engineering/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo nút “save” cho biểu mẫu đăng ký, đảm bảo dễ nhấn trên điện thoại.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ tổ chức code một cách logic, tách phần giao diện khỏi phần logic. Nó cũng dùng các mẫu thiết kế đã được chấp nhận và tuân thủ quy tắc truy cập để đảm bảo chất lượng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Frontend UI Engineering

Overview

Build production-quality user interfaces that are accessible, performant, and visually polished. The goal is UI that looks like it was built by a design-aware engineer at a top company — not like it was generated by an AI. This means real design system adherence, proper accessibility, thoughtful interaction patterns, and no generic "AI aesthetic."

When to Use

  • Building new UI components or pages
  • Modifying existing user-facing interfaces
  • Implementing responsive layouts
  • Adding interactivity or state management
  • Fixing visual or UX issues

Component Architecture

File Structure

Colocate everything related to a component:

src/components/
  TaskList/
    TaskList.tsx          # Component implementation
    TaskList.test.tsx     # Tests
    TaskList.stories.tsx  # Storybook stories (if using)
    use-task-list.ts      # Custom hook (if complex state)
    types.ts              # Component-specific types (if needed)

Component Patterns

Prefer composition over configuration:

// Good: Composable
<Card>
  <CardHeader>
    <CardTitle>Tasks</CardTitle>
  </CardHeader>
  <CardBody>
    <TaskList tasks={tasks} />
  </CardBody>
</Card>

// Avoid: Over-configured
<Card
  title="Tasks"
  headerVariant="large"
  bodyPadding="md"
  content={<TaskList tasks={tasks} />}
/>

Keep components focused:

// Good: Does one thing
export function TaskItem({ task, onToggle, onDelete }: TaskItemProps) {
  return (
    <li className="flex items-center gap-3 p-3">
      <Checkbox checked={task.done} onChange={() => onToggle(task.id)} />
      <span className={task.done ? 'line-through text-muted' : ''}>{task.title}</span>
      <Button variant="ghost" size="sm" onClick={() => onDelete(task.id)}>
        <TrashIcon />
      </Button>
    </li>
  );
}

Separate data fetching from presentation:

// Container: handles data
export function TaskListContainer() {
  const { tasks, isLoading, error, refetch } = useTasks();

  if (isLoading) return <TaskListSkeleton />;
  if (error) return <ErrorState message="Failed to load tasks" retry={refetch} />;
  if (tasks.length === 0) return <EmptyState message="No tasks yet" />;

  return <TaskList tasks={tasks} />;
}

// Presentation: handles rendering
export function TaskList({ tasks }: { tasks: Task[] }) {
  return (
    <ul role="list" className="divide-y">
      {tasks.map(task => <TaskItem key={task.id} task={task} />)}
    </ul>
  );
}

State Management

Choose the simplest approach that works:

Local state (useState)           → Component-specific UI state
Lifted state                     → Shared between 2-3 sibling components
Context                          → Theme, auth, locale (read-heavy, write-rare)
URL state (searchParams)         → Filters, pagination, shareable UI state
Server state (React Query, SWR)  → Remote data with caching
Global store (Zustand, Redux)    → Complex client state shared app-wide

Avoid prop drilling deeper than 3 levels. If you're passing props through components that don't use them, introduce context or restructure the component tree.

Design System Adherence

Reference-led UI quality

When the product needs a distinct visual direction, collect evidence before choosing a layout:

  1. Search a trusted reference catalogue or use references supplied by the product team.
  2. Study two or three relevant screens. Record decisions about hierarchy, density, navigation, controls, responsive behavior, and interaction states.
  3. Turn those decisions into a short design contract before implementation. Name the screen's job, primary action, required states, responsive rules, and patterns to reject.
  4. Rebuild the useful structure in the product's own components, tokens, content, and visual language. Never copy another product's branding, proprietary text, imagery, or exact layout.

Use references as evidence, not as templates. If references are unavailable, document the assumptions and verify the result against the product's existing design system.

Avoid the AI Aesthetic

AI-generated UI has recognizable patterns. Avoid all of them:

AI Default Why It Is a Problem Production Quality
Purple/indigo everything Models default to visually "safe" palettes, making every app look identical Use the project's actual color palette

…

Câu hỏi thường gặp

“Accessible” (dễ tiếp cận) nghĩa là gì?

Nghĩa là giao diện có thể được mọi người sử dụng, kể cả người khiếm thị hoặc gặp khó khăn vận động, bằng trình đọc màn hình hoặc các công nghệ hỗ trợ khác.

“Responsive” nghĩa là gì?

Là khi giao diện tự thích ứng với các kích thước màn hình khác nhau, như điện thoại, máy tính bảng và máy tính, để mọi thứ đều dễ đọc và dễ dùng.

Vì sao tránh “phong cách AI”?

Giao diện do AI tạo ra thường dùng màu sắc, hình dạng và khoảng cách chung chung không hợp với thiết kế chuyên nghiệp. Công cụ tập trung tạo ra thứ trông có chất lượng và phù hợp với dự án.

Chi tiết

Mô tả gốc của tác giả

Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.

repo: addyosmani/agent-skills

Độ phổ biến

Sao GitHub
107k
Vị trí xếp hạng
#772
Giấy phép
MIT
Cập nhật
13/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự