Files
claude_dev 9649e8a761 feat: 实现 11 个 Wiki Skills
P0 (核心):
- wiki-setup: 初始化 wiki vault
- wiki-ingest: 蒸馏文档为 wiki 页面
- wiki-capture: 保存对话为 wiki 笔记

P1 (重要):
- wiki-rebuild: 重建 wiki 索引
- data-ingest: 录入非结构化数据
- ingest-url: 抓取 URL 内容
- wiki-export: 导出知识图谱

P2 (可选):
- wiki-research: 多轮搜索研究
- impl-validator: 验证实现
- graph-colorize: 着色 Obsidian 图形
- wiki-agent: 录入 agent 历史

Co-Authored-By: Claude Dev <noreply@anthropic.com>
2026-06-26 12:17:38 +08:00

2.4 KiB
Raw Permalink Blame History

name, description, trigger
name description trigger
ingest-url 抓取 URL 内容并蒸馏为 wiki 页面 当用户需要保存网页内容到 wiki 时

Ingest URL

使用场景

  • 保存技术文章到 wiki
  • 归档博客内容
  • 捕获文档页面
  • 整合参考资料

操作步骤

  1. 获取 URL

    • 从用户输入获取 URL
    • 验证 URL 格式
    • 检查可访问性
  2. 抓取内容

    • 使用 web_reader MCP 工具
    • 获取页面内容
    • 提取元数据(标题、作者)
  3. 蒸馏为 wiki 格式

    • 转换为 Markdown
    • 提取关键信息
    • 添加元数据和来源
  4. 写入 wiki

    • 放入 references/ 目录
    • 创建适当的标签
    • 更新索引

支持的 URL 类型

URL 类型 处理方式
技术博客 提取文章内容、代码
官方文档 提取文档结构、API 说明
GitHub README 提取项目说明、使用方法
Stack Overflow 提取问题和答案
新闻/博客 提取标题、正文

页面模板

---
name: article-slug
description: 文章简短摘要
metadata:
  type: reference
  source_url: <original-url>
  source_title: <page-title>
  author: <author-if-available>
  created: <date>
  tags: [tag1, tag2]
---

# <文章标题>

**来源**: [原始链接](<url>)
**作者**: <author>
**日期**: <capture-date>
**标签**: \`tag1\` \`tag2\`

## 摘要
<文章摘要或简介>

## 核心内容

<提取的主要内容和结构>

## 关键要点

- 要点 1
- 要点 2

## 相关链接

- [[related-wiki-page]]
- [[related-concept]]

输出格式

{
  "success": true,
  "url": "https://example.com/article",
  "saved_to": "references/article-slug.md",
  "word_count": 1500,
  "extracted": {
    "title": "文章标题",
    "author": "作者",
    "tags": ["tag1", "tag2"],
    "summary": "文章摘要"
  },
  "links_created": 2
}

MCP 集成

使用 MCP 工具:

  • web_reader - 抓取网页内容
  • wiki_ingest - 蒸馏为 wiki 格式
  • cross_linker - 创建相关链接

配置选项

~/.sanguo-llmwiki/config.yaml

ingest_url:
  timeout: 30              # 请求超时(秒)
  max_size: 1048576       # 最大内容大小(1MB
  preserve_images: false  # 是否保留图片
  strip_ads: true         # 是否移除广告

注意事项

  1. 遵守 robots.txt
  2. 尊重版权信息
  3. 保留原始来源链接
  4. 避免抓取受限内容