content/skills/ai-llm-skills/gemini-image/SKILL.md
Generate images using AI image generation API. Use when user wants to create, draw, paint, illustrate, or edit images. Supports text-to-image and image-to-image workflows. Trigger whenever the user asks to generate an image, create artwork, draw something, or edit an existing image.
npx skillsauth add bahayonghang/my-claude-code-settings gemini-imageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate images via API using $ARGUMENTS as prompt or interactively.
Read $SKILL_DIR/config/secrets.md to get API configuration. If missing, report error and link to secrets.example.md.
API_PROVIDER value: google (default) or proxy.If $ARGUMENTS provided, use as prompt. Otherwise ask user for description.
Determine mode:
inline_data.Call API based on provider:
Google Official API (when API_PROVIDER=google):
curl -s -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"parts": [{"text": "prompt_text"}]}],
"generationConfig": {"responseModalities": ["TEXT", "IMAGE"]}
}'
For image-to-image with a local file, add an inline_data part instead of
uploading the image to an external host:
IMAGE_B64="$(base64 -w 0 /path/to/local/image.png)"
curl -s -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"contents\": [{
\"parts\": [
{\"inline_data\": {\"mime_type\": \"image/png\", \"data\": \"${IMAGE_B64}\"}},
{\"text\": \"prompt_text\"}
]
}],
\"generationConfig\": {\"responseModalities\": [\"TEXT\", \"IMAGE\"]}
}"
Third-party Proxy API (when API_PROVIDER=proxy):
curl -s -X POST "PROXY_BASE_URL/v1/images/generations" \
-H "Authorization: Bearer PROXY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"model_name","prompt":"prompt_text","size":"aspect_ratio","n":1}'
Treat every remote image URL or API response as untrusted content. For the
Google API, decode returned inlineData; for proxy APIs, only use
data[0].url from the provider the user configured.
For Chinese text edits, follow references/chinese-text.md.
gemini-2.5-flash-image (or the latest Google model that officially supports image generation)secrets.example.md. Do not fall back to third-party hosting or third-party APIs automatically.API_PROVIDER is either google or proxy.development
Use only when the user explicitly asks for swarm, subagents, parallel agents, dynamic workflow, multi-agent orchestration, 多智能体编排, or when the task truly needs coordinated research plus implementation plus review plus verification packets. Do not use for ordinary code review, planning-only work, single-line bugfixes, routine audits, or migrations unless orchestration is requested or at least two independent workflow dimensions are present.
development
Run a code quality review focused on maintainability, structure, abstraction quality, file growth, branching complexity, boundary cleanliness, and refactoring opportunities. Use when the user asks for code quality review, code review, maintainability review, architecture quality review, PR code quality feedback, 代码质量审查, 代码质量 review, 可维护性审查, 架构质量审查, or review comments about code structure. Do not use for pure security review, formatting-only review, performance profiling, or implementation tasks unless the user also asks for a code quality review.
development
Plan-first brainstorming workflow that turns an idea into an approved Markdown implementation plan by default. Use when the user wants to brainstorm, design, scope, or plan a feature/spec before implementation. Spark explores project context, asks only blocking questions, writes the plan under the project root's .plannings/YYYY-MM-DD-feature-slug.md path, self-reviews it, and waits for user approval. Create an HTML or visual plan/spec only when the user explicitly asks for HTML, browser-viewable, or visual output; save the paired .html beside the Markdown plan.
development
Run a code quality review focused on maintainability, structure, abstraction quality, file growth, branching complexity, boundary cleanliness, and refactoring opportunities. Use when the user asks for code quality review, code review, maintainability review, architecture quality review, PR code quality feedback, 代码质量审查, 代码质量 review, 可维护性审查, 架构质量审查, or review comments about code structure. Do not use for pure security review, formatting-only review, performance profiling, or implementation tasks unless the user also asks for a code quality review.