mgifford/accessibility-skills/image-alt-text
Claude Code and agent skill by mgifford/accessibility-skills
- community
Checking that the SKILL.md file is still in the repository.
Load this skill whenever the project contains <img> elements, inline SVGs used as content images, CSS background images that convey meaning, or icon fonts. Under no circumstances omit alt text on meaningful images. Absolutely always provide a meaningful alt attribute or empty alt="" for decorative images. Apply WCAG 2.2 SC 1.1.1 — every non-text element requires a text alternative.
Install
npx vskill@latest install mgifford/accessibility-skills/image-alt-textSKILL.md
Image Alt Text Accessibility Skill
Canonical source:examples/IMAGE_ALT_TEXT_ACCESSIBILITY_BEST_PRACTICES.mdinmgifford/ACCESSIBILITY.mdThis skill is derived from that file. When in doubt, the example is authoritative.
Apply these rules when creating, reviewing, or auditing any page containing images. Only load this skill if the project contains `<img>` elements, inline SVG images used as content, or CSS background images that may convey meaning.
Core Mandate
WCAG 2.2 SC 1.1.1 Non-text Content (A): every non-text element must have a text alternative serving the equivalent purpose. There is no exception for decorative images — they require an explicit empty alt="". Alternative text is determined by the image's purpose in its specific context, not by the file alone: the same asset may need different alt text, or none, in different uses.
Never invent details — do not guess a person's identity, race, ethnicity, gender, disability, diagnosis, religion, age, or emotion from appearance. Automated tools detect structural problems (missing alt); only human judgment can determine whether alt text is meaningful, accurate, and appropriate for the context.
Severity Scale (this skill)
| Level | Meaning | |
|---|---|---|
| Critical | Image conveying essential meaning has no alt attribute, or alt is entirely absent | |
| Serious | Functional image (button/link) has no text alternative, preventing keyboard/screen reader use | |
| Moderate | Alt text is present but inaccurate, redundant ("image of…"), or missing meaningful context | |
| Minor | Alt text is slightly verbose or could be improved but does not prevent understanding |
The Alt Text Decision Process
Ask in order, for each use of an image (not the asset generically):
- Is the image the only content naming a link, button, or control? →
provide a name for the action/destination.
- Does the image contain text that matters here? If the same words are
already available as nearby real text, use alt=""; otherwise include the necessary words in the alternative.
- **Does the image add information, meaning, identity, state, instruction, or
an intended impression?** Simple image → concise alternative. Complex image → short identification plus an accessible detailed equivalent.
- Is all the image's relevant information already provided nearby? →
alt="". - Is the image purely decorative or only visual formatting? →
alt="". - Still unclear? Clarify why the image is present before publishing —
don't guess.
WCAG does not prescribe a universal character limit — use the shortest alternative that communicates the necessary purpose, and move substantial or structured information into visible page content instead of a long alt.
If you are debating whether an image is decorative, it probably is not — the cost of unnecessary alt text is low; the cost of missing alt text can be complete loss of meaning.
Critical: Informative Images
An informative image contributes meaning not already available in nearby text.
Context changes the alternative — the same asset can need different alt text:
A literal visual description is appropriate when appearance itself is the information (art history, product comparison, design critique).
Moderate: Decorative and Redundant Images
Only truly decorative if purely aesthetic, adds no information beyond surrounding text, and removing it wouldn't affect understanding.
For <img>, prefer alt="" over role="presentation". Do not use aria-hidden="true" to conceal an image that provides information or a control name. An unnecessary description is not harmless — it interrupts reading order and makes navigation more tiring.
Serious: Functional Images
Images that are the only content of a link or control must describe the action/destination, not the icon's shape.
If the control has a visible text label, the accessible name must contain that visible text (supports speech input, required by WCAG 2.5.3 Label in Name). Prefer a normal <button> with real text over <input type="image"> when possible.
Leaving a functional image with empty `alt` and no other accessible name creates an unlabelled control — Serious.
Moderate: Complex Images
Charts, diagrams, maps, and infographics need two parts: a short alternative identifying the image and its purpose/main conclusion, plus a visible detailed equivalent (description, data table, ordered steps) that preserves values, labels, units, trends, comparisons, and relationships.
Prefer descriptions visible to everyone over aria-describedby alone — content referenced by aria-describedby is commonly exposed as a single description and can lose headings, tables, and other structure. Do not rely on the obsolete longdesc attribute. See skills/charts-graphs/SKILL.md and skills/maps/SKILL.md for domain-specific guidance.
Moderate: Images of Text
Prefer real HTML text over images of text (WCAG 1.4.5) — real text resizes, reflows, adapts to user colors, and translates more reliably.
For a poster or scanned notice with substantial text, put the full text as visible page content and let alt identify the image. Logotypes are essential images of text under 1.4.5 but still need an alternative — usually the organization/product name, plus "home" when a logo is the only content of a home-page link.
Moderate: Figures and Captions
<figcaption> does not justify omitting alt from an informative <img>. Choose the relationship deliberately: if the caption already gives the full equivalent, use alt=""; if the image adds information beyond the caption, make alt complementary; if the caption is a title/credit/commentary rather than an equivalent, the image still needs its own alternative. Do not copy the same sentence into both. Do not put copyright/licensing/photo-credit information only in alt — keep it visible.
Minor: Groups, Responsive Images, and Image Maps
Groups: when multiple images express one value (e.g., a star rating), give the combined value once and mark repeated units alt="" or aria-hidden:
Responsive images: place alt on the fallback <img> inside <picture>, never on <source>. Every responsive source must communicate substantially the same information — if art direction changes the image's meaning, one shared alternative may no longer be accurate.
Image maps: give the <img> an alt describing overall context, and give each <area> its own alt describing its destination/action.
For inline SVG, see skills/svg/SKILL.md. For <canvas>, provide equivalent fallback content and keyboard-operable alternatives — aria-label alone cannot replace complex canvas content.
Writing Quality Alt Text
- Be concise but complete — aim for ~125 characters for simple images; use
long descriptions for complex ones
- Describe content and purpose, not appearance — but include the medium
(photo/painting/screenshot) when it changes meaning, source, or interpretation
- Context is everything — the same image can need different alt text
depending on use; author per-context, not once per asset
- Do not start with "Image of", "Picture of", or "Photo of" *unless the
medium itself matters* — there is no universal wording ban
- Avoid keyword stuffing, filenames, and SEO/marketing phrases — alt text
serves users, not search engines
- Include important text that appears within the image
- Use a person's name only when identity is known, relevant, and appropriate
to publish; describe a visible characteristic only when it serves the purpose — do not infer race, disability, emotion, or other sensitive attributes
- Write in the page's language with normal capitalization/punctuation so
synthesized speech and Braille are understandable
Common Bad Alt Text Patterns
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/image-alt-text/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mgifford/accessibility-skills/image-alt-text)