fix-blog-images
修复和优化未提交的博客文章中的图像。在准备发布博客文章、修复损坏的图像路径、重命名通用图像名称 (image.png)、将图像移动到正确的 /images/blog/ 目录、改进替代文本或在提交之前检查图像引用时使用。在“修复博客图像”、“检查图像”、“准备发布帖子”或将屏幕截图粘贴到 Markdown 后触发。
📖 中文导读:修复和优化未提交的博客文章中的图像。在准备发布博客文章、修复损坏的图像路径、重命名通用图像名称 (image.png)、将图像移动到正确的 /images/blog/ 目录、改进替代文本或在提交之前检查图像引用时使用。在“修复博客图像”、“检查图像”、“准备发布帖子”或将屏幕截图粘贴到 Markdown 后触发。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: fix-blog-images description: Fix and optimize images in uncommitted blog posts. Use when preparing blog posts for publication, fixing broken image paths, renaming generic image names (image.png), moving images to proper /images/blog/ directory, improving alt text, or checking image references before committing. Trigger on "fix blog images", "check images", "prepare post for publish", or after pasting screenshots into markdown.
Fix Blog Images
Fixes image issues in uncommitted blog posts before publishing.
Workflow
- Run the analysis script:
python3 scripts/fix_blog_images.py --json
Review output and for each issue:
- rename_and_move: Move image to
/images/blog/with descriptive name - improve_alt_text: Update alt text to describe the image content
- missing_image: Locate or remove the reference
- rename_and_move: Move image to
Apply fixes:
- Move/rename image files to
packages/blog/public/images/blog/ - Update markdown references to use absolute paths
/images/blog/... - Add descriptive alt text
- Move/rename image files to
Image Conventions
- Location: All images in
packages/blog/public/images/blog/ - Naming:
YYYYMMDD-HHMM-descriptive-name.pngorYYYYMMDD-descriptive-name.png - References: Use absolute paths
/images/blog/filename.png - Alt text: Describe what the image shows for accessibility
Example Fix
Before:

After:

Addtional Notes
Don't try and Optimize Images. a git hook will run image optimization on commit. This skill is just to fix paths, names, and alt text before committing.