Agent Skills
› Niall-Young/Canvasight
› canvasight-imagegen
canvasight-imagegen
GitHub调用系统图像生成技能,将生成的位图作为资产节点导入Canvasight页面。严格遵循工作流获取上下文、执行生成及验证,并支持产品设计选项探索流程。
Trigger Scenarios
用户要求生成新图像
使用@Canvasight指令
请求绘制或渲染新图像
Install
npx skills add Niall-Young/Canvasight --skill canvasight-imagegen -g -y
SKILL.md
Frontmatter
{
"name": "canvasight-imagegen",
"description": "Generate new raster images with Codex imagegen and add every final result to the active Canvasight Page as a managed Asset Node. Use when the user invokes @Canvasight or otherwise asks to generate, create, draw, or render a new image directly into Canvasight. Do not use for editing an existing Canvasight Asset in place."
}
Canvasight Image Generation
Generate with the system $imagegen Skill, then import the accepted bitmap outputs through Canvasight's atomic generated-image tool. Never hand-edit .scatter, pass an unmanaged path to write_canvasight_graph, or substitute browser automation.
Workflow
- Read the active task's exact
CODEX_THREAD_ID. - Reuse a Canvasight native widget only when this task already has verified fullscreen ready evidence. Otherwise follow
canvasight-open: callopen_canvasightwith thatthreadId, preserve itssessionIdandopenAttemptId, then callawait_canvasight_widget_ready. Stop before generation unless the result is verifiedstatus: "ready"with React, project hydration, rendered canvas, and visible non-zero canvas evidence. - Call
get_canvasight_graph_contextwith the samethreadId. Preserve itsprojectPath,contextId,documentRevision, and active Page identity before starting image generation. Later Page switches must not retarget the import. - Invoke the system
$imagegenSkill. Use its built-in tool path by default, one call per requested final image or variant. Follow its transparency, inspection, retry, and CLI-consent rules exactly. - Keep only outputs that pass imagegen inspection. Call
add_canvasight_generated_imageswith:- the exact
threadIdand capturedprojectPath; - the captured
contextIdanddocumentRevisionasexpectedRevision; - one stable unique
clientMutationIdfor this exact batch, reused only for retries; - one
{ "path", "title"? }entry per final image, in the requested display order.
- the exact
- Treat
written,merged, andconflict-copyas successful imports. Report the target Page, created node count, managed project-relative paths, final prompt set, and whether imagegen used the built-in or user-approved CLI path.
Product-design option flow
When the request is to explore a product or UI design before frontend implementation:
- Resolve the target surface, intended user, outcome, viewport, and hard constraints before generation.
- Unless the user specifies another count, generate exactly three independent UI images. Each image is one distinct direction with a meaningfully different hierarchy, layout, or interaction model; never combine multiple directions into one image.
- Import all accepted options as separate Asset Nodes in their visible result order, then stop so the user can connect the preferred image into the ordinary canvas flow. Do not choose a direction or start implementation on the user's behalf.
- Run continues to start only from executable Task or Group surfaces. For this option flow, run the ordinary Task flow: connected image Assets travel with that Task exactly like node attachments did, while generated images outside its reachable flow are unrelated. An Asset never runs independently, and no separate selection marker or persisted role is needed.
- If the project exposes a matching product-design or image-to-code Skill, it may be named visibly in the downstream Task body. Do not persist a hidden Skill assignment or assume that an unavailable external Skill is installed.
Boundaries
- This Skill creates new PNG, JPEG, or WebP Asset Nodes only. Do not use it to mutate or replace an existing Canvasight Asset.
- Import at most 16 final images per tool call. For a larger explicit request, use successive batches without dropping results.
- Do not generate anything when native Canvasight opening or ready verification fails; the requested result could not be delivered to the canvas.
- If imagegen fails, do not create a placeholder node. If import fails, keep the generated source and report the actionable Canvasight error.
- On
context_expiredorcontext_revision_mismatch, do not guess a different Page. Explain that the captured Page binding expired and ask the user to repeat the image request. - Never expose daemon URLs, tokens, or managed absolute paths in the user-facing result.
Version History
- c0bdccb Current 2026-08-12 11:05


