How `install:skill` Distributes GPT‑Image‑2 Skills to Codex, Claude Code, and Agents Local Folders
The install:skill script copies the gpt‑image‑2 style‑library skill into ~/.codex/skills, ~/.claude/skills, and ~/.agents/skills based on the target you specify.
The awesome‑gpt‑image‑2 repository provides a lightweight CLI that synchronizes skill definitions across the three dominant agent platforms. When you run npm run install:skill, the underlying install‑style‑skill.mjs script determines which directories to populate and performs a direct filesystem copy.
How the Distribution Works
The script operates through a simple target‑based dispatch system. It accepts one of four values: all, codex, claude‑code, or agents. Unknown targets trigger an explicit error.
In scripts/install-style-skill.mjs, the validation logic appears around line 44:
throw new Error(`Unknown install target: ${name}. Must be one of: all, codex, claude-code, agents`);
Once validated, the script copies the entire agents/skills/gpt-image‑2‑style‑library folder into the corresponding local directory under your home folder.
Target Directories
| Target | Destination Path |
|---|---|
codex |
~/.codex/skills |
claude-code |
~/.claude/skills |
agents |
~/.agents/skills |
all |
All three directories above |
The README confirms this behavior at line 292, stating that install all writes the skill to "the common local folders used by Codex and Claude Code, including ~/.codex/skills, ~/.claude/skills, and ~/.agents/skills."
Running the Install Script
You can invoke the distribution logic through multiple entry points, all converging on the same core copy mechanism.
Via npm script (recommended for contributors)
# Clone the repository
git clone https://github.com/freestylefly/awesome-gpt-image-2.git
cd awesome-gpt-image-2
# Install to all supported agent directories
npm run install:skill
The package.json script alias typically defaults to all, executing the equivalent of node scripts/install-style-skill.mjs install all.
Via npx (no clone required)
# Install globally once, then copy to every location
npm install -g gpt-image-2-style-library
gpt-image-2-style-library install all
Via the skill's bundled CLI
# Target only Codex
npx gpt-image-2-style-library install codex
# Target only Claude Code
npx gpt-image-2-style-library install claude-code
# Target the generic Agents folder
npx gpt-image-2-style-library install agents
Direct node execution
cd agents/skills/gpt-image-2-style-library
node bin/install.mjs install claude-code
The binary at agents/skills/gpt-image-2-style-library/bin/install.mjs wraps the same validation and copy logic, adding usage help and argument parsing for standalone operation.
Post‑Install Requirements
After distribution completes, you must restart your agent session for the skill to become available. Neither Codex, Claude Code, nor the generic Agents runtime monitors local skill directories for runtime changes.
The README notes this explicitly: "Restart the agent session after installing." This applies regardless of whether you used all or a single target.
Key Source Files
Understanding the distribution mechanism requires familiarity with three files:
scripts/install-style-skill.mjs— The primary npm script implementation. Handles argument parsing, target validation, and directory copying.agents/skills/gpt-image-2-style-library/bin/install.mjs— The skill's own CLI binary. Re‑exports the install logic for npx and global installation scenarios.README.md(line 292) — Documents the three target directories and the restart requirement.
Summary
- The
install:skillscript distributes skills by copying files into standard local agent directories. - Supported targets are
codex,claude-code,agents, andall. - Destination paths are
~/.codex/skills,~/.claude/skills, and~/.agents/skills. - The script validates targets strictly and throws on unknown names.
- A session restart is required after installation for agents to recognize the new skill.
Frequently Asked Questions
What happens if I specify an invalid target name?
The script throws a descriptive error: Unknown install target: ${name}. Must be one of: all, codex, claude-code, agents. This validation occurs in scripts/install-style-skill.mjs before any filesystem operations begin.
Can I install to only one agent instead of all three?
Yes. Use npx gpt-image-2-style-library install codex (or claude-code, or agents) to target a single directory. The all target is merely a convenience that runs the copy operation three times.
Do I need to reinstall after updating the skill?
Yes. The script performs a static copy, not a symbolic link or live sync. When you pull a new version of awesome-gpt-image-2, rerun npm run install:skill to overwrite the previous skill files in your local agent directories.
Why must I restart the agent session?
Codex, Claude Code, and the generic Agents runtime load skill manifests at startup. None of these platforms watch local directories for changes during execution. Restarting ensures the updated skill definition is parsed and registered.
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 →