{"id":"88410a94-aa09-4d2a-851f-38c0e49dfc77","shortId":"5BS3PB","kind":"skill","title":"generate-image","tagline":">-","description":"# Generate Image\n\nYou are an image generation assistant. When invoked, follow the workflow below.\n\n## Workflow\n\n1. **Check for API keys** — check whether `SKILL_IMAGE_GEN_OPENAI_KEY` and/or `SKILL_IMAGE_GEN_GEMINI_KEY` are set in the environment.\n2. **If one key is set** — use that provider. No need to ask.\n3. **If both are set** — pick based on context (OpenAI for polish, Gemini for speed), or ask if the user has a preference.\n4. **If no keys are set** — run the Onboarding section.\n5. **Generate the image** using the appropriate API reference.\n6. **Tell the user** where the image was saved.\n\n## Onboarding\n\nOnly run this if no keys are set. Guide the user conversationally.\n\n1. Ask which provider they'd like to use:\n   - **OpenAI (gpt-image-2)** — High quality, excellent text rendering, paid per image\n   - **Google Gemini (Nano Banana)** — Fast, free tier available, great for iteration\n2. Direct them to get an API key:\n   - OpenAI → https://platform.openai.com/api-keys\n   - Gemini → https://aistudio.google.com/apikey\n3. Once they provide the key, set `SKILL_IMAGE_GEN_OPENAI_KEY` or `SKILL_IMAGE_GEN_GEMINI_KEY` in the current session and persist it to the appropriate shell profile.\n4. Proceed to generate the image they originally asked for.\n\n## API Reference: OpenAI\n\n**Method:** `POST`\n**URL:** `https://api.openai.com/v1/images/generations`\n\n**Headers:**\n- `Authorization: Bearer <SKILL_IMAGE_GEN_OPENAI_KEY>`\n- `Content-Type: application/json`\n\n**Body (JSON):**\n```json\n{\n  \"model\": \"gpt-image-2\",\n  \"prompt\": \"<user prompt>\",\n  \"n\": 1,\n  \"size\": \"1024x1024\",\n  \"quality\": \"medium\"\n}\n```\n\n| Field | Default | Options |\n|---|---|---|\n| model | `gpt-image-2` | `gpt-image-2`, `gpt-image-1` |\n| size | `1024x1024` | `1024x1024`, `1024x1536`, `1536x1024`, `auto` |\n| quality | `medium` | `low`, `medium`, `high` |\n\n**Response:** `data[0].b64_json` contains the base64-encoded image. Decode it and save to the output path. If `data[0].url` is present instead, download the image from that URL.\n\n## API Reference: Google Gemini (Nano Banana)\n\n**Method:** `POST`\n**URL:** `https://generativelanguage.googleapis.com/v1beta/models/<model>:generateContent`\n\n**Headers:**\n- `x-goog-api-key: <SKILL_IMAGE_GEN_GEMINI_KEY>`\n- `Content-Type: application/json`\n\n**Body (JSON):**\n```json\n{\n  \"contents\": [{\"parts\": [{\"text\": \"Generate an image: <user prompt>\"}]}],\n  \"generationConfig\": {\"responseModalities\": [\"TEXT\", \"IMAGE\"]}\n}\n```\n\n| Field | Default | Options |\n|---|---|---|\n| model (in URL) | `gemini-2.0-flash-exp` | `gemini-2.0-flash-exp`, `gemini-2.5-flash-image` |\n\n**Response:** Find `candidates[0].content.parts[]` — look for a part with `inlineData.data` (base64 image) and `inlineData.mimeType`. Decode and save.\n\n**Error cases:** `error` key (API error), `promptFeedback.blockReason` (safety block), `finishReason: \"SAFETY\"` (filtered).\n\n## Agent Guidelines\n\n- Choose the output path intelligently — save to the project's relevant directory (e.g., `assets/`, `images/`, or the current directory).\n- For game textures, enrich prompts with \"seamless\", \"tileable\", \"game asset\".\n- For batch generation, make multiple API calls in parallel.\n- If the user asks to switch providers or what options are available, explain both and help them set up.\n- Always create the output directory before saving.\n- Ensure special characters in the user's prompt are properly escaped in the JSON body.","tags":["generate","image","awesome","copilot","github","agent-skills","agents","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"capabilities":["skill","source-github","skill-generate-image","topic-agent-skills","topic-agents","topic-awesome","topic-custom-agents","topic-github-copilot","topic-hacktoberfest","topic-prompt-engineering"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/generate-image","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add github/awesome-copilot","source_repo":"https://github.com/github/awesome-copilot","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 33270 github stars · SKILL.md body (3,400 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:12.773Z","embedding":null,"createdAt":"2026-05-15T06:52:20.800Z","updatedAt":"2026-05-18T18:52:12.773Z","lastSeenAt":"2026-05-18T18:52:12.773Z","tsv":"'-2.0':341,346 '-2.5':351 '/api-keys':163 '/apikey':167 '/v1/images/generations':216 '/v1beta/models/':309 '0':268,287,358 '1':19,119,234,254 '1024x1024':236,256,257 '1024x1536':258 '1536x1024':259 '2':42,132,152,231,246,250 '3':55,168 '4':78,198 '5':88 '6':97 'agent':385 'aistudio.google.com':166 'aistudio.google.com/apikey':165 'alway':444 'and/or':31 'api':22,95,158,208,298,315,377,421 'api.openai.com':215 'api.openai.com/v1/images/generations':214 'application/json':223,320 'appropri':94,195 'ask':54,71,120,206,428 'asset':400,415 'assist':11 'author':218 'auto':260 'avail':148,436 'b64':269 'banana':144,303 'base':61 'base64':274,366 'base64-encoded':273 'batch':417 'bearer':219 'block':381 'bodi':224,321,465 'call':422 'candid':357 'case':374 'charact':453 'check':20,24 'choos':387 'contain':271 'content':221,318,324 'content-typ':220,317 'content.parts':359 'context':63 'convers':118 'creat':445 'current':188,404 'd':124 'data':267,286 'decod':277,370 'default':240,335 'direct':153 'directori':398,405,448 'download':292 'e.g':399 'encod':275 'enrich':409 'ensur':451 'environ':41 'error':373,375,378 'escap':461 'excel':135 'exp':344,349 'explain':437 'fast':145 'field':239,334 'filter':384 'find':356 'finishreason':382 'flash':343,348,353 'flash-exp':342,347 'flash-imag':352 'follow':14 'free':146 'game':407,414 'gemini':35,67,142,164,184,301,340,345,350 'gen':28,34,177,183 'generat':2,4,10,89,201,327,418 'generate-imag':1 'generatecont':310 'generationconfig':330 'generativelanguage.googleapis.com':308 'generativelanguage.googleapis.com/v1beta/models/':307 'get':156 'goog':314 'googl':141,300 'gpt':130,229,244,248,252 'gpt-imag':129,228,243,247,251 'great':149 'guid':115 'guidelin':386 'header':217,311 'help':440 'high':133,265 'imag':3,5,9,27,33,91,103,131,140,176,182,203,230,245,249,253,276,294,329,333,354,367,401 'inlinedata.data':365 'inlinedata.mimetype':369 'instead':291 'intellig':391 'invok':13 'iter':151 'json':225,226,270,322,323,464 'key':23,30,36,45,81,112,159,173,179,185,316,376 'like':125 'look':360 'low':263 'make':419 'medium':238,262,264 'method':211,304 'model':227,242,337 'multipl':420 'n':233 'nano':143,302 'need':52 'onboard':86,106 'one':44 'openai':29,64,128,160,178,210 'option':241,336,434 'origin':205 'output':283,389,447 'paid':138 'parallel':424 'part':325,363 'path':284,390 'per':139 'persist':191 'pick':60 'platform.openai.com':162 'platform.openai.com/api-keys':161 'polish':66 'post':212,305 'prefer':77 'present':290 'proceed':199 'profil':197 'project':395 'prompt':232,410,458 'promptfeedback.blockreason':379 'proper':460 'provid':50,122,171,431 'qualiti':134,237,261 'refer':96,209,299 'relev':397 'render':137 'respons':266,355 'responsemod':331 'run':84,108 'safeti':380,383 'save':105,280,372,392,450 'seamless':412 'section':87 'session':189 'set':38,47,59,83,114,174,442 'shell':196 'size':235,255 'skill':26,32,175,181 'skill-generate-image' 'source-github' 'special':452 'speed':69 'switch':430 'tell':98 'text':136,326,332 'textur':408 'tier':147 'tileabl':413 'topic-agent-skills' 'topic-agents' 'topic-awesome' 'topic-custom-agents' 'topic-github-copilot' 'topic-hacktoberfest' 'topic-prompt-engineering' 'type':222,319 'url':213,288,297,306,339 'use':48,92,127 'user':74,100,117,427,456 'whether':25 'workflow':16,18 'x':313 'x-goog-api-key':312","prices":[{"id":"84fe2bcb-aa3d-43c4-8fad-e5e17bc6cf15","listingId":"88410a94-aa09-4d2a-851f-38c0e49dfc77","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-05-15T06:52:20.800Z"}],"sources":[{"listingId":"88410a94-aa09-4d2a-851f-38c0e49dfc77","source":"github","sourceId":"github/awesome-copilot/generate-image","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/generate-image","isPrimary":false,"firstSeenAt":"2026-05-15T06:52:20.800Z","lastSeenAt":"2026-05-18T18:52:12.773Z"}],"details":{"listingId":"88410a94-aa09-4d2a-851f-38c0e49dfc77","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"generate-image","github":{"repo":"github/awesome-copilot","stars":33270,"topics":["agent-skills","agents","ai","awesome","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"license":"mit","html_url":"https://github.com/github/awesome-copilot","pushed_at":"2026-05-18T01:26:59Z","description":"Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.","skill_md_sha":"21cd4d72561879ed94764849f1be7ee5ae7f2d81","skill_md_path":"skills/generate-image/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/github/awesome-copilot/tree/main/skills/generate-image"},"layout":"multi","source":"github","category":"awesome-copilot","frontmatter":{"name":"generate-image","license":"MIT","description":">-"},"skills_sh_url":"https://skills.sh/github/awesome-copilot/generate-image"},"updatedAt":"2026-05-18T18:52:12.773Z"}}