使用 AI 生成图片,支持多种模型和风格。Use when user wants to 生成图片, 画图, 创建图像, AI绘图, 生成一张图, generate image, create image, draw picture, AI art, 编辑图片, 修改图片, edit image, modify image.
Uses OpenRouter API to generate or edit AI images with customizable models, aspect ratios, and batch sizes. Automatically checks prerequisites and guides users through prompt, model, and output configuration.
/plugin marketplace add InfQuest/vibe-ops-plugin/plugin install vibe-ops@vibe-opsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
image-gen.js使用 OpenRouter API 生成 AI 图片,支持多种模型和自定义选项。也支持传入图片进行二次编辑。
OPENROUTER_API_KEY 环境变量(调用时传递)install-app skill 来安装)你是一个 AI 图片生成助手,帮助用户使用 OpenRouter API 生成图片。请按以下步骤操作:
首先验证 OPENROUTER_API_KEY 是否已设置:
[ -n "$OPENROUTER_API_KEY" ] && echo "API_KEY_SET" || echo "API_KEY_NOT_SET"
如果未设置,直接报错退出:「缺少 OPENROUTER_API_KEY 环境变量,无法生成图片。」
which node && node --version || echo "NOT_INSTALLED"
如果未安装,使用 install-app skill 来安装 Node.js。告诉用户:「需要先安装 Node.js,我来帮你安装。」然后调用 install-app skill 安装 node。
⚠️ 必须:使用 AskUserQuestion 工具收集用户的图片生成需求。不要跳过这一步。
使用 AskUserQuestion 工具收集以下信息:
输入图片(可选):是否基于现有图片进行编辑
图片描述(Prompt):让用户描述想要生成/编辑的图片
模型选择:选择使用哪个 AI 模型
图片比例:选择输出比例
生成数量:生成几张图片?
保存位置:图片保存到哪里?
generated_image_时间戳.png使用 skill 目录下的 image-gen.js 脚本:
node /path/to/skills/image-gen/image-gen.js "MODEL" "PROMPT" "ASPECT_RATIO" NUM_IMAGES "OUTPUT_DIR" "INPUT_IMAGE"
参数说明:
示例(纯文本生成):
node skills/image-gen/image-gen.js "gemini-pro" "一只在星空下的猫" "1:1" 1 "."
示例(图片编辑):
node skills/image-gen/image-gen.js "gemini-pro" "把背景换成海边" "1:1" 1 "." "/path/to/input.jpg"
生成完成后:
# macOS 上打开图片
open "OUTPUT_PATH"
API Key 无效:
生成失败:
图片打不开:
用户:帮我生成一张图片,一只在星空下的猫
助手:
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.