Agent skill

Image Generation Tools

by NanmiCoder in NanmiCoder/cc-haha

Generates new images and edits existing ones through the desktop's built-in ImageGen and ImageEdit tools, with rules for choosing between them and writing the art-direction prompt.

MITAuto-check passedMedia & Creative

Install Image Generation Tools

skills CLI
$ npx skills add NanmiCoder/cc-haha --skill imagegen -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install NanmiCoder/cc-haha imagegen --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/NanmiCoder/cc-haha.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/bundled/imagegen .claude/skills/imagegen && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
imagegen
GitHub stars
15k
Token cost
~991 tokens
SKILL.md length
576 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Generates new images and edits existing ones through the desktop's built-in ImageGen and ImageEdit tools, with rules for choosing between them and writing the art-direction prompt.

  • Creating an original illustration, product visual or diagram image from a description
  • SKILL.md covers Decide the request shape, Build the prompt and Output options
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Changing one element of an image you attached while keeping the rest the same

What it does

The desktop host manages provider authentication, model routing, output storage and secrets, so the agent never asks you for an API key. A brand-new visual goes to `ImageGen`, which has no image-path argument. A request that keeps, combines or changes an existing picture goes to `ImageEdit`, which needs `referenced_image_paths` listing exact paths to images you supplied in the conversation or that an earlier generation returned. The agent must not invent or search for paths, and asks you to attach the image if it has none. One distinct prompt means one call, `count` is for variations of the same prompt, and a call takes at most three source images.

Multi-turn edits use the latest selected output as the next edit target and restate identity, layout, text and unchanged-region constraints each turn so the image does not drift. The prompt is built as an art-direction brief covering use case, subject, setting, composition, lighting and mood, style, palette, any exact text and things to avoid. If the provider returns an error the agent does not retry on its own and lets you decide.

When your agent uses it

  • Creating an original illustration, product visual or diagram image from a description
  • Changing one element of an image you attached while keeping the rest the same
  • Producing several variations of one concept

Example prompts

  • “Generate a flat-style poster of a lighthouse at dusk in teal and orange.”
  • “Edit the attached product photo so the background is a plain light gray, keeping the bottle unchanged.”
  • “Give me four variations of a minimalist logo mark for a bakery.”

Requirements

  • A desktop host with an image provider configured
  • Pre-approved tools (allowed-tools): ImageGen, ImageEdit

What it can do on your machine

Read from SKILL.md and the folder at commit 1c78154. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • ImageGen
    • ImageEdit

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Image Generation Tools loads about 991 tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 576 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~991

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from NanmiCoder/cc-haha at commit 1c78154, republished under its MIT licence (© NanmiCoder). 576 words, ~991 tokens.

Download SKILL.mdSave it as .claude/skills/imagegen/SKILL.md (or your agent's skills folder).
name
imagegen
description
Generate original images, artwork, product visuals, diagrams, or other raster assets with the desktop's configured image provider. Use whenever the user asks to create or generate an image.
allowed-tools
ImageGen, ImageEdit

Image generation

Use the built-in ImageGen and ImageEdit tools. Provider authentication, model routing, output storage, and secrets are managed by the desktop host; never ask the user to put an API key in this skill or in the prompt.

Decide the request shape

  • Treat a brand-new visual as generation and call ImageGen. Its schema intentionally has no image-path argument.
  • Treat a request that preserves, combines, or changes an existing visual as an edit and call ImageEdit.
  • One distinct prompt equals one tool call.
  • Use count only for multiple variations of the same prompt. For different concepts, make separate calls.
  • ImageEdit requires referenced_image_paths: populate it with ordered, exact paths to images the user supplied in this conversation — a path surfaced by [Image source: ...], a file the user attached with @, or a path returned by an earlier ImageGen call. Never invent, search for, or substitute another filesystem path, and never read an image off disk yourself to use it as an input; if the user means an image you have no path for, ask them to attach it. The first image is the primary canvas unless the user says otherwise.
  • For multi-turn editing, use the latest selected output as the next turn's edit_target. Repeat all identity, layout, text, and unchanged-region constraints on every turn so edits do not drift.
  • To edit several images independently, make one call per image. Put multiple images in one call only when the user wants them combined or used together as references. A single call accepts at most three source images.
  • Prefer a useful default composition when the user leaves details open. Do not invent branding, logos, or people they did not request.
  • Provider and image model selection come from the current desktop session; do not add either to the tool arguments.
  • If the provider returns an error, do not retry the image tool automatically. Explain the failure and let the user decide whether to retry or change providers.
Show full SKILL.md (254 more words)Show less

Build the prompt

Turn the request into a complete art-direction brief. Preserve all relevant user-specified detail.

  • use case and image type
  • subject, action, and important attributes
  • environment and context
  • composition, framing, and camera angle
  • lighting and mood
  • visual style or medium
  • color palette
  • exact text, only when text must appear in the image
  • constraints and elements to avoid

For edits, start the prompt with each input's numbered role, then say change only X; keep Y unchanged. For a composite, specify which subject or visual property comes from each numbered image and preserve the requested identities. Do not rely on conversational pronouns such as "it" or "the previous one" inside the tool prompt.

Preserve the user's intent and wording for names or required on-image text. For diagrams, specify hierarchy, reading order, labels, and connections. For photorealistic work, describe lens, depth of field, lighting direction, and material detail when they matter.

Output options

  • Use aspect_ratio when the user describes a layout such as square, portrait, landscape, banner, or phone wallpaper.
  • Use resolution: "2k" only when higher resolution is useful and supported.
  • Use transparent background only when requested or clearly needed for a reusable asset.
  • The host displays one placeholder per requested image and replaces each slot as the saved image becomes available.

After a successful call, briefly summarize what was created or changed. The host card already displays and opens the saved images, so do not repeat, link, or embed the returned local paths in the final answer. Do not include base64 data in the conversation.

© NanmiCoder, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in src/skills/bundled/imagegen of NanmiCoder/cc-haha.

Open the folder on GitHubat commit 1c78154

Compare with similar skills

Image Generation Tools next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Image Generation Tools compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Image Generation Tools this skillNanmiCoder/cc-haha15k—~991Automated safety check: PassMIT
AI Image Generation and Editingzhayujie/CowAgent47k—~1.3kAutomated safety check: PassMIT
Generate Imageynulihao/AgentSkillOS61710 repos~1.7kAutomated safety check: NotesNone
GPT Image Generation CLIwuyoscar/GPT-Image2-Skill5.6k—~2.5kAutomated safety check: NotesMIT
NanobananaReScienceLab/opc-skills1.8k1 repos~1.3kAutomated safety check: PassApache-2.0
Native Transparent ImagegenZSeven-W/craft-skills2232 repos~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.

    47k GitHub stars~1.3k tokensUpdated yesterday
    Media & CreativeAuto-check passed
  • Generate Image

    ynulihao/AgentSkillOS

    Generate or edit images using AI models (FLUX, Gemini). An agent skill from ynulihao/AgentSkillOS.

    617 GitHub starsUsed in 10 repos~1.7k tokens
    Media & CreativeAuto-check: notes
  • GPT Image Generation CLI

    wuyoscar/GPT-Image2-Skill

    Generates and edits images with GPT Image 2 or 2.5 through a packaged CLI and a prompt gallery, after settling which model fits the request.

    5.6k GitHub stars~2.5k tokensUpdated 7 days ago
    Media & CreativeAuto-check: notes
  • Nanobanana

    ReScienceLab/opc-skills

    Generate and edit images using Google Gemini 3 Pro Image (Nano Banana Pro).

    1.8k GitHub starsUsed in 1 repo~1.3k tokens
    Media & CreativeAuto-check passed
  • Native Transparent Imagegen

    ZSeven-W/craft-skills

    Generate new raster assets that must contain native pixel transparency, then verify the untouched PNG or WebP before delivery.

    223 GitHub starsUsed in 2 repos~1.1k tokens
    Media & CreativeAuto-check passed
  • BlockRun Image Generation

    BlockRunAI/ClawRouter

    Generates or edits images through ClawRouter's local image API, with a choice of models and sizes and payment handled automatically through x402.

    6.6k GitHub stars~2.1k tokensUpdated 2 days ago
    Media & CreativeAuto-check passed

More from NanmiCoder/cc-haha

  • Release Announcement Poster

    NanmiCoder/cc-haha

    Turns the latest release notes into a short WeChat group message and a tall PNG poster, with contributor GitHub IDs checked and real avatars embedded.

    15k GitHub stars~516 tokensUpdated yesterday
    Auto-check passed

Questions about Image Generation Tools

What does Image Generation Tools do?

Generates new images and edits existing ones through the desktop's built-in ImageGen and ImageEdit tools, with rules for choosing between them and writing the art-direction prompt. The desktop host manages provider authentication, model routing, output storage and secrets, so the agent never asks you for an API key. A brand-new visual goes to `ImageGen`, which has no image-path argument.

When should I use Image Generation Tools?

Image Generation Tools fits situations like: creating an original illustration, product visual or diagram image from a description; changing one element of an image you attached while keeping the rest the same; producing several variations of one concept.

How do I install Image Generation Tools in Claude Code?

Run `npx skills add NanmiCoder/cc-haha --skill imagegen -a claude-code`. Or copy the skill folder (src/skills/bundled/imagegen in NanmiCoder/cc-haha) into .claude/skills/imagegen in your project. Claude Code loads it when a task matches its description.

How do I install Image Generation Tools in Codex?

Run `npx skills add NanmiCoder/cc-haha --skill imagegen -a codex`. Or copy the skill folder (src/skills/bundled/imagegen in NanmiCoder/cc-haha) into .agents/skills/imagegen in your project. Codex loads it when a task matches its description.

Can I use Image Generation Tools in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NanmiCoder/cc-haha --skill imagegen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/imagegen, .gemini/skills/imagegen, .github/skills/imagegen and .opencode/skills/imagegen in your project.

What does Image Generation Tools need to run?

SKILL.md names no scripts, command-line tools or credentials: Image Generation Tools is instructions for the agent only. Our summary lists: A desktop host with an image provider configured. Its frontmatter pre-approves these tools: ImageGen, ImageEdit.

Does Image Generation Tools access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Image Generation Tools safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Image Generation Tools use?

Image Generation Tools is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Image Generation Tools use?

About 991 tokens (SKILL.md is roughly 4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Image Generation Tools?

Skills that share tags, products or a category with Image Generation Tools: AI Image Generation and Editing (zhayujie/CowAgent, 47k stars), Generate Image (ynulihao/AgentSkillOS, 617 stars), GPT Image Generation CLI (wuyoscar/GPT-Image2-Skill, 5.6k stars) and Nanobanana (ReScienceLab/opc-skills, 1.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Image Generation Tools?

NanmiCoder (a GitHub user) maintains it in NanmiCoder/cc-haha, which has 14,886 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 5, 2026.

Source: NanmiCoder/cc-haha on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.