360 Secure SkillHub
360 安全技能中心

Main Image Editor

该 Skill 是“主图修改”编排层:把截图与中文指令解析为结构化编辑任务,转换为 psd-automator 任务 JSON,串行执行并采用 rollback_all 策略,任一失败即从备份恢复所有已改动 PSD;复用 psd-automator 的导出与打包输出,支持 dry-run、force 与置信度阈值。

dhrxy
dhrxy
热度 55.49
最近更新 2026-05-11 17:32:16
分类:创作依赖:代码执行 / 读写文件应用场景:图像生成 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add main-image-editor
Metadata
name
main-image-editor
description
Orchestrate screenshot + Chinese instruction into PSD batch edits with transaction rollback by reusing psd-automator.
command-dispatch
tool
command-tool
main_image_editor
command-arg-mode
raw
metadata
{"openclaw":{"userInvocable":true,"commandDispatch":"tool","commandTool":"main_image_editor","commandArgMode":"raw"}}

main-image-editor

Orchestration layer for "main image modification" workflows:

  1. Parse screenshot + Chinese instruction into structured edit tasks.
  2. Convert tasks into psd-automator task JSON.
  3. Execute serially with transaction rollback (rollback all on any failure).
  4. Reuse psd-automator export + bundle output.

Usage

node skills/main-image-editor/scripts/run-main-image-editor.js \
  --request skills/main-image-editor/examples/request.sample.json \
  --index ~/.openclaw/psd-index.json

Dry-run or force execute:

node skills/main-image-editor/scripts/run-main-image-editor.js \
  --request skills/main-image-editor/examples/request.sample.json \
  --dry-run
node skills/main-image-editor/scripts/run-main-image-editor.js \
  --request skills/main-image-editor/examples/request.sample.json \
  --force

Request payload

request JSON supports:

  • text: Chinese requirement text
  • screenshotPath: screenshot path (used for match + audit)
  • confidenceThreshold: optional (default 0.8)
  • tasks: optional pre-parsed tasks (skip regex parsing when provided)
  • execution: optional runtime controls (indexPath, dryRun, force)

When fileHint is missing, parser will try to extract .psd/.psb filename from:

  1. request text
  2. OCR text from screenshotPath (local tesseract command or macOS Vision OCR fallback)

Failure policy

  • Default policy is rollback_all.
  • Any single PSD failure restores all touched PSD files from transaction backups.
  • Temporary outputs generated in the failed run are cleaned up before returning.