Chuyển đến nội dung
Skillpedia
Lập trình chung64k · #3164

context7-mcp

Skill này làm gì

Skill này khiến agent kiểm tra tài liệu hiện tại của thư viện và framework phần mềm trước khi trả lời. Skill dành cho lập trình viên muốn có code chính xác thay vì ví dụ đã lỗi thời.

Khi nào nên dùng

  • ✓Khi bạn nhờ agent viết code dùng một thư viện như React, Next.js hoặc Prisma.
  • ✓Khi bạn hỏi một câu hỏi về cài đặt hoặc cấu hình của một framework.
  • ✓Khi bạn cần đúng các phương thức API của một công cụ đang dùng.

Liên kết skill

https://github.com/upstash/context7/blob/master/packages/opencode/skills/context7-mcp/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/upstash/context7/blob/master/packages/opencode/skills/context7-mcp/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

“Hãy chỉ cho tôi cách thiết lập proxy Next.js theo tài liệu mới nhất.”

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

Cách hoạt động

Skill trước hết tìm thư viện phù hợp trong chỉ mục của Context7, rồi lấy tài liệu cho câu hỏi của bạn. Agent trả lời dựa trên tài liệu đó, chứ không chỉ dựa vào trí nhớ.

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.

When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data.

When to Use This Skill

Activate this skill when the user:

  • Asks setup or configuration questions ("How do I configure a Next.js proxy?")
  • Requests code involving libraries ("Write a Prisma query for...")
  • Needs API references ("What are the Supabase auth methods?")
  • Mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)

How to Fetch Documentation

Step 1: Resolve the Library ID

Call resolve-library-id with:

  • libraryName: The library name extracted from the user's question
  • query: What to look up in the library's documentation (improves relevance ranking)

Step 2: Select the Best Match

From the resolution results, choose based on:

  • Exact or closest name match to what the user asked for
  • Higher benchmark scores indicate better documentation quality
  • If the user mentioned a version (e.g., "React 19"), prefer version-specific IDs

Step 3: Fetch the Documentation

Call query-docs with:

  • libraryId: The selected Context7 library ID (e.g., /vercel/next.js)
  • query: What to look up in the library's documentation, scoped to a single concept

If the user's question spans multiple distinct concepts (e.g. routing and auth and caching), make a separate query-docs call per concept with the same library ID, unless the question is about how the concepts interact — combined queries dilute ranking and return shallow results for each topic.

Step 4: Use the Documentation

Incorporate the fetched documentation into your response:

  • Answer the user's question using current, accurate information
  • Include relevant code examples from the docs
  • Cite the library version when relevant

Guidelines

  • Be specific: Describe what to look up in the library's documentation, but keep each query to a single concept
  • One topic per query: Split multi-topic questions into separate query-docs calls — resolve the library ID once, then query per concept, unless the question is about how the concepts interact
  • Version awareness: When users mention versions ("Next.js 16", "React 19"), use version-specific library IDs if available from the resolution step
  • Prefer official sources: When multiple matches exist, prefer official/primary packages over community forks
Câu hỏi thường gặp

Vì sao không chỉ dựa vào trí nhớ của agent?

Thư viện thay đổi thường xuyên, nên trí nhớ có thể đã lỗi thời. Tài liệu hiện tại giúp tránh các ví dụ code cũ.

Skill có thể tìm tài liệu cho một phiên bản cụ thể không?

Có, nếu bạn nêu một phiên bản như React 19, skill ưu tiên tài liệu dành riêng cho phiên bản đó.

Skill có làm việc với nhiều công cụ không?

Skill làm việc với nhiều thư viện và framework, như React, Vue, Next.js, Prisma và Supabase.

Chi tiết

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

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

repo: upstash/context7

Độ phổ biến

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