canghe-image-gen — Claude Code skill: what it does, how to install
Generates AI images via OpenAI, Google, DashScope, and Canghe APIs. Handles text prompts, aspect ratios, and reference files right inside coding agents.
npx skills add freestylefly/canghe-skills --skill canghe-image-gen -a claude-codeWhat canghe-image-gen does
The skill executes a TypeScript script through Bun to invoke upstream image generation endpoints. Google acts as the default provider, but you can explicitly route requests to OpenAI, DashScope, or the Canghe gateway. It accepts prompt strings, reads concatenated markdown prompt files, and maps ratios such as 16:9 or 1:1.
You must provide at least one valid provider API key in your environment or a .env file before running jobs. The runner creates images sequentially by default to keep output predictable. Parallel execution runs via background subagents only when explicitly requested, with concurrency recommended at 4 and capped at 8. Project-level defaults can be pinned in an EXTEND.md config file.
What it helps with
- generate illustrations from text prompts inside coding agents
- edit images using reference files through multimodal models
- compose complex prompts from multiple local text files
- enforce target aspect ratios and resolution presets
Example prompts for the agent
- Generate a cat illustration and save it to cat.png with a 16:9 aspect ratio
- Edit source.png to have a blue background using Google API and save to out.png
- Create an image from prompt files system.md and content.md with 2k quality
How to install canghe-image-gen
1Skills CLI (Vercel)
npx skills add freestylefly/canghe-skills --skill canghe-image-gen -a claude-code2Manually: put the files in place
~/.claude/skills/canghe-image-gen/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/canghe-image-gen/
1Skills CLI (Vercel)
npx skills add freestylefly/canghe-skills --skill canghe-image-gen -a codex2Manually: put the files in place
.agents/skills/canghe-image-gen/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add freestylefly/canghe-skills --skill canghe-image-gen -a cursor2Manually: put the files in place
.cursor/skills/canghe-image-gen/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install freestylefly/canghe-skills canghe-image-gen2Manually: put the files in place
.github/skills/canghe-image-gen/SKILL.md1Skills CLI (Vercel)
npx skills add freestylefly/canghe-skills --skill canghe-image-gen -a gemini-cli2Platform CLI
gemini skills install https://github.com/freestylefly/canghe-skills --path skills/canghe-image-genManually: put the files in place
.devin/skills/canghe-image-gen/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add freestylefly/canghe-skills --skill canghe-image-gen -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about canghe-image-gen
How to install canghe-image-gen in Claude Code?
Run npx skills add freestylefly/canghe-skills --skill canghe-image-gen -a claude-code. The skill definition will be added to ~/.claude/skills/canghe-image-gen/SKILL.md.
What does canghe-image-gen do?
It coordinates AI image generation across Google, OpenAI, DashScope, and Canghe. You can generate assets from text, transform them with reference inputs, and configure dimensions.
Which API keys are required?
You need a key for the provider you want to use: GOOGLE_API_KEY, OPENAI_API_KEY, DASHSCOPE_API_KEY, or CANGHE_API_KEY. If multiple keys are set, Google is selected by default.