AgentSkillsCN

auto-skill-generator

通过网络调研生成技能。无论您想了解“如何使用 Stripe API”还是“Prisma ORM”,此技能都会自动搜寻权威文档、爬取优质资源,并生成一份开箱即用的 .md 技能文件。适用场景如下:(1) 用户希望创建关于某个库、工具或 API 的技能;(2) 用户说“为 X 创建一个技能”、“制作关于 X 的技能”或“为 X 生成技能”;(3) 用户希望将文档转化为可复用的技能。

SKILL.md
--- frontmatter
name: auto-skill-generator
description: >
  Generate skills from web research. Given a topic like "how to use Stripe API"
  or "Prisma ORM", this skill searches for authoritative documentation, crawls the best source,
  and generates a ready-to-use .md skill file. Use when: (1) User wants to create a skill
  about a library/tool/API, (2) User says "create a skill for X", "make a skill about X",
  or "generate skill for X", (3) User wants to capture documentation as a reusable skill.

Auto Skill Generator

Generate skills by researching and crawling authoritative documentation.

Tool: fetch_docs.py

bash
# Search - returns all URLs with snippets
python scripts/fetch_docs.py search "Modal GPU Python documentation"

# Crawl - with domain/path filtering to stay focused
python scripts/fetch_docs.py crawl \
  --url https://modal.com/docs/guide/gpu \
  --no-external \
  --select-paths "/docs/.*" \
  --instructions "Focus on GPU setup and code examples" \
  --limit 30

Workflow

1. Search for Documentation

bash
python scripts/fetch_docs.py search "{topic} documentation"

Returns JSON with all URLs, titles, scores, and content snippets.

2. Select Best URL

Review search results and select based on:

  • Official docs: *.com/docs/, docs.*.com, *.readthedocs.io
  • Content relevance: Check snippets for API docs, code examples
  • Avoid: Blog posts, changelogs, marketing, glossaries

3. Crawl with Filtering

bash
python scripts/fetch_docs.py crawl \
  --url {selected_url} \
  --no-external \
  --select-paths "/docs/.*" "/guide/.*" \
  --instructions "Focus on API methods and code examples"

Core Parameters:

ParameterDescription
--urlRequired. URL to crawl
--instructionsNatural language guidance for crawler
--limitTotal pages (default: 50)
--max-depthLink depth (default: 2)

Domain/Path Filtering (Critical):

ParameterDescription
--no-externalBlock external domains
--select-pathsRegex patterns to include (e.g., /docs/.*)
--exclude-pathsRegex patterns to exclude (e.g., /blog/.*)
--select-domainsRegex for allowed domains
--exclude-domainsRegex for blocked domains

Quality Options:

ParameterDescription
--extract-depthbasic (1 credit/5 URLs) or advanced (2 credits/5 URLs)
--formatmarkdown or text
--timeoutSeconds (10-150, default: 150)

4. Generate Skill File

From crawled content, create:

markdown
---
name: {topic-slug}ß
description: >
  {What the skill does}. Use when: {specific triggers}.
---

# {Topic Name}

## Quick Start
## Core API
## Common Patterns

Output

  • Location: ~/.claude/skills/{topic-slug}/SKILL.md
  • Extract ALL code blocks from crawled content
  • Keep SKILL.md under 500 lines; split to references/ if longer