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

diffs

Skill này làm gì

Skill hướng dẫn AI dùng thư viện @pierre/diffs để hiển thị mã được tô sáng, bản vá và màn hình review trong React hoặc JavaScript thuần. Dành cho lập trình viên xây dựng tính năng xem mã.

Khi nào nên dùng

  • ✓Khi ứng dụng web của bạn cần hiển thị file mã hoặc diff có tô sáng cú pháp.
  • ✓Khi bạn xây dựng màn hình review mã hoặc màn hình xung đột khi gộp mã.
  • ✓Khi bạn dùng @pierre/diffs trong React hoặc JavaScript thuần.

Liên kết skill

https://github.com/trycompai/crm/blob/release/.agents/skills/diffs/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/trycompai/crm/blob/release/.agents/skills/diffs/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

“Bạn có thể thêm trình xem diff mã vào ứng dụng React của tôi bằng thư viện @pierre/diffs không?”

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

Cách hoạt động

AI cài gói, chọn tài liệu tham chiếu React hoặc trình soạn thảo phù hợp, rồi hiển thị file hoặc diff bằng các thành phần của thư viện.

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.

@pierre/diffs

Use @pierre/diffs to render syntax-highlighted files and diffs. Use its optional editor, SSR, and worker entries for those capabilities.

Install

pnpm add @pierre/diffs

Install react and react-dom when the app uses the React entry.

Select an API reference

Surface Reference
@pierre/diffs/react React API
@pierre/diffs/edit Editor API

Select a recipe

Task Recipe
Render a file or diff in React Render with React
Build a virtualized review surface Use CodeView
Edit a React surface or CodeView Edit with React

Not vendored here

These references were not copied into this skill. There is no local file for them. Read the package types and the upstream documentation instead.

  • Core API: root components, parsing, and file extension APIs.
  • Highlighting API: languages, themes, highlighter state, and streams.
  • Low-level rendering API: renderers, managers, DOM helpers, and constants.
  • Shared types: data, option, render, selection, and editor types.
  • SSR API for @pierre/diffs/ssr, and the recipe for preloading server markup.
  • Worker API for @pierre/diffs/worker, and the recipe for a worker pool.
  • Recipes for vanilla JavaScript rendering and vanilla editing.
  • Recipes for line annotations and selection.
  • Recipe for registering a custom Shiki language or theme.
Câu hỏi thường gặp

Nó hỗ trợ những framework nào?

Nó bao quát React và JavaScript thuần, đồng thời đề cập đến render phía máy chủ và worker.

Người dùng có thể sửa mã bằng nó không?

Có. Nó có mục trình soạn thảo tùy chọn cho các bề mặt chỉnh sửa.

Tất cả tài liệu tham chiếu có được đưa vào không?

Không phải tất cả. Một số tài liệu chưa được sao chép vào skill, nên AI phải đọc kiểu dữ liệu của gói và tài liệu gốc cho các phần đó.

Chi tiết

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

Use when an app uses @pierre/diffs to render or edit code files, diffs, patches, merge conflicts, or CodeView review surfaces, including React, vanilla JavaScript, SSR, workers, annotations, selection, and custom Shiki languages or themes.

repo: trycompai/crm

Độ phổ biến

Sao GitHub
12k
Vị trí xếp hạng
#11517
Giấy phép
MIT
Cập nhật
1/11/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ự