AgentSkillsCN

docs

为各类库和框架获取最新文档。关键——自动调用: - 当用户希望使用任何外部库(如 GSAP、Lenis、Three.js、Framer、Radix 等)进行开发时; - 当用户询问“如何使用 X”、“X 的文档”、“X 的 API”、“X 的参考信息”时; - 在编写任何依赖外部包的代码之前; - 当用户提及库名:gsap、lenis、three、framer、motion、radix、sanity、zustand。 务必牢记:切勿自以为熟知 API。每次使用前,务必先获取最新文档。

SKILL.md
--- frontmatter
name: docs
description: |
  Fetch latest documentation for libraries and frameworks. CRITICAL - AUTO-INVOKE when:
  - User wants to implement with ANY external library (GSAP, Lenis, Three.js, Framer, Radix, etc.)
  - User asks "how to use X", "X docs", "X API", "X reference"
  - Before writing ANY code that uses external packages
  - User mentions library names: gsap, lenis, three, framer, motion, radix, sanity, zustand

  MANDATORY: Never assume API knowledge. Always fetch current docs first.
context: fork
allowed-tools: [mcp__context7__resolve-library-id, mcp__context7__get-library-docs, WebFetch, WebSearch]

Documentation Fetcher

CRITICAL: Always fetch current documentation before implementing with ANY external library. APIs change. Your training data is outdated.

Using Context7 MCP

bash
# Step 1: Resolve library ID
mcp__context7__resolve-library-id { "libraryName": "gsap" }

# Step 2: Fetch docs for specific topic
mcp__context7__get-library-docs {
  "context7CompatibleLibraryID": "greensock/docs",
  "topic": "ScrollTrigger",
  "tokens": 10000
}

Common Libraries

LibraryContext7 IDTopics
GSAPgreensock/docsScrollTrigger, Timeline, Tweens
Lenisdarkroom/lenissetup, scrollTo, events
Three.jsmrdoob/three.jsScene, Camera, Renderer
Framer Motionframer/motionanimate, variants, gestures
Radixradix-ui/primitivesDialog, Dropdown, Tabs
Next.jsvercel/nextjsApp Router, Server Components
Reactfacebook/reacthooks, components, patterns
Sanitysanity-io/sanityGROQ, schemas, studio

Pre-Implementation Checklist

Before writing code with a library:

  1. Fetch docs - Get current API documentation
  2. Check version - Run bun info <package>
  3. Find examples - Look for usage patterns in docs
  4. Verify imports - Confirm correct import paths

Output

After fetching docs, summarize:

  • Key APIs needed for the task
  • Import statements to use
  • Example usage from docs
  • Gotchas or important notes

Remember

  • NEVER write library code from memory
  • Always verify current API before implementing
  • Store useful discoveries as learnings