generate-image
GitHub用于生成演示文稿和文档所需的图片、插图及背景。需先配置插件,通过识别用途、编写提示词并调用 image_generate 工具生成图像,最后插入文档并确保风格一致与路径复用。
Trigger Scenarios
Install
npx skills add dataelement/dsh-desktop --skill generate-image -g -y
SKILL.md
Frontmatter
{
"name": "generate-image",
"description": "Generate reusable photos, illustrations and backgrounds for presentations, documents and other image requests."
}
Do not call image_generate until the user has saved an image configuration in Settings → Plugins → Image generation. After that, use it whenever a task needs a generated raster visual. The tool selects the saved provider. Credentials remain on the host. Never ask for an API key in conversation.
- Identify the image's purpose and placement. For PPT/Word, inspect the relevant document or template first. Carry its palette, art direction and whitespace needs into
style_context, and reuse that style across the document. - Write a complete prompt: subject, composition, setting, lighting, palette and required details. Specify room for titles or captions where the document needs it. Keep readable document text as native text; use native editable objects for charts, tables, flowcharts and simple diagrams.
- Choose the target
aspect_ratioandpurpose. A 16:9 slide does not require a 16:9 image when the illustration occupies only part of the slide. The tool returns actual dimensions; use proportional scaling or an intentional crop, preserving the main subject. - Call
image_generateonce per needed visual using the saved provider configuration. A presentation or document may call it in parallel for multiple visuals. The Host applies workspace and deployment policy. The conversation displays the resulting PNG with click-to-enlarge preview. If an image-viewing tool is available, inspect the PNG before placing it; report visual findings only after viewing it. Correct specific visible defects if another generation is needed. Reuse an existing suitable image instead of generating duplicates. - Insert the returned
workspace_pathinto the PPT/Word workflow, then inspect the rendered document page. Keep visual assets linked to their purpose and reuse their paths across later edits. Return the document and any requested standalone image.
If the tool reports missing configuration, direct the user to Settings → Plugins → Image generation. Never request an API key in conversation or place one in a document, prompt, sandbox command or source file. Respect tool approval, cancellation and workspace policy. Surface provider errors accurately; use a placeholder only when the user accepts one. Configuration validation checks the connection without submitting an image generation job; successful generation is established by an actual generated image.
For a provider rejection, report the returned HTTP status, error code, parameter and request ID when present. A rejected adapter-owned parameter requires a plugin correction; preserve those diagnostics for the developer. Change a prompt or aspect ratio only when the reported cause points to that input. Describe account access or quota issues when the tool explicitly reports that category. The settings card validates automatically on Save.
Version History
- a23788a Current 2026-09-22 01:09


