How to Integrate GPT-Image2 Agent Skill with Claude Code: Complete Setup Guide
Install the GPT-Image2 Agent Skill via Claude Code's plugin marketplace commands or npm to enable style-aware image prompt generation directly in your chat interface.
The GPT-Image2 style-library skill allows Claude Code to generate production-ready image prompts by tapping into the shared style-library.json dataset from the freestylefly/awesome-gpt-image-2 repository. Once integrated, you can summon visual styles, prompt templates, and scene tags without leaving your development environment.
What is the GPT-Image2 Style-Library Skill?
The skill functions as a bridge between Claude Code and the curated visual style database used by the GPT-Image2 web gallery. According to the source code in agents/skills/gpt-image-2-style-library/SKILL.md, the skill exposes a workflow that detects your request language, identifies the target output type (infographic, poster, portrait), and matches the most appropriate template from data/style-library.json.
Key capabilities include:
- Automatic style matching against 200+ curated templates
- Bilingual support for Chinese and English prompt generation
- Local execution via the
bin/install.mjsentry point
Installation Methods
You can integrate the skill using either Claude Code's native plugin marketplace or manual npm installation for development workflows.
Method 1: Installing via Claude Code Plugin Marketplace
Claude Code discovers skills by scanning the ~/.claude/skills directory for folders containing a SKILL.md file. To install via the marketplace:
-
Register the repository:
/plugin marketplace add freestylefly/awesome-gpt-image-2 -
Install the specific skill:
/plugin install gpt-image-2-style-library@awesome-gpt-image-2 -
Reload the session:
Restart Claude Code or execute
:reloadto scan~/.claude/skillsand register the new skill metadata. -
Verify installation:
/skill listYou should see
gpt-image-2-style-libraryin the available commands.
Method 2: Manual npm Installation for Developers
For local development or testing unpublished versions, use the npm package directly:
npm install -g gpt-image-2-style-library
gpt-image-2-style-library install all
The install all command executes bin/install.mjs, which copies the skill into all supported local agent directories: ~/.claude/skills, ~/.codex/skills, and ~/.agents/skills. After installation, restart Claude Code to trigger the skill discovery mechanism.
How Claude Code Consumes the Skill
Understanding the internal flow helps debug integration issues and customize templates.
-
Discovery phase: At startup, Claude Code recursively scans
~/.claude/skillsfor directories containing aSKILL.mdfile. -
Metadata parsing: The YAML front-matter in
SKILL.md(fieldsnameanddescription) registers the skill identifiergpt-image-2-style-library. -
Command routing: When your message begins with the skill name, Claude Code forwards the request to the compiled JavaScript module specified in the skill's
bin/install.mjsentry point. -
Data access: The runtime imports the bundled
data/style-library.jsonto perform category and template lookups against the latest gallery cases. -
Response formatting: The skill constructs the final prompt following the structured sections defined in
SKILL.md(Subject, Composition, Style, Negative Constraints) and returns plain text to the chat interface.
Using the Skill in Practice
Once integrated, invoke the skill naturally in conversation or via the explicit skill command.
Example 1: Generating an Infographic Prompt (Chinese)
Request:
/skill gpt-image-2-style-library
用 gpt-image-2-style-library 技能生成关于 "Codex" 的信息图
Claude Code processes the Chinese input, detects the "infographic" intent, and queries style-library.json for matching templates. The response follows the exact output format specified in SKILL.md:
Prompt:
Codex 信息图,包含以下模块:
- 标题:"Codex 代码生成平台概览"
- 子标题:简要说明功能
- 结构化箭头展示工作流:输入 → 处理 → 输出
- 颜色方案:淡蓝 + 灰白
- 视觉风格:现代平面设计,圆角卡片
- 纵横比:16:9
- 负面约束:避免过度装饰,保持简洁
参考案例:#123、#210(相似信息图)
Example 2: Creating a Product Poster (English)
Request:
/skill gpt-image-2-style-library
Create a product poster prompt for a new AI-powered coffee mug.
The skill identifies the "product poster" category from data/style-library.json and returns:
Prompt:
AI Coffee Mug – product poster
- Subject: sleek matte-black mug with embedded AI display
- Layout: central product, top tagline, bottom specs
- Style: minimalistic, high-contrast, neon teal accents
- Text: "Smart Brew. Smarter You."
- Aspect ratio: 4:5
- Constraints: no background clutter, focus on surface texture
Template: poster-standard-v2 (see style-library)
Key Source Files and Architecture
The integration relies on these specific files from the freestylefly/awesome-gpt-image-2 repository:
-
agents/skills/gpt-image-2-style-library/SKILL.md– Defines the skill metadata, workflow steps, and output defaults that Claude Code parses at startup. -
agents/skills/gpt-image-2-style-library/bin/install.mjs– CLI entry point that copies skill files to local agent directories (~/.claude/skills, etc.) and handles theinstall allcommand. -
data/style-library.json– The consolidated database of templates, category tags, and example cases shared between the web gallery and the agent skill. -
agents/skills/gpt-image-2-style-library/package.json– npm package manifest specifying the global binary name and version metadata.
When the gallery updates, regenerate the skill using npm run generate:style-skill followed by npm run install:skill to propagate new templates to Claude Code.
Summary
- The GPT-Image2 Agent Skill connects Claude Code to the
style-library.jsontemplate database via thegpt-image-2-style-librarynpm package. - Install via
/plugin installcommands ornpm install -g gpt-image-2-style-libraryfollowed byinstall all. - Claude Code loads skills from
~/.claude/skillsby parsingSKILL.mdmetadata at startup. - Invoke the skill with
/skill gpt-image-2-style-libraryfollowed by your image generation request in English or Chinese. - Update the skill by running
npm run generate:style-skilland reinstalling to refresh templates from the gallery.
Frequently Asked Questions
Where does Claude Code store the GPT-Image2 skill files?
Claude Code stores skills in the ~/.claude/skills directory. The bin/install.mjs script copies the SKILL.md and supporting assets into a subfolder named gpt-image-2-style-library within that path. Claude Code scans this location at startup to build the available command list.
Can I use this skill with other agents besides Claude Code?
Yes. The installation script targets multiple agent directories: ~/.claude/skills, ~/.codex/skills, and ~/.agents/skills. Running gpt-image-2-style-library install all deploys the skill to all compatible agents simultaneously, provided they follow the same SKILL.md discovery convention.
How do I update the skill when new templates are added to the gallery?
Run npm run generate:style-skill in the repository root to regenerate data/style-library.json from the latest gallery cases, then execute npm run install:skill to copy the updated files to ~/.claude/skills. Restart Claude Code to load the new templates.
What information does the skill use to build prompts?
The skill parses data/style-library.json to extract subject classifications, composition guidelines, color schemes, and negative constraints. It matches your request against these fields using the workflow defined in SKILL.md to construct a complete image-generation prompt with proper aspect ratios and style tags.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →