{"id":"67d0f539-8066-40b3-862c-75579393ae33","entityType":"agent","slug":"clawhub-axelhu-codex-imggen","name":"Codex Imggen","canonicalUrl":"https://www.xpersona.co/agent/clawhub-axelhu-codex-imggen","canonicalPath":"/agent/clawhub-axelhu-codex-imggen","generatedAt":"2026-10-11T17:43:28.002Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T15:09:09.967Z","emptyReason":null},"description":"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。 Skill: Codex Imggen Owner: axelhu Summary: 通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。 Tags: latest:1.1.1 Version history: v1.1.1 | 2026-06-08T10:28:23.801Z | user 回退 1.1.0 的整体时长预估（5-10 分钟太保守，按 30-90 秒 + 180s timeout 即可）。文档加一条'完成后看一眼图'的轻量提示。 v1.0.7 | 2026-06-08T10:26:06.790Z | user 回退 1.1.0 的整体时长预估（实测 5-10 分","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s172yaxxd2drm0sc92554g9aq983hegj:codex-imggen","sourceUrl":"https://clawhub.ai/axelhu/codex-imggen","homepage":"https://clawhub.ai/axelhu/skills/codex-imggen","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/axelhu/codex-imggen","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/axelhu/skills/codex-imggen","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。 Skill"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T15:09:09.967Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T15:09:09.967Z","emptyReason":null},"stars":null,"forks":null,"downloads":1043,"packageName":null,"latestVersion":"1.1.1","tractionLabel":"1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T15:09:09.952Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T15:09:09.967Z","lastCrawledAt":"2026-10-11T15:09:09.952Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T15:09:09.952Z","lastVerifiedAt":null,"highlights":[{"version":"1.1.1","createdAt":"2026-06-08T10:28:23.801Z","changelog":"回退 1.1.0 的整体时长预估（5-10 分钟太保守，按 30-90 秒 + 180s timeout 即可）。文档加一条'完成后看一眼图'的轻量提示。","fileCount":6,"zipByteSize":8517},{"version":"1.0.7","createdAt":"2026-06-08T10:26:06.790Z","changelog":"回退 1.1.0 的整体时长预估（实测 5-10 分钟太长了），保留 30-90 秒单次 + timeout ≥ 180s。文档加一条'完成后看一眼图'的轻量提示。","fileCount":6,"zipByteSize":8408},{"version":"1.1.0","createdAt":"2026-06-08T09:47:19.112Z","changelog":"新增「特殊情况与故障模式」小节：真实总时长 5-10 分钟（timeout 建议 ≥ 600s），网络异常时 Codex 内部会重试；CLI 报错不可信，有视觉能力的话实际看一眼生成的图。","fileCount":6,"zipByteSize":8641},{"version":"1.0.6","createdAt":"2026-05-24T01:37:01.975Z","changelog":"超时建议从120秒改为180秒","fileCount":6,"zipByteSize":8130},{"version":"1.0.5","createdAt":"2026-05-24T00:56:41.406Z","changelog":"补充 Codex CLI 超时说明（≥120秒）","fileCount":5,"zipByteSize":7041},{"version":"1.0.4","createdAt":"2026-05-23T16:38:24.365Z","changelog":"修复 -i 参数数组展开导致 codex 找不到的问题，实测通过","fileCount":5,"zipByteSize":6933},{"version":"1.0.3","createdAt":"2026-05-23T11:10:11.974Z","changelog":"新增 -i 参考图参数，三个脚本均支持","fileCount":5,"zipByteSize":6992},{"version":"1.0.2","createdAt":"2026-05-22T08:57:10.490Z","changelog":"界面文字中文化","fileCount":5,"zipByteSize":6388}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s172yaxxd2drm0sc92554g9aq983hegj:codex-imggen","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-axelhu-codex-imggen/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-axelhu-codex-imggen/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-axelhu-codex-imggen/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-axelhu-codex-imggen/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-axelhu-codex-imggen/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-axelhu-codex-imggen/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T17:43:28.000Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-axelhu-codex-imggen/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-axelhu-codex-imggen/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-axelhu-codex-imggen/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-axelhu-codex-imggen/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T15:09:09.967Z","emptyReason":null},"readme":"Skill: Codex Imggen\n\nOwner: axelhu\n\nSummary: 通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。\n\nTags: latest:1.1.1\n\nVersion history:\n\nv1.1.1 | 2026-06-08T10:28:23.801Z | user\n\n回退 1.1.0 的整体时长预估（5-10 分钟太保守，按 30-90 秒 + 180s timeout 即可）。文档加一条'完成后看一眼图'的轻量提示。\n\nv1.0.7 | 2026-06-08T10:26:06.790Z | user\n\n回退 1.1.0 的整体时长预估（实测 5-10 分钟太长了），保留 30-90 秒单次 + timeout ≥ 180s。文档加一条'完成后看一眼图'的轻量提示。\n\nv1.1.0 | 2026-06-08T09:47:19.112Z | user\n\n新增「特殊情况与故障模式」小节：真实总时长 5-10 分钟（timeout 建议 ≥ 600s），网络异常时 Codex 内部会重试；CLI 报错不可信，有视觉能力的话实际看一眼生成的图。\n\nv1.0.6 | 2026-05-24T01:37:01.975Z | user\n\n超时建议从120秒改为180秒\n\nv1.0.5 | 2026-05-24T00:56:41.406Z | user\n\n补充 Codex CLI 超时说明（≥120秒）\n\nv1.0.4 | 2026-05-23T16:38:24.365Z | user\n\n修复 -i 参数数组展开导致 codex 找不到的问题，实测通过\n\nv1.0.3 | 2026-05-23T11:10:11.974Z | user\n\n新增 -i 参考图参数，三个脚本均支持\n\nv1.0.2 | 2026-05-22T08:57:10.490Z | user\n\n界面文字中文化\n\nv1.0.1 | 2026-05-22T08:19:10.992Z | user\n\nproxy 默认值回退 + version 字段\n\nv1.0.0 | 2026-05-22T08:07:30.928Z | auto\n\ncodex-imggen 1.0.0\n\n- Initial release of Codex CLI-based image generation with batch and size control.\n- Provides single image, batch asset, and size-specific generation scripts.\n- Documents output dimension limits (max ~1.57MP) and guides for reliable UI/game asset sizes.\n- Batch mode creates grid images for easy sprite/icon extraction.\n- All generated images are saved to ~/.codex/generated_images/.\n- Proxy settings auto-detected from environment for easy network configuration.\n\nArchive index:\n\nArchive v1.1.1: 6 files, 8517 bytes\n\nFiles: _meta.json (131b), scripts/batch_generate.sh (1944b), scripts/gen_size.sh (2681b), scripts/generate.sh (1100b), skill-card.md (2415b), SKILL.md (8178b)\n\nFile v1.1.1:SKILL.md\n\n---\nname: codex-imggen\nversion: 1.1.1\ndescription: \"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex 图片生成\n\n> ⚠️ **美术必读 — 尺寸限制**：Codex CLI 最大输出约 1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n>\n> ⏱️ **超时注意**：Codex CLI 生图耗时较长（约 30~90 秒），调用时 timeout 应设不低于 **180 秒**，避免 agent 误判为失败而中断重试。\n\n## 注意事项\n\n> **完成后看一眼生成的图对不对**：Codex CLI 报错信息不一定准——报“failed N times with a server error”不一定真没生成。Agent 有视觉能力就调一下 image 工具看一眼生成的图是否对需求；没生成或内容不对，重试即可。\n\n## 尺寸限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## 快速参考\n\n| 任务 | 命令 |\n|------|------|\n| 单张图片 | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir] [-i <ref_image>]` |\n| 指定尺寸 | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir] [-i <ref_image>]` |\n| 批量游戏 UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir] [-i <ref_image>]` |\n\n## 尺寸 Key（gen_size.sh）\n\n| Key | 实际输出 | 比例 | MP | 精确度 |\n|-----|---------|------|-----|--------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K（差 <3%） |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K（面积差 -22%） |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ 2K 最佳匹配 |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ 无法达到 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ 竖版 |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ 完全精确 |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ 等同 2K |\n\n> **可选参数 `-i <ref_image>`**：传入参考图路径，Codex 会将参考图作为生成上下文，适用于风格迁移、色调匹配等场景。不传此参数则走默认行为。\n\n## 生成图片\n\n### 单张图片\n```bash\n# 无参考图\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n\n# 带参考图（风格迁移）\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background, flat vector art style\" \\\n  /tmp/my-images \\\n  -i /path/to/reference.png\n```\n\n### 指定尺寸\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### 批量游戏 UI 素材（2026-05-21 实测）\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons\n```\n\n批量生成会输出包含所有元素的一张合并大图（通常为 2x3 或 3x2 网格）。详见下方已验证的 Prompt 示例。\n\n## 批量 Prompt 示例（2026-05-21 实测）\n\n所有批量输出均为一张合并大图；使用 ImageMagick 或 batch_split.sh 裁剪拆分。\n\n### RPG Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects.\n```\n\n### Cyberpunk（3x2 网格，1024×1536）\n```\nGenerate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects.\n```\n\n### Pixel Art 道具（2x3 网格，1536×1024）\n```\nGenerate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style.\n```\n\n### Flat Minimal Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 flat minimalist game UI icons in a 3x2 grid (2 columns, 3 rows). Each icon approximately 256x256 pixels in combined image. Icons: (1) play button (triangle), (2) pause button (two bars), (3) settings cogwheel, (4) home button (house shape), (5) sound on (speaker with waves), (6) sound off (speaker with X). Style: ultra flat, solid colors, no outlines, modern mobile game aesthetic. Colors: flat blue (#4a90d9), flat white, flat gray on white background.\n```\n\n## 拆分批量输出\n\n> ⚠️ **Layout 注意**：\n> - 1024×1536 图片 → 2列 × 3行 → **3x2** layout（每格约 512×512）\n> - 1536×1024 图片 → 3列 × 2行 → **2x3** layout（每格约 512×341）\n\n```bash\n# ✅ 推荐：用 batch_split.py（背景透明 + 网格拆分 + alpha 抠图一气呵成）\npython3 ~/.openclaw/skills/sprite-tools/scripts/batch_split.sh \\\n  /tmp/batch.png 3x2 /tmp/icons/\n\n# layout 格式：rows x cols，第一个数是行数（纵向），第二个数是列数（横向）\n```\n\n## 尺寸精确度指南\n\n**可靠（可直接使用）：**\n- `1K` / `1:1` / `square` → 1254×1254\n- `2048x1080` → 1727×911（2K 最佳匹配）\n- `1536x1024` → 1536×1024（完全精确！）\n- `2K` / `16:9` / `FHD` → 1672×941\n- `9:16` → 941×1672\n- `4:3` → 1448×1086\n\n**不可靠（避免使用）：**\n- `4K` / `3840x2160` → 上限 1672×941（面积损失 95%）\n- 直接请求像素尺寸如 `1920x1080` → 降级至 1672×941\n- 小尺寸如 `512x512` → 膨胀至 1254×1254（大幅放大）\n\n**需要精确尺寸**：用语义描述生成，再用 `ffmpeg` 或 PIL 裁剪/缩放至目标尺寸。\n\n## 输出位置\n\n所有图片保存至 `~/.codex/generated_images/<session-id>/`。脚本会自动复制最新一张到指定输出目录；未指定目录时可在该目录查找。\n\n## 代理\n\n代理（`http://127.0.0.1:1080`）默认启用。如代理地址不同，修改各脚本顶部的 `PROXY` 变量。\n\n## 架构说明\n\n```\nCodex CLI → Plus 订阅 → ~1.57MP 固定输出 bucket\n                                    (8 个 bucket：1:1, 16:9, 3:2, 4:3, 9:16, ~17:9)\n\n需要 >1.57MP 分辨率：使用官方 gpt-image-2 API（planned as separate skill）\n```\n\nFile v1.1.1:_meta.json\n\n{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.1.1\",\n  \"publishedAt\": 1780914503801\n}\n\nFile v1.1.1:skill-card.md\n\n## Description:\n\nGenerates images through Codex CLI with size controls, optional reference images, and batch game UI asset prompts.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[axelhu](https://clawhub.ai/user/axelhu)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and content creators use this skill to generate single images, targeted size or aspect-ratio images, and batch game UI image sheets through Codex CLI. It is useful when an agent needs repeatable shell-command guidance for image generation and copying PNG outputs to a requested directory.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Prompts and optional reference images may be sent outside the local machine through Codex CLI.\n\nMitigation: Use only approved Codex accounts, proxy settings, sandboxes, and data-handling policies; avoid confidential prompts, private artwork, internal screenshots, regulated data, and sensitive local image files unless approved.\n\nRisk: The copy step can select the newest shared Codex generated-image directory rather than a guaranteed current-session result.\n\nMitigation: Run the skill in a restricted, disposable workspace and visually verify the copied output before using or publishing it.\n\nRisk: Requested pixel dimensions may not be exact because the documented Codex CLI image output is constrained to about 1.57 megapixels.\n\nMitigation: Use the documented safe size keys when possible, and post-process with an image tool when exact final dimensions are required.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/axelhu/skills/codex-imggen)\n- [ClawHub publisher profile](https://clawhub.ai/user/axelhu)\n\n## Skill Output:\n\n**Output Type(s):** [Shell commands, Files, Guidance]\n\n**Output Format:** [Markdown guidance with bash commands and generated PNG image files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs are copied from ~/.codex/generated_images/ to the requested output directory; batch mode writes a combined PNG image.]\n\n## Skill Version(s):\n\n1.1.1 (source: SKILL.md frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.7: 6 files, 8408 bytes\n\nFiles: _meta.json (131b), scripts/batch_generate.sh (1944b), scripts/gen_size.sh (2681b), scripts/generate.sh (1100b), skill-card.md (2335b), SKILL.md (8178b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: codex-imggen\nversion: 1.0.7\ndescription: \"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex 图片生成\n\n> ⚠️ **美术必读 — 尺寸限制**：Codex CLI 最大输出约 1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n>\n> ⏱️ **超时注意**：Codex CLI 生图耗时较长（约 30~90 秒），调用时 timeout 应设不低于 **180 秒**，避免 agent 误判为失败而中断重试。\n\n## 注意事项\n\n> **完成后看一眼生成的图对不对**：Codex CLI 报错信息不一定准——报“failed N times with a server error”不一定真没生成。Agent 有视觉能力就调一下 image 工具看一眼生成的图是否对需求；没生成或内容不对，重试即可。\n\n## 尺寸限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## 快速参考\n\n| 任务 | 命令 |\n|------|------|\n| 单张图片 | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir] [-i <ref_image>]` |\n| 指定尺寸 | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir] [-i <ref_image>]` |\n| 批量游戏 UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir] [-i <ref_image>]` |\n\n## 尺寸 Key（gen_size.sh）\n\n| Key | 实际输出 | 比例 | MP | 精确度 |\n|-----|---------|------|-----|--------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K（差 <3%） |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K（面积差 -22%） |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ 2K 最佳匹配 |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ 无法达到 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ 竖版 |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ 完全精确 |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ 等同 2K |\n\n> **可选参数 `-i <ref_image>`**：传入参考图路径，Codex 会将参考图作为生成上下文，适用于风格迁移、色调匹配等场景。不传此参数则走默认行为。\n\n## 生成图片\n\n### 单张图片\n```bash\n# 无参考图\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n\n# 带参考图（风格迁移）\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background, flat vector art style\" \\\n  /tmp/my-images \\\n  -i /path/to/reference.png\n```\n\n### 指定尺寸\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### 批量游戏 UI 素材（2026-05-21 实测）\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons\n```\n\n批量生成会输出包含所有元素的一张合并大图（通常为 2x3 或 3x2 网格）。详见下方已验证的 Prompt 示例。\n\n## 批量 Prompt 示例（2026-05-21 实测）\n\n所有批量输出均为一张合并大图；使用 ImageMagick 或 batch_split.sh 裁剪拆分。\n\n### RPG Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects.\n```\n\n### Cyberpunk（3x2 网格，1024×1536）\n```\nGenerate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects.\n```\n\n### Pixel Art 道具（2x3 网格，1536×1024）\n```\nGenerate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style.\n```\n\n### Flat Minimal Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 flat minimalist game UI icons in a 3x2 grid (2 columns, 3 rows). Each icon approximately 256x256 pixels in combined image. Icons: (1) play button (triangle), (2) pause button (two bars), (3) settings cogwheel, (4) home button (house shape), (5) sound on (speaker with waves), (6) sound off (speaker with X). Style: ultra flat, solid colors, no outlines, modern mobile game aesthetic. Colors: flat blue (#4a90d9), flat white, flat gray on white background.\n```\n\n## 拆分批量输出\n\n> ⚠️ **Layout 注意**：\n> - 1024×1536 图片 → 2列 × 3行 → **3x2** layout（每格约 512×512）\n> - 1536×1024 图片 → 3列 × 2行 → **2x3** layout（每格约 512×341）\n\n```bash\n# ✅ 推荐：用 batch_split.py（背景透明 + 网格拆分 + alpha 抠图一气呵成）\npython3 ~/.openclaw/skills/sprite-tools/scripts/batch_split.sh \\\n  /tmp/batch.png 3x2 /tmp/icons/\n\n# layout 格式：rows x cols，第一个数是行数（纵向），第二个数是列数（横向）\n```\n\n## 尺寸精确度指南\n\n**可靠（可直接使用）：**\n- `1K` / `1:1` / `square` → 1254×1254\n- `2048x1080` → 1727×911（2K 最佳匹配）\n- `1536x1024` → 1536×1024（完全精确！）\n- `2K` / `16:9` / `FHD` → 1672×941\n- `9:16` → 941×1672\n- `4:3` → 1448×1086\n\n**不可靠（避免使用）：**\n- `4K` / `3840x2160` → 上限 1672×941（面积损失 95%）\n- 直接请求像素尺寸如 `1920x1080` → 降级至 1672×941\n- 小尺寸如 `512x512` → 膨胀至 1254×1254（大幅放大）\n\n**需要精确尺寸**：用语义描述生成，再用 `ffmpeg` 或 PIL 裁剪/缩放至目标尺寸。\n\n## 输出位置\n\n所有图片保存至 `~/.codex/generated_images/<session-id>/`。脚本会自动复制最新一张到指定输出目录；未指定目录时可在该目录查找。\n\n## 代理\n\n代理（`http://127.0.0.1:1080`）默认启用。如代理地址不同，修改各脚本顶部的 `PROXY` 变量。\n\n## 架构说明\n\n```\nCodex CLI → Plus 订阅 → ~1.57MP 固定输出 bucket\n                                    (8 个 bucket：1:1, 16:9, 3:2, 4:3, 9:16, ~17:9)\n\n需要 >1.57MP 分辨率：使用官方 gpt-image-2 API（planned as separate skill）\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1780914366790\n}\n\nFile v1.0.7:skill-card.md\n\n## Description: <br>\nCodex Imggen helps agents generate images through the local Codex CLI, including single-image generation, size-guided generation, and batch game UI asset generation. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[axelhu](https://clawhub.ai/user/axelhu) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agents use this skill to create image assets from prompts or reference images using Codex CLI scripts. It is especially suited for quick single-image outputs, controlled aspect-ratio attempts, and combined game UI asset sheets. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Prompts and optional reference images may be processed by Codex and the configured local proxy. <br>\nMitigation: Review prompts and reference images before running the scripts, and avoid sending sensitive or restricted content. <br>\nRisk: Generated image placement depends on files copied from ~/.codex/generated_images. <br>\nMitigation: Check the requested output directory and visually inspect the generated image before using it. <br>\nRisk: Requested image dimensions may not be produced exactly because the skill documents Codex CLI output size limits. <br>\nMitigation: Use the documented safe size keys where possible, and crop or resize generated images with a dedicated image tool when exact dimensions are required. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/axelhu/codex-imggen) <br>\n- [Publisher profile](https://clawhub.ai/user/axelhu) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Files, Shell commands, Guidance] <br>\n**Output Format:** [PNG image files, terminal status text, and Markdown usage guidance] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Generated images are copied from ~/.codex/generated_images to the requested output directory when available.] <br>\n\n## Skill Version(s): <br>\n1.0.7 (source: frontmatter and server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.1.0: 6 files, 8641 bytes\n\nFiles: _meta.json (131b), scripts/batch_generate.sh (1944b), scripts/gen_size.sh (2681b), scripts/generate.sh (1100b), skill-card.md (2309b), SKILL.md (8675b)\n\nFile v1.1.0:SKILL.md\n\n---\nname: codex-imggen\nversion: 1.1.0\ndescription: \"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex 图片生成\n\n> ⚠️ **美术必读 — 尺寸限制**：Codex CLI 最大输出约 1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n>\n> ⏱️ **超时注意**：Codex CLI 生图耗时较长（约 30~90 秒），调用时 timeout 应设不低于 **180 秒**，避免 agent 误判为失败而中断重试。\n\n## 特殊情况与故障模式\n\n> 上面的“超时注意”只讲了**正常生图**的耗时。实际使用中 Plus image service 会间歇性 server error、Codex CLI 报错信息不可信，下面是踩过的坑。\n\n**1. 整体时长估计（不是单次调用）**：30–90 秒是**单次** image tool 调用的预期耗时。真实总时长（包含 Codex 重写 prompt、调用 image tool、网络异常重试）通常是 **5–10 分钟**。Agent 调用时 timeout 建议 **≥ 600 秒**，180 秒不够——会误杀还在重试中的调用。\n\n**2. 实际看一眼生成素材对不对**：Codex CLI 报错信息**不可信**——报“failed N times with a server error”不一定真没生成。Agent 有视觉能力就调一下 image 工具看一眼生成的图是否对需求。\n\n## 尺寸限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## 快速参考\n\n| 任务 | 命令 |\n|------|------|\n| 单张图片 | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir] [-i <ref_image>]` |\n| 指定尺寸 | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir] [-i <ref_image>]` |\n| 批量游戏 UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir] [-i <ref_image>]` |\n\n## 尺寸 Key（gen_size.sh）\n\n| Key | 实际输出 | 比例 | MP | 精确度 |\n|-----|---------|------|-----|--------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K（差 <3%） |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K（面积差 -22%） |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ 2K 最佳匹配 |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ 无法达到 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ 竖版 |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ 完全精确 |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ 等同 2K |\n\n> **可选参数 `-i <ref_image>`**：传入参考图路径，Codex 会将参考图作为生成上下文，适用于风格迁移、色调匹配等场景。不传此参数则走默认行为。\n\n## 生成图片\n\n### 单张图片\n```bash\n# 无参考图\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n\n# 带参考图（风格迁移）\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background, flat vector art style\" \\\n  /tmp/my-images \\\n  -i /path/to/reference.png\n```\n\n### 指定尺寸\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### 批量游戏 UI 素材（2026-05-21 实测）\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons\n```\n\n批量生成会输出包含所有元素的一张合并大图（通常为 2x3 或 3x2 网格）。详见下方已验证的 Prompt 示例。\n\n## 批量 Prompt 示例（2026-05-21 实测）\n\n所有批量输出均为一张合并大图；使用 ImageMagick 或 batch_split.sh 裁剪拆分。\n\n### RPG Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects.\n```\n\n### Cyberpunk（3x2 网格，1024×1536）\n```\nGenerate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects.\n```\n\n### Pixel Art 道具（2x3 网格，1536×1024）\n```\nGenerate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style.\n```\n\n### Flat Minimal Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 flat minimalist game UI icons in a 3x2 grid (2 columns, 3 rows). Each icon approximately 256x256 pixels in combined image. Icons: (1) play button (triangle), (2) pause button (two bars), (3) settings cogwheel, (4) home button (house shape), (5) sound on (speaker with waves), (6) sound off (speaker with X). Style: ultra flat, solid colors, no outlines, modern mobile game aesthetic. Colors: flat blue (#4a90d9), flat white, flat gray on white background.\n```\n\n## 拆分批量输出\n\n> ⚠️ **Layout 注意**：\n> - 1024×1536 图片 → 2列 × 3行 → **3x2** layout（每格约 512×512）\n> - 1536×1024 图片 → 3列 × 2行 → **2x3** layout（每格约 512×341）\n\n```bash\n# ✅ 推荐：用 batch_split.py（背景透明 + 网格拆分 + alpha 抠图一气呵成）\npython3 ~/.openclaw/skills/sprite-tools/scripts/batch_split.sh \\\n  /tmp/batch.png 3x2 /tmp/icons/\n\n# layout 格式：rows x cols，第一个数是行数（纵向），第二个数是列数（横向）\n```\n\n## 尺寸精确度指南\n\n**可靠（可直接使用）：**\n- `1K` / `1:1` / `square` → 1254×1254\n- `2048x1080` → 1727×911（2K 最佳匹配）\n- `1536x1024` → 1536×1024（完全精确！）\n- `2K` / `16:9` / `FHD` → 1672×941\n- `9:16` → 941×1672\n- `4:3` → 1448×1086\n\n**不可靠（避免使用）：**\n- `4K` / `3840x2160` → 上限 1672×941（面积损失 95%）\n- 直接请求像素尺寸如 `1920x1080` → 降级至 1672×941\n- 小尺寸如 `512x512` → 膨胀至 1254×1254（大幅放大）\n\n**需要精确尺寸**：用语义描述生成，再用 `ffmpeg` 或 PIL 裁剪/缩放至目标尺寸。\n\n## 输出位置\n\n所有图片保存至 `~/.codex/generated_images/<session-id>/`。脚本会自动复制最新一张到指定输出目录；未指定目录时可在该目录查找。\n\n## 代理\n\n代理（`http://127.0.0.1:1080`）默认启用。如代理地址不同，修改各脚本顶部的 `PROXY` 变量。\n\n## 架构说明\n\n```\nCodex CLI → Plus 订阅 → ~1.57MP 固定输出 bucket\n                                    (8 个 bucket：1:1, 16:9, 3:2, 4:3, 9:16, ~17:9)\n\n需要 >1.57MP 分辨率：使用官方 gpt-image-2 API（planned as separate skill）\n```\n\nFile v1.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.1.0\",\n  \"publishedAt\": 1780912039112\n}\n\nFile v1.1.0:skill-card.md\n\n## Description: <br>\nCodex Imggen helps agents generate images through the Codex CLI, with helpers for single images, size or aspect-ratio requests, reference-image generation, and batch game UI assets. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[axelhu](https://clawhub.ai/user/axelhu) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agents use this skill to generate visual assets with Codex CLI, including single images, size-guided images, and batch game UI assets. It is intended for workflows where the user can review generated images and manage local output files. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Prompts and chosen reference images may leave the machine through Codex CLI and the configured proxy. <br>\nMitigation: Do not provide confidential screenshots, personal documents, proprietary artwork, credentials, or regulated data unless allowed by the user's organization data policy. <br>\nRisk: Generated images are stored under ~/.codex/generated_images and copied to the selected output directory. <br>\nMitigation: Review generated images before use and clean or manage output directories according to local retention requirements. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/axelhu/codex-imggen) <br>\n- [Publisher profile](https://clawhub.ai/user/axelhu) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [shell commands, guidance, files] <br>\n**Output Format:** [Markdown guidance with bash command examples and generated PNG image files copied to the chosen output directory.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Requires the codex binary; supports optional reference-image input and size keys; generated images are stored under ~/.codex/generated_images and may be copied to a user-selected output directory.] <br>\n\n## Skill Version(s): <br>\n1.1.0 (source: frontmatter and server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.6: 6 files, 8130 bytes\n\nFiles: _meta.json (131b), scripts/batch_generate.sh (1944b), scripts/gen_size.sh (2681b), scripts/generate.sh (1100b), skill-card.md (1950b), SKILL.md (7877b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: codex-imggen\nversion: 1.0.0\ndescription: \"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex 图片生成\n\n> ⚠️ **美术必读 — 尺寸限制**：Codex CLI 最大输出约 1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n>\n> ⏱️ **超时注意**：Codex CLI 生图耗时较长（约 30~90 秒），调用时 timeout 应设不低于 **180 秒**，避免 agent 误判为失败而中断重试。\n\n## 尺寸限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## 快速参考\n\n| 任务 | 命令 |\n|------|------|\n| 单张图片 | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir] [-i <ref_image>]` |\n| 指定尺寸 | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir] [-i <ref_image>]` |\n| 批量游戏 UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir] [-i <ref_image>]` |\n\n## 尺寸 Key（gen_size.sh）\n\n| Key | 实际输出 | 比例 | MP | 精确度 |\n|-----|---------|------|-----|--------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K（差 <3%） |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K（面积差 -22%） |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ 2K 最佳匹配 |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ 无法达到 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ 竖版 |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ 完全精确 |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ 等同 2K |\n\n> **可选参数 `-i <ref_image>`**：传入参考图路径，Codex 会将参考图作为生成上下文，适用于风格迁移、色调匹配等场景。不传此参数则走默认行为。\n\n## 生成图片\n\n### 单张图片\n```bash\n# 无参考图\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n\n# 带参考图（风格迁移）\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background, flat vector art style\" \\\n  /tmp/my-images \\\n  -i /path/to/reference.png\n```\n\n### 指定尺寸\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### 批量游戏 UI 素材（2026-05-21 实测）\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons\n```\n\n批量生成会输出包含所有元素的一张合并大图（通常为 2x3 或 3x2 网格）。详见下方已验证的 Prompt 示例。\n\n## 批量 Prompt 示例（2026-05-21 实测）\n\n所有批量输出均为一张合并大图；使用 ImageMagick 或 batch_split.sh 裁剪拆分。\n\n### RPG Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects.\n```\n\n### Cyberpunk（3x2 网格，1024×1536）\n```\nGenerate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects.\n```\n\n### Pixel Art 道具（2x3 网格，1536×1024）\n```\nGenerate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style.\n```\n\n### Flat Minimal Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 flat minimalist game UI icons in a 3x2 grid (2 columns, 3 rows). Each icon approximately 256x256 pixels in combined image. Icons: (1) play button (triangle), (2) pause button (two bars), (3) settings cogwheel, (4) home button (house shape), (5) sound on (speaker with waves), (6) sound off (speaker with X). Style: ultra flat, solid colors, no outlines, modern mobile game aesthetic. Colors: flat blue (#4a90d9), flat white, flat gray on white background.\n```\n\n## 拆分批量输出\n\n> ⚠️ **Layout 注意**：\n> - 1024×1536 图片 → 2列 × 3行 → **3x2** layout（每格约 512×512）\n> - 1536×1024 图片 → 3列 × 2行 → **2x3** layout（每格约 512×341）\n\n```bash\n# ✅ 推荐：用 batch_split.py（背景透明 + 网格拆分 + alpha 抠图一气呵成）\npython3 ~/.openclaw/skills/sprite-tools/scripts/batch_split.sh \\\n  /tmp/batch.png 3x2 /tmp/icons/\n\n# layout 格式：rows x cols，第一个数是行数（纵向），第二个数是列数（横向）\n```\n\n## 尺寸精确度指南\n\n**可靠（可直接使用）：**\n- `1K` / `1:1` / `square` → 1254×1254\n- `2048x1080` → 1727×911（2K 最佳匹配）\n- `1536x1024` → 1536×1024（完全精确！）\n- `2K` / `16:9` / `FHD` → 1672×941\n- `9:16` → 941×1672\n- `4:3` → 1448×1086\n\n**不可靠（避免使用）：**\n- `4K` / `3840x2160` → 上限 1672×941（面积损失 95%）\n- 直接请求像素尺寸如 `1920x1080` → 降级至 1672×941\n- 小尺寸如 `512x512` → 膨胀至 1254×1254（大幅放大）\n\n**需要精确尺寸**：用语义描述生成，再用 `ffmpeg` 或 PIL 裁剪/缩放至目标尺寸。\n\n## 输出位置\n\n所有图片保存至 `~/.codex/generated_images/<session-id>/`。脚本会自动复制最新一张到指定输出目录；未指定目录时可在该目录查找。\n\n## 代理\n\n代理（`http://127.0.0.1:1080`）默认启用。如代理地址不同，修改各脚本顶部的 `PROXY` 变量。\n\n## 架构说明\n\n```\nCodex CLI → Plus 订阅 → ~1.57MP 固定输出 bucket\n                                    (8 个 bucket：1:1, 16:9, 3:2, 4:3, 9:16, ~17:9)\n\n需要 >1.57MP 分辨率：使用官方 gpt-image-2 API（planned as separate skill）\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1779586621975\n}\n\nFile v1.0.6:skill-card.md\n\n## Description: <br>\nGenerates images through Codex CLI with single-image, size-controlled, and batch game UI asset workflows. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[axelhu](https://clawhub.ai/user/axelhu) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, designers, and game UI creators use this skill to generate image assets from prompts through Codex CLI, including fixed-aspect outputs, batch UI elements, and optional reference-image guided generation. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Prompts and optional reference images may be processed outside the local machine through Codex and the configured proxy. <br>\nMitigation: Avoid sensitive prompts or private reference images unless that processing path is acceptable for the deployment. <br>\nRisk: Requested high-resolution or small fixed-size outputs may not match the requested pixel dimensions. <br>\nMitigation: Use the documented safe size keys and post-process with image tooling when exact dimensions are required. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/axelhu/codex-imggen) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Files, Shell commands, Configuration, Guidance] <br>\n**Output Format:** [Markdown guidance with bash commands; generated PNG files copied to the requested output directory] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Requires Codex CLI. Outputs are also stored under ~/.codex/generated_images/.] <br>\n\n## Skill Version(s): <br>\n1.0.6 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.5: 5 files, 7041 bytes\n\nFiles: _meta.json (131b), scripts/batch_generate.sh (1944b), scripts/gen_size.sh (2681b), scripts/generate.sh (1100b), SKILL.md (7877b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: codex-imggen\nversion: 1.0.0\ndescription: \"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex 图片生成\n\n> ⚠️ **美术必读 — 尺寸限制**：Codex CLI 最大输出约 1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n>\n> ⏱️ **超时注意**：Codex CLI 生图耗时较长（约 30~90 秒），调用时 timeout 应设不低于 **120 秒**，避免 agent 误判为失败而中断重试。\n\n## 尺寸限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## 快速参考\n\n| 任务 | 命令 |\n|------|------|\n| 单张图片 | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir] [-i <ref_image>]` |\n| 指定尺寸 | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir] [-i <ref_image>]` |\n| 批量游戏 UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir] [-i <ref_image>]` |\n\n## 尺寸 Key（gen_size.sh）\n\n| Key | 实际输出 | 比例 | MP | 精确度 |\n|-----|---------|------|-----|--------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K（差 <3%） |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K（面积差 -22%） |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ 2K 最佳匹配 |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ 无法达到 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ 竖版 |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ 完全精确 |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ 等同 2K |\n\n> **可选参数 `-i <ref_image>`**：传入参考图路径，Codex 会将参考图作为生成上下文，适用于风格迁移、色调匹配等场景。不传此参数则走默认行为。\n\n## 生成图片\n\n### 单张图片\n```bash\n# 无参考图\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n\n# 带参考图（风格迁移）\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background, flat vector art style\" \\\n  /tmp/my-images \\\n  -i /path/to/reference.png\n```\n\n### 指定尺寸\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### 批量游戏 UI 素材（2026-05-21 实测）\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons\n```\n\n批量生成会输出包含所有元素的一张合并大图（通常为 2x3 或 3x2 网格）。详见下方已验证的 Prompt 示例。\n\n## 批量 Prompt 示例（2026-05-21 实测）\n\n所有批量输出均为一张合并大图；使用 ImageMagick 或 batch_split.sh 裁剪拆分。\n\n### RPG Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects.\n```\n\n### Cyberpunk（3x2 网格，1024×1536）\n```\nGenerate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects.\n```\n\n### Pixel Art 道具（2x3 网格，1536×1024）\n```\nGenerate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style.\n```\n\n### Flat Minimal Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 flat minimalist game UI icons in a 3x2 grid (2 columns, 3 rows). Each icon approximately 256x256 pixels in combined image. Icons: (1) play button (triangle), (2) pause button (two bars), (3) settings cogwheel, (4) home button (house shape), (5) sound on (speaker with waves), (6) sound off (speaker with X). Style: ultra flat, solid colors, no outlines, modern mobile game aesthetic. Colors: flat blue (#4a90d9), flat white, flat gray on white background.\n```\n\n## 拆分批量输出\n\n> ⚠️ **Layout 注意**：\n> - 1024×1536 图片 → 2列 × 3行 → **3x2** layout（每格约 512×512）\n> - 1536×1024 图片 → 3列 × 2行 → **2x3** layout（每格约 512×341）\n\n```bash\n# ✅ 推荐：用 batch_split.py（背景透明 + 网格拆分 + alpha 抠图一气呵成）\npython3 ~/.openclaw/skills/sprite-tools/scripts/batch_split.sh \\\n  /tmp/batch.png 3x2 /tmp/icons/\n\n# layout 格式：rows x cols，第一个数是行数（纵向），第二个数是列数（横向）\n```\n\n## 尺寸精确度指南\n\n**可靠（可直接使用）：**\n- `1K` / `1:1` / `square` → 1254×1254\n- `2048x1080` → 1727×911（2K 最佳匹配）\n- `1536x1024` → 1536×1024（完全精确！）\n- `2K` / `16:9` / `FHD` → 1672×941\n- `9:16` → 941×1672\n- `4:3` → 1448×1086\n\n**不可靠（避免使用）：**\n- `4K` / `3840x2160` → 上限 1672×941（面积损失 95%）\n- 直接请求像素尺寸如 `1920x1080` → 降级至 1672×941\n- 小尺寸如 `512x512` → 膨胀至 1254×1254（大幅放大）\n\n**需要精确尺寸**：用语义描述生成，再用 `ffmpeg` 或 PIL 裁剪/缩放至目标尺寸。\n\n## 输出位置\n\n所有图片保存至 `~/.codex/generated_images/<session-id>/`。脚本会自动复制最新一张到指定输出目录；未指定目录时可在该目录查找。\n\n## 代理\n\n代理（`http://127.0.0.1:1080`）默认启用。如代理地址不同，修改各脚本顶部的 `PROXY` 变量。\n\n## 架构说明\n\n```\nCodex CLI → Plus 订阅 → ~1.57MP 固定输出 bucket\n                                    (8 个 bucket：1:1, 16:9, 3:2, 4:3, 9:16, ~17:9)\n\n需要 >1.57MP 分辨率：使用官方 gpt-image-2 API（planned as separate skill）\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1779584201406\n}\n\nArchive v1.0.4: 5 files, 6933 bytes\n\nFiles: _meta.json (131b), scripts/batch_generate.sh (1944b), scripts/gen_size.sh (2681b), scripts/generate.sh (1100b), SKILL.md (7702b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: codex-imggen\nversion: 1.0.0\ndescription: \"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex 图片生成\n\n> ⚠️ **美术必读 — 尺寸限制**：Codex CLI 最大输出约 1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n\n## 尺寸限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## 快速参考\n\n| 任务 | 命令 |\n|------|------|\n| 单张图片 | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir] [-i <ref_image>]` |\n| 指定尺寸 | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir] [-i <ref_image>]` |\n| 批量游戏 UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir] [-i <ref_image>]` |\n\n## 尺寸 Key（gen_size.sh）\n\n| Key | 实际输出 | 比例 | MP | 精确度 |\n|-----|---------|------|-----|--------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K（差 <3%） |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K（面积差 -22%） |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ 2K 最佳匹配 |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ 无法达到 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ 竖版 |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ 完全精确 |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ 等同 2K |\n\n> **可选参数 `-i <ref_image>`**：传入参考图路径，Codex 会将参考图作为生成上下文，适用于风格迁移、色调匹配等场景。不传此参数则走默认行为。\n\n## 生成图片\n\n### 单张图片\n```bash\n# 无参考图\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n\n# 带参考图（风格迁移）\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background, flat vector art style\" \\\n  /tmp/my-images \\\n  -i /path/to/reference.png\n```\n\n### 指定尺寸\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### 批量游戏 UI 素材（2026-05-21 实测）\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons\n```\n\n批量生成会输出包含所有元素的一张合并大图（通常为 2x3 或 3x2 网格）。详见下方已验证的 Prompt 示例。\n\n## 批量 Prompt 示例（2026-05-21 实测）\n\n所有批量输出均为一张合并大图；使用 ImageMagick 或 batch_split.sh 裁剪拆分。\n\n### RPG Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects.\n```\n\n### Cyberpunk（3x2 网格，1024×1536）\n```\nGenerate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects.\n```\n\n### Pixel Art 道具（2x3 网格，1536×1024）\n```\nGenerate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style.\n```\n\n### Flat Minimal Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 flat minimalist game UI icons in a 3x2 grid (2 columns, 3 rows). Each icon approximately 256x256 pixels in combined image. Icons: (1) play button (triangle), (2) pause button (two bars), (3) settings cogwheel, (4) home button (house shape), (5) sound on (speaker with waves), (6) sound off (speaker with X). Style: ultra flat, solid colors, no outlines, modern mobile game aesthetic. Colors: flat blue (#4a90d9), flat white, flat gray on white background.\n```\n\n## 拆分批量输出\n\n> ⚠️ **Layout 注意**：\n> - 1024×1536 图片 → 2列 × 3行 → **3x2** layout（每格约 512×512）\n> - 1536×1024 图片 → 3列 × 2行 → **2x3** layout（每格约 512×341）\n\n```bash\n# ✅ 推荐：用 batch_split.py（背景透明 + 网格拆分 + alpha 抠图一气呵成）\npython3 ~/.openclaw/skills/sprite-tools/scripts/batch_split.sh \\\n  /tmp/batch.png 3x2 /tmp/icons/\n\n# layout 格式：rows x cols，第一个数是行数（纵向），第二个数是列数（横向）\n```\n\n## 尺寸精确度指南\n\n**可靠（可直接使用）：**\n- `1K` / `1:1` / `square` → 1254×1254\n- `2048x1080` → 1727×911（2K 最佳匹配）\n- `1536x1024` → 1536×1024（完全精确！）\n- `2K` / `16:9` / `FHD` → 1672×941\n- `9:16` → 941×1672\n- `4:3` → 1448×1086\n\n**不可靠（避免使用）：**\n- `4K` / `3840x2160` → 上限 1672×941（面积损失 95%）\n- 直接请求像素尺寸如 `1920x1080` → 降级至 1672×941\n- 小尺寸如 `512x512` → 膨胀至 1254×1254（大幅放大）\n\n**需要精确尺寸**：用语义描述生成，再用 `ffmpeg` 或 PIL 裁剪/缩放至目标尺寸。\n\n## 输出位置\n\n所有图片保存至 `~/.codex/generated_images/<session-id>/`。脚本会自动复制最新一张到指定输出目录；未指定目录时可在该目录查找。\n\n## 代理\n\n代理（`http://127.0.0.1:1080`）默认启用。如代理地址不同，修改各脚本顶部的 `PROXY` 变量。\n\n## 架构说明\n\n```\nCodex CLI → Plus 订阅 → ~1.57MP 固定输出 bucket\n                                    (8 个 bucket：1:1, 16:9, 3:2, 4:3, 9:16, ~17:9)\n\n需要 >1.57MP 分辨率：使用官方 gpt-image-2 API（planned as separate skill）\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1779554304365\n}\n\nArchive v1.0.3: 5 files, 6992 bytes\n\nFiles: _meta.json (131b), scripts/batch_generate.sh (1940b), scripts/gen_size.sh (2677b), scripts/generate.sh (1118b), SKILL.md (7702b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: codex-imggen\nversion: 1.0.0\ndescription: \"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex 图片生成\n\n> ⚠️ **美术必读 — 尺寸限制**：Codex CLI 最大输出约 1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n\n## 尺寸限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## 快速参考\n\n| 任务 | 命令 |\n|------|------|\n| 单张图片 | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir] [-i <ref_image>]` |\n| 指定尺寸 | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir] [-i <ref_image>]` |\n| 批量游戏 UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir] [-i <ref_image>]` |\n\n## 尺寸 Key（gen_size.sh）\n\n| Key | 实际输出 | 比例 | MP | 精确度 |\n|-----|---------|------|-----|--------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K（差 <3%） |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K（面积差 -22%） |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ 2K 最佳匹配 |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ 无法达到 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ 竖版 |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ 完全精确 |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ 等同 2K |\n\n> **可选参数 `-i <ref_image>`**：传入参考图路径，Codex 会将参考图作为生成上下文，适用于风格迁移、色调匹配等场景。不传此参数则走默认行为。\n\n## 生成图片\n\n### 单张图片\n```bash\n# 无参考图\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n\n# 带参考图（风格迁移）\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background, flat vector art style\" \\\n  /tmp/my-images \\\n  -i /path/to/reference.png\n```\n\n### 指定尺寸\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### 批量游戏 UI 素材（2026-05-21 实测）\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons\n```\n\n批量生成会输出包含所有元素的一张合并大图（通常为 2x3 或 3x2 网格）。详见下方已验证的 Prompt 示例。\n\n## 批量 Prompt 示例（2026-05-21 实测）\n\n所有批量输出均为一张合并大图；使用 ImageMagick 或 batch_split.sh 裁剪拆分。\n\n### RPG Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects.\n```\n\n### Cyberpunk（3x2 网格，1024×1536）\n```\nGenerate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects.\n```\n\n### Pixel Art 道具（2x3 网格，1536×1024）\n```\nGenerate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style.\n```\n\n### Flat Minimal Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 flat minimalist game UI icons in a 3x2 grid (2 columns, 3 rows). Each icon approximately 256x256 pixels in combined image. Icons: (1) play button (triangle), (2) pause button (two bars), (3) settings cogwheel, (4) home button (house shape), (5) sound on (speaker with waves), (6) sound off (speaker with X). Style: ultra flat, solid colors, no outlines, modern mobile game aesthetic. Colors: flat blue (#4a90d9), flat white, flat gray on white background.\n```\n\n## 拆分批量输出\n\n> ⚠️ **Layout 注意**：\n> - 1024×1536 图片 → 2列 × 3行 → **3x2** layout（每格约 512×512）\n> - 1536×1024 图片 → 3列 × 2行 → **2x3** layout（每格约 512×341）\n\n```bash\n# ✅ 推荐：用 batch_split.py（背景透明 + 网格拆分 + alpha 抠图一气呵成）\npython3 ~/.openclaw/skills/sprite-tools/scripts/batch_split.sh \\\n  /tmp/batch.png 3x2 /tmp/icons/\n\n# layout 格式：rows x cols，第一个数是行数（纵向），第二个数是列数（横向）\n```\n\n## 尺寸精确度指南\n\n**可靠（可直接使用）：**\n- `1K` / `1:1` / `square` → 1254×1254\n- `2048x1080` → 1727×911（2K 最佳匹配）\n- `1536x1024` → 1536×1024（完全精确！）\n- `2K` / `16:9` / `FHD` → 1672×941\n- `9:16` → 941×1672\n- `4:3` → 1448×1086\n\n**不可靠（避免使用）：**\n- `4K` / `3840x2160` → 上限 1672×941（面积损失 95%）\n- 直接请求像素尺寸如 `1920x1080` → 降级至 1672×941\n- 小尺寸如 `512x512` → 膨胀至 1254×1254（大幅放大）\n\n**需要精确尺寸**：用语义描述生成，再用 `ffmpeg` 或 PIL 裁剪/缩放至目标尺寸。\n\n## 输出位置\n\n所有图片保存至 `~/.codex/generated_images/<session-id>/`。脚本会自动复制最新一张到指定输出目录；未指定目录时可在该目录查找。\n\n## 代理\n\n代理（`http://127.0.0.1:1080`）默认启用。如代理地址不同，修改各脚本顶部的 `PROXY` 变量。\n\n## 架构说明\n\n```\nCodex CLI → Plus 订阅 → ~1.57MP 固定输出 bucket\n                                    (8 个 bucket：1:1, 16:9, 3:2, 4:3, 9:16, ~17:9)\n\n需要 >1.57MP 分辨率：使用官方 gpt-image-2 API（planned as separate skill）\n```\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1779534611974\n}\n\nArchive v1.0.2: 5 files, 6388 bytes\n\nFiles: _meta.json (131b), scripts/batch_generate.sh (1491b), scripts/gen_size.sh (2228b), scripts/generate.sh (901b), SKILL.md (7440b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: codex-imggen\nversion: 1.0.0\ndescription: \"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex 图片生成\n\n> ⚠️ **美术必读 — 尺寸限制**：Codex CLI 最大输出约 1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n\n## 尺寸限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## 快速参考\n\n| 任务 | 命令 |\n|------|------|\n| 单张图片 | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir]` |\n| 指定尺寸 | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir]` |\n| 批量游戏 UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir]` |\n\n## 尺寸 Key（gen_size.sh）\n\n| Key | 实际输出 | 比例 | MP | 精确度 |\n|-----|---------|------|-----|--------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K（差 <3%） |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K（面积差 -22%） |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ 2K 最佳匹配 |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ 无法达到 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ 竖版 |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ 完全精确 |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ 等同 2K |\n\n> **核心约束**：Codex CLI 所有输出被强制限制在 ~1.57MP 以内。4K / FHD / 2K / 720p 等大尺寸标识均会被降级处理，只有 `1K`、`1536x1024`、`9:16`、`4:3` 能保持原始比例不缩放。\n\n## 生成图片\n\n### 单张图片\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n```\n\n### 指定尺寸\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### 批量游戏 UI 素材（2026-05-21 实测）\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons\n```\n\n批量生成会输出包含所有元素的一张合并大图（通常为 2x3 或 3x2 网格）。详见下方已验证的 Prompt 示例。\n\n## 批量 Prompt 示例（2026-05-21 实测）\n\n所有批量输出均为一张合并大图；使用 ImageMagick 或 batch_split.sh 裁剪拆分。\n\n### RPG Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects.\n```\n\n### Cyberpunk（3x2 网格，1024×1536）\n```\nGenerate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects.\n```\n\n### Pixel Art 道具（2x3 网格，1536×1024）\n```\nGenerate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style.\n```\n\n### Flat Minimal Icons（3x2 网格，1024×1536）\n```\nGenerate a set of 6 flat minimalist game UI icons in a 3x2 grid (2 columns, 3 rows). Each icon approximately 256x256 pixels in combined image. Icons: (1) play button (triangle), (2) pause button (two bars), (3) settings cogwheel, (4) home button (house shape), (5) sound on (speaker with waves), (6) sound off (speaker with X). Style: ultra flat, solid colors, no outlines, modern mobile game aesthetic. Colors: flat blue (#4a90d9), flat white, flat gray on white background.\n```\n\n## 拆分批量输出\n\n> ⚠️ **Layout 注意**：\n> - 1024×1536 图片 → 2列 × 3行 → **3x2** layout（每格约 512×512）\n> - 1536×1024 图片 → 3列 × 2行 → **2x3** layout（每格约 512×341）\n\n```bash\n# ✅ 推荐：用 batch_split.py（背景透明 + 网格拆分 + alpha 抠图一气呵成）\npython3 ~/.openclaw/skills/sprite-tools/scripts/batch_split.sh \\\n  /tmp/batch.png 3x2 /tmp/icons/\n\n# layout 格式：rows x cols，第一个数是行数（纵向），第二个数是列数（横向）\n```\n\n## 尺寸精确度指南\n\n**可靠（可直接使用）：**\n- `1K` / `1:1` / `square` → 1254×1254\n- `2048x1080` → 1727×911（2K 最佳匹配）\n- `1536x1024` → 1536×1024（完全精确！）\n- `2K` / `16:9` / `FHD` → 1672×941\n- `9:16` → 941×1672\n- `4:3` → 1448×1086\n\n**不可靠（避免使用）：**\n- `4K` / `3840x2160` → 上限 1672×941（面积损失 95%）\n- 直接请求像素尺寸如 `1920x1080` → 降级至 1672×941\n- 小尺寸如 `512x512` → 膨胀至 1254×1254（大幅放大）\n\n**需要精确尺寸**：用语义描述生成，再用 `ffmpeg` 或 PIL 裁剪/缩放至目标尺寸。\n\n## 输出位置\n\n所有图片保存至 `~/.codex/generated_images/<session-id>/`。脚本会自动复制最新一张到指定输出目录；未指定目录时可在该目录查找。\n\n## 代理\n\n代理（`http://127.0.0.1:1080`）默认启用。如代理地址不同，修改各脚本顶部的 `PROXY` 变量。\n\n## 架构说明\n\n```\nCodex CLI → Plus 订阅 → ~1.57MP 固定输出 bucket\n                                    (8 个 bucket：1:1, 16:9, 3:2, 4:3, 9:16, ~17:9)\n\n需要 >1.57MP 分辨率：使用官方 gpt-image-2 API（planned as separate skill）\n```\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1779440230490\n}\n\nArchive v1.0.1: 5 files, 6323 bytes\n\nFiles: _meta.json (131b), scripts/batch_generate.sh (1491b), scripts/gen_size.sh (2228b), scripts/generate.sh (901b), SKILL.md (7267b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: codex-imggen\nversion: 1.0.0\ndescription: \"Generate images via Codex CLI with size control and batch support. Requires: codex (npm). Proxy auto-enabled. Use generate.sh for single images, batch_generate.sh for game UI assets, gen_size.sh for specific dimensions. All output goes to ~/.codex/generated_images/.\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex Image Generation\n\n> ⚠️ **美术必读 — Size 限制**：Codex CLI 最大输出 ~1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n\n## Size 限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 ~HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Single image | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir]` |\n| Size-controlled | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir]` |\n| Batch game UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir]` |\n\n## Size Keys (gen_size.sh)\n\n| Key | Actual Output | Aspect | MP | Accuracy |\n|-----|--------------|--------|-----|---------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K (diff <3%) |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K (diff -22% area) |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ Best 2K match |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ Cannot reach 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ Portrait |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ Exact |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ Same as 2K |\n\n> **核心约束**：Codex CLI 所有输出被强制限制在 ~1.57MP 以内。4K / FHD / 2K / 720p 等大尺寸标识均会被降级处理，只有 `1K`、`1536x1024`、`9:16`、`4:3` 能保持原始比例不缩放。\n\n## Generating Images\n\n### Single image\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n```\n\n### With size control\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### Batch game UI assets (proven 2026-05-21)\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons\n```\n\nThis generates one combined image with all items in a grid (usually 2x3). See Batch Examples below for tested prompts.\n\n## Batch Examples (tested 2026-05-21)\n\nAll outputs are single combined images; use ImageMagick to cut apart.\n\n### RPG Icons (3x2 grid, 1024×1536)\n```\nGenerate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects.\n```\n\n### Cyberpunk (3x2 grid, 1024×1536)\n```\nGenerate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects.\n```\n\n### Pixel Art Items (2x3 grid, 1536×1024)\n```\nGenerate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style.\n```\n\n### Flat Minimal Icons (3x2 grid, 1024×1536)\n```\nGenerate a set of 6 flat minimalist game UI icons in a 3x2 grid (2 columns, 3 rows). Each icon approximately 256x256 pixels in combined image. Icons: (1) play button (triangle), (2) pause button (two bars), (3) settings cogwheel, (4) home button (house shape), (5) sound on (speaker with waves), (6) sound off (speaker with X). Style: ultra flat, solid colors, no outlines, modern mobile game aesthetic. Colors: flat blue (#4a90d9), flat white, flat gray on white background.\n```\n\n## Cutting Apart Batch Output\n\n> ⚠️ **Layout 注意**：\n> - 1024×1536 图片 → 2列 × 3行 → **3x2** layout（每格 512×512）\n> - 1536×1024 图片 → 3列 × 2行 → **2x3** layout（每格 512×341）\n\n```bash\n# ✅ 推荐：用 batch_split.py（背景透明 + 网格拆分 + alpha 抠图一气呵成）\npython3 ~/.openclaw/skills/sprite-tools/scripts/batch_split.sh \\\n  /tmp/batch.png 3x2 /tmp/icons/\n\n# layout 格式：rows x cols，第一个数是行数（纵向），第二个数是列数（横向）\n```\n\n## Size Accuracy Guide\n\n**Reliable:**\n- `1K` / `1:1` / `square` → 1254×1254\n- `2048x1080` → 1727×911 (best 2K match)\n- `1536x1024` → 1536×1024 (exact!)\n- `2K` / `16:9` / `FHD` → 1672×941\n- `9:16` → 941×1672\n- `4:3` → 1448×1086\n\n**Unreliable** (avoid):\n- `4K` / `3840x2160` → capped at 1672×941 (95% area loss)\n- Direct pixel requests like `1920x1080` → degrades to 1672×941\n- Small sizes like `512x512` → 1254×1254 (huge inflation)\n\n**For precise sizes**: generate with semantic description, then post-process with `ffmpeg` or PIL to crop/resize.\n\n## Output Location\n\nAll images saved to `~/.codex/generated_images/<session-id>/`. Scripts copy latest to your output dir. Check there if no output dir specified.\n\n## Proxy\n\nProxy (`http://127.0.0.1:1080`) auto-enabled. Change `PROXY` variable at top of each script if your proxy differs.\n\n## Architecture\n\n```\nCodex CLI → Plus subscription → ~1.57MP fixed output bucket\n                                    (8 buckets: 1:1, 16:9, 3:2, 4:3, 9:16, ~17:9)\n\nFor >1.57MP: use official gpt-image-2 API (separate skill planned)\n```\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1779437950992\n}\n\nArchive v1.0.0: 5 files, 6330 bytes\n\nFiles: _meta.json (131b), scripts/batch_generate.sh (1557b), scripts/gen_size.sh (2294b), scripts/generate.sh (967b), SKILL.md (7335b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: codex-imggen\ndescription: \"Generate images via Codex CLI with size control and batch support. Requires: codex (npm). Proxy auto-enabled. Use generate.sh for single images, batch_generate.sh for game UI assets, gen_size.sh for specific dimensions. All output goes to ~/.codex/generated_images/.\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex Image Generation\n\n> ⚠️ **美术必读 — Size 限制**：Codex CLI 最大输出 ~1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n\n## Size 限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 ~HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Single image | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir]` |\n| Size-controlled | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir]` |\n| Batch game UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir]` |\n\n## Size Keys (gen_size.sh)\n\n| Key | Actual Output | Aspect | MP | Accuracy |\n|-----|--------------|--------|-----|---------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K (diff <3%) |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K (diff -22% area) |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ Best 2K match |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ Cannot reach 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ Portrait |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ Exact |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ Same as 2K |\n\n> **核心约束**：Codex CLI 所有输出被强制限制在 ~1.57MP 以内。4K / FHD / 2K / 720p 等大尺寸标识均会被降级处理，只有 `1K`、`1536x1024`、`9:16`、`4:3` 能保持原始比例不缩放。\n\n## Generating Images\n\n### Single image\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n```\n\n### With size control\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### Batch game UI assets (proven 2026-05-21)\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons\n```\n\nThis generates one combined image with all items in a grid (usually 2x3). See Batch Examples below for tested prompts.\n\n## Batch Examples (tested 2026-05-21)\n\nAll outputs are single combined images; use ImageMagick to cut apart.\n\n### RPG Icons (3x2 grid, 1024×1536)\n```\nGenerate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects.\n```\n\n### Cyberpunk (3x2 grid, 1024×1536)\n```\nGenerate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects.\n```\n\n### Pixel Art Items (2x3 grid, 1536×1024)\n```\nGenerate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style.\n```\n\n### Flat Minimal Icons (3x2 grid, 1024×1536)\n```\nGenerate a set of 6 flat minimalist game UI icons in a 3x2 grid (2 columns, 3 rows). Each icon approximately 256x256 pixels in combined image. Icons: (1) play button (triangle), (2) pause button (two bars), (3) settings cogwheel, (4) home button (house shape), (5) sound on (speaker with waves), (6) sound off (speaker with X). Style: ultra flat, solid colors, no outlines, modern mobile game aesthetic. Colors: flat blue (#4a90d9), flat white, flat gray on white background.\n```\n\n## Cutting Apart Batch Output\n\n> ⚠️ **Layout 注意**：\n> - 1024×1536 图片 → 2列 × 3行 → **3x2** layout（每格 512×512）\n> - 1536×1024 图片 → 3列 × 2行 → **2x3** layout（每格 512×341）\n\n```bash\n# ✅ 推荐：用 batch_split.py（背景透明 + 网格拆分 + alpha 抠图一气呵成）\npython3 ~/.openclaw/skills/sprite-tools/scripts/batch_split.sh \\\n  /tmp/batch.png 3x2 /tmp/icons/\n\n# layout 格式：rows x cols，第一个数是行数（纵向），第二个数是列数（横向）\n```\n\n## Size Accuracy Guide\n\n**Reliable:**\n- `1K` / `1:1` / `square` → 1254×1254\n- `2048x1080` → 1727×911 (best 2K match)\n- `1536x1024` → 1536×1024 (exact!)\n- `2K` / `16:9` / `FHD` → 1672×941\n- `9:16` → 941×1672\n- `4:3` → 1448×1086\n\n**Unreliable** (avoid):\n- `4K` / `3840x2160` → capped at 1672×941 (95% area loss)\n- Direct pixel requests like `1920x1080` → degrades to 1672×941\n- Small sizes like `512x512` → 1254×1254 (huge inflation)\n\n**For precise sizes**: generate with semantic description, then post-process with `ffmpeg` or PIL to crop/resize.\n\n## Output Location\n\nAll images saved to `~/.codex/generated_images/<session-id>/`. Scripts copy latest to your output dir. Check there if no output dir specified.\n\n## Proxy\n\nProxy auto-enabled via `http_proxy`/`https_proxy` env vars (set in shell or pass `http_proxy=http://your:proxy script.sh`). No hardcoded proxy; falls back to your shell's env if PROXY var is unset.\n\n## Architecture\n\n```\nCodex CLI → Plus subscription → ~1.57MP fixed output bucket\n                                    (8 buckets: 1:1, 16:9, 3:2, 4:3, 9:16, ~17:9)\n\nFor >1.57MP: use official gpt-image-2 API (separate skill planned)\n```\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1779437250928\n}","readmeExcerpt":"Skill: Codex Imggen Owner: axelhu Summary: 通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。 Tags: latest:1.1.1 Version history: v1.1.1 | 2026-06-08T10:28:23.801Z | user 回退 1.1.0 的整体时长预估（5-10 分钟太保守，按 30-90 秒 + 180s timeout 即可）。文档加一条'完成后看一眼图'的轻量提示。 v1.0.7 | 2026-06-08T10:26:06.790Z | user 回退 1.1.0 的整体时长预估（实测 5-10 分","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# 无参考图\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n\n# 带参考图（风格迁移）\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background, flat vector art style\" \\\n  /tmp/my-images \\\n  -i /path/to/reference.png"},{"language":"bash","snippet":"bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images"},{"language":"bash","snippet":"bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px gold (#d4af37) border, same lighting angle, centered subjects\" \\\n  6 \\\n  /tmp/my-icons"},{"language":"text","snippet":"Generate a set of 6 RPG game UI icons in a 3x2 grid (2 columns, 3 rows), all in the same flat vector art style with a white background (#ffffff). Each icon approximately 256x256 pixels in combined image. Icons: (1) sword with golden blade, (2) shield with silver surface and red cross, (3) red health potion bottle, (4) purple crystal gem, (5) golden 5-pointed star, (6) red heart. All icons share consistent 2px gold (#d4af37) border, consistent padding, same lighting angle, centered subjects."},{"language":"text","snippet":"Generate a set of 6 cyberpunk game UI elements in a 3x2 grid (2 columns, 3 rows), all in the same neon glow cyberpunk style. Each element approximately 256x256 pixels in combined image. Elements: (1) circuit board chip icon, (2) glowing cyan hexagon, (3) neon sword, (4) holographic shield, (5) power battery with lightning bolt, (6) digital eye/sensor. White background, neon colors (cyan #00ffff, magenta #ff00ff, yellow #ffff00), glow effects."},{"language":"text","snippet":"Generate a set of 6 pixel art game items in a 2x3 grid (3 columns, 2 rows), authentic retro pixel style. Each item approximately 256x256 pixels in combined image. Items: (1) red potion, (2) green herb/plant, (3) blue mana crystal, (4) golden coin, (5) brown wooden chest, (6) white feather. White background, pixel perfect, 16-bit era style."}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: codex-imggen\nversion: 1.1.1\ndescription: \"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。\"\nmetadata: {\"openclaw\":{\"emoji\":\"🎨\",\"requires\":{\"anyBins\":[\"codex\"]}}}\n---\n\n# Codex 图片生成\n\n> ⚠️ **美术必读 — 尺寸限制**：Codex CLI 最大输出约 1.57MP（1254×1254 级别），所有尺寸都会被卡在这个上限内。**4K/FHD/2K 都会降级**，不会真的输出那些尺寸。详见下方安全尺寸表。\n>\n> ⏱️ **超时注意**：Codex CLI 生图耗时较长（约 30~90 秒），调用时 timeout 应设不低于 **180 秒**，避免 agent 误判为失败而中断重试。\n\n## 注意事项\n\n> **完成后看一眼生成的图对不对**：Codex CLI 报错信息不一定准——报“failed N times with a server error”不一定真没生成。Agent 有视觉能力就调一下 image 工具看一眼生成的图是否对需求；没生成或内容不对，重试即可。\n\n## 尺寸限制速查\n\n| 用途 | 推荐尺寸 | 实际输出 | 风险 |\n|------|---------|---------|------|\n| **方图素材（安全）** | `1K` / `1:1` / `square` | 1254×1254 | ✅ 无缩放 |\n| **横版大图（安全）** | `1536x1024` | 1536×1024 | ✅ 无缩放（唯一精确大尺寸） |\n| **竖版素材（安全）** | `9:16` | 941×1672 | ✅ 无缩放 |\n| **横版4:3（安全）** | `4:3` | 1448×1086 | ✅ 无缩放 |\n| **16:9 横版** | `2K` / `FHD` / `16:9` | 1672×941 | ⚠️ 实际只有 HD 级 |\n| **4K / 1080p / 720p** | ❌ 勿用 | 全部降级至 1672×941 | ❌ 严重缩水 |\n| **小图如 512×512** | ❌ 勿用 | 膨胀至 1254×1254 | ❌ 严重放大 |\n\n**结论**：游戏 UI 素材推荐用 `1K`（方图）或 `1536x1024`（横版），不要用 FHD/4K/720p 等标识。\n\n## 快速参考\n\n| 任务 | 命令 |\n|------|------|\n| 单张图片 | `bash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \"<prompt>\" [output_dir] [-i <ref_image>]` |\n| 指定尺寸 | `bash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh <size_key> \"<subject>\" [output_dir] [-i <ref_image>]` |\n| 批量游戏 UI | `bash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \"<style>\" <count> [output_dir] [-i <ref_image>]` |\n\n## 尺寸 Key（gen_size.sh）\n\n| Key | 实际输出 | 比例 | MP | 精确度 |\n|-----|---------|------|-----|--------|\n| `1K` / `1:1` / `square` | 1254×1254 | 1:1 | ~1.57MP | ✅ ~1K（差 <3%） |\n| `2K` / `16:9` / `FHD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ ~2K（面积差 -22%） |\n| `2048x1080` | 1727×911 | ~17:9 | ~1.57MP | ✅ 2K 最佳匹配 |\n| `4K` / `3840x2160` | 1672×941 | 16:9 | ~1.57MP | ❌ 无法达到 4K |\n| `9:16` | 941×1672 | 9:16 | ~1.57MP | ✅ 竖版 |\n| `4:3` | 1448×1086 | 4:3 | ~1.57MP | ✅ |\n| `1536x1024` | 1536×1024 | 3:2 | ~1.57MP | ✅ 完全精确 |\n| `720p` / `HD` | 1672×941 | 16:9 | ~1.57MP | ⚠️ 等同 2K |\n\n> **可选参数 `-i <ref_image>`**：传入参考图路径，Codex 会将参考图作为生成上下文，适用于风格迁移、色调匹配等场景。不传此参数则走默认行为。\n\n## 生成图片\n\n### 单张图片\n```bash\n# 无参考图\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background (#ffffff), flat vector art style\" \\\n  /tmp/my-images\n\n# 带参考图（风格迁移）\nbash ~/.openclaw/skills/codex-imggen/scripts/generate.sh \\\n  \"A fantasy sword with golden blade on white background, flat vector art style\" \\\n  /tmp/my-images \\\n  -i /path/to/reference.png\n```\n\n### 指定尺寸\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/gen_size.sh \\\n  \"1K\" \\\n  \"A medieval castle on a hill at sunset\" \\\n  /tmp/my-images\n```\n\n### 批量游戏 UI 素材（2026-05-21 实测）\n```bash\nbash ~/.openclaw/skills/codex-imggen/scripts/batch_generate.sh \\\n  \"flat vector art style, white background (#ffffff), each icon approximately 256x256 pixels, consistent 2px "},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7bcaearb90wwcjbr9gpv32s5831k39\",\n  \"slug\": \"codex-imggen\",\n  \"version\": \"1.1.1\",\n  \"publishedAt\": 1780914503801\n}"},{"path":"skill-card.md","content":"## Description:\n\nGenerates images through Codex CLI with size controls, optional reference images, and batch game UI asset prompts.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[axelhu](https://clawhub.ai/user/axelhu)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and content creators use this skill to generate single images, targeted size or aspect-ratio images, and batch game UI image sheets through Codex CLI. It is useful when an agent needs repeatable shell-command guidance for image generation and copying PNG outputs to a requested directory.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Prompts and optional reference images may be sent outside the local machine through Codex CLI.\n\nMitigation: Use only approved Codex accounts, proxy settings, sandboxes, and data-handling policies; avoid confidential prompts, private artwork, internal screenshots, regulated data, and sensitive local image files unless approved.\n\nRisk: The copy step can select the newest shared Codex generated-image directory rather than a guaranteed current-session result.\n\nMitigation: Run the skill in a restricted, disposable workspace and visually verify the copied output before using or publishing it.\n\nRisk: Requested pixel dimensions may not be exact because the documented Codex CLI image output is constrained to about 1.57 megapixels.\n\nMitigation: Use the documented safe size keys when possible, and post-process with an image tool when exact final dimensions are required.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/axelhu/skills/codex-imggen)\n- [ClawHub publisher profile](https://clawhub.ai/user/axelhu)\n\n## Skill Output:\n\n**Output Type(s):** [Shell commands, Files, Guidance]\n\n**Output Format:** [Markdown guidance with bash commands and generated PNG image files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs are copied from ~/.codex/generated_images/ to the requested output directory; batch mode writes a combined PNG image.]\n\n## Skill Version(s):\n\n1.1.1 (source: SKILL.md frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。 Skill: Codex Imggen Owner: axelhu Summary: 通过 Codex CLI 生成图片，支持尺寸控制和批量模式。依赖：codex (npm)。代理默认启用。用 generate.sh 生成单张，batch_generate.sh 批量生成游戏 UI 素材，gen_size.sh 指定尺寸。所有输出保存至 ~/.codex/generated_images/。 Tags: latest:1.1.1 Version history: v1.1.1 | 2026-06-08T10:28:23.801Z | user 回退 1.1.0 的整体时长预估（5-10 分钟太保守，按 30-90 秒 + 180s timeout 即可）。文档加一条'完成后看一眼图'的轻量提示。 v1.0.7 | 2026-06-08T10:26:06.790Z | user 回退 1.1.0 的整体时长预估（实测 5-10 分","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":935,"uniquenessScore":54,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T15:09:09.967Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T15:09:09.967Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T17:43:28.002Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}