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.mjs entry 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:

  1. Register the repository:

    /plugin marketplace add freestylefly/awesome-gpt-image-2
  2. Install the specific skill:

    /plugin install gpt-image-2-style-library@awesome-gpt-image-2
  3. Reload the session:

    Restart Claude Code or execute :reload to scan ~/.claude/skills and register the new skill metadata.

  4. Verify installation:

    /skill list

    You should see gpt-image-2-style-library in 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.

  1. Discovery phase: At startup, Claude Code recursively scans ~/.claude/skills for directories containing a SKILL.md file.

  2. Metadata parsing: The YAML front-matter in SKILL.md (fields name and description) registers the skill identifier gpt-image-2-style-library.

  3. 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.mjs entry point.

  4. Data access: The runtime imports the bundled data/style-library.json to perform category and template lookups against the latest gallery cases.

  5. 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 the install all command.

  • 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.json template database via the gpt-image-2-style-library npm package.
  • Install via /plugin install commands or npm install -g gpt-image-2-style-library followed by install all.
  • Claude Code loads skills from ~/.claude/skills by parsing SKILL.md metadata at startup.
  • Invoke the skill with /skill gpt-image-2-style-library followed by your image generation request in English or Chinese.
  • Update the skill by running npm run generate:style-skill and 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.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →