技能 codex-pet
🦀

codex-pet

中风险 ⚙️ 外部命令🌐 网络访问📁 文件系统访问🔑 环境变量

从任意图片构建自定义 Codex 宠物

也可从以下获取: agentspace-so

从单张参考图片创建自定义动画 Codex 宠物精灵图。该技能使用 RunComfy GPT Image 2 API 和 ImageMagick 生成像素风格伴侣,包含 9 种动画状态。将结果放入 Codex 宠物文件夹即可获得个性化桌面伴侣。

支持: Claude Codex Code(CC)
⚠️ 64
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“codex-pet”。 Create a codex pet from https://example.com/photo.jpg

预期结果:

已生成名为 'my-pet' 的宠物并安装到 ~/.codex/pets/my-pet/ 目录下,包含 spritesheet.webp (1536x1872, 9 个动画行) 和 pet.json 清单文件。请重启 Codex 以在选择列表中看到新宠物。

正在使用“codex-pet”。 Make a codex pet named ninja-cat from https://example.com/cat.png with description 'A stealthy feline companion'

预期结果:

Codex 宠物 'ninja-cat' 已创建并安装。精灵图包含待机、向右奔跑、向左奔跑、挥手、跳跃、失败、等待、奔跑和审核动画状态。所有单元格均符合 Codex 规范要求的帧数。

正在使用“codex-pet”。 Adjust my-pet animation to have bigger idle movement

预期结果:

待机行已修改:shift 从 shift:0:-1 改为 shift:0:-2,以增强呼吸效果。已更新 spritesheet.webp 到 ~/.codex/pets/my-pet/。请重新加载 Codex 以预览更改。

安全审计

中风险
v1 • 5/28/2026

This is a legitimate Codex Pet generator that uses RunComfy CLI and ImageMagick to create animated pet spritesheets. The static analysis flagged many patterns (97 command usages, filesystem access) but these are all legitimate tool invocations. The external commands (`runcomfy run`, `magick`) use hardcoded arguments derived from skill logic, not user-controlled shell input. Network calls go only to runcomfy.net endpoints. Path traversal in PET_NAME is a low concern as writes are scoped to the ~/.codex/pets sandbox. Environment variable access is explicit and documented (RUNCOMFY_TOKEN). No credential exfiltration, no data theft patterns, no command injection vectors confirmed. Skill performs exactly what it claims: generates pet spritesheets via API + ImageMagick transforms.

1
已扫描文件
348
分析行数
7
发现项
1
审计总数
中风险问题 (1)
Path Injection via PET_NAME in mkdir/cp Commands
PET_NAME user input is interpolated into mkdir and cp paths without sanitization. A malicious PET_NAME like '../../etc' could escape the intended ~/.codex/pets/ directory. This is a LOW-to-MEDIUM risk because: (1) writes are scoped to local filesystem only, (2) no privilege escalation apparent, (3) Codex pet directories are user-controlled workspace. However, the shell commands at lines 242-245 concatenate PET_NAME directly into mkdir/cp with no validation.
低风险问题 (2)
Hidden File in Home Directory Access
Skill accesses ~/.config/runcomfy/token.json to store API credentials. This is standard configuration file access for authenticated CLI tools, documented openly in the Security & Privacy section. Not a security vulnerability but worth noting for transparency.
External URL fetch in Image Processing Pipeline
The skill accepts a SOURCE_URL parameter and fetches external images. This is standard for image generation workflows but introduces a data boundary concern: external images are processed by RunComfy's servers. Documented as a known risk.
审计者: claude

质量评分

38
架构
100
可维护性
87
内容
42
社区
56
安全
83
规范符合性

你能构建什么

构建个人 Codex 伴侣

上传自己的照片、宠物或角色形象,将其转变为 Codex 桌面伴侣。该技能会将你的图片转换为 Q 版像素艺术风格,悬浮在代码编辑器上。

批量生成宠物精灵图

处理多张源图片创建多个 Codex 宠物供团队使用。每个宠物与 Codex 内置宠物并列安装,团队任何人都可以选择自己喜爱的宠物。

原型设计新宠物动画

快速生成并测试宠物动画时序。调整 ImageMagick 微变换参数即可改变动画效果,无需重新生成整个精灵图。

试试这些提示

基础宠物生成
Create a codex pet from this image: [SOURCE_IMAGE_URL]
命名宠物并添加描述
Make me a codex pet named [PET_NAME] based on [IMAGE_URL]. Description: [PET_DESCRIPTION]
自定义动画调整
Adjust [PET_NAME] animation: change idle bob to shift:0:-2, make running cycle faster with shift:3:0
调试生成失败
Retry generating [PET_NAME] with tighter identity preservation: emphasize [SPECIFIC_FEATURES] from original image

最佳实践

  • 使用方形或接近方形的源图片以获得 192x208 像素单元格的最佳适配
  • 选择轮廓清晰、颜色简单的图片以获得干净的去色处理效果
  • 当需要保持身份特征时,在提示词优化中描述具体特征

避免

  • 不要使用带品红色背景的源图片(会与色度键占位符冲突)
  • 避免将包含多个角色的复杂场景作为单张源图片
  • 通过 skills CLI 安装时不要跳过反引号代码块

常见问题

这与 OpenAI 的 hatch-pet 技能有何不同?
此技能使用 Google 的 RunComfy CLI 而非 Codex Pro 的 $imagegen 系统。它只需要 RUNCOMFY_TOKEN,不需要 Codex Pro 访问权限。输出格式完全相同,因此 Codex 对两者一视同仁。
为什么动画使用 ImageMagick 变换而非生成不同的帧?
Codex 的内置宠物也采用这种方式。动画效果本应很微妙。一个规范姿势加上 1-2 像素的变换能产生相同的效果,无需生成 72 张不同的图片。
如果我的源图片包含接近品红的颜色会怎样?
将色度键从 #FF00FF 改为青色 (#00FFFF) 或绿色 (#00FF00)。同时更新提示词和后处理的模糊阈值。
没有 RunComfy 账户能使用这个功能吗?
不行,需要拥有 API token 的 RunComfy 账户。该技能将 RunComfy GPT Image 2 编辑端点作为其图像生成后端。
宠物会被安装到哪里?
文件写入到 ${CODEX_HOME:-$HOME/.codex}/pets/<pet-name>/。重启 Codex 或重新加载宠物列表以查看新的自定义宠物。
为什么技能说它使用了弱加密算法?
这指的是用于动画的有意简单的 ImageMagick 变换(平移、旋转)。它们不是加密算法。ImageMagick 是一个图像处理工具,而非加密库。

开发者详情

文件结构

📄 SKILL.md