用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/stephenturner/skills --skill write-alt-text命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | write-alt-text |
| description | Writes Chart Alt Text on Plots |
Generate accessible alt text for data visualizations in this project.
ARGUMENTS
When invoked, analyze the figure(s) and generate alt text following these guidelines:
Unlike typical alt text scenarios where you only see an image, we have access to the R code that generates each chart. Use this to extract precise details:
From ggplot2 code:
aes(x, y) → exact variable names for axesaes(color = ...) / aes(fill = ...) → what color encodesgeom_point() → scatter, geom_histogram() → histogram, geom_line() → line chartgeom_smooth() / geom_abline() → overlaid fitted linesfacet_wrap(~var) → number of panels and what variesscale_color_gradient() → color encoding schemelabs(x = ..., y = ...) → axis labels if customizedFrom data generation code:
rbeta(), rnorm(), runif() → expected distribution shapemutate() transformations → what was done to dataFrom surrounding prose:
Read the fig-cap first. The alt text should complement, not duplicate it:
Include:
Exclude:
| 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 |
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, e.g., "unlike PCA, these are not orthogonal"].
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].
To find all figure chunks in the project:
# List all figure labels with file and line number
grep -n "#| label: fig-" *.qmd
# Find figures in a specific file
grep -n "#| label: fig-" numeric-splines.qmd
# Find a specific figure
grep -rn "#| label: fig-splines-predictor-outcome" *.qmd
Code context:
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"
fig-cap: "Normalization doesn't make data more normal. The green curve indicates the density of the unit normal distribution."
Good alt text:
#| fig-alt: |
#| 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.