alt-text
Generates and improves accessible alt text for data visualizations in R packages with pkgdown sites or Quarto documents.
Community author
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- MIT (permissive)
- Pin
- e20b71bpinned Oct 9, 2026
- Context cost
- about 1,600 tokenswhen the skill loads
- GitHub stars
- 532on posit-dev/skills
- Scripts
- None found
What it does
“Generate and improve accessible alt text for data visualizations and images in R packages and Quarto documents. Use when the user wants to add, improve, or audit alt text for figures in a pkgdown site or .qmd files. Activate for requests that mention fig-alt, fig.alt, figure descriptions, or alt text in the context of an R package or Quarto document.”
Generated summary from the skill's own text
Generates and improves accessible alt text for data visualizations in R packages with pkgdown sites or Quarto documents. The skill reads source code to extract chart types, axis variables, and data patterns, then creates alt text that complements rather than duplicates figure captions.
When to use it
- Adding alt text to figures in pkgdown documentation sites
- Improving alt text descriptions for Quarto documents with charts
- Auditing accessibility of existing figures in R projects
- Creating alt text for complex faceted or multi-layer visualizations
When not to
- For images without available source code or data generation code
- When alt text is already comprehensive and well-written
- For non-technical images or photographs unrelated to data visualization
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add posit-dev/skills --skill alt-textInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install posit-dev/skills alt-text@e20b71b2ab527b7c480f4f60dcce2b18df1a99aeInstalls the commit we checked (e20b71b).
Copy by hand
Download the folder at e20b71b and put it in .claude/skills/alt-text for Claude Code and in .agents/skills/alt-text for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "alt-text" by posit-dev. Source, pinned to commit e20b71b2ab527b7c480f4f60dcce2b18df1a99ae: https://github.com/posit-dev/skills/tree/e20b71b2ab527b7c480f4f60dcce2b18df1a99ae/alt-text 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/alt-text/ for Claude Code and .agents/skills/alt-text/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/posit-dev/alt-text
SKILL.md at the pin
--- name: alt-text description: > Generate and improve accessible alt text for data visualizations and images in R packages and Quarto documents. Use when the user wants to add, improve, or audit alt text for figures in a pkgdown site or .qmd files. Activate for requests that mention fig-alt, fig.alt, figure descriptions, or alt text in the context of an R package or Quarto document. metadata: author: Emil Hvitfeldt (@emilhvitfeldt) version: "1.0" license: MIT --- # Write Accessible Alt Text Generate accessible alt text for data visualizations and images in this project. ARGUMENTS - label: (optional) specific figure label or chunk to target - file: (optional) specific file to process ## Detect project type Before proceeding, identify the project context and read the relevant reference. Check for a `_pkgdown.yml` file in the project root to detect a pkgdown site: ```bash ls _pkgdown.yml 2>/dev/null && echo "pkgdown" || echo "not pkgdown" ``` - **pkgdown site** (`_pkgdown.yml` present) → read `references/pkgdown.md` - **Quarto documents** (no `_pkgdown.yml`, `.qmd` files present) → read `references/quarto.md` If the context is still ambiguous, ask the user which format they are working in. ## Key advantage: source code access Unlike typical alt text scenarios where you only see an image, **we have access to the code that generates each chart**. Use this to extract precise details: **From plotting code:** - Variable mappings → exact variable names for axes - Color/fill mappings → what color encodes - Plot type functions → scatter, histogram, line chart, etc. - Trend lines or fitted curves → overlaid statistical fits - Faceting/subplots → number of panels and what varies - Color scales → encoding scheme (sequential, diverging, categorical) - Axis labels and titles → customized labels **From data generation code:** - Random distributions → expected distribution shape - Transformations → what was done to data - Feature engineering → preprocessing applied - Filtering/subsetting → what subset is shown **From surrounding prose:** - Text before/after the chunk explains the **purpose** and **key insight** - Chapter context tells you what the figure is meant to teach - This is often the best source for the "key insight" part of alt text ## Three-part structure (Amy Cesal's formula) 1. **Chart type** — first words identify the format 2. **Data description** — axes, variables, what is shown 3. **Key insight** — the pattern or takeaway (often found in surrounding text) ## Relationship to captions Read the caption (`fig-cap`, `fig.cap`) first. Alt text should **complement, not duplicate** it: - If the caption states the insight, alt text can focus on describing the visual structure - If the caption is generic, alt text should include the key insight - Together they should give a complete understanding ## Content rules **Include:** - Chart type as first words - Axis labels and what they represent - Specific values/ranges when code reveals them (e.g., "peaks between 25–50") - Number of panels/facets - What color/size encodes if used - The key pattern that supports the surrounding point **Exclude:** - "Image of…" or "Chart showing…" (screen readers announce this) - Decorative color descriptions (unless color encodes data) - Information already in the caption - Implementation details (package names, function internals) ## Length guidelines | Complexity | Sentences | When to use | |------------|-----------|----------------------------------------------| | Simple | 2–3 | Single geom, no facets, obvious pattern | | Standard | 3–4 | Multiple geoms or color encoding | | Complex | 4–5 | Faceted, multiple overlays, nuanced insight | ## Quality checklist - [ ] Starts with chart type (Scatter chart, Histogram, Faceted bar chart, etc.) - [ ] Names the axis variables - [ ] Includes specific values/ranges from code when informative - [ ] States the key insight from surrounding prose - [ ] Complements (not duplicates) the caption - [ ] Would make sense to someone who cannot see the image - [ ] Uses plain language (avoid jargon like "geom" or "aesthetic") ## Template patterns **Scatter chart:** ``` Scatter chart. [X var] along the x-axis, [Y var] along the y-axis. [Shape: linear/curved/clustered]. [Specific pattern, e.g., "peaks when X is 25–50"]. [Any overlaid fits or annotations]. ``` **Histogram:** ``` Histogram of [variable]. [Shape: right-skewed/bimodal/normal/uniform]. [If transformed: "after [transformation], the distribution [result]"]. [Notable features: outliers, gaps, multiple modes]. ``` **Bar chart:** ``` Bar chart. [Categories] along the x-axis, [measure] along the y-axis. [Key comparison: which is highest/lowest, relative differences]. [Pattern: increasing/decreasing/grouped]. ``` **Tile/raster chart:** ``` Tile chart [or heatmap]. [Row variable] along the y-axis, [column variable] along the x-axis. Color encodes [what value]. [Pattern: where values are high/low]. [If faceted: "N panels showing [what varies]"]. ``` **Faceted chart:** ``` Faceted [chart type] with [N] panels, one per [faceting variable]. [What's constant across panels]. [What changes/varies]. [Key comparison or insight across panels]. ``` **Correlation heatmap:** ``` Correlation [matrix/heatmap] of [what variables]. [Arrangement]. [Overall pattern: mostly positive/negative/mixed]. [Notable clusters or strong/weak pairs]. [If relevant: contrast with expected behavior]. ``` **Before/after comparison:** ``` [N] [chart type]s arranged [vertically/in grid]. [Top/Left] shows [original]. [Bottom/Right] shows [transformed]. [Key difference/similarity]. [If overlay: "[color] curve shows [reference]"]. ``` **Line chart with overlays:** ``` [Line/Scatter] chart with overlaid [fits/curves]. [Axes]. [Number] of [lines/fits] shown: [list what each represents]. [Which fits well vs. poorly and why]. ``` ## Example **Code context:** ```r plotting_data |> ggplot(aes(value)) + geom_histogram(binwidth = 0.2) + facet_grid(name~., scales = "free_y") + geom_line(aes(x, y), data = norm_curve, color = "green4") ``` **Surrounding prose says:** "Normalization doesn't make data more normal" **Caption:** "Normalization doesn't make data more normal. The green curve indicates the density of the unit normal distribution." **Good alt text:** ``` Faceted histogram with two panels stacked vertically. Top panel shows original data with a bimodal distribution. Bottom panel shows the same data after z-score normalization, retaining the bimodal shape. A green normal distribution curve overlaid on the bottom panel clearly does not match the data, demonstrating that normalization preserves distribution shape rather than creating normality. ```
From posit-dev/skills at e20b71b, shown as plain text under its license: MIT (permissive). The license text is in alt-text/SKILL.md.
View SKILL.md on GitHub at e20b71bFiles
- SKILL.md6.9 KB · 0d33621f007e
- references/
- pkgdown.md4.8 KB · d5b173f42b32
- quarto.md1.8 KB · a59ba84a250e
3 files, 14 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at e20b71bRelated in Docs and writing
n8n-docs-assistant
This skill answers questions about n8n configuration, setup, credentials, nodes, and troubleshooting by retrieving information from current n8n documentation.
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 450 tokens · pinned 6 days ago
algodocs-automation
This skill automates Algodocs document processing tasks through Composio's toolkit via the Rube MCP server.
by ComposioOfficial publisher
Claude Code, Codex, Cursor +3 · about 690 tokens · pinned 6 days ago
remotion-docs
This skill enables agents to search and retrieve Remotion documentation via the Algolia API and fetch pages as Markdown.
by RemotionOfficial publisher
Claude Code, Codex, Cursor +3 · about 320 tokens · pinned 6 days ago
remotion-docs
This skill searches the Remotion documentation using the Algolia API and retrieves documentation pages as Markdown.
by RemotionOfficial publisher
Claude Code, Codex, Cursor +3 · about 320 tokens · pinned 6 days ago
receipts
This skill generates a personal Claude Code usage report from local session transcripts stored in ~/.claude/projects, mining activity across projects without…
by AnthropicOfficial publisher
Contains scripts
Claude Code · about 4.1K tokens · pinned 6 days ago
solo
This skill enables an agent to work through a single difficult mathematics problem independently within one session.
by AnthropicOfficial publisher
Claude Code · about 1.4K tokens · pinned 6 days ago