{"id":"ebb2617d-e09c-40ff-9ccc-56d31564f15f","shortId":"MuNqjt","kind":"skill","title":"gpt-image","tagline":"Use this skill whenever a user asks to generate, create, draw, render, or edit images with GPT Image 2 / gpt-image-2, text-to-image, reference-image editing, inpainting, posters, typography, Chinese text, UI mockups, diagrams, or gallery prompts. Analyze the user's prompt, search","description":"# gpt-image\n\nAgent runbook for GPT Image 2 generation/editing. Use the prompt library + packaged CLI. Do not reimplement image API code.\n\n## Operating loop\n\n1. **Classify request**: `generate`, `edit`, `inpaint`, or `multi-reference`; identify asset type, exact text, aspect ratio, references, safety constraints, and budget/quality.\n2. **Search references first**: open `references/gallery.md`; load/search the closest `references/gallery-<category>.md` file(s). Read actual `**Prompt**` text before choosing a pattern.\n3. **Refine with craft**: load `references/craft.md` for dense text, diagrams, UI, data visualization, multi-panel layouts, weak prompts, or no close gallery match.\n4. **Confer when useful**: before costly/ambiguous/high-polish calls, present 1–3 matched directions plus planned size/quality; ask at most one concise question. Skip long discussion for precise “generate now” requests.\n5. **Preflight, no side effects**: use existing CLI/skill if present. Check command availability (`command -v gpt-image`), installed tool lists when the tool manager exists, or the runtime’s own skill registry when available. Do not assume a local home path in cloud/hosted runtimes.\n6. **No blind setup**: do not reinstall, overwrite skill folders, create/modify `.env`, or write API keys unless the user explicitly requested setup. Global/shared installs are opt-in only.\n7. **Execute via CLI only**: call `gpt-image` or `scripts/generate.py`. Do not create a new `generate.py`, SDK wrapper, or ad-hoc script for normal image requests.\n8. **Report**: output file path(s), key flags, and one concise refinement suggestion if useful.\n\nFast path: precise prompt + explicit “generate now” → quick reference/craft check, then CLI.\n\n## CLI resolution\n\nPreferred call order:\n\n```bash\n# Existing CLI on PATH\ngpt-image -p \"PROMPT\" [-f OUT] [-i REF...] [-m MASK] [options]\n\n# Installed skill folder; use runtime-provided skill path when available\nuv run \"$SKILL_DIR/scripts/generate.py\" -p \"PROMPT\" [-f OUT] [-i REF...] [-m MASK] [options]\n\n# Direct transient CLI when the user requested setup/one-off CLI execution\nuvx --from git+https://github.com/wuyoscar/gpt_image_2_skill gpt-image -p \"PROMPT\" [options]\n```\n\n`scripts/generate.py` is a launcher: repo-local `src/gpt_image_cli` → installed `gpt-image` → PATH `gpt-image` → transient `uvx`/`uv` fallback.\n\n## Key and cost rules\n\n- CLI reads `OPENAI_API_KEY` from process env, then `.env`, then `~/.env` without overriding existing env; successful API calls may bill the user’s OpenAI account.\n- If host/runtime has native platform-managed image generation and the user wants that path, use the host tool instead of this CLI.\n- If `OPENAI_API_KEY` is unset, report missing key or use host-native generation when requested; do not write secrets.\n- If user wants to avoid local-key use, respect `unset OPENAI_API_KEY`; if a key exists in `.env`/`~/.env`, tell them to remove/rename it for the session rather than working around it.\n- Never print secret values.\n\n## Flags\n\n| Flag | Values | Use |\n|---|---|---|\n| `-p, --prompt` | string | Required prompt/edit instruction |\n| `-f, --file` | path | Output path; auto-named if omitted |\n| `-i, --image` | repeatable path | Use edits endpoint; supports multiple references |\n| `-m, --mask` | PNG path | Inpaint with alpha mask; requires `-i` |\n| `--model` | default `gpt-image-2` | Image model |\n| `--size` | `1k`, `2k`, `4k`, `portrait`, `landscape`, `square`, `wide`, `tall`, or literal | Canvas size |\n| `--quality` | `low`, `medium`, `high`, `auto` | Cost/quality dial |\n| `-n, --n` | integer | Number of images |\n| `--background` | `auto`, `opaque` | Generation background |\n| `--moderation` | `auto`, `low` | Generation moderation setting |\n| `--format` | `png`, `jpeg`, `webp` | Output encoding |\n| `--compression` | `0-100` | JPEG/WebP compression |\n| `--user` | string | Optional end-user identifier |\n\nQuality policy:\n- `low`: cheap drafts, broad exploration, many variants.\n- `medium`: normal exploration, style probing, balanced cost.\n- `high`: final assets, Chinese text, posters, diagrams, UI, paper figures, dense labels.\n\nSize policy:\n- default/social square: `1k` / `1024x1024`\n- poster/mobile/beauty: `portrait`\n- landscape/gameplay/photo: `landscape`\n- print/paper figure: `2k`\n- widescreen hero: `4k`\n- vertical story/banner: `tall`\n\n## Endpoint routing\n\n| Mode | Trigger | Endpoint |\n|---|---|---|\n| Text-to-image | no `-i` | `/v1/images/generations` |\n| Reference edit | one or more `-i` | `/v1/images/edits` |\n| Inpaint | `-i` + `-m` | `/v1/images/edits` with mask |\n\nSurface API errors verbatim enough for debugging; exit codes: `0` success, `1` API/refusal, `2` bad args/missing key.\n\n## Reference loading\n\n- `references/gallery.md`: routing index for the 162-prompt Reference Gallery Atlas. Load first.\n- `references/gallery-*.md`: concrete prompts, previews, paths, metadata, attribution. Load 1 category for normal requests; 2–3 for hybrids.\n- `references/craft.md`: prompt-craft checklist. Load for prompt repair, exact text, UI/data/diagram grammar, edit invariants, and multi-panel consistency.\n- `references/openai-cookbook.md`: official parameter/model semantics. Load for API behavior or model capability questions.\n\nReference loading policy: load the smallest useful slice; never load all category files by default.\n\n## Verification\n\n- Before API call: confirm endpoint mode, size, quality, output path, and required reference/mask files.\n- After CLI call: report path(s) printed by the CLI and surface stderr on failure.\n- For edits/inpaints: verify `-i` paths exist; verify `-m` exists when used.\n\nPreserve `Curated` vs `Author + Source` metadata when adapting examples. Add new collected prompts to the Reference Gallery before README promotion.","tags":["gpt","image","skill","wuyoscar","agent-skills","ai-image-prompts","claude-code-skill","cli","codex-skill","gpt-image","gpt-image-2","gpt-image-2-prompts"],"capabilities":["skill","source-wuyoscar","skill-gpt-image","topic-agent-skills","topic-ai-image-prompts","topic-claude-code-skill","topic-cli","topic-codex-skill","topic-gpt-image","topic-gpt-image-2","topic-gpt-image-2-prompts","topic-image-editing","topic-image-generation","topic-image-prompt","topic-openai"],"categories":["gpt_image_2_skill"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/wuyoscar/gpt_image_2_skill/gpt-image","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add wuyoscar/gpt_image_2_skill","source_repo":"https://github.com/wuyoscar/gpt_image_2_skill","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 2195 github stars · SKILL.md body (5,777 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:53.525Z","embedding":null,"createdAt":"2026-04-23T07:01:22.735Z","updatedAt":"2026-05-18T18:52:53.525Z","lastSeenAt":"2026-05-18T18:52:53.525Z","tsv":"'-100':594 '/.env':404,483 '/v1/images/edits':669,673 '/v1/images/generations':662 '/wuyoscar/gpt_image_2_skill':362 '0':593,685 '1':76,151,687,716 '1024x1024':637 '162':700 '1k':550,636 '2':22,26,60,98,546,689,721 '2k':551,644 '3':119,152,722 '4':143 '4k':552,647 '5':172 '6':217 '7':246 '8':274 'account':418 'actual':112 'ad':267 'ad-hoc':266 'adapt':820 'add':822 'agent':55 'alpha':537 'analyz':46 'api':72,231,396,410,444,475,677,751,774 'api/refusal':688 'args/missing':691 'around':495 'ask':10,158 'aspect':91 'asset':87,622 'assum':209 'atlas':704 'attribut':714 'author':816 'auto':517,566,576,581 'auto-nam':516 'avail':184,206,333 'avoid':467 'background':575,579 'bad':690 'balanc':618 'bash':306 'behavior':752 'bill':413 'blind':219 'broad':609 'budget/quality':97 'call':149,251,304,411,775,789 'canva':560 'capabl':755 'categori':717,768 'cheap':607 'check':182,298 'checklist':729 'chines':38,623 'choos':116 'classifi':77 'cli':67,249,300,301,308,349,355,393,441,788,796 'cli/skill':179 'close':140 'closest':106 'cloud/hosted':215 'code':73,684 'collect':824 'command':183,185 'compress':592,596 'concis':162,284 'concret':709 'confer':144 'confirm':776 'consist':744 'constraint':95 'cost':391,619 'cost/quality':567 'costly/ambiguous/high-polish':148 'craft':122,728 'creat':13,259 'create/modify':227 'curat':814 'data':130 'debug':682 'default':542,771 'default/social':634 'dens':126,630 'diagram':42,128,626 'dial':568 'dir/scripts/generate.py':337 'direct':154,347 'discuss':166 'draft':608 'draw':14 'edit':17,34,80,526,664,738 'edits/inpaints':803 'effect':176 'encod':591 'end':601 'end-us':600 'endpoint':527,651,655,777 'enough':680 'env':228,400,402,408,482 'error':678 'exact':89,734 'exampl':821 'execut':247,356 'exist':178,197,307,407,480,807,810 'exit':683 'explicit':236,293 'explor':610,615 'f':316,340,511 'failur':801 'fallback':388 'fast':289 'figur':629,643 'file':109,277,512,769,786 'final':621 'first':101,706 'flag':281,501,502 'folder':226,325 'format':586 'galleri':44,141,703,829 'generat':12,79,169,294,427,456,578,583 'generate.py':262 'generation/editing':61 'git':359 'github.com':361 'github.com/wuyoscar/gpt_image_2_skill':360 'global/shared':239 'gpt':2,20,24,53,58,188,253,312,364,379,383,544 'gpt-imag':1,23,52,187,252,311,363,378,382,543 'grammar':737 'hero':646 'high':565,620 'hoc':268 'home':212 'host':436,454 'host-nat':453 'host/runtime':420 'hybrid':724 'identifi':86,603 'imag':3,18,21,25,30,33,54,59,71,189,254,272,313,365,380,384,426,522,545,547,574,659 'index':697 'inpaint':35,81,535,670 'instal':190,240,323,377 'instead':438 'instruct':510 'integ':571 'invari':739 'jpeg':588 'jpeg/webp':595 'key':232,280,389,397,445,450,470,476,479,692 'label':631 'landscap':554,641 'landscape/gameplay/photo':640 'launcher':372 'layout':135 'librari':65 'list':192 'liter':559 'load':123,694,705,715,730,749,758,760,766 'load/search':104 'local':211,375,469 'local-key':468 'long':165 'loop':75 'low':563,582,606 'm':320,344,531,672,809 'manag':196,425 'mani':611 'mask':321,345,532,538,675 'match':142,153 'may':412 'md':108,708 'medium':564,613 'metadata':713,818 'miss':449 'mockup':41 'mode':653,778 'model':541,548,754 'moder':580,584 'multi':84,133,742 'multi-panel':132,741 'multi-refer':83 'multipl':529 'n':569,570 'name':518 'nativ':422,455 'never':497,765 'new':261,823 'normal':271,614,719 'number':572 'offici':746 'omit':520 'one':161,283,665 'opaqu':577 'open':102 'openai':395,417,443,474 'oper':74 'opt':243 'opt-in':242 'option':322,346,368,599 'order':305 'output':276,514,590,781 'overrid':406 'overwrit':224 'p':314,338,366,505 'packag':66 'panel':134,743 'paper':628 'parameter/model':747 'path':213,278,290,310,331,381,433,513,515,524,534,712,782,791,806 'pattern':118 'plan':156 'platform':424 'platform-manag':423 'plus':155 'png':533,587 'polici':605,633,759 'portrait':553,639 'poster':36,625 'poster/mobile/beauty':638 'precis':168,291 'prefer':303 'preflight':173 'present':150,181 'preserv':813 'preview':711 'print':498,793 'print/paper':642 'probe':617 'process':399 'promot':832 'prompt':45,50,64,113,137,292,315,339,367,506,701,710,727,732,825 'prompt-craft':726 'prompt/edit':509 'provid':329 'qualiti':562,604,780 'question':163,756 'quick':296 'rather':492 'ratio':92 'read':111,394 'readm':831 'ref':319,343 'refer':32,85,93,100,530,663,693,702,757,828 'reference-imag':31 'reference/craft':297 'reference/mask':785 'references/craft.md':124,725 'references/gallery-':107,707 'references/gallery.md':103,695 'references/openai-cookbook.md':745 'refin':120,285 'registri':204 'reimplement':70 'reinstal':223 'remove/rename':487 'render':15 'repair':733 'repeat':523 'repo':374 'repo-loc':373 'report':275,448,790 'request':78,171,237,273,353,458,720 'requir':508,539,784 'resolut':302 'respect':472 'rout':652,696 'rule':392 'run':335 'runbook':56 'runtim':200,216,328 'runtime-provid':327 'safeti':94 'script':269 'scripts/generate.py':256,369 'sdk':263 'search':51,99 'secret':462,499 'semant':748 'session':491 'set':585 'setup':220,238 'setup/one-off':354 'side':175 'size':549,561,632,779 'size/quality':157 'skill':6,203,225,324,330,336 'skill-gpt-image' 'skip':164 'slice':764 'smallest':762 'sourc':817 'source-wuyoscar' 'squar':555,635 'src/gpt_image_cli':376 'stderr':799 'story/banner':649 'string':507,598 'style':616 'success':409,686 'suggest':286 'support':528 'surfac':676,798 'tall':557,650 'tell':484 'text':28,39,90,114,127,624,657,735 'text-to-imag':27,656 'tool':191,195,437 'topic-agent-skills' 'topic-ai-image-prompts' 'topic-claude-code-skill' 'topic-cli' 'topic-codex-skill' 'topic-gpt-image' 'topic-gpt-image-2' 'topic-gpt-image-2-prompts' 'topic-image-editing' 'topic-image-generation' 'topic-image-prompt' 'topic-openai' 'transient':348,385 'trigger':654 'type':88 'typographi':37 'ui':40,129,627 'ui/data/diagram':736 'unless':233 'unset':447,473 'use':4,62,146,177,288,326,434,452,471,504,525,763,812 'user':9,48,235,352,415,430,464,597,602 'uv':334,387 'uvx':357,386 'v':186 'valu':500,503 'variant':612 'verbatim':679 'verif':772 'verifi':804,808 'vertic':648 'via':248 'visual':131 'vs':815 'want':431,465 'weak':136 'webp':589 'whenev':7 'wide':556 'widescreen':645 'without':405 'work':494 'wrapper':264 'write':230,461","prices":[{"id":"619ff5cc-a2e8-4709-8e8a-1bbc5e5d9b7e","listingId":"ebb2617d-e09c-40ff-9ccc-56d31564f15f","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"wuyoscar","category":"gpt_image_2_skill","install_from":"skills.sh"},"createdAt":"2026-04-23T07:01:22.735Z"}],"sources":[{"listingId":"ebb2617d-e09c-40ff-9ccc-56d31564f15f","source":"github","sourceId":"wuyoscar/gpt_image_2_skill/gpt-image","sourceUrl":"https://github.com/wuyoscar/gpt_image_2_skill/tree/main/skills/gpt-image","isPrimary":false,"firstSeenAt":"2026-04-23T07:01:22.735Z","lastSeenAt":"2026-05-18T18:52:53.525Z"}],"details":{"listingId":"ebb2617d-e09c-40ff-9ccc-56d31564f15f","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"wuyoscar","slug":"gpt-image","github":{"repo":"wuyoscar/gpt_image_2_skill","stars":2195,"topics":["agent-skills","ai-image-prompts","claude-code-skill","cli","codex-skill","gpt-image","gpt-image-2","gpt-image-2-prompts","image-editing","image-generation","image-prompt","openai","prompt-library","prompt-templates","research-figures","text-to-image"],"license":"mit","html_url":"https://github.com/wuyoscar/gpt_image_2_skill","pushed_at":"2026-05-08T15:13:27Z","description":"GPT Image 2 prompt gallery, image prompt library, agentic skill, and CLI for OpenAI image generation/editing","skill_md_sha":"0db0ea3e98961b5d53d2fd0a9912de0eee538bab","skill_md_path":"skills/gpt-image/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/wuyoscar/gpt_image_2_skill/tree/main/skills/gpt-image"},"layout":"multi","source":"github","category":"gpt_image_2_skill","frontmatter":{"name":"gpt-image","description":"Use this skill whenever a user asks to generate, create, draw, render, or edit images with GPT Image 2 / gpt-image-2, text-to-image, reference-image editing, inpainting, posters, typography, Chinese text, UI mockups, diagrams, or gallery prompts. Analyze the user's prompt, search the bundled Reference Gallery/craft files for matching design patterns, confer on direction when useful, then call the packaged `gpt-image` CLI or bundled `scripts/generate.py`. Do not write new image-generation code unless explicitly asked to modify this repo.","compatibility":"Requires Python 3.11+ and either `gpt-image`, `uv`, or `uvx`. CLI/API calls read `OPENAI_API_KEY` and may incur OpenAI API charges."},"skills_sh_url":"https://skills.sh/wuyoscar/gpt_image_2_skill/gpt-image"},"updatedAt":"2026-05-18T18:52:53.525Z"}}