Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Highlight Images

ASecurity

Find, download, resize, and embed images for the three Highlight links in draft.md. Fetches each article, picks a representative image, runs upload_image() to push to the rweekly/image repo, then inserts the image embed below each highlight link in draft.md. Has human-in-the-loop review gates before downloading, before pushing to GitHub, and before editing draft.md.

820 stars
0 votes
0 copies
0 views
Added 9/20/2026
datagobashgit

Security Analysis

A92/100
mediumUses curl or wget to download content

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add rweekly/rweekly.org --skill highlight-images --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Highlight Images?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Highlight Images
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rweekly-highlight-images/badge)](https://www.skillsdirectory.com/skills/rweekly-highlight-images)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: highlight-images
description: Find, download, resize, and embed images for the three Highlight links in draft.md. Fetches each article, picks a representative image, runs upload_image() to push to the rweekly/image repo, then inserts the image embed below each highlight link in draft.md. Has human-in-the-loop review gates before downloading, before pushing to GitHub, and before editing draft.md.
disable-model-invocation: true
allowed-tools: Read, Edit, Bash, WebFetch
---

# Highlight Images

Automates the image workflow for the `### Highlight` section of `draft.md`.

There are three human review gates — **do not skip them**:
1. Before downloading: confirm all three candidate image URLs with the editor
2. Before pushing: confirm the resized images in the local image repo look good
3. Before editing draft.md: confirm the final embed URLs

## Prerequisites

- `rweekly-image` repo cloned at `/Users/sam/Documents/01-projects/rweekly-image`
- `scripts/img_raw/` directory exists (create if not: `mkdir -p scripts/img_raw`)
- `rweekly.tools` R package installed

## Steps

### Step 1: Get issue week and highlight links

Read `draft.md`:
- Extract issue week from `title:` front matter (e.g. `R Weekly 2026-W25` → `W25`)
- Extract all three links from the `### Highlight` section (lines matching `+ [Title](URL)`)

The image repo target dir will be `2026/{WEEK}` (e.g. `2026/W25`).

### Step 2: For each highlight link, find a good image

For each of the three highlight articles:

1. Fetch the article URL with WebFetch. Ask: "What is the main representative image on this page? Give me the full absolute image URL (prefer PNG, JPG, or WebP — avoid icons/logos/avatars/favicons). If there are multiple, pick the one most representative of the article content."
2. **OG image fallback**: If the article body only has SVGs, generated plots, or no good raster image, check the page's `og:image` / `twitter:image` meta tags:
   ```bash
   curl -s "{URL}" | grep -i 'og:image\|twitter:image'
   ```
3. **SVG fallback**: If the best available image is an SVG (common with knitr/R Markdown posts), note it — it will need conversion in Step 4. raw.githubusercontent.com serves SVG as `text/plain`, so SVGs cannot be embedded directly via `![]()`.
4. **No image found**: If neither article body, OG tags, nor SVG yield a candidate, say so and ask the editor to supply a URL or skip the embed for that highlight.
5. If WebFetch fails entirely, try Jina: `curl https://r.jina.ai/{URL}` and scan for image URLs.
6. Pick a short kebab-case slug for each filename (e.g. `history-posit-agents`, `three-dots-readable`, `ulam-prime-spiral`).

---

### ⏸ GATE 1 — Confirm image candidates with the editor

Present a summary of all three candidates before downloading anything:

```
Proposed images:
1. [Article title]
   URL: {image-url}
   Slug: {slug}

2. [Article title]
   URL: {image-url}
   Slug: {slug}

3. [Article title]
   URL: {image-url}
   Slug: {slug}

Do these look good, or would you like to swap any out?
```

**Wait for explicit confirmation before proceeding.** The editor may supply a different URL — use whatever they provide.

---

### Step 3: Download images to img_raw

For each confirmed image:

```bash
curl -L -o "scripts/img_raw/{slug}.{ext}" "{image-url}"
```

Save with the original file extension (`.png`, `.jpg`, `.webp`, `.svg`).

If an image is an **SVG**, convert it to PNG using R magick immediately after download:
```bash
Rscript -e '
library(magick)
img <- image_read("scripts/img_raw/{slug}.svg")
img_resized <- image_resize(img, "600x")
image_write(img_resized, "scripts/img_raw/{slug}-chart.png", format="png")
cat("done\n")
'
```
Use `{slug}-chart.png` as the file going forward. (System ImageMagick has rsvg support even without the R `rsvg` package.)

Verify all files are present and non-empty:
```bash
ls -lh scripts/img_raw/
```

If any download fails (404, empty file), stop and ask the editor for an alternative.

### Step 4: Resize images with `upload_image()` — push=FALSE

Run `upload_image()` for each image with **`push = FALSE`** — this resizes and copies to the local image repo but does NOT push to GitHub yet:

```bash
Rscript -e '
library(rweekly.tools)
upload_image(
  file = "scripts/img_raw/{slug}.{ext}",
  caption = "",
  width = "600",
  issue = "2026/{WEEK}",
  image_repo = "/Users/sam/Documents/01-projects/rweekly-image",
  push = FALSE
)
cat("done\n")
'
```

Note: `upload_image()` appends `_600` to the filename (e.g. `ulam-prime-spiral.png` → `ulam-prime-spiral_600.png`).

Run all three sequentially. Then list the result:
```bash
ls -lh /Users/sam/Documents/01-projects/rweekly-image/2026/{WEEK}/
```

---

### ⏸ GATE 2 — Confirm resized images before pushing to GitHub

Tell the editor:

```
Resized images are ready in /Users/sam/Documents/01-projects/rweekly-image/2026/{WEEK}/:
  {slug}_600.{ext}  ({size})
  {slug}_600.{ext}  ({size})
  {slug}_600.{ext}  ({size})

Please review the files (open them locally if you'd like).
Ready to push to the rweekly/image GitHub repo?
```

**Wait for the editor to confirm before pushing.**

---

### Step 5: Push to GitHub

Once the editor confirms, push the image repo:

```bash
cd /Users/sam/Documents/01-projects/rweekly-image && git add 2026/{WEEK}/ && git commit -m "Add W{WEEK} highlight images" && git push
```

Check for errors. If push fails due to auth, let the editor know they should push manually from the image repo.

---

### ⏸ GATE 3 — Confirm embed URLs before editing draft.md

Show the editor the three embed lines that will be inserted, noting which section each goes into:

```
Ready to insert into draft.md (in each link's original section, not in ### Highlight):

[Insights] ![A brief and biased history of...](https://raw.githubusercontent.com/rweekly/image/master/2026/{WEEK}/{slug1}_600.{ext})
[Tutorials] ![Three small dots for...](https://raw.githubusercontent.com/rweekly/image/master/2026/{WEEK}/{slug2}_600.{ext})
[Gist & Cookbook] ![Little useless-useful...](https://raw.githubusercontent.com/rweekly/image/master/2026/{WEEK}/{slug3}_600.{ext})

OK to insert?
```

**Wait for confirmation.**

---

### Step 6: Insert image embeds into draft.md

Image embeds go in each link's **original section** (e.g. Insights, Tutorials, Gist & Cookbook) — NOT in the `### Highlight` section. The Highlight section contains only the bare links.

For each highlight link, find its duplicate in the original section and insert the image embed immediately after that line:

```
+ [Title](article-url)
![Title](https://raw.githubusercontent.com/rweekly/image/master/2026/{WEEK}/{slug}_600.{ext})
```

Use the Edit tool. Image alt text should match the link title exactly.

### Step 7: Verify

Read back the `### Highlight` section of `draft.md` to confirm all three embeds are in place and correctly formatted.

## Notes

- Highlight links are **copies** — they stay in both `### Highlight` and their original section. Image embeds go **only** under the original-section copy — never under the `### Highlight` copy, which stays bare links only.
- Image filenames: short, lowercase, kebab-case slugs — no dates or issue numbers.
- `upload_image()` always appends `_600` to the resized output filename.
- `scripts/img_raw/` is gitignored — safe to use as temporary staging.
- If `upload_image()` is unavailable, fall back to: `cp scripts/img_raw/{slug}.png /Users/sam/Documents/01-projects/rweekly-image/2026/{WEEK}/` then push manually.

Attribution

rweeklyrweekly
View sourceMore from rweekly →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Rank Tracker

This skill helps you track, analyze, and report on keyword ranking positions over time. It monitors both traditional SERP rankings and AI/GEO visibility to provide comprehensive search performance insights.

1821 votes

Youtube Competitor Analyzer

Find and analyze YouTube competitor channels using YouTube Data API v3. Discover competitors through keyword search, category matching, content similarity, and related channel discovery. Compare metrics, content strategies, and market positioning. Use when users want to (1) Find competitors for their YouTube channel, (2) Analyze competitor performance metrics, (3) Compare their channel against competitors, (4) Identify content gaps and opportunities, (5) Benchmark against similar creators, (6...

31 votes

Twitter Algorithm Optimizer

Analyze and optimize tweets for maximum reach using Twitter's open-source algorithm insights. Rewrite and edit user tweets to improve engagement and visibility based on how the recommendation system ranks content.

742580 votes

Weather Fetcher

Instructions for fetching current weather temperature data for Karachi, Pakistan from wttr.in API

655280 votes

Weather

Get current weather and forecasts (no API key required).

476190 votes
View all in data →