360 Secure SkillHub
360 安全技能中心

blog-image-embedder

核心功能:读取打磨后的中文博客Markdown,解析标题与章节,生成英雄图及各章节配图提示词,插入图片占位符并保存更新版。典型场景:完成博客内容打磨后使用,如触发“给我的打磨好的博客加图片”。输入需指定打磨后Markdown路径、输出目录,可配置图片模型、风格等参数;输出含带占位符的Markdown路径、提示词列表、图片路径列表。

j3ffyang
j3ffyang
热度 59.01
最近更新 2026-05-17 14:44:02
分类:创作依赖:读写文件 / 内部调用大模型 / 代码执行应用场景:博客写作 / 图像生成 / 摘要总结

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add blog-image-embedder
Metadata
name
blog-image-embedder
description
Analyze polished zh-CN blog markdown, generate hero + per-section image prompts, embed image placeholders into the markdown, and save updated version.
author
Jeff Yang
version
1.0.4
tags
["openclaw","clawhub","blog","images","prompts","embed","markdown"]
metadata
{"openclaw":{"requires":[],"platforms":["linux","darwin"]}}
inputSchema
{"type":"object","properties":{"imageModel":{"type":"string","default":"openai/gpt-5-mini","enum":["openai/gpt-5-mini","openai/dall-e-3","stability/ai-sdxl"]},"polishedPath":{"type":"string","description":"Path to polished markdown from blog-polish-zhcn","pattern":".*\\.md$"},"outputDir":{"type":"string","default":"~/.openclaw/workspace/contentPolished/"},"style":{"type":"string","default":"clean flat vector illustration, minimal isometric, software-engineering diagram vibe"},"background":{"type":"string","default":"white background with subtle grid"},"aspectRatioHero":{"type":"string","default":"16:9 horizontal"},"aspectRatioSection":{"type":"string","default":"16:9"},"imageWidth":{"type":"integer","default":800,"description":"Width in pixels for hero image"},"imageHeight":{"type":"integer","default":450},"sectionWidth":{"type":"integer","default":800},"imageQuality":{"type":"string","enum":["low","medium","high","ultra"],"default":"medium"},"imageFormat":{"type":"string","enum":["png","jpg","webp"],"default":"png"}},"required":["polishedPath","outputDir"]}
outputSchema
{"type":"object","properties":{"illustratedPath":{"type":"string"},"imagePrompts":{"type":"array"},"imagePaths":{"type":"array"}},"required":["illustratedPath","imagePrompts","imagePaths"]}
workflow
[{"name":"resolve_latest_polished","description":"Find latest *.md in outputDir","inputs":["outputDir"],"outputs":["polishedPath"],"run":"polishedPath=\"$(ls -t \"$outputDir\"/*.md | head -n 1)\"\nsave_state polishedPath \"$polishedPath\"\n"},{"name":"read_polished","description":"Read polished markdown from disk","inputs":["polishedPath"],"outputs":["markdownContent"],"run":"polishedPath=$(load_state polishedPath)\nmarkdownContent=\"$(cat \"$polishedPath\")\"\nsave_state markdownContent \"$markdownContent\"\n"},{"name":"parse_sections","description":"Extract title and sections from markdown","inputs":["markdownContent"],"outputs":["title","sections"],"llm":true},{"name":"generate_prompts","description":"Generate hero & section images using configured model","inputs":["sections","style","background","imageModel","imageWidth","imageHeight","imageQuality"],"outputs":["imagePrompts","imagePaths"],"image":true,"params":{"model":"${imageModel}","width":"${imageWidth}","height":"${imageHeight}","quality":"${imageQuality}","format":"png"}},{"name":"embed_placeholders","description":"Insert [image:x] placeholders and save illustrated markdown","inputs":["markdownContent","imagePaths","outputDir"],"outputs":["illustratedPath"],"run":"markdownContent=$(load_state markdownContent)\nimagePaths=$(load_state imagePaths)\n# ...apply embedding, write to file...\nts=$(date +\"%y%m%d%H%M\")\nillustratedPath=\"$outputDir/${ts}-illustrated.md\"\nsave_state illustratedPath \"$illustratedPath\"\n"},{"name":"finalize","run":"illustratedPath=$(load_state illustratedPath)\nimagePrompts=$(load_state imagePrompts)\nimagePaths=$(load_state imagePaths)\njq -n --arg illustratedPath \"$illustratedPath\" \\\n --argjson imagePrompts \"$(echo \"$imagePrompts\" | jq -c .)\" \\\n --argjson imagePaths \"$(echo \"$imagePaths\" | jq -c .)\" \\\n '{illustratedPath:$illustratedPath,imagePrompts:$imagePrompts,imagePaths:$imagePaths}'\n"}]

Blog Image Embedder

Analyzes polished zh-CN markdown, generates consistent image prompts (hero + 1 per section), embeds [image:x] placeholders, saves illustrated version.

When to Use

Use after blog-polish-zhcn completes. Input is polishedPath from first skill. Triggers: "add images to my polished blog", "generate image prompts for sections".

Defaults

  • style: clean flat vector illustration, minimal isometric, software-engineering diagram vibe
  • background: default: white background with subtle grid
  • aspectRatioHero: 16:9 horizontal
  • aspectRatioSection: 16:9

Workflow Summary

  1. Read polished markdown from input.polishedPath
  2. Parse structure: Extract title + ## section headings (expect 3-4 sections)
  3. Generate prompts:
    • Hero: [Hero of {title}]: {topic summary}, {style}, {background}, 16:9
    • Section N: [Section {N} of {title}]: {section summary}, {style}, {background}, 16:9
  4. Embed placeholders: Insert \n\n[image:0]\n\n after title, \n\n[image:1]\n\n after first section, etc.
  5. Save: ${outputDir}/${ts}-illustrated.md
  6. Return: { illustratedPath, imagePrompts: [...], imagePaths: [...] }

Output Format

{
  "illustratedPath": "/home/jeff/.openclaw/workspace/contentPolished/2603142145-illustrated.md",
  "imagePrompts": ["Hero prompt...", "Section 1 prompt...", "Section 2 prompt..."],
  "imagePaths": ["2603142145-main.png", "2603142145-section1.png", "2603142145-section2.png"]
}