一键导入
optimize-image
Convert and optimize images to WebP for blog posts and series. Use proactively when adding images to blog posts or series.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Convert and optimize images to WebP for blog posts and series. Use proactively when adding images to blog posts or series.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create blog posts — from a topic (writes content) or with provided content (scaffolding). Use proactively when creating new blog posts or articles.
Pre-publication audit for blog posts — comprehensive final review of SEO, AEO, accessibility, images, content quality, i18n parity, and project conventions before publishing. Use proactively before publishing any blog post.
Pre-publication audit for blog series — validates series definition, post ordering, cross-post consistency, navigation, and runs individual post audits for all posts in the series. Use proactively before publishing any blog series.
Audit the blog tag taxonomy — frequency analysis, orphan detection, hierarchy validation, and proposals for new subtopic tags. Read-only — proposes, never modifies tags or posts. Use proactively before each release cycle or after a content drop of 5+ posts.
Optional DeepWorkPlan addon that connects an AI-first repo to the developer's Dailybot team — installing (with consent) the Dailybot agent skill (DailybotHQ/agent-skill) and/or the Dailybot CLI (DailybotHQ/cli), wiring the plan lifecycle into best-effort agent updates - kickoff when a plan starts, significant task completions, a blocked report when an unattended run halts, and a milestone on plan completion - with payloads derived from the plan's state layer, and optionally committing the Dailybot skill's deterministic hook enforcement (dailybot hook lifecycle hooks, CLI >= 1.12.0) so the agent harness itself reminds agents about unreported work. Opt-in, never required, never blocks the work, reconciles existing setups instead of clobbering them, and defers all auth to the Dailybot skill's own consent flow. Use when the developer or team already uses Dailybot and wants DWP progress visible to humans.
Optional DeepWorkPlan addon that safely upgrades a repo's dependencies — reasoning about the repo's ACTUAL package manager (npm/pnpm/yarn + ncu, pip/poetry/uv, cargo, go mod, bundler, composer, and more) rather than assuming npm — with a batched, validated, revertible workflow that detects the manager and manifests/lockfiles, classifies upgrades (patch/minor/major), upgrades in safe batches, runs the repo's real validation gate after each batch, reverts a failing batch, and summarizes. Opt-in, never required, reconciles with the repo's existing tooling. Use when the developer wants to bring dependencies up to date without breaking the build.
| name | optimize-image |
| description | Convert and optimize images to WebP for blog posts and series. Use proactively when adding images to blog posts or series. |
| disable-model-invocation | false |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash |
| model | haiku |
| argument-hint | <source-path> [--slug <post-slug>] [--type hero|content] |
| tier | 1 |
| intent | execute |
| max-files | 5 |
| max-loc | 0 |
Convert user-provided images (PNG, JPG, etc.) to optimized WebP format and place them in the correct blog post or series directory. This is the standard workflow for adding any image to blog content (posts, series, shared assets).
/add-blog-post for that)pnpm run images:optimize for staging pipeline)Tier: 1 - Light
Reasoning: Simple file conversion using sharp with well-defined parameters. No reasoning needed, just execution.
$SOURCE_PATH: Path to the source image file (any format: PNG, JPG, JPEG, BMP, TIFF, etc.)$SLUG: Blog post slug for the target directory (default: inferred from source filename or asked)$TYPE: Image type — hero or content (default: hero if filename contains "hero", otherwise content)$OUTPUT_NAME: Output filename without extension (default: hero for hero type, or source filename in kebab-case)Before running this skill, ensure:
sharp is available in node_modules (installed as dev dependency)$SLUG parameter, or ask the user)$TYPE or filenamemkdir -p public/images/blog/posts/{slug}
Create a temporary conversion script and run it from the project root:
node -e "
const sharp = require('sharp');
const input = '${SOURCE_PATH}';
const output = 'public/images/blog/posts/${SLUG}/${OUTPUT_NAME}.webp';
const maxWidth = ${MAX_WIDTH};
sharp(input)
.resize({ width: maxWidth, withoutEnlargement: true })
.webp({ quality: 80 })
.toFile(output)
.then(info => console.log('OK:', info.width + 'x' + info.height + ',', (info.size / 1024).toFixed(1) + 'KB'))
.catch(err => {
console.error('WebP conversion failed:', err.message);
process.exit(1);
});
"
If the inline script has escaping issues, use a file-based approach:
// /tmp/convert-to-webp.mjs (run from project root)
import sharp from 'sharp';
const [input, output, width] = process.argv.slice(2);
try {
const info = await sharp(input)
.resize({ width: parseInt(width || '1400'), withoutEnlargement: true })
.webp({ quality: 80 })
.toFile(output);
console.log(`OK: ${info.width}x${info.height}, ${(info.size/1024).toFixed(1)}KB`);
} catch (err) {
console.error(`FAIL: ${err.message}`);
process.exit(1);
}
node /tmp/convert-to-webp.mjs "{source}" "public/images/blog/posts/{slug}/{name}.webp" {maxWidth}
If sharp cannot convert the image to WebP:
Show the conversion result:
Image optimized:
Source: {source_path} ({original_size})
Output: public/images/blog/posts/{slug}/{name}.webp ({output_size})
Dimensions: {width}x{height}
Reduction: {percentage}%
Reference in frontmatter:
heroImage: '/images/blog/posts/{slug}/{name}.webp'
Reference in markdown:

Image optimized:
Source: ~/Downloads/screenshot.png (1.2MB)
Output: public/images/blog/posts/my-post/hero.webp (45.2KB)
Dimensions: 1400x700
Reduction: 96.2%
Reference in frontmatter:
heroImage: '/images/blog/posts/my-post/hero.webp'
WebP conversion failed for: ~/Downloads/photo.bmp
Error: Input file has unsupported pixel format
Fallback: Keeping as JPG format
Output: public/images/blog/posts/my-post/hero.jpg (89.5KB)
Note: This image could not be converted to WebP. Using JPG as fallback.
public/images/blog/posts/, public/images/blog/shared/, public/images/blog/series/src/, scripts/, docs/Before making changes:
public/images/blog/Stop immediately and report if:
public/images/blog/node_modules/sharp missing)This skill is complete when ALL of the following are true:
posts/{slug}/ directoryEscalate to user if:
Escalation Path:
Context: User provides a PNG screenshot to use as hero image for a new post.
Input:
/optimize-image ~/Downloads/hero-banner.png --slug my-new-post --type hero
Execution:
Converts PNG to WebP at 1400px max width, quality 80. Places in public/images/blog/posts/my-new-post/hero.webp.
Output:
Image optimized:
Source: ~/Downloads/hero-banner.png (2.1MB)
Output: public/images/blog/posts/my-new-post/hero.webp (67.3KB)
Dimensions: 1400x700
Reduction: 96.8%
Reference in frontmatter:
heroImage: '/images/blog/posts/my-new-post/hero.webp'
Context: User wants to add a diagram to an existing post.
Input:
/optimize-image /tmp/architecture-diagram.jpg --slug getting-started-with-astro --type content
Execution: Converts JPG to WebP at 1200px max width. Names output after the source file.
Output:
Image optimized:
Source: /tmp/architecture-diagram.jpg (450KB)
Output: public/images/blog/posts/getting-started-with-astro/architecture-diagram.webp (38.1KB)
Dimensions: 1200x800
Reduction: 91.5%
Reference in markdown:

Context: User provides a BMP file that sharp can't convert to WebP.
Input:
/optimize-image ~/old-screenshot.bmp --slug legacy-project
Result:
WebP conversion failed for: ~/old-screenshot.bmp
Error: Input file has unsupported pixel format
Fallback: Optimized as JPG
Output: public/images/blog/posts/legacy-project/old-screenshot.jpg (92KB)
Note: This image could not be converted to WebP. Using JPG as fallback.
Report this to the user for manual review.
add-blog-post - Creates blog posts that reference these optimized imagesdoc-edit - For updating image-related documentation| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2026-03-11 | Initial version |