context7-skill-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Context7 Skill Generator

Context7 Skill生成器

Automatically captures Context7 MCP documentation responses and generates properly formatted skill files.
自动捕获Context7 MCP文档响应并生成格式规范的Skill文件。

How It Works

工作原理

When Context7 MCP is invoked during a conversation, this skill:
  1. Detects Context7 usage - Identifies when Context7 tools were called
  2. Extracts documentation - Pulls the relevant docs from the conversation
  3. Formats as skill - Creates proper YAML frontmatter and markdown structure
  4. Generates skill file - Writes to the appropriate location
当对话中调用Context7 MCP时,本Skill会:
  1. 检测Context7使用情况 - 识别何时调用了Context7工具
  2. 提取文档内容 - 从对话中拉取相关文档
  3. 格式化为Skill - 创建标准的YAML前置元数据和Markdown结构
  4. 生成Skill文件 - 写入至对应目录

Usage

使用方法

Automatic Detection

自动检测

Simply invoke this skill after using Context7:
/skill context7-skill-generator
The skill will analyze the conversation for Context7 responses and prompt you for:
  • Skill name (e.g.,
    latest-nextjs
    ,
    react-compiler
    )
  • Description (brief summary of what the skill covers)
  • Plugin location (which plugin to add the skill to)
只需在使用Context7后调用本Skill即可:
/skill context7-skill-generator
本Skill会分析对话中的Context7响应,并提示您提供以下信息:
  • Skill名称(例如:
    latest-nextjs
    ,
    react-compiler
  • 描述(Skill涵盖内容的简要概述)
  • 插件位置(将Skill添加至哪个插件)

Manual Command

手动命令

For explicit invocation with parameters:
bash
/skill:from-context7
如需带参数的显式调用:
bash
/skill:from-context7

Context7 Tool Patterns

Context7工具模式

The skill looks for these Context7 MCP tool invocations:
  • resolve-library-id
    - Library resolution
  • query-docs
    - Documentation queries
本Skill会识别以下Context7 MCP工具调用:
  • resolve-library-id
    - 库解析
  • query-docs
    - 文档查询

Generated Skill Structure

生成的Skill结构

The generated skill follows this template:
yaml
---
name: skill-name
description: Brief description of the skill
updated: YYYY-MM-DD
source: context7
library: library-name
version: detected-version
---
生成的Skill遵循以下模板:
yaml
---
name: skill-name
description: Brief description of the skill
updated: YYYY-MM-DD
source: context7
library: library-name
version: detected-version
---

Sections Generated

生成的章节

  1. Frontmatter - YAML metadata (name, description, updated, source, library, version)
  2. Title - Formatted from skill name
  3. Overview - Brief introduction
  4. Key Features - Main functionality extracted from docs
  5. Code Examples - Relevant examples from Context7 response
  6. API Reference - Important API patterns
  7. Best Practices - Usage patterns found in docs
  8. Migration Notes - Any version-specific migration info
  9. Resources - Links to official docs
  1. 前置元数据 - YAML元数据(名称、描述、更新日期、来源、库、版本)
  2. 标题 - 根据Skill名称格式化生成
  3. 概述 - 简要介绍
  4. 核心功能 - 从文档中提取的主要功能
  5. 代码示例 - 来自Context7响应的相关示例
  6. API参考 - 重要的API模式
  7. 最佳实践 - 文档中提到的使用模式
  8. 迁移说明 - 特定版本的迁移信息
  9. 资源 - 官方文档链接

Output Location

输出位置

Skills are generated to:
plugins/{plugin-name}/skills/{skill-name}/SKILL.md
Skill文件会生成至:
plugins/{plugin-name}/skills/{skill-name}/SKILL.md

Example Workflow

示例工作流程

bash
undefined
bash
undefined

1. Use Context7 to get documentation

1. 使用Context7获取文档

How do I set up Next.js 16 middleware? use context7
How do I set up Next.js 16 middleware? use context7

2. Generate a skill from the response

2. 从响应中生成Skill

/skill context7-skill-generator
/skill context7-skill-generator

3. Provide prompted information:

3. 提供提示的信息:

- Skill name: nextjs-middleware

- Skill名称: nextjs-middleware

- Description: Next.js 16 middleware patterns and configuration

- 描述: Next.js 16中间件模式与配置

- Plugin: nextjs

- 插件: nextjs

4. Skill file created at:

4. Skill文件创建于:

plugins/nextjs/skills/nextjs-middleware/SKILL.md

plugins/nextjs/skills/nextjs-middleware/SKILL.md

undefined
undefined

Extraction Logic

提取逻辑

Content Identification

内容识别

The skill identifies Context7 content by looking for:
  • Tool results containing
    resolve-library-id
    or
    query-docs
  • Documentation sections with code examples
  • Version-specific information
  • API patterns and usage examples
本Skill通过以下特征识别Context7内容:
  • 包含
    resolve-library-id
    query-docs
    的工具结果
  • 带有代码示例的文档章节
  • 特定版本的信息
  • API模式与使用示例

Smart Formatting

智能格式化

  • Code blocks - Preserved as markdown code fences
  • Headers - Converted to proper markdown hierarchy
  • Lists - Formatted as bulleted or numbered lists
  • Links - Preserved as markdown links
  • Tables - Converted to markdown tables
  • 代码块 - 保留为Markdown代码块格式
  • 标题 - 转换为标准的Markdown层级
  • 列表 - 格式化为无序列表或有序列表
  • 链接 - 保留为Markdown链接
  • 表格 - 转换为Markdown表格

Version Detection

版本检测

Attempts to extract version information from:
  • Explicit version mentions in docs
  • Library identifiers (e.g.,
    /vercel/next.js
    )
  • Release notes or changelog entries
尝试从以下位置提取版本信息:
  • 文档中明确提及的版本
  • 库标识符(例如:
    /vercel/next.js
  • 发布说明或变更日志条目

Error Handling

错误处理

If the skill cannot:
  • Find Context7 content: Prompts you to paste the documentation manually
  • Determine library: Asks for library name manually
  • Detect version: Uses current date and notes version as "latest"
若本Skill无法:
  • 找到Context7内容:提示您手动粘贴文档
  • 确定库名称:手动询问库名称
  • 检测版本:使用当前日期并将版本标记为"latest"

Best Practices

最佳实践

  1. Review generated skills - Always review and edit the generated skill for accuracy
  2. Add custom examples - Supplement Context7 content with project-specific examples
  3. Keep focused - Generate skills for specific topics, not entire libraries
  4. Update regularly - Re-run for updated documentation as libraries evolve
  5. Index skills - Run
    update-indexes
    after generating new skills
  1. 审核生成的Skill - 务必审核并编辑生成的Skill以确保准确性
  2. 添加自定义示例 - 用项目特定示例补充Context7内容
  3. 聚焦主题 - 针对特定主题生成Skill,而非整个库
  4. 定期更新 - 当库更新时重新运行以获取最新文档
  5. 索引Skill - 生成新Skill后运行
    update-indexes

Integration with Marketplace

与市场集成

This skill integrates with the IP Labs marketplace by:
  • Following marketplace skill conventions (YAML frontmatter, markdown structure)
  • Supporting multi-plugin skill generation
  • Maintaining consistency with existing skills like
    latest-nextjs
    and
    latest-react
本Skill通过以下方式与IP Labs市场集成:
  • 遵循市场Skill规范(YAML前置元数据、Markdown结构)
  • 支持多插件Skill生成
  • 与现有Skill(如
    latest-nextjs
    latest-react
    )保持一致性

Advanced Usage

高级用法

Batch Generation

批量生成

For multiple libraries, invoke multiple times:
bash
/skill context7-skill-generator
如需为多个库生成Skill,可多次调用:
bash
/skill context7-skill-generator

(generate first skill)

(生成第一个Skill)

/skill context7-skill-generator
/skill context7-skill-generator

(generate second skill)

(生成第二个Skill)

undefined
undefined

Custom Sections

自定义章节

Add custom sections by editing the generated skill file after creation. Common additions:
  • Project-Specific Patterns - How your team uses this library
  • Integration Examples - Connecting with other tools in your stack
  • Troubleshooting - Common issues and solutions
  • Performance Tips - Optimization guidance
生成Skill文件后,可通过编辑添加自定义章节。常见的补充内容包括:
  • 项目特定模式 - 您的团队如何使用该库
  • 集成示例 - 与技术栈中其他工具的连接方式
  • 故障排除 - 常见问题与解决方案
  • 性能优化建议 - 优化指导