Resizes images that are too large for the blog. Use when asked to resize images, optimize images, or make images smaller. Can resize to a specific width (e.g., "resize to 300px") or default to 1000px max width. Defaults to the most recent post's assets folder.
Resize images in blog post assets folders. Default max width is 1000px, but can resize to any specified width.
Public/_posts/ and selecting the textbundle with the latest date prefix (YYYY-MM-DD format)assets/ folder within the textbundleOnly process these image formats:
.jpeg.jpg.pngWhen a custom width is specified, resize the image to that width regardless of its current size.
Find images that are either:
Use git status --porcelain to identify unstaged files, then filter for images in the target assets folder.
If a specific image is requested, use that directly without checking git status.
For each image, check its width using ImageMagick:
/usr/local/bin/magick identify -format "%w" <image_path>
Present a summary of images to resize:
For default (1000px max) mode:
## Images to Resize (max 1000px)
| Image | Current Width | New Width |
|-------|---------------|-----------|
| image1.png | 2400px | 1000px |
| image2.jpg | 1800px | 1000px |
Resize these images?
For custom width mode:
## Images to Resize (to 300px)
| Image | Current Width | New Width |
|-------|---------------|-----------|
| icon.png | 512px | 300px |
Resize these images?
Use the AskUserQuestion tool to confirm before proceeding.
After confirmation, resize each image using ImageMagick:
/usr/local/bin/magick mogrify -resize <width> <image_path>
After resizing, report what was done:
## Resized Images
- image1.png: 2400px → 1000px
- icon.png: 512px → 300px