|
| 1 | +--- |
| 2 | +name: audit-images |
| 3 | +description: Audit and fix Markdown image alt text in Arm Learning Paths and install guides. Use when the user asks to review images, find deficient alt text, count faulty images, run project-level or path-level image audits, track before/after image quality, or update image alt text and captions against repository image guidance. |
| 4 | +--- |
| 5 | + |
| 6 | +# Audit images |
| 7 | + |
| 8 | +## Description |
| 9 | + |
| 10 | +Audit Markdown image references in Arm Learning Paths and install guides, report deficient alt text and image syntax, and help fix alt text with useful instructional descriptions. |
| 11 | + |
| 12 | +Use the script for repeatable inventory and counting. Use assistant judgment for semantic alt-text quality and final edits. |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +- Work from the repository root. |
| 17 | +- Read `AGENTS.md` to locate shared guidance. |
| 18 | +- Read `references/image-guidance.md` before editing image alt text, captions, or image syntax. |
| 19 | + |
| 20 | +## Trigger |
| 21 | + |
| 22 | +Use this skill when the user asks to: |
| 23 | + |
| 24 | +- Audit images or alt text. |
| 25 | +- Find placeholder, vague, missing, malformed, or duplicated alt text. |
| 26 | +- Count faulty images across the project or inside one Path/guide. |
| 27 | +- Track image audit counts before and after fixes. |
| 28 | +- Fix image alt text, captions, or `#center` syntax. |
| 29 | + |
| 30 | +## Review levels |
| 31 | + |
| 32 | +### Project-level review |
| 33 | + |
| 34 | +Scan all Learning Paths and install guides unless the user gives a narrower scope. |
| 35 | + |
| 36 | +Use project-level review to: |
| 37 | + |
| 38 | +- Count total image references and faulty image references. |
| 39 | +- Group faults by content unit and issue type. |
| 40 | +- Identify high-priority directories or files for cleanup. |
| 41 | +- Produce a before/after baseline for tracking progress. |
| 42 | + |
| 43 | +Don't mass-edit the whole project unless the user explicitly asks. Prefer reporting the project-level inventory and then fixing one Path, guide, category, or batch. |
| 44 | + |
| 45 | +### Path/guide-level review |
| 46 | + |
| 47 | +Scan one Learning Path directory, install guide file, or install guide directory. |
| 48 | + |
| 49 | +Use path/guide-level review to: |
| 50 | + |
| 51 | +- List each faulty image with file, line, image path, current alt text, caption, and issue type. |
| 52 | +- Inspect surrounding Markdown context before changing alt text. |
| 53 | +- View local images when visual inspection is needed. |
| 54 | +- Fix alt text and syntax in place. |
| 55 | +- Re-run the audit and report before/after counts. |
| 56 | + |
| 57 | +## Workflow |
| 58 | + |
| 59 | +1. Identify whether the requested scope is project-level or path/guide-level. |
| 60 | +2. Run `.github/skills/audit-images/scripts/audit_images.py` on that scope. |
| 61 | +3. Record the baseline summary: total images, faulty images, content units affected, and issue counts. |
| 62 | +4. Depending on the request level, do the following: |
| 63 | + - For project-level requests, summarize the results and suggest prioritized cleanup batches unless the user asked for edits. |
| 64 | + - For path/guide-level edit requests, inspect the relevant Markdown context and image files. |
| 65 | +5. Suggest rewrites for deficient alt text using `references/image-guidance.md`. |
| 66 | +6. After the reviewer accepts suggestions, rewrite text, then re-run the audit on the same scope. |
| 67 | +7. Report before/after counts, files changed, and any remaining issues. |
| 68 | + |
| 69 | +## Validation rules |
| 70 | + |
| 71 | +- Treat the script as a detector, not the final authority. It flags likely problems for review. |
| 72 | +- Use `references/image-guidance.md` as the source of truth for alt text, captions, placeholder text, `#center` syntax, and figure numbering. |
| 73 | +- Don't replace meaningful alt text only because it is long or short; judge whether it helps the learner complete the task. |
| 74 | +- Preserve valid local image paths and existing captions unless they are wrong, vague, or outdated. |
| 75 | +- Preserve repository image syntax unless syntax cleanup is the target of the edit. |
| 76 | + |
| 77 | +## Error handling |
| 78 | + |
| 79 | +- If the script reports a missing local image path, verify whether the path is site-root-relative, file-relative, or intentionally external before changing content. |
| 80 | +- If an image cannot be inspected, fix only issues that can be resolved from surrounding Markdown context and state the limitation. |
| 81 | +- If project-level results are too large to edit safely, report the inventory and recommend a smaller batch. |
| 82 | +- If the audit script and visual/context review disagree, explain the judgment and leave a short note in the final response. |
| 83 | + |
| 84 | +## Script usage |
| 85 | + |
| 86 | +Run a project-level audit: |
| 87 | + |
| 88 | +```bash |
| 89 | +python3 .github/skills/audit-images/scripts/audit_images.py |
| 90 | +``` |
| 91 | + |
| 92 | +Run a path-level audit: |
| 93 | + |
| 94 | +```bash |
| 95 | +python3 .github/skills/audit-images/scripts/audit_images.py content/learning-paths/servers-and-cloud-computing/example-path |
| 96 | +``` |
| 97 | + |
| 98 | +Write JSON for tracking: |
| 99 | + |
| 100 | +```bash |
| 101 | +python3 .github/skills/audit-images/scripts/audit_images.py --format json --output image-audit.json |
| 102 | +``` |
0 commit comments