| name | cowart-image-edit |
| description | Generate new AI images from user-supplied Cowart annotation screenshots. Use when the user provides one or more screenshots showing Cowart images marked with the 批注 tool, arrows, or visible edit notes and wants Codex to apply those requested changes, create revised bitmap images sized to the original, and place each result beside the corresponding original or in a nearby clear area without replacing, moving, hiding, or deleting the original images or annotations. |
Cowart Image Edit
Use this skill to turn user-provided Cowart 批注 screenshots into revised AI-generated bitmaps placed next to the corresponding original images.
Preconditions
The Cowart service should be running for the active project, usually at:
http://127.0.0.1:43217
The user is responsible for providing the relevant screenshot(s). Do not auto-capture the current canvas and do not scan the whole canvas to infer edit requests; a canvas may contain many images with different annotations.
Workflow
-
Read the user-provided screenshot(s).
Treat each screenshot as the authoritative edit brief for one output image unless the user says multiple screenshots belong to the same image.
If the user provides multiple screenshots, process them independently and keep their generated outputs separate. Do not merge annotations across screenshots unless explicitly requested.
-
Extract the edit requirements from each screenshot.
Read visible 批注 labels, arrows, and nearby edit notes from the screenshot itself. Use the arrow tip or marked region to understand where each note applies.
Ignore editor chrome such as toolbars, blue selection outlines, resize handles, cursor icons, and unrelated neighboring images.
-
Choose the source image for generation.
Use the clean underlying image content visible in the provided screenshot as the visual base whenever possible.
If the screenshot is too cropped, obstructed, or low-resolution to serve as a good image base, ask the user for the original image export or a cleaner screenshot of that specific image.
Do not read the current Cowart canvas to discover edit intent. Use the screenshot for the requested changes. Cowart state may be read later only to place the generated result without covering existing content.
-
Build the generation prompt.
The prompt should:
- apply the 批注 text as edit instructions
- preserve the original image's subject, composition, aspect ratio, and style unless an annotation asks otherwise
- remove all annotation artifacts from the output, including red arrows, labels, blue selection outlines, handles, and tool UI
- output only the revised clean image
-
Generate and place the revised image beside the original.
Preferred: use the Cowart MCP generate_cowart_image tool with a beside
placement and editSourceFromAnchor: true. With that flag it performs true
image-to-image: it sends the anchor's existing image to the /images/edits
endpoint so the result preserves the original's subject/composition and only
applies the annotated changes (it falls back to text-to-image if the anchor has
no local image or edits are unsupported). It sizes to the anchor's aspect ratio
(no cropping), saves into the page-local assets folder, and places the result
next to the anchor without touching the original image or its annotations.
Anchor on the original image (not the AI 图片 frame) whenever possible, so
the source image is available for the edit.
{
"prompt": "<revised-image instructions from the annotations, with all annotation artifacts removed>",
"projectDir": "/absolute/path/to/user/codex-project",
"cowartUrl": "http://127.0.0.1:43217",
"anchorShapeId": "<original generated image id; prefer the image over the frame>",
"placement": "right",
"margin": 40,
"editSourceFromAnchor": true,
"altText": "Revised image generated from Cowart annotation screenshot",
"shapeMeta"
-
Verify visually.
Refresh the Cowart tab or let Vite hot-reload, then confirm:
- the original image is still in the same place
- the original 批注 arrows and labels are still visible
- the new revised image appears beside the original
- the new image does not include annotation arrows, labels, selections, or UI chrome
Guardrails
- Never replace the original image unless the user explicitly asks for replacement.
- Never delete or move annotation shapes; they are the visible edit brief.
- Never put the revised image inside the original
AI 图片 frame, because that can cover the old image and make the before/after comparison harder.
- Never auto-capture or scan the current canvas for edit intent; use the screenshot(s) supplied by the user.
- Never crop, pad, or resize the generated bitmap locally to force a fit; the tool already matches the anchor ratio.
- If the annotations contradict each other, generate the most literal combined interpretation and mention the ambiguity.
- If a supplied screenshot shows selected-state outlines or toolbar UI, treat them as context only, not as content to generate.