# How to Configure Agent Skill Installation for Local Development in awesome-gpt-image-2

> Learn to configure agent skill installation for local development in awesome-gpt-image-2. Easily copy the gpt-image-2-style-library to agent directories using environment variables.

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

---

**Configure agent skill installation for local development by running `node scripts/install-style-skill.mjs` to copy the `gpt-image-2-style-library` into Codex, Claude Code, and shared agent directories, using environment variables `CODEX_HOME`, `CLAUDE_HOME`, and `AGENTS_HOME` to customize target paths.**

The *awesome-gpt-image-2* repository by freestylefly distributes the **gpt-image-2-style-library** as an installable agent skill. To configure agent skill installation for local development, you must copy the skill files from the repository into the runtime-specific directories where AI agents expect to discover and load them.

## Installation Scripts Overview

The repository provides two Node.js scripts that implement identical installation logic for different workflow contexts.

### Repository-Level Installer

The primary script for active development is `scripts/install-style-skill.mjs`. This file sits at the repository root and is the recommended entry point when working within the cloned source code.

### Bundled Skill Installer

The file `agents/skills/gpt-image-2-style-library/bin/install.mjs` is packaged with the skill itself. After publishing, you can invoke this via `npx gpt-image-2-style-library` to install the skill independently of the full repository.

## Installation Architecture and Root Detection

Both scripts calculate the repository root dynamically to ensure portability across execution contexts. They use `dirname(dirname(fileURLToPath(import.meta.url)))` to resolve paths relative to the script location, allowing the installer to function correctly whether run from the repository root or a packaged distribution.

## Target Runtime Configuration

### Default Agent Directories

By default, the installers target skill directories within the user's home folder:

- **Codex**: `~/.codex/skills`
- **Claude Code**: `~/.claude/skills`
- **Shared agents**: `~/.agents/skills`

### Environment Variable Overrides

You can configure agent skill installation for local development to use custom paths by setting environment variables before execution:

```bash
export CODEX_HOME=$HOME/.custom-codex
export CLAUDE_HOME=$HOME/.custom-claude
export AGENTS_HOME=$HOME/.custom-agents

```

The scripts construct target paths using the pattern:

```javascript
root: join(process.env.CODEX_HOME || join(homedir(), '.codex'), 'skills')

```

## Command-Line Interface and Aliases

### Target Aliases

The CLI accepts intuitive aliases that map to concrete installation targets. The `targetAliases` object in `install-style-skill.mjs` defines the following mappings:

```javascript
const targetAliases = {
  all: Object.keys(targetDefinitions),
  codex: ['codex'],
  claude: ['claude-code'],
  agents: ['agents'],
  shared: ['agents']
};

```

### Installation Commands

The bundled `install.mjs` accepts optional commands (`install` or `sync`) followed by target names. If the first argument is not a known command, it defaults to `install`:

```bash

# Install to all runtimes (default)

npx gpt-image-2-style-library install all

# Install only to Claude Code

npx gpt-image-2-style-library install claude-code

```

## Step-by-Step Local Development Workflow

Follow this workflow to configure agent skill installation for local development:

1. **Clone the repository**:

```bash
git clone https://github.com/freestylefly/awesome-gpt-image-2.git
cd awesome-gpt-image-2

```

2. **Run the installer**:

```bash

# Install to every supported runtime (default behavior)

node scripts/install-style-skill.mjs

# Or install selectively

node scripts/install-style-skill.mjs codex claude-code

```

3. **Verify the installation**:

```bash
ls $HOME/.codex/skills/gpt-image-2-style-library
ls $HOME/.claude/skills/gpt-image-2-style-library
ls $HOME/.agents/skills/gpt-image-2-style-library

```

Each directory should contain [`SKILL.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/SKILL.md), `agents/`, `assets/`, and `references/`.

4. **Develop and iterate**:

Edit files under `agents/skills/gpt-image-2-style-library/`, then re-run the installer to push changes to the runtime directories.

## Internal Installation Flow

The `selectedTargets()` function in `scripts/install-style-skill.mjs` processes CLI arguments and resolves aliases:

```javascript
function selectedTargets() {
  const names = rawTargets.length ? rawTargets : ['all'];
  const selected = new Set();
  for (const name of names) {
    const normalized = name.toLowerCase();
    const matches = targetAliases[normalized];
    if (!matches) {
      throw new Error(`Unknown install target: ${name}. Use all, codex, claude-code, or agents.`);
    }
    for (const match of matches) selected.add(match);
  }
  return [...selected].map((name) => targetDefinitions[name]);
}

```

The installation process performs these atomic operations:

- **Directory creation**: `mkdirSync(..., {recursive:true})` ensures the destination exists
- **Cleanup**: `rmSync(target, {recursive:true, force:true})` removes previous installations
- **Copy**: `cpSync(source, target, {recursive:true})` recursively copies the skill folder

## Summary

- **Use `scripts/install-style-skill.mjs`** for development workflows within the cloned awesome-gpt-image-2 repository
- **Set `CODEX_HOME`, `CLAUDE_HOME`, or `AGENTS_HOME`** environment variables to override default installation paths
- **Target specific runtimes** using aliases like `codex`, `claude-code`, `agents`, or `all` (default)
- **Re-run the installer** after modifying skill files to update the runtime directories
- **Verify installations** by checking for [`SKILL.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/SKILL.md) and subdirectories in the target agent folders

## Frequently Asked Questions

### What is the difference between the two installation scripts?

The `scripts/install-style-skill.mjs` file is the primary development tool used when working directly with the repository source code. The `agents/skills/gpt-image-2-style-library/bin/install.mjs` file is bundled with the skill package and can be executed via `npx` after publication. Both implement identical installation logic but serve different distribution contexts.

### How do I install the skill to a custom directory outside the defaults?

Set the appropriate environment variable before running the installer. For example, `export CODEX_HOME=$HOME/my-custom-agents` configures the script to install into `~/my-custom-agents/skills/` instead of `~/.codex/skills/`. The scripts check `process.env.CODEX_HOME`, `process.env.CLAUDE_HOME`, and `process.env.AGENTS_HOME` before falling back to the default home directory subfolders.

### Can I install the skill to only one specific agent runtime?

Yes. Pass the runtime alias as an argument to the installer script. For example, `node scripts/install-style-skill.mjs claude-code` installs only to the Claude Code directory, while `node scripts/install-style-skill.mjs codex` targets only Codex. Omitting arguments defaults to `all`.

### What files should exist after a successful installation?

After installation, the target directory (e.g., `~/.codex/skills/gpt-image-2-style-library/`) should contain [`SKILL.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/SKILL.md) (the skill manifest), an `agents/` subdirectory with implementation files, an `assets/` folder for resources, and a `references/` directory for documentation. If these are missing, the skill may not load properly in the agent runtime.