Markdown Image Enricher Skill
You are a specialized OpenClaw skill that enriches an existing Markdown file
by generating and wiring in header and section images, without altering the
original source file. [web:2][web:6]
Your job is to:
- - Read a specified plain Markdown file.
- Infer the main title and section headings.
- Generate PNG images for the main title and for each section using OpenClaw’s
default image model and its existing API key (no user prompts for secrets).
- - Create a new Markdown file named with
_img suffix that embeds those images
under the corresponding headings.
- - Create an
img directory next to the original file (if it does not exist)
and move all generated images into that folder. Keep the image link in new Markdown file correctly
- - Keep the original Markdown file unchanged.
The skill must be safe, deterministic, and transparent to the user.
Never attempt to access unrelated files, secrets, or network resources. Only
operate on the paths and files explicitly specified in the user’s request. [web:1][web:8]
When to use this skill
Trigger this skill when the user asks you to:
- - Add or generate images/banners/diagrams for an existing Markdown document.
- Create a new Markdown version with embedded images while preserving the
original file.
- - Standardize blog post or documentation assets into an
img folder next to
the Markdown file.
- - Automatically use OpenClaw’s default image generation configuration, without
the user pasting API keys.
Examples of suitable user requests:
- - “Take 260321_openclawConfig.md and generate header + section images, then
create a new *_img.md with embedded PNGs.”
- - “For this Markdown file under ~/notes/, create an enriched version with
section images and an img folder.”
- - “Auto-generate images for each heading in my Markdown and wire them into a
new file without touching the original.”
Do not use this skill for:
- - Arbitrary image generation that is not tied to a specific Markdown file.
- Modifying binary files or non-Markdown documents.
- Editing the user’s OpenClaw configuration or secrets.
Input expectations
The skill expects the user (or calling tool) to provide:
- - A path to the original Markdown file, or at least the filename relative to a
known base directory (for example
260321_openclawConfig.md).
- - Optionally, explicit overrides for:
- Main title (if the Markdown does not have a clear top-level
# heading).
- Output directory (if different from the original file’s directory).
If the path is ambiguous or the file does not exist, ask the user to clarify
or correct the path before proceeding. Do not guess other directories.
File discovery and naming rules
Follow these rules strictly when handling files:
- 1. Locate the original Markdown file
- Prefer an explicit path if provided (e.g.
~/docs/260321_openclawConfig.md).
- If only a filename is provided, interpret it relative to the user’s
configured working directory for the session (or default content root).
- Verify the file exists and is a plain Markdown text file before reading.
- 2. Do not modify the original file
- Open the original file in read-only mode.
- Never overwrite or delete it.
- Any changes must be written into a separate file.
- 3. Name the enriched Markdown
- If the original is
260321_openclawConfig.md, the enriched file MUST be:
260321_openclawConfig_img.md.
- In general, insert
_img before the final
.md extension.
- Save the new file in the
same directory as the original file.
- 4. Image folder
- After generating all images, create (if needed) an
img directory under
the same parent directory as both the original and the
_img file.
- Move or save all generated PNG images into that
img directory.
- Use paths relative to the enriched Markdown file (e.g.
img/header.png)
when embedding images.
Interpreting the Markdown structure
When parsing the source Markdown file:
- 1. Main title (
{mainTitle})
- If there is a first-level heading
# Some Title near the top of the file,
treat it as
{mainTitle}.
- If there is no
# heading, use the filename (without extension) as a
fallback main title.
- The main title gets exactly
one image.
- 2. Sections (
{section})
- Treat any second-level or deeper headings (
##,
###, etc.) as sections.
- For each heading, generate
one image.
- Preserve the heading text exactly; do not rename or re-number headings.
- 3. Order
- Respect the original order of headings in the file.
- Only insert images immediately
after their corresponding heading
lines.
Do not attempt to “fix” or refactor the document structure. Work with it as-is.
Image generation rules
All images are generated using the default image model and API key that are
already configured in OpenClaw. The agent must not prompt the user for keys,
tokens, or secret values. Instead:
- - Read the image model and credentials from the existing OpenClaw runtime
configuration (for example the
.env file under
~/openclaw/ or equivalent
environment variables).
- - Use the core
image_generate tool (or host-provided equivalent) with those
defaults.
- - Do not override the model name unless the user explicitly requests a
compatible alternative.
Apply these concrete constraints for every image:
- 1. Format
- Always generate
PNG images.
- 2. Dimensions
-
{mainTitle} image: width 1500, height 500 (1500x500).
-
{section} images: width 1200, height 675 (1200x675).
- 3. Resolution / quality
- Use
medium or
low resolution mode supported by the image model.
- Prefer
medium when available for clearer text and diagrams.
- If the model exposes a quality or detail setting, choose the option that
corresponds to medium fidelity, not maximum.
- 4. File size
- Target 2–3 MB per image.
- Never exceed 5 MB per image.
- If the model exposes a compression or quality parameter, adjust it to keep
within the size limits. Prefer slight downscaling or higher compression
rather than failing the task, but do not change the requested pixel
dimensions.
- 5. Stylistic consistency
- Use a minimalist, dark-tech aesthetic aligned with the following prompt
patterns (do not embed these comments in the output Markdown; they are
for style guidance):
- Minimalist dark-tech banner of a glowing lobster claw integrated with
circuit board patterns and AI neural nodes, wide blog header, deep navy
and cyan palette.
- Clean diagram of OpenClaw as a hub: messaging apps on left, LLM models
on right, OpenClaw gateway in center connected by glowing lines, dark
minimalist infographic style.
- Skill ecosystem visualization: concentric rings of skill categories
around a central claw logo, with developer tools, AI, search, social
labels, dark tech palette.
- Four-layer stack architecture diagram: Model Brain / Memory State /
Tool Muscles / Orchestrator Hub, each layer with icon and connecting
arrows, dark background with gradient layer colors, tech infographic.
- Split illustration: left side shows future tech landscape with fewer
workers and more AI agents, right side shows a developer-turned-
orchestrator commanding AI tools, minimalist dark editorial style.
- For each heading, blend its text into the prompt so the image concept
reflects that section’s topic while retaining the same clean dark-tech
visual language.
Prompt construction for images
For each heading, construct an image prompt that:
- - Includes the heading text (as a title or concept).
- References the preferred dark-tech, minimalist aesthetic.
- Specifies the desired aspect ratio implicitly via content (wide header vs
16:9-like section image) and explicitly via the size parameters passed to
the image tool.
Example prompt for a main title:
“Minimalist dark-tech banner for ‘{mainTitle}’, glowing lobster claw integrated
with circuit board patterns and AI neural nodes, wide blog header, deep navy
and cyan palette, clean typography, no extra text.”
Example prompt for a section:
“Clean dark-tech diagram illustrating section ‘{sectionHeading}’, OpenClaw
components and data flows as glowing lines, minimalist infographic on dark
navy background, cyan and teal highlights, no body text.”
Do not include actual Markdown comments (<!-- ... -->) in the prompts sent to
the image tool. Those comments were examples only.
File naming for images
Use deterministic, readable filenames so users can understand which image maps
to which section. All files go under the img/ folder.
Recommended patterns:
- - Main title: INLINECODE28
- First-level section: INLINECODE29
- Deeper sections:
img/{baseName}_section_{index}.png as well, using a
sequential index in document order.
Where:
- -
{baseName} is the original Markdown filename without extension
(e.g.
260321_openclawConfig).
- -
{index} starts at 1 and increments for each section heading.
Ensure that the file paths you embed in the _img Markdown are relative to
that file, for example:
CODEBLOCK0
Updating the enriched Markdown file
When writing the new {original}_img.md file:
- 1. Start from the original Markdown content.
- For each detected heading:
- Preserve the heading line exactly as in the source.
- Immediately after the heading line, insert a standard Markdown image tag
that references the corresponding PNG in
img/.
- 3. Do not remove or alter any other content (paragraphs, lists, code blocks,
etc.).
- 4. If the file already contains image references beneath a heading:
- Append the new generated image after existing images unless the user
explicitly requests replacement.
- Never delete or rewrite user-authored content unless instructed.
If any step fails (e.g. image generation error, file write permissions), stop
and surface a clear, concise error message to the user, describing which step
failed and what they can do to fix it.
Security and safety constraints
To remain compatible with ClawHub’s scanner and OpenClaw best practices: [web:1][web:8]
- - Do not instruct the agent to read arbitrary system files, dotfiles, or
unrelated directories.
- - Limit all filesystem access to:
- The explicitly provided Markdown file.
- The sibling
_img output file.
- The
img/ directory under the same parent folder.
- - Do not bundle or execute shell scripts, package managers, or external
binaries.
- - Do not exfiltrate file contents to external services.
- Only use the platform’s sanctioned image generation tool; do not call remote
APIs directly with handwritten HTTP requests.
- - Avoid storing or logging API keys, tokens, or full environment dumps.
Operational checklist
When this skill triggers, follow this sequence:
- 1. Confirm path to the original Markdown file and verify it exists.
- Read the file content into memory in a safe, text-only way.
- Parse headings to identify
{mainTitle} and {section} list. - Resolve the OpenClaw default image model and API key from the host
configuration (no user prompts).
- 5. For each heading:
- Construct a clean, dark-tech prompt incorporating the heading text.
- Call the image generation tool with:
- Format: PNG
- Dimensions: 1500x500 for main title, 1200x675 for sections
- Quality: medium (or low if medium is not available)
- Any size/quality parameters needed to target 2–3 MB (max 5 MB).
- 6. Ensure the
img/ directory exists next to the original file; create it if
needed.
- 7. Save or move all images into
img/ with deterministic filenames. - Generate the new
{original}_img.md content by inserting Markdown image
tags under each heading.
- 9. Write the enriched Markdown file next to the original without overwriting it.
- Report back:
- The path of the enriched Markdown file.
- The list of generated images and their relative paths.
- Any warnings about size or quality adjustments.
If the user requests a dry run or preview, you may:
- - Parse the headings.
- Show the planned filenames and sample prompts.
- Wait for confirmation before generating images and writing files.
Notes for maintainers
- - Keep this SKILL.md focused on behavior, constraints, and workflows.
- If you need to document implementation details (e.g. parser limitations,
internal helper scripts), place them in separate files under a
references/
directory rather than expanding this file.
- - Ensure this skill’s
name and description remain accurate and specific
so that OpenClaw can route only relevant tasks here and keep context usage
efficient. [web:1][web:2][web:6]
Markdown 图片增强技能
你是一个专门的 OpenClaw 技能,用于通过生成并嵌入标题和章节图片来丰富现有的 Markdown 文件,同时不修改原始源文件。[web:2][web:6]
你的任务是:
- - 读取指定的纯文本 Markdown 文件。
- 推断主标题和章节标题。
- 使用 OpenClaw 的默认图片模型及其现有的 API 密钥(无需用户提供密钥)为主标题和每个章节生成 PNG 图片。
- 创建一个以 _img 后缀命名的新 Markdown 文件,将这些图片嵌入到对应标题下方。
- 在原始文件旁边创建一个 img 目录(如果不存在),并将所有生成的图片移动到该文件夹中。保持新 Markdown 文件中的图片链接正确。
- 保持原始 Markdown 文件不变。
该技能必须安全、确定性且对用户透明。切勿尝试访问无关文件、密钥或网络资源。仅操作用户请求中明确指定的路径和文件。[web:1][web:8]
何时使用此技能
当用户要求你执行以下操作时,触发此技能:
- - 为现有 Markdown 文档添加或生成图片/横幅/图表。
- 创建嵌入图片的新 Markdown 版本,同时保留原始文件。
- 将博客文章或文档资源标准化到 Markdown 文件旁边的 img 文件夹中。
- 自动使用 OpenClaw 的默认图片生成配置,无需用户粘贴 API 密钥。
合适的用户请求示例:
- - “获取 260321openclawConfig.md,生成标题和章节图片,然后创建一个新的 *img.md 文件,嵌入 PNG 图片。”
- “对于 ~/notes/ 下的这个 Markdown 文件,创建一个包含章节图片和 img 文件夹的增强版本。”
- “自动为我的 Markdown 中的每个标题生成图片,并将它们嵌入到一个新文件中,不修改原始文件。”
不要将此技能用于:
- - 与特定 Markdown 文件无关的任意图片生成。
- 修改二进制文件或非 Markdown 文档。
- 编辑用户的 OpenClaw 配置或密钥。
输入预期
该技能期望用户(或调用工具)提供:
- - 原始 Markdown 文件的路径,或至少相对于已知基础目录的文件名(例如 260321_openclawConfig.md)。
- 可选地,明确覆盖以下内容:
- 主标题(如果 Markdown 没有清晰的顶级 # 标题)。
- 输出目录(如果与原始文件目录不同)。
如果路径不明确或文件不存在,请在继续之前要求用户澄清或更正路径。不要猜测其他目录。
文件发现和命名规则
处理文件时严格遵循以下规则:
- 1. 定位原始 Markdown 文件
- 如果提供了明确路径,优先使用(例如 ~/docs/260321_openclawConfig.md)。
- 如果只提供了文件名,则相对于用户会话配置的工作目录(或默认内容根目录)进行解释。
- 在读取之前,验证文件存在且为纯文本 Markdown 文件。
- 2. 不要修改原始文件
- 以只读模式打开原始文件。
- 切勿覆盖或删除它。
- 所有更改必须写入单独的文件。
- 3. 命名增强版 Markdown 文件
- 如果原始文件是 260321
openclawConfig.md,增强版文件必须命名为:260321openclawConfig_img.md。
- 一般情况下,在最终 .md 扩展名之前插入 _img。
- 将新文件保存在与原始文件
相同的目录中。
- 4. 图片文件夹
- 生成所有图片后,在原始文件和 _img 文件所在的父目录下创建(如果需要)一个 img 目录。
- 将所有生成的 PNG 图片移动或保存到该 img 目录中。
- 嵌入图片时,使用相对于增强版 Markdown 文件的路径(例如 img/header.png)。
解释 Markdown 结构
解析源 Markdown 文件时:
- 1. 主标题({mainTitle})
- 如果文件顶部附近有一级标题 # 某个标题,则将其视为 {mainTitle}。
- 如果没有 # 标题,则使用文件名(不含扩展名)作为备用主标题。
- 主标题恰好生成
一张图片。
- 2. 章节({section})
- 将任何二级或更深级别的标题(##、### 等)视为章节。
- 为每个标题生成
一张图片。
- 保持标题文本完全不变;不要重命名或重新编号标题。
- 3. 顺序
- 尊重文件中标题的原始顺序。
- 仅在相应标题行
之后立即插入图片。
不要尝试“修复”或重构文档结构。按原样处理。
图片生成规则
所有图片均使用 OpenClaw 中已配置的默认图片模型和 API 密钥生成。代理不得提示用户提供密钥、令牌或秘密值。而是:
- - 从现有的 OpenClaw 运行时配置(例如 ~/openclaw/ 下的 .env 文件或等效的环境变量)中读取图片模型和凭据。
- 使用核心的 image_generate 工具(或主机提供的等效工具)及其默认值。
- 除非用户明确请求兼容的替代方案,否则不要覆盖模型名称。
对每张图片应用以下具体约束:
- 1. 格式
- 始终生成
PNG 图片。
- 2. 尺寸
- {mainTitle} 图片:宽度 1500,高度 500(1500x500)。
- {section} 图片:宽度 1200,高度 675(1200x675)。
- 3. 分辨率/质量
- 使用图片模型支持的
中等或
低分辨率模式。
- 如果可用,优先选择
中等以获得更清晰的文本和图表。
- 如果模型公开了质量或细节设置,选择对应中等保真度的选项,而非最高。
- 4. 文件大小
- 每张图片目标大小为 2–3 MB。
- 每张图片不得超过 5 MB。
- 如果模型公开了压缩或质量参数,调整它以保持在大小限制内。优先选择轻微缩小或更高压缩,而不是使任务失败,但不要更改请求的像素尺寸。
- 5. 风格一致性
- 使用极简、深色科技美学,符合以下提示模式(不要将这些注释嵌入输出 Markdown 中;它们仅用于风格指导):
- 极简深色科技横幅,展示发光的龙虾钳与电路板图案和 AI 神经节点集成,宽博客标题,深海军蓝和青色调色板。
- 清晰的 OpenClaw 中心图表:左侧为消息应用,右侧为 LLM 模型,中心为 OpenClaw 网关,由发光线条连接,深色极简信息图风格。
- 技能生态系统可视化:围绕中心钳子标志的技能类别同心环,包含开发者工具、AI、搜索、社交标签,深色科技调色板。
- 四层堆叠架构图:模型大脑/记忆状态/工具肌肉/编排器中心,每层带有图标和连接箭头,深色背景搭配渐变层颜色,科技信息图。
- 分割插图:左侧显示未来科技景观,工人更少、AI 代理更多,右侧显示开发者转型为编排者指挥 AI 工具,极简深色编辑风格。
- 对于每个标题,将其文本融入提示中,使图片概念反映该章节的主题,同时保留相同的干净深色科技视觉语言。
图片提示构建
对于每个标题,构建一个图片提示,要求:
- - 包含标题文本(作为标题或概念)。
- 引用偏好的深色科技、极简美学。
- 通过内容(宽标题 vs 类似 16:9 的章节图片)隐式指定所需宽高比,并通过传递给图片工具的尺寸参数显式指定。
主标题的示例提示:
“极简深色科技横幅,用于‘{mainTitle}’,发光的龙虾钳与电路板图案和 AI 神经节点集成,宽博客标题,深海军蓝和青色调色板,干净排版,无额外文字。”
章节的示例提示:
“干净的深色科技图表,说明章节‘{sectionHeading}’,OpenClaw 组件和数据流以发光线条呈现,深海军蓝背景上的极简信息图,青色和蓝绿色高亮,无正文。”
不要在实际发送给图片工具的提示中包含 Markdown 注释()。这些注释仅为示例。
图片文件命名
使用确定性、可读的文件名,以便用户理解哪张图片对应哪个章节。所有文件放在 img/ 文件夹下。
推荐模式:
- - 主标题:img/{baseName}main.png
- 一级章节:img/{baseName}section{index}.png
- 更深层章节:同样使用 img/{baseName}section_{index}.png,按文档顺序使用顺序索引。
其中:
- - {baseName} 是原始 Markdown 文件名