К основному содержанию
скилл CX Codex

alt-text — скилл для Claude Code: alt-текст для графиков в R и Quarto

Пишет и правит alt-текст для графиков и картинок в R-пакетах и документах Quarto. Пригодится, когда фигуры на сайте pkgdown или в .qmd остаются без описания.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add posit-dev/skills --skill alt-text -a claude-code
Открыть на GitHub

Что делает alt-text

Скилл разбирает код, который строит график, и вытаскивает из него точные детали: какие переменные на осях, что кодирует цвет, сколько панелей у фасетки, есть ли поверх линии подгонки. Поэтому описание получается конкретным, а не общими словами. Сначала скилл проверяет контекст проекта: если в корне лежит _pkgdown.yml, он читает references/pkgdown.md, иначе для .qmd берёт references/quarto.md. Когда формат непонятен, спросит у вас.

Структура описания трёхчастная: тип графика, данные, главный вывод. Подпись (fig-cap, fig.cap) скилл читает первым делом и старается не повторять её, а дополнять. Если в подписи уже сформулирован вывод, alt-текст описывает визуальную структуру; если подпись общая, вывод идёт в описание. Длина зависит от сложности: от двух предложений для простого графика до пяти для фасеточного с наложениями.

Есть чек-лист качества: начинать с типа графика, называть переменные осей, добавлять конкретные значения из кода, писать простым языком без «geom» и «aesthetic». Скилл умеет принимать необязательные аргументы — метку фигуры или конкретный файл. Ставить его имеет смысл там, где графики генерируются кодом: без доступа к исходнику описание выйдет куда беднее.

Какие задачи решает

  • написать alt-текст для графика в .qmd, не видя картинки
  • проверить, у всех ли фигур на сайте pkgdown есть описания
  • переписать общую подпись в конкретное описание данных
  • добавить alt-текст одной фигуре по её метке
  • привести описания графиков к единой структуре

Примеры запросов агенту

  • Добавь alt-текст для всех фигур в этом .qmd
  • Улучши alt-текст для фигуры с меткой fig-norm
  • Проверь alt-текст в vignettes/plots.Rmd

Как установить alt-text

1Через Skills CLI (Vercel)

npx skills add posit-dev/skills --skill alt-text -a claude-code

2Вручную: положить файлы

~/.claude/skills/alt-text/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/alt-text/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора18

release-post Пишет блог-пост о выпуске R или Python пакета по правилам блогов Tidyverse и Shiny. Пригодится, когда NEWS.md уже есть, а текста для сайта нет. CX Codex +1 684установок r-cli-app Помогает агенту собрать консольную утилиту на R: разбор аргументов, справка и подкоманды берутся из самого скрипта. CX Codex +1 682установок pr-threads-resolve Скилл закрывает все незакрытые треды ревью в PR текущей ветки одной командой. Пригодится, когда правки уже внесены и осталось только снять статус «unresolved». CX Codex +1 668установок pr-threads-address Скилл находит все неразрешённые треды ревью в пулреквесте текущей ветки, вносит правки в код с тестами и помогает ответить рецензенту. CX Codex +1 666установок ggsql Помогает агенту писать и править запросы ggsql, где SQL и описание графика живут в одном синтаксисе. Пригодится, когда нужно построить визуализацию прямо из таблицы или CSV. CX Codex +1 522установок implement Скилл берёт готовый файл плана и передаёт задачи субагентам для параллельного исполнения. Он проверяет состояние ветки git и отслеживает прогресс. CX Codex +1 491установок review-testing Разбирает тесты, написанные вместе с фичей или багфиксом: ловит слабые утверждения, лишние моки и хрупкие места. Пригодится, когда тесты вроде есть, а уверенности в них нет. CX Codex +1 474установок maintainer-decline Скилл помогает мейнтейнерам открытых проектов вежливо закрывать issues, отклонять пулреквесты и объяснять архитектурные решения без лишних споров. CX Codex +1 409установок

Похожие

power-bi-report-design-consultation официальный github Скилл помогает спроектировать Power BI-отчёт: выбрать визуализации, продумать структуру страниц и учесть аудиторию. Пригодится, когда отчёт должен поддерживать конкретные решения. 9 390установок data-visualization Owl-Listener Помогает агенту выбрать тип графика и настроить оси, подписи и цвета так, чтобы диаграмма читалась без легенды. CX Codex +1 2 400установок data-storytelling Seth Hobson Скилл превращает сырые данные в понятный рассказ с визуализациями, контекстом и рекомендациями. Пригодится для отчётов и презентаций для руководителей. CX Codex 16 782установок slide-excellence pedrohcgs Многопоточная проверка лекционных слайдов: визуал, педагогика, вычитка. Пригодится перед выступлением или сдачей колоды. CX Codex +1 ★ 1 668звёзд репо r официальный github Задаёт Copilot правила генерации кода на R: стиль проекта, безопасность, работа с путями и данными. Пригодится, если в репозитории есть .R, .Rmd или .qmd файлы. ★ 40 418звёзд репо speech-to-text elevenlabs Отдаёт агенту ElevenLabs Scribe v2: отправляет аудио или видео на распознавание и возвращает текст, метку языка и таймстемпы по словам. CX Codex +1 11 800установок

Рядом в теме «Тексты и документация»

Всё по теме «Тексты и документация» →

Вопросы о alt-text

Как установить alt-text в Claude?

Выполните npx skills add posit-dev/skills --skill alt-text -a claude-code. Скилл окажется в ~/.claude/skills/alt-text/SKILL.md.

Что делает alt-text?

Генерирует и улучшает alt-текст для визуализаций данных и картинок в R-пакетах и документах Quarto, опираясь на код, который строит график.

Чем alt-текст отличается от подписи к графику?

Скилл читает подпись первой и старается её не дублировать. Если вывод уже есть в подписи, описание сосредотачивается на визуальной структуре.

Исходный текст

SKILL.md · MIT
---
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.
```

© Emil Hvitfeldt (@emilhvitfeldt) · MIT · posit-dev/skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой