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
- •
Use shell_command tool for every command from this skill.
- •
Save the page as markdown (cleaned).
bash
npx -y url-to-markdown-cli-tool 'https://example.com' --clean-content > result.md
- •Inspect structure before reading content.
bash
mq result.md '.tree'
- •Extract only the needed sections.
bash
mq result.md '.section("Using Blueprints") | .text'
- •Search when you are not sure where the content lives.
bash
mq result.md '.search("auth")'
- •If the search returns a large subtree, narrow it by re-running
.treeon 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
catthe whole markdown file into the conversation. - •Prefer
.treeand.searchto locate content, then extract only the minimal.textneeded. - •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 --helpwhenever you need more selectors or flags.