Writes context-aware alt text for images on a page or in a document, or marks them decorative, following the W3C alt decision tree. Use when publishing images on the web.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Write Alt Text?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hermes-hq-write-alt-text)
---
name: write-alt-text
description: Writes context-aware alt text for images on a page or in a document, or marks them decorative, following the W3C alt decision tree. Use when publishing images on the web.
license: CC0-1.0
arguments:
- images
- page_context
- max_chars
argument-hint: <images> <page_context> [max_chars]
disable-model-invocation: true
metadata:
version: 1.0.0
kind: prompt
category: accessibility
source: https://hermes-ide.com/prompts/write-alt-text
catalog: 2026.1014.1
---
# Write alt text for images
## Inputs
- `images` (required): The images themselves, or for each one its file name, a description and any text it contains, plus whether it is inside a link or button.
- `page_context` (required): The page or document the images appear in, its purpose, and the text around each image.
- `max_chars` (optional; default: 125): Soft length limit for the alt attribute. Longer explanations go in a long description instead.
Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.
<context>
Alt text is not a description of the picture. It is the text that replaces the picture for someone who cannot see it, so it depends on why the image is there. The same photo of a laptop needs different alt text on a product page, in a news story about a data breach, and as a decorative header. Common failures: "image of...", file names, repeating the caption, describing a linked logo instead of where the link goes, and long descriptions of decoration that make screen-reader users wade through noise.
</context>
<task>
Write alt text for these images:
$images
Page context:
$page_context
For each image, walk the W3C alt decision tree in this order, stop at the first branch that applies, and record it:
1. **Inside a link or button, or the only content of one?** The alt describes the destination or action ("Acme home", "Search"), not the picture, and includes any text the image shows (label in name, WCAG 2.5.3). If the link or button already has visible text that says the same, the image is redundant: use `alt=""`.
2. **Contains text?** If the same text is already next to the image, use `alt=""`. If the text is only a visual effect, use `alt=""`. Otherwise the alt is that text.
3. **Adds meaning to the content?** Write a short alt that conveys what the image contributes here, in this context.
4. **Complex (chart, diagram, map, infographic)?** Write a short alt with the key takeaway, then a long description or data table to place on the page or link to.
5. **Decorative or redundant with nearby text?** Use `alt=""`. Do not omit the attribute.
Writing rules:
- Stay within about $max_chars characters. If you need more, the image is complex: use branch 4.
- Do not start with "image of" or "picture of". Name the medium only when it matters ("Oil painting of...", "Screenshot of the settings page...").
- Put the most important information first, end with a full stop, and match the page's language.
- Describe people only by attributes that matter to the content. Do not guess identity, gender, ethnicity, age or disability unless the context establishes it and it matters.
- No keyword stuffing, and no repeating the caption or the surrounding sentence.
- If you cannot see an image and its description is too thin to know what it shows or why it is there, ask instead of inventing details.
</task>
<constraints>
- Never invent text, numbers or details that are not visible in the image or stated in its description.
- For charts, give the trend or comparison that matters, not every data point; put the data in the long description.
- Separate what you verified from what you inferred. Mark inferences as such.
- When you do not know, say "I don't know" once and state what would settle it.
</constraints>
<output_format>
## Alt text
| # | Image | Branch (functional / text / informative / complex / decorative) | alt | Long description needed? |
Write each alt value exactly as it should appear in quotes, including `""` for decorative images.
## Markup
An HTML snippet per image with the alt in place, plus `figure` and `figcaption` or a linked long description where branch 4 applied.
## Questions
What you need to finish any image you could not do, or "None".
</output_format>
<examples>
<example>
Image: company logo reading "Northwind", wrapped in a link to the home page. Context: site header.
Branch: functional. alt: "Northwind home"
Image: line chart of monthly sign-ups rising from 1,200 in January to 4,800 in June. Context: quarterly report, paragraph says "growth accelerated".
Branch: complex. alt: "Monthly sign-ups quadrupled from 1,200 in January to 4,800 in June." Long description: a table of the six monthly values.
Image: abstract gradient behind the page title.
Branch: decorative. alt: ""
</example>
</examples>