-
Notifications
You must be signed in to change notification settings - Fork 782
Add alt text skill #11077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dbreseman
wants to merge
3
commits into
development
Choose a base branch
from
db-alt-text-skill
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+79
−3
Open
Add alt text skill #11077
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| --- | ||
| name: docs-alt-text | ||
| description: Generates W3C-compliant alt text for images in documentation pages. Analyzes each image's purpose and adds descriptive alt text for informative images or empty alt for decorative images, improving accessibility and SEO. | ||
| user-invocable: true | ||
| disable-model-invocation: false | ||
| --- | ||
|
|
||
| > **Accessibility skill:** Generates alt text following W3C/WCAG 2.1 guidelines. Analyzes actual image content plus context to create concise, meaningful descriptions. | ||
|
|
||
| ## Workflow | ||
|
|
||
| Follow this order for each image: | ||
|
|
||
| 1. **STEP 1 - View the image file** (REQUIRED) | ||
| - Extract image src path from figure shortcode | ||
| - Convert path: `src="/attachments/path/file.png"` → `static/attachments/path/file.png` | ||
| - Use Read tool to view the actual image | ||
| - Understand what the image shows BEFORE reading context | ||
|
|
||
| 2. **STEP 2 - Read surrounding context** | ||
| - Read the heading, preceding/following text, list item, or numbered step | ||
| - Understand the image's purpose within the documentation | ||
| - Consider if context + image together make the image informative or decorative | ||
|
|
||
| 3. **STEP 3 - Determine if informative or decorative** | ||
| - **Technical docs assumption:** Images are informative unless obviously decorative | ||
| - **Informative:** Images that convey information → write descriptive alt text | ||
| - **Decorative:** Images where the information is already given in adjacent text, or pure visual styling with no informational value → use `alt=""` | ||
|
|
||
| 4. **STEP 4 - Generate alt text** | ||
| - **If decorative, use `alt=""`.** Never omit the alt attribute entirely. | ||
| - **If informative, generate descriptive alt text:** | ||
| - Focus on the information the image communicates, not what it looks like | ||
| - Give the most concise description possible | ||
| - Maximum 30 words (flag complex images needing longer descriptions for body text) | ||
| - Don't include "screenshot of", "image of", or "picture of" (screen readers already announce it's an image) | ||
| - Use Mendix terminology | ||
| - Avoid redundancy with nearby text | ||
| - **Based on surrounding context:** | ||
| - In a procedure: emphasize the action/element relevant to the step (e.g., "Download button in Registration dialog") | ||
| - Showing UI elements: name the relevant elements (e.g., "Properties pane") | ||
| - Showing structure or relationships: describe what entities/components are connected (e.g., "Domain model with Customer and Order entities connected by one-to-many association") | ||
| - Showing logic or process flow: describe what the flow accomplishes (e.g., "Microflow that retrieves FileDocument list and updates encryption keys") | ||
|
|
||
| 5. **STEP 5 - Edit the figure shortcode** | ||
| - Use Edit tool to add/update only the `alt` attribute | ||
| - Preserve all other attributes: `class`, `width`, `max-width`, `link` | ||
| - Maintain exact indentation and spacing | ||
|
|
||
| ## Special Cases | ||
|
|
||
| - **Images in numbered lists:** Common in procedures—describe the procedural step shown | ||
| - **Before/after sequences:** Describe what changed or the state shown | ||
| - **Existing alt text:** May update if it's empty, generic, or poor quality (e.g., `alt=""`, `alt="button"`, `alt="before"`) | ||
| - **File format icons:** Use format name (e.g., "PDF", "ZIP", "Word document") | ||
| - **Complex diagrams:** If needs >30 words, flag to user and suggest adding description to body text | ||
|
|
||
| ## What NOT to do | ||
|
|
||
| - Don't modify `src` path or attributes other than `alt` | ||
| - Don't change surrounding text or document structure | ||
| - Don't process images outside the determined scope | ||
| - Don't generate alt text based solely on filename—always view the image first | ||
|
|
||
| ## After Processing | ||
|
|
||
| Report summary: | ||
| - How many images processed | ||
| - How many updated | ||
|
|
||
| **Always suggest user review:** Recommend that the user review the images themselves to confirm alt text accuracy, as AI-generated descriptions may miss important nuances or context-specific details. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.