# How to Install Skills for Claude Code or Codex in awesome-gpt-image-2

> Easily install Claude Code or Codex skills for awesome-gpt-image-2. Run the install script from the repository root and restart your agent to activate new skills.

- Repository: [苍何/awesome-gpt-image-2](https://github.com/freestylefly/awesome-gpt-image-2)
- Tags: how-to-guide
- Published: 2026-09-08

---

**TLDR:** Run `node scripts/install-style-skill.mjs [target]` from the repository root to copy the GPT-Image2 style library to `~/.claude/skills`, `~/.codex/skills`, or all supported agent directories, then restart your agent session to activate it.

The *awesome-gpt-image-2* repository packages a reusable agent skill that exposes the complete GPT-Image2 style library to Claude Code, Codex, and compatible AI agents. Installing this skill requires executing a single Node.js script that maps the skill files to each agent's expected directory structure. This guide details the installation process based on the implementation in `scripts/install-style-skill.mjs`.

## Skill Location and Structure

The skill bundle resides in `agents/skills/gpt-image-2-style-library`. This directory contains the **SKILL.md** descriptor, the master style data in [`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json), and rendering logic that agents consume automatically upon startup.

The installation script treats this folder as an atomic unit, copying it wholesale to the target agent's skills directory without modification.

## Installation Steps

### Install for All Agents

To install the skill for every supported agent (Codex, Claude Code, and shared agents) simultaneously, run the install script without arguments:

```bash
node scripts/install-style-skill.mjs

```

The script defaults to the `all` target, which copies the skill to `~/.codex/skills`, `~/.claude/skills`, and `~/.agents/skills` in sequence.

### Install for Claude Code Only

To restrict installation to Claude Code, pass the `claude-code` argument:

```bash
node scripts/install-style-skill.mjs claude-code

```

This command copies `agents/skills/gpt-image-2-style-library` to `~/.claude/skills/gpt-image-2-style-library` (or `$CLAUDE_HOME/skills` if the environment variable is set).

### Install for Codex Only

To install exclusively for Codex, specify the `codex` target:

```bash
node scripts/install-style-skill.mjs codex

```

The script deploys the skill to `~/.codex/skills/gpt-image-2-style-library`, respecting the `$CODEX_HOME` environment variable if defined.

## How the Installation Script Works

Understanding the mechanics of `scripts/install-style-skill.mjs` ensures you can troubleshoot path issues or customize the deployment.

### Target Directory Resolution

The script defines a `targetDefinitions` map (lines 10–21) that resolves default paths using `os.homedir()`:

- **Codex:** `~/.codex/skills` or `$CODEX_HOME/skills`
- **Claude Code:** `~/.claude/skills` or `$CLAUDE_HOME/skills`
- **Shared Agents:** `~/.agents/skills` or `$AGENTS_HOME/skills`

If the environment variables exist, they override the home-directory defaults.

### CLI Argument Parsing

Lines 31–48 handle argument validation. The script accepts a space-separated list of targets (`all`, `codex`, `claude-code`, `agents`). Invalid arguments trigger an error message listing valid options. When invoked without arguments, the script defaults to `all`.

### Skill Deployment Logic

For each valid target, the script (lines 51–56):

1. Creates the target skills root directory if missing.
2. Removes any existing `gpt-image-2-style-library` folder to prevent stale data.
3. Recursively copies the source directory `agents/skills/gpt-image-2-style-library` to the target location.
4. Prints a confirmation message indicating the final installation path.

## Activating the Skill

After installation, **restart your agent session** (e.g., exit and relaunch Claude Code or Codex). The agent scans its skills folder on startup and loads the new `gpt-image-2-style-library` automatically. No additional configuration edits are required; the **SKILL.md** descriptor provides the metadata the agent needs to expose the style templates and categories.

## Summary

- The **awesome-gpt-image-2** repository distributes a portable skill in `agents/skills/gpt-image-2-style-library`.
- Run `node scripts/install-style-skill.mjs` to deploy to all agents, or specify `claude-code`, `codex`, or `agents` for selective installation.
- The script respects `$CLAUDE_HOME`, `$CODEX_HOME`, and `$AGENTS_HOME` environment variables for custom directory paths.
- Installation simply copies the skill folder; agents discover it automatically after a restart.

## Frequently Asked Questions

### What file path does Claude Code use for skills?

Claude Code looks for skills in `~/.claude/skills` by default. If you define the `$CLAUDE_HOME` environment variable, it uses `$CLAUDE_HOME/skills` instead. The install script handles this resolution automatically according to the logic in `scripts/install-style-skill.mjs`.

### Can I override the default installation directories?

Yes. Set the appropriate environment variable before running the script: `CLAUDE_HOME` for Claude Code, `CODEX_HOME` for Codex, or `AGENTS_HOME` for shared agents. The script checks these variables before falling back to the default home-directory paths.

### Do I need to restart the agent after installing the skill?

Yes. Claude Code, Codex, and similar agents scan their skills folders only during initialization. You must restart the agent process to load the newly copied `gpt-image-2-style-library` and access the style templates defined in [`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json).

### What data is included in the gpt-image-2-style-library skill?

The skill includes a **SKILL.md** file describing its capabilities, the master [`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json) containing templates, categories, styles, and scenes, plus rendering logic used by the agent to format style references. This replaces or supplements the agent's built-in knowledge of GPT-Image2 parameters.