link-understanding

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Link Understanding Skill

链接理解Skill

Fetch web pages, extract key information, and provide structured understanding of link content. Combines web fetching with NLP-powered analysis.
抓取网页内容,提取关键信息,并对链接内容提供结构化理解。结合网页抓取与基于NLP的分析能力。

When to Use

适用场景

USE this skill when:
  • Analyzing articles and documentation
  • Extracting key points from URLs
  • Research and fact-checking
  • Content categorization
DON'T use this skill when:
  • Direct API endpoints (use http-request)
  • Binary content (PDFs, images - use specialized skills)
  • Rate-limited crawling
以下场景适用该Skill:
  • 分析文章与文档
  • 从URL中提取要点
  • 研究与事实核查
  • 内容分类
以下场景请勿使用该Skill:
  • 直接调用API接口(请使用http-request)
  • 二进制内容(PDF、图片——请使用专用技能)
  • 受速率限制的爬取操作

Features

功能特性

  • HTML to text conversion
  • Key point extraction
  • Entity recognition
  • Content classification
  • Link graph analysis
  • Summary generation
  • HTML转文本转换
  • 要点提取
  • 实体识别
  • 内容分类
  • 链接图谱分析
  • 摘要生成

Usage

使用方法

Basic Understanding

基础理解

javascript
const { understandLink } = require('/job/.pi/skills/link-understanding/analyzer.js');

const result = await understandLink('https://example.com/article');
console.log(result);
javascript
const { understandLink } = require('/job/.pi/skills/link-understanding/analyzer.js');

const result = await understandLink('https://example.com/article');
console.log(result);

With Options

带参数配置

javascript
const result = await understandLink('https://example.com/article', {
  extractKeyPoints: true,
  extractEntities: true,
  generateSummary: true,
  followInternalLinks: false,
  timeoutMs: 15000
});
javascript
const result = await understandLink('https://example.com/article', {
  extractKeyPoints: true,
  extractEntities: true,
  generateSummary: true,
  followInternalLinks: false,
  timeoutMs: 15000
});

Batch Processing

批量处理

javascript
const urls = [
  'https://example.com/1',
  'https://example.com/2',
  'https://example.com/3'
];

const results = await Promise.all(urls.map(url => understandLink(url)));

// Aggregate insights
const allKeyPoints = results.flatMap(r => r.keyPoints);
console.log(allKeyPoints);
javascript
const urls = [
  'https://example.com/1',
  'https://example.com/2',
  'https://example.com/3'
];

const results = await Promise.all(urls.map(url => understandLink(url)));

// Aggregate insights
const allKeyPoints = results.flatMap(r => r.keyPoints);
console.log(allKeyPoints);

Output Structure

输出结构

javascript
{
  url: "https://example.com/article",
  fetchedAt: "2026-02-25T13:45:00Z",
  contentType: "text/html",
  title: "Understanding AI Agents",
  author: "John Doe",
  publishedDate: "2026-02-20",
  wordCount: 1542,
  readingTimeMinutes: 6,
  
  summary: "This article explains the fundamentals of AI agents...",
  
  keyPoints: [
    "AI agents combine LLMs with tools and memory",
    "Multi-agent systems enable complex workflows",
    "Security is paramount for autonomous agents"
  ],
  
  entities: {
    people: ["John Doe", "Jane Smith"],
    organizations: ["OpenAI", "Anthropic"],
    technologies: ["LLM", "Python", "TypeScript"],
    concepts: ["autonomous agents", "multi-agent systems"]
  },
  
  categories: ["Technology", "Artificial Intelligence", "Software"],
  tone: "Educational",
  language: "en",
  
  outgoingLinks: [
    { url: "https://reference.com", anchor: "AI research", context: "..." }
  ],
  
  images: [
    { src: "/diagram.png", alt: "Agent architecture" }
  ],
  
  metadata: {
    ogTitle: "Understanding AI Agents",
    ogDescription: "A comprehensive guide...",
    ogImage: "https://example.com/og.jpg"
  }
}
javascript
{
  url: "https://example.com/article",
  fetchedAt: "2026-02-25T13:45:00Z",
  contentType: "text/html",
  title: "Understanding AI Agents",
  author: "John Doe",
  publishedDate: "2026-02-20",
  wordCount: 1542,
  readingTimeMinutes: 6,
  
  summary: "This article explains the fundamentals of AI agents...",
  
  keyPoints: [
    "AI agents combine LLMs with tools and memory",
    "Multi-agent systems enable complex workflows",
    "Security is paramount for autonomous agents"
  ],
  
  entities: {
    people: ["John Doe", "Jane Smith"],
    organizations: ["OpenAI", "Anthropic"],
    technologies: ["LLM", "Python", "TypeScript"],
    concepts: ["autonomous agents", "multi-agent systems"]
  },
  
  categories: ["Technology", "Artificial Intelligence", "Software"],
  tone: "Educational",
  language: "en",
  
  outgoingLinks: [
    { url: "https://reference.com", anchor: "AI research", context: "..." }
  ],
  
  images: [
    { src: "/diagram.png", alt: "Agent architecture" }
  ],
  
  metadata: {
    ogTitle: "Understanding AI Agents",
    ogDescription: "A comprehensive guide...",
    ogImage: "https://example.com/og.jpg"
  }
}

Extract Sections

提取章节内容

javascript
const result = await understandLink('https://docs.example.com', {
  extractSections: true
});

console.log(result.sections);
// [
//   { heading: "Introduction", content: "...", level: 1 },
//   { heading: "Getting Started", content: "...", level: 2 },
//   { heading: "Installation", content: "...", level: 3 }
// ]
javascript
const result = await understandLink('https://docs.example.com', {
  extractSections: true
});

console.log(result.sections);
// [
//   { heading: "Introduction", content: "...", level: 1 },
//   { heading: "Getting Started", content: "...", level: 2 },
//   { heading: "Installation", content: "...", level: 3 }
// ]

Compare Multiple Links

多链接对比

javascript
const { compareLinks } = require('/job/.pi/skills/link-understanding/analyzer.js');

const comparison = await compareLinks([
  'https://site1.com/topic',
  'https://site2.com/topic'
]);

console.log(comparison);
// {
//   commonThemes: ["theme1", "theme2"],
//   differences: [...],
//   qualityScores: [8.5, 7.2],
//   recommendation: "Link 1 is more comprehensive"
// }
javascript
const { compareLinks } = require('/job/.pi/skills/link-understanding/analyzer.js');

const comparison = await compareLinks([
  'https://site1.com/topic',
  'https://site2.com/topic'
]);

console.log(comparison);
// {
//   commonThemes: ["theme1", "theme2"],
//   differences: [...],
//   qualityScores: [8.5, 7.2],
//   recommendation: "Link 1 is more comprehensive"
// }

Extract Data Tables

提取数据表格

javascript
const result = await understandLink('https://example.com/data', {
  extractTables: true
});

console.log(result.tables);
// [
//   {
//     caption: "Comparison",
//     headers: ["Feature", "Product A", "Product B"],
//     rows: [
//       ["Speed", "Fast", "Medium"],
//       ["Cost", "$10", "$20"]
//     ]
//   }
// ]
javascript
const result = await understandLink('https://example.com/data', {
  extractTables: true
});

console.log(result.tables);
// [
//   {
//     caption: "Comparison",
//     headers: ["Feature", "Product A", "Product B"],
//     rows: [
//       ["Speed", "Fast", "Medium"],
//       ["Cost", "$10", "$20"]
//     ]
//   }
// ]

Link Graph Analysis

链接图谱分析

javascript
const result = await understandLink('https://example.com', {
  analyzeInternalLinks: true,
  maxDepth: 2
});

console.log(result.linkGraph);
// {
//   rootUrl: "https://example.com",
//   pages: [
//     { url: "https://example.com/about", depth: 1, title: "About" },
//     { url: "https://example.com/team", depth: 2, title: "Team" }
//   ]
// }
javascript
const result = await understandLink('https://example.com', {
  analyzeInternalLinks: true,
  maxDepth: 2
});

console.log(result.linkGraph);
// {
//   rootUrl: "https://example.com",
//   pages: [
//     { url: "https://example.com/about", depth: 1, title: "About" },
//     { url: "https://example.com/team", depth: 2, title: "Team" }
//   ]
// }

API

API

javascript
understandLink(url, options = {})
Options:
  • extractKeyPoints
    - Extract main points (default: true)
  • extractEntities
    - Named entity recognition (default: true)
  • generateSummary
    - Generate summary (default: true)
  • extractSections
    - Extract section hierarchy
  • extractTables
    - Extract data tables
  • followInternalLinks
    - Analyze internal link graph
  • maxDepth
    - Link graph depth (default: 1)
  • timeoutMs
    - Fetch timeout (default: 15000)
  • language
    - Language code (default: auto-detect)
Returns:
javascript
// See Output Structure above
javascript
understandLink(url, options = {})
参数选项:
  • extractKeyPoints
    - 提取要点(默认值:true)
  • extractEntities
    - 命名实体识别(默认值:true)
  • generateSummary
    - 生成摘要(默认值:true)
  • extractSections
    - 提取章节层级
  • extractTables
    - 提取数据表格
  • followInternalLinks
    - 分析内部链接图谱
  • maxDepth
    - 链接图谱深度(默认值:1)
  • timeoutMs
    - 抓取超时时间(默认值:15000)
  • language
    - 语言代码(默认值:自动检测)
返回值:
javascript
// 参见上方的输出结构

Use Cases

应用场景

Research Assistant

研究助手

javascript
async function research(topic) {
  const searchResults = await searchWeb(topic);
  
  const analyses = await Promise.all(
    searchResults.slice(0, 5).map(url => understandLink(url, {
      extractKeyPoints: true,
      generateSummary: true
    }))
  );
  
  // Combine insights
  return {
    topic,
    sources: analyses.map(a => a.url),
    combinedSummary: analyses.map(a => a.summary).join('\n\n'),
    allKeyPoints: [...new Set(analyses.flatMap(a => a.keyPoints))]
  };
}
javascript
async function research(topic) {
  const searchResults = await searchWeb(topic);
  
  const analyses = await Promise.all(
    searchResults.slice(0, 5).map(url => understandLink(url, {
      extractKeyPoints: true,
      generateSummary: true
    }))
  );
  
  // Combine insights
  return {
    topic,
    sources: analyses.map(a => a.url),
    combinedSummary: analyses.map(a => a.summary).join('\n\n'),
    allKeyPoints: [...new Set(analyses.flatMap(a => a.keyPoints))]
  };
}

Documentation Analyzer

文档分析器

javascript
async function analyzeDocs(docsUrl) {
  const result = await understandLink(docsUrl, {
    extractSections: true,
    extractTables: true
  });
  
  return {
    title: result.sections[0]?.heading || result.title,
    sections: result.sections,
    tables: result.tables,
    codeExamples: extractCodeBlocks(result.content)
  };
}
javascript
async function analyzeDocs(docsUrl) {
  const result = await understandLink(docsUrl, {
    extractSections: true,
    extractTables: true
  });
  
  return {
    title: result.sections[0]?.heading || result.title,
    sections: result.sections,
    tables: result.tables,
    codeExamples: extractCodeBlocks(result.content)
  };
}

Fact Checker

事实核查工具

javascript
async function factCheck(claim, sources) {
  const results = await Promise.all(
    sources.map(url => understandLink(url, {
      extractEntities: true,
      generateSummary: true
    }))
  );
  
  const mentions = results.flatMap(r => 
    r.entities.people.filter(p => claim.includes(p))
  );
  
  return {
    claim,
    supportingSources: sources.filter((_, i) => 
      results[i].summary.includes('supports')
    ),
    conflictingSources: sources.filter((_, i) =>
      results[i].summary.includes('contradicts')
    )
  };
}
javascript
async function factCheck(claim, sources) {
  const results = await Promise.all(
    sources.map(url => understandLink(url, {
      extractEntities: true,
      generateSummary: true
    }))
  );
  
  const mentions = results.flatMap(r => 
    r.entities.people.filter(p => claim.includes(p))
  );
  
  return {
    claim,
    supportingSources: sources.filter((_, i) => 
      results[i].summary.includes('supports')
    ),
    conflictingSources: sources.filter((_, i) =>
      results[i].summary.includes('contradicts')
    )
  };
}

Bash CLI

Bash 命令行工具

bash
undefined
bash
undefined

Analyze single URL

分析单个URL

node /job/.pi/skills/link-understanding/analyzer.js
--url "https://example.com/article"
node /job/.pi/skills/link-understanding/analyzer.js
--url "https://example.com/article"

Extract only key points

仅提取要点

node /job/.pi/skills/link-understanding/analyzer.js
--url "https://example.com"
--key-points
node /job/.pi/skills/link-understanding/analyzer.js
--url "https://example.com"
--key-points

Batch process URLs from file

批量处理文件中的URL

cat urls.txt |
node /job/.pi/skills/link-understanding/analyzer.js
--batch --output results.json
undefined
cat urls.txt |
node /job/.pi/skills/link-understanding/analyzer.js
--batch --output results.json
undefined

Integration with Other Skills

与其他Skill集成

javascript
// With summarize skill
const { understandLink } = require('./link-understanding/analyzer.js');
const { summarize } = require('../summarize/summarize.js');

const linkAnalysis = await understandLink('https://example.com/long-article');
const shorterSummary = await summarize(linkAnalysis.summary, { maxLength: 100 });

// With web-fetch skill
const { fetchWeb } = require('../web-fetch/fetch.js');
const content = await fetchWeb('https://example.com');
const understanding = await understandLink('https://example.com');
javascript
// 与summarize skill集成
const { understandLink } = require('./link-understanding/analyzer.js');
const { summarize } = require('../summarize/summarize.js');

const linkAnalysis = await understandLink('https://example.com/long-article');
const shorterSummary = await summarize(linkAnalysis.summary, { maxLength: 100 });

// 与web-fetch skill集成
const { fetchWeb } = require('../web-fetch/fetch.js');
const content = await fetchWeb('https://example.com');
const understanding = await understandLink('https://example.com');