self-learning

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Self-Learning Skill Generator

自学习Skill生成器

Autonomously research and learn new technologies from the web, then generate a reusable skill.
可自主从网络调研并学习新技术,进而生成可复用的Skill。

Usage

使用方法

/learn <topic>
If
<topic>
is missing, show usage. If topic is ambiguous, ask to clarify:
  • "react" → "React for web, React Native, or a specific library like react-query?"
  • "apollo" → "Apollo GraphQL client, Apollo Server, or Apollo Federation?"
  • "aws" → "Which AWS service? (S3, Lambda, DynamoDB, etc.)"
Normalize to kebab-case for filenames.
/learn <topic>
如果缺失
<topic>
,则显示使用方法。如果主题不明确,请要求用户澄清:
  • "react" → "是指Web端React、React Native,还是像react-query这样的特定库?"
  • "apollo" → "是指Apollo GraphQL客户端、Apollo Server还是Apollo Federation?"
  • "aws" → "指的是哪项AWS服务?(S3、Lambda、DynamoDB等)"
文件名需统一为短横线分隔格式(kebab-case)

2. Discover Sources (Web Search)

2. 发现数据源(网页搜索)

Use web search tool to find authoritative documentation:
Search queries to try:
  1. <topic> official documentation
  2. <topic> getting started guide
  3. <topic> API reference
  4. <topic> GitHub repository
Source prioritization:
  1. Official docs sites (e.g., docs.*, *.dev)
  2. Official GitHub repositories (README, /docs)
  3. Official blogs/announcements
Select 3–5 high-quality URLs maximum.
If no credible sources found, ask user to provide a URL.

使用网页搜索工具查找权威文档:
可尝试的搜索查询词:
  1. <topic> official documentation
  2. <topic> getting started guide
  3. <topic> API reference
  4. <topic> GitHub repository
数据源优先级:
  1. 官方文档网站(例如:docs..dev)
  2. 官方GitHub仓库(README、/docs目录)
  3. 官方博客/公告
最多选择3-5个高质量URL
如果未找到可信数据源,请要求用户提供URL。

3. Extract Content (URL Reading)

3. 提取内容(URL读取)

For each selected URL, read the content:
Extract only relevant sections:
  • Installation / setup
  • Core concepts
  • API reference / key functions
  • Common patterns / examples
  • Version information
Skip irrelevant content:
  • Navigation, ads, login prompts
  • Unrelated sidebar content
  • Comments, forums
If reading the content fails (JavaScript-heavy sites), fall back to browser agent:
Task: Navigate to <URL> and extract the main content including:
- Installation instructions
- Core concepts and API reference
- Code examples
Return the extracted content as markdown.
Record scrape timestamp for each source (use current date: YYYY-MM-DD format).

读取每个选中URL的内容:
仅提取相关章节:
  • 安装/设置
  • 核心概念
  • API参考/核心函数
  • 常见模式/示例
  • 版本信息
跳过无关内容:
  • 导航栏、广告、登录提示
  • 无关侧边栏内容
  • 评论、论坛
如果读取内容失败(如依赖JavaScript的网站),则改用浏览器Agent:
Task: Navigate to <URL> and extract the main content including:
- Installation instructions
- Core concepts and API reference
- Code examples
Return the extracted content as markdown.
记录每个数据源的抓取时间戳(使用当前日期:YYYY-MM-DD格式)。

4. Generate Skill

4. 生成Skill

Skills are modular, self-contained packages. Every skill consists of a required
SKILL.md
file and optional bundled resources:
skill-name/
├── SKILL.md (required)
│   ├── YAML frontmatter metadata (required)
│   │   ├── name: (required)
│   │   └── description: (required)
│   └── Markdown instructions (required)
└── Bundled Resources (optional)
    ├── scripts/          - Executable code (Python/Bash/etc.)
    ├── references/       - Documentation intended to be loaded into context as needed
    └── assets/           - Files used in output (templates, icons, fonts, etc.)
  1. Read
    references/skill_creation_guide.md
    to understand the format and principles.
  2. Synthesize the learned and extracted information into a new skill.
    • Trigger: Write a description that clearly defines when to use it.
    • Workflow: Create step-by-step instructions.
    • Format: Ensure valid YAML frontmatter and proper file structure.
Skill是模块化、独立的包。每个Skill都包含一个必填的
SKILL.md
文件和可选的捆绑资源:
skill-name/
├── SKILL.md (required)
│   ├── YAML frontmatter metadata (required)
│   │   ├── name: (required)
│   │   └── description: (required)
│   └── Markdown instructions (required)
└── Bundled Resources (optional)
    ├── scripts/          - Executable code (Python/Bash/etc.)
    ├── references/       - Documentation intended to be loaded into context as needed
    └── assets/           - Files used in output (templates, icons, fonts, etc.)
  1. 阅读
    references/skill_creation_guide.md
    以了解格式和原则。
  2. 将学习和提取到的信息合成新的Skill。
    • 触发条件: 编写清晰的描述,定义该Skill的适用场景。
    • 工作流程: 创建分步操作说明。
    • 格式: 确保YAML前置元数据有效,文件结构正确。

5. Save the Skill

5. 保存Skill

Antigravity supports two types of skills, save a global-workspace if asked.
  • .agent/skills/<skill-folder>/
    Workspace-specific
  • ~/.gemini/antigravity/skills/<skill-folder>/
    Global (all workspaces)
Create directory if it doesn't exist, warn user before overwriting existing skill.

Antigravity支持两种类型的Skill,若用户要求则保存为全局工作区版本。
  • .agent/skills/<skill-folder>/
    工作区专属
  • ~/.gemini/antigravity/skills/<skill-folder>/
    全局(所有工作区)
如果目录不存在则创建,覆盖现有Skill前需向用户发出警告。

6. Confirm to User

6. 向用户确认

Report:
✓ Created skill: <topic>
  Sources scraped: <N>
  Saved to: .agent/skills/<topic>/SKILL.md
  This skill will auto-trigger when working with <topic>.

反馈内容:
✓ Created skill: <topic>
  Sources scraped: <N>
  Saved to: .agent/skills/<topic>/SKILL.md
  This skill will auto-trigger when working with <topic>.

Tool Reference

工具参考

  • search_web
    : Discover documentation URLs
  • read_url_content
    : Extract content from static pages
  • browser_subagent
    : Extract content from JavaScript-heavy sites
  • write_to_file
    : Save the generated skill
  • search_web
    : 发现文档URL
  • read_url_content
    : 从静态页面提取内容
  • browser_subagent
    : 从依赖JavaScript的网站提取内容
  • write_to_file
    : 保存生成的Skill

Critical Rules

重要规则

  1. Never hallucinate documentation: Only include information from scraped sources.
  2. Never invent APIs: If documentation is unclear, ask the user what to do.
  3. Ask for URLs: If automated discovery fails, ask user for specific URLs.
  4. Verify sources: Prefer official sources over third-party tutorials.
  1. 切勿虚构文档: 仅包含从抓取数据源获取的信息。
  2. 切勿编造API: 如果文档内容不明确,请询问用户如何处理。
  3. 主动索要URL: 如果自动发现失败,请要求用户提供特定URL。
  4. 验证数据源: 优先使用官方数据源,而非第三方教程。