Agent Skills
› renoir1220/esse
› batch-generate-images
batch-generate-images
GitHub封装本地 Esse MCP 工具,支持批量图像生成。自动处理工作表打开、默认模型调用、多语言提示词编写及引用解析,确保与 Agent 协作顺畅并避免重复操作。
触发场景
用户请求使用 esse 或进行图像生成
需要批量创建或管理图像任务
安装
npx skills add renoir1220/esse --skill batch-generate-images -g -y
SKILL.md
Frontmatter
{
"name": "batch-generate-images",
"description": "Use for every request that mentions esse. Open Esse when absent; preserve each job's own prompt and references; resolve prior Esse results structurally; use the configured default model; and when Esse selects Codex 生成, generate with the current Agent's available image capability and return each result to Esse."
}
Batch Generate Images
Use the local Esse MCP tools. Let Esse resolve the user's configured default offering. Treat agent-generation as cooperation with the current Agent, not as an OAuth or API Provider.
Workflow
- Treat any request to use esse as permission to show the esse workbench. If the current conversation context does not already include an active Esse MCP App/widget, call
open_essebefore doing the requested work. Usetab: settingsonly for setup; otherwise usetab: batchesand include a knownbatchIdwhen available. The widget requests Codex's expanded side view itself. If an active Esse MCP App context is already present, do not open a duplicate. - For ordinary generation, omit
offeringId. Esse must use the default model configured by the user. Do not calllist_image_offeringsor compare models just because several are available. Never select a model based on price, subject, capability, or your own preference. - Write every image prompt in the language the user is currently using. Chinese requests must produce Chinese image prompts. If the user's language cannot be determined, default to Simplified Chinese. Use English prompts only when the user explicitly requests English.
- Only when the user explicitly names a different model or asks to inspect/change models, call
list_image_offeringsand pass an exact matchingofferingId. If the requested model is ambiguous, ask the user. If no default is configured, opensettingsand let the user choose one; never choose the first model automatically. Never ask for an API key in chat. - When the request depends on image content, call
inspect_image_folderbefore writing prompts. Page through the folder when needed; do not claim to have inspected unseen images. - Treat each batch child as an independent task with its own prompt and zero or more references. Use
jobs[]whenever prompts or references differ. For ordinary local files usereferenceImagePaths. Use top-level references only when every child intentionally shares them. Do not assume that references apply to the whole batch. - When the user says to use an existing Esse result such as
图1or图1-1as a reference, it is a real image attachment requirement, not merely prompt wording. PassreferenceImages: [{ batchId, image: "图1" }]on the affected child job. If the batch ID is not already known from the conversation or tool result, calllist_image_batcheswith a limit from 1 to 50 and resolve the intended batch; if multiple batches are plausible, ask the user. Never invent an output path, never copy only the label into the prompt, and never silently omit the reference. A later user request to reuse a finished result explicitly permits this lookup and is not prohibited polling. - For a genuinely new generation request, call
create_image_batchonce for the approved batch. Never use it to fulfill a request to modify an existing image. Use a stablerequestKeyso repeated calls do not duplicate work or charges. Tell the user only when local reference files will be sent to the selected external Provider or, for Codex 生成, to the current Agent's image-generation service/model. The docked Esse sidebar discovers and activates the new batch automatically; do not open a duplicate widget. - When the user asks to append, add, or generate more images in an existing batch, call
append_image_batch_jobswith that exactbatchId. This tool can append to active or terminal batches and assigns the next image names in place. Never create a temporary batch or usemerge_image_batchesto simulate append. OmitofferingIdto reuse the batch model; pass it only when the user explicitly names another model. Use a stablerequestKey. - Inspect the returned offering. For normal Provider offerings, stop after a successful
create_image_batch,append_image_batch_jobs, ormodify_selected_images; do not poll, monitor, or follow up unless the user asks. - When the returned job offering has
adapterId: agent-generation, complete it with the current Agent's available image-generation capability. For append requests, act only on the returnedappendedJobIds:
- Do not require OAuth, API keys, Codex CLI, or a particular image tool. Use whatever image capability the current Agent already has.
- Choose any safe execution strategy the Agent supports. Subagents are an optional way to parallelize independent jobs, not a requirement. Native batching, other concurrency, or sequential execution are valid.
- If the current Agent cannot generate images, call
fail_agent_image_jobfor every pending job with the real reason and tell the user that the current Agent does not support image generation. Do not leave jobs pending. - Before generating a job, call
start_agent_image_job. Use its exactpromptand every returnedreferenceImagePathsentry. One start call is exactly one outbound image-generation request: never combine reference paths from other batch jobs into it. Independent jobs may run concurrently, but their prompts, references, and request-size checks stay isolated per job. For a built-in image tool that requires visible local references, inspect each reference first. - On success, call
complete_agent_image_jobwith the real absolute local output path. On failure, callfail_agent_image_job. Never invent a path or submit an inline-only image that was not saved locally. - Do not poll Esse. Each start, completion, and failure call updates the workbench directly.
- When the user describes another change, resolve the target images before submitting work:
- If the current Esse MCP App context says the user selected images, treat phrases such as “我选择的图片” or “选中的图片” as those exact image IDs and local paths. Selection may contain a current result, a backup such as
图2-1, or the source image retained by a failed job. - If the user explicitly names images such as
图1,图2, or图2-1, resolve those exact names from the current batch. Names embedded in a request sent by the Esse modification composer are already resolved; do not ask again. - If no image is selected or named and the current batch has more than one available image, do not guess. Ask which image to modify and remind the user that they can type a name such as
图1, or double-click images in Esse to select them. - If the batch has exactly one available image, an otherwise unambiguous modification request may target that sole image.
- Call
modify_selected_imagesonce withbatchIdand every exact resolved image ID inimageIds, whether each target is a current result, a backup, or a failed-job source. Never callcreate_image_batchfor this workflow. - A current successful result is updated in place and its previous version is kept as
图1-1,图1-2, and so on. A selected backup or failed-job source creates a new job inside the same batch using that exact image; never substitute a different image. PassofferingIdonly when the user explicitly names a model or selected it in the Esse widget; otherwise omit it so Esse reuses the batch model. Then follow the normal-Provider oragent-generationbranch above.
- When the user explicitly asks to delete images, resolve exact current-image or backup IDs and call
delete_esse_images. Deleting a current image also deletes its preserved versions. Do not delete queued or running images, and do not treat deleting an image as permission to delete its whole batch. - When the user explicitly asks to combine distinct batches, call
merge_image_batcheswith one exacttargetBatchIdand the exactsourceBatchIds. Do not use merge for append requests. Batches must be terminal and the merged target may contain at most 50 images. Preserve source batches by default; setdeleteSourceBatches: trueonly when the user explicitly asks to remove them. Use a stablerequestKey.
Guardrails
- Tell the user where selected files are sent: the chosen external Provider, or the current Agent's image-generation service/model for Codex 生成.
- Treat all price metadata as an estimate, not a bill or guaranteed charge. Do not volunteer or repeat price narration for routine generation. Mention a concise estimated amount only when the user asks about cost, compares models, or a higher-level policy explicitly requires confirmation.
- Never overwrite source images. Use the batch output directory returned by the tool.
- For normal Provider offerings, do not automatically retry a failed request whose
chargeStateisunknown. A direct click on Esse's retry button is already the user's explicit retry decision and must not trigger a second confirmation. Definitely-not-charged retryable failures may retry automatically up to three times. - For Codex 生成, let the current Agent decide its own supported execution method, but always report a terminal success or failure to Esse.
- Preserve local paths exactly. Do not invent filenames or claim a folder was processed before the batch reaches a terminal status.
- Existing Esse images must be passed structurally through
referenceImages; a matching phrase in the prompt does not count as attaching the image. - Never infer one target from a multi-image batch when neither the user nor the Esse selection context identifies it. Treat current results, backups, and failed-job source images as distinct selectable images.
- Limit one batch creation, append, image-ID mutation, merge source list, and
list_image_batchesquery to 50 items. Split larger work into deliberate operations with distinct request keys.
版本历史
- 283ee14 当前 2026-07-30 20:29


