Search Web → Markdown (illustrated research)
When to use
- The user asks you to research a topic on the web and output an illustrated Markdown document
- Images must be real images collected from the web (news photos, diagrams, screenshots, etc.) — AI-generated images must never be used
- Images are downloaded and saved as local files (e.g. an
imgs/directory) and referenced in Markdown with relative paths, with the document and image directory kept at the same level
Hard rules
- Image source = real images from search result pages / the original web page; AI generation is forbidden
- Every image must be attributed to its source (URL), and an "Image sources" list must appear at the end of the document
- After embedding, you must verify that each image file exists and is displayable (see workflow step 6)
- Images are always stored as local files; do not embed base64 (smaller document, reusable images, batch compression possible)
Workflow
- Clarify requirements: topic, length, number of images (default 5–8), language
- Search: use browser_use to open Bing (https://www.bing.com/search?q=...), browse 6 highly relevant pages in turn; use get_readable to extract the article text; use get_backbone to inspect the DOM structure when needed
- Extract image URLs: for each page use execute_js to collect
<img src>(filter out data: URIs, images ≤80px, logos/icons), prefer large / original images, and deduplicate - Download and save as local files: first create the image directory
mkdir -p imgs(same level as the document), then callscripts/image_to_local.sh:
scripts/image_to_local.sh "<image-url>" "imgs" "01-topic-description.jpg" "caption text" >> output.md
- The script downloads the image, detects the MIME type, saves it underimgs/, and prints one line of
- Suggested filenames:<index>-<short-topic-description>.<ext>(non-ASCII filenames can cause compatibility issues, so prefer pinyin/English)
- If the download fails or the file is not an image, the script exits with an error → retry with a fallback URL
- For images larger than 3MB, compress before saving:
ffmpeg -i imgs/in.jpg -vf "scale='min(1600,iw)':-2" -q:v 5 imgs/out.jpg - Assemble the document: title + introduction → sections by topic (1–3 relevant images each, with the source link after each image) → conclusion → "Image sources" list
- Validate:
- Count the](imgs/relative references in the document and confirm it equals the number of images
- Use a script or shell to confirm that every file referenced underimgs/actually exists and is non-empty
- Make sure no absolute-URL image references remain - Deliver: save to /var/minis/workspace/ and provide the Markdown link; deliver the image directory together with the document
Details
- Prefer Bing as the search engine; if blocked by anti-bot measures, switch to Baidu / DuckDuckGo
- Quote content faithfully and cite the source URL; never fabricate data
- Keep the document small and fast to load; images can be reused separately (e.g. for a PDF or PPT later)
- Put temporary files in /tmp so they don't pollute the workspace; write captions in the user's language
- If the document must be distributed to another device/platform, package the image directory too (zip) so the relative-path references keep working
Script
scripts/image_to_local.sh <image-url|local-path> <output-dir> [filename] [alt-text]
Downloads the image into the output directory and prints one line of Markdown relative-path image syntax to stdout (append it to the document with >>).
minis_url: minis://skills/web-search-make-markdown/SKILL.md