AgentSkillsCN

web-browse-context

高效地将网页内容抓取为简洁的Markdown格式,并通过`mq`进行查询,避免将整页内容加载到上下文中。当您浏览网页、提取特定章节,或以最小的上下文使用量来总结资料时,可使用此功能。

SKILL.md
--- frontmatter
name: web-browse-context
description: Efficiently capture web pages as clean markdown and query them with `mq` to avoid loading full content into context. Use when browsing web pages, extracting specific sections, or summarizing sources with minimal context usage.

Web Browsing With Context Economy

Overview

Capture web pages into local markdown, inspect structure with mq, and extract only the relevant sections to keep context small and focused.

Workflow

  1. Use shell_command tool for every command from this skill.

  2. Save the page as markdown (cleaned).

bash
npx -y url-to-markdown-cli-tool 'https://example.com' --clean-content > result.md
  1. Inspect structure before reading content.
bash
mq result.md '.tree'
  1. Extract only the needed sections.
bash
mq result.md '.section("Using Blueprints") | .text'
  1. Search when you are not sure where the content lives.
bash
mq result.md '.search("auth")'
  1. If the search returns a large subtree, narrow it by re-running .tree on the specific section(s), then extract .text.

Query Patterns

  • View a fuller outline: mq result.md '.tree("preview")'
  • Get all headings: mq result.md '.headings'
  • Extract code blocks by language: mq result.md '.code("bash")'
  • List links: mq result.md '.links'
  • Extract a section: mq result.md '.section("Name") | .text'

Context Hygiene

  • Never cat the whole markdown file into the conversation.
  • Prefer .tree and .search to locate content, then extract only the minimal .text needed.
  • Use one file per page (e.g., result-pricing.md, result-api.md) to keep sources separated.
  • If a page changes, re-run the capture command and overwrite the corresponding file.
  • Use mq --help whenever you need more selectors or flags.