Skip to content

Prompt as Code | GPT Image 2 / 2.5 提示词与案例库,530+ 个案例、20+ 套工业级模板与可复用 Skills,新增 2.5 同提示词对比专区,附完整提示词与生成记录,持续更新。

Improve agent skill installation docs

freestyleflyf12b8826f825
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
new file mode 100644
index 0000000..3378023
--- /dev/null
+++ b/.claude-plugin/marketplace.json
@@ -0,0 +1,22 @@
+{
+ "name": "awesome-gpt-image-2",
+ "owner": {
+ "name": "freestylefly",
+ "email": "[email protected]"
+ },
+ "metadata": {
+ "description": "GPT-Image2 prompt cases and style-library agent skill.",
+ "version": "1.0.1"
+ },
+ "plugins": [
+ {
+ "name": "gpt-image-2-style-library",
+ "description": "Choose GPT-Image2 visual styles, industrial prompt templates, categories, and scene tags.",
+ "source": "./",
+ "strict": false,
+ "skills": [
+ "./agents/skills/gpt-image-2-style-library"
+ ]
+ }
+ ]
+}
diff --git a/README.md b/README.md
index 43eccb0..8f8132b 100644
--- a/README.md
+++ b/README.md
@@ -40,21 +40,46 @@ The core goal is simple: compress prose-style prompts into structured protocols.
## 🤖 Agent Skill
-This repository includes a Codex skill for choosing GPT-Image2 styles, templates, categories, and scene tags from the same data used by the website.
+This repository includes an agent skill for choosing GPT-Image2 styles, templates, categories, and scene tags from the same data used by the website.
Package links: [npm](https://www.npmjs.com/package/gpt-image-2-style-library) / [GitHub Packages](https://github.com/freestylefly/awesome-gpt-image-2/pkgs/npm/gpt-image-2-style-library)
-Install from npm:
+### Quick Install for Agent Skills
+
+Recommended for Claude Code, Codex, Cursor, and other tools supported by [`skills`](https://www.npmjs.com/package/skills):
+
+```bash
+npx skills add freestylefly/awesome-gpt-image-2 --skill gpt-image-2-style-library --agent claude-code codex --global --yes --copy
+```
+
+Install to every supported local agent:
```bash
-npx gpt-image-2-style-library install
+npx skills add freestylefly/awesome-gpt-image-2 --global --all --copy
+```
+
+### Claude Code Plugin Marketplace
+
+Run these commands inside Claude Code:
+
+```text
+/plugin marketplace add freestylefly/awesome-gpt-image-2
+/plugin install gpt-image-2-style-library@awesome-gpt-image-2
```
-Or install globally:
+### npm CLI
+
+If you prefer npm, install the CLI and then sync the skill into local agent folders:
```bash
npm install -g gpt-image-2-style-library
-gpt-image-2-style-library install
+gpt-image-2-style-library install all
+```
+
+You can also run it without a global install:
+
+```bash
+npx gpt-image-2-style-library install all
```
Install from GitHub Packages:
@@ -62,10 +87,12 @@ Install from GitHub Packages:
```bash
npm login --scope=@freestylefly --registry=https://npm.pkg.github.com
npm install -g @freestylefly/gpt-image-2-style-library --registry=https://npm.pkg.github.com
-gpt-image-2-style-library install
+gpt-image-2-style-library install all
```
-Use it in Codex with a request like:
+`install all` writes the skill to the common local folders used by Codex and Claude Code, including `~/.codex/skills`, `~/.claude/skills`, and `~/.agents/skills`. Restart the agent session after installing.
+
+Use it with a request like:
```text
Use gpt-image-2-style-library to create an infographic prompt about Codex.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 63ff6c8..ce55aaa 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -40,21 +40,46 @@ GPT-Image2 全量开放后,AI 画图从“能不能出图”变成了“能不
## 🤖 Agent Skill
-仓库内提供了 Codex skill,用同一份风格库数据为 Agent 选择 GPT-Image2 模板、分类、风格和场景标签。
+仓库内提供了 agent skill,用同一份风格库数据为 Claude Code、Codex 等 Agent 选择 GPT-Image2 模板、分类、风格和场景标签。
包地址:[npm](https://www.npmjs.com/package/gpt-image-2-style-library) / [GitHub Packages](https://github.com/freestylefly/awesome-gpt-image-2/pkgs/npm/gpt-image-2-style-library)
-从 npm 安装:
+### Agent 一键安装
+
+推荐给 Claude Code、Codex、Cursor,以及其他 [`skills`](https://www.npmjs.com/package/skills) 支持的本地 Agent:
+
+```bash
+npx skills add freestylefly/awesome-gpt-image-2 --skill gpt-image-2-style-library --agent claude-code codex --global --yes --copy
+```
+
+安装到所有支持的本地 Agent:
```bash
-npx gpt-image-2-style-library install
+npx skills add freestylefly/awesome-gpt-image-2 --global --all --copy
+```
+
+### Claude Code 插件市场
+
+在 Claude Code 中运行:
+
+```text
+/plugin marketplace add freestylefly/awesome-gpt-image-2
+/plugin install gpt-image-2-style-library@awesome-gpt-image-2
```
-也可以全局安装:
+### npm CLI
+
+如果你习惯 npm,可以先安装 CLI,再同步到本地 Agent 技能目录:
```bash
npm install -g gpt-image-2-style-library
-gpt-image-2-style-library install
+gpt-image-2-style-library install all
+```
+
+也可以不全局安装,直接运行:
+
+```bash
+npx gpt-image-2-style-library install all
```
从 GitHub Packages 安装:
@@ -62,10 +87,12 @@ gpt-image-2-style-library install
```bash
npm login --scope=@freestylefly --registry=https://npm.pkg.github.com
npm install -g @freestylefly/gpt-image-2-style-library --registry=https://npm.pkg.github.com
-gpt-image-2-style-library install
+gpt-image-2-style-library install all
```
-在 Codex 里这样调用:
+`install all` 会写入 Codex 和 Claude Code 常用的本地技能目录,包括 `~/.codex/skills`、`~/.claude/skills`、`~/.agents/skills`。安装后重启 Agent 会话。
+
+这样调用:
```text
使用 gpt-image-2-style-library 技能,帮我生成介绍 Codex 的信息图
diff --git a/agents/skills/gpt-image-2-style-library/bin/install.mjs b/agents/skills/gpt-image-2-style-library/bin/install.mjs
index 72698c7..7dcd967 100755
--- a/agents/skills/gpt-image-2-style-library/bin/install.mjs
+++ b/agents/skills/gpt-image-2-style-library/bin/install.mjs
@@ -5,19 +5,54 @@ import { homedir } from 'node:os';
import { fileURLToPath } from 'node:url';
const skillName = 'gpt-image-2-style-library';
-const command = process.argv[2] || 'install';
+const args = process.argv.slice(2);
+const commandOrTarget = args[0] || 'install';
const allowedCommands = new Set(['install', 'sync']);
+let command = commandOrTarget;
+let targetArgs = args.slice(1);
+if (!allowedCommands.has(commandOrTarget)) {
+ command = 'install';
+ targetArgs = args;
+}
+
+const usage = [
+ 'Usage: gpt-image-2-style-library install [all|codex|claude-code|agents]',
+ 'Examples:',
+ ' gpt-image-2-style-library install all',
+ ' gpt-image-2-style-library install claude-code',
+ ' gpt-image-2-style-library install codex'
+].join('\n');
+
if (!allowedCommands.has(command)) {
- console.error(`Usage: gpt-image-2-style-library install`);
+ console.error(usage);
process.exit(1);
}
const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
-const codexHome = process.env.CODEX_HOME || join(homedir(), '.codex');
-const targetRoot = join(codexHome, 'skills');
-const target = join(targetRoot, skillName);
const entries = ['SKILL.md', 'agents', 'references'];
+const targetDefinitions = {
+ codex: {
+ label: 'Codex',
+ root: join(process.env.CODEX_HOME || join(homedir(), '.codex'), 'skills')
+ },
+ 'claude-code': {
+ label: 'Claude Code',
+ root: join(process.env.CLAUDE_HOME || join(homedir(), '.claude'), 'skills')
+ },
+ agents: {
+ label: 'Shared agent skills',
+ root: join(process.env.AGENTS_HOME || join(homedir(), '.agents'), 'skills')
+ }
+};
+const targetAliases = {
+ all: Object.keys(targetDefinitions),
+ codex: ['codex'],
+ claude: ['claude-code'],
+ 'claude-code': ['claude-code'],
+ agents: ['agents'],
+ shared: ['agents']
+};
for (const entry of entries) {
const source = join(packageRoot, entry);
@@ -26,12 +61,32 @@ for (const entry of entries) {
}
}
-mkdirSync(targetRoot, { recursive: true });
-rmSync(target, { recursive: true, force: true });
-mkdirSync(target, { recursive: true });
+function selectedTargets(rawTargets) {
+ const names = rawTargets.length ? rawTargets : ['all'];
+ const selected = new Set();
-for (const entry of entries) {
- cpSync(join(packageRoot, entry), join(target, entry), { recursive: true });
+ for (const name of names) {
+ const normalized = name.toLowerCase();
+ const matches = targetAliases[normalized];
+ if (!matches) {
+ console.error(usage);
+ throw new Error(`Unknown target: ${name}`);
+ }
+ for (const match of matches) selected.add(match);
+ }
+
+ return [...selected].map((name) => targetDefinitions[name]);
}
-console.log(`Installed ${skillName} to ${target}`);
+for (const targetDefinition of selectedTargets(targetArgs)) {
+ const target = join(targetDefinition.root, skillName);
+ mkdirSync(targetDefinition.root, { recursive: true });
+ rmSync(target, { recursive: true, force: true });
+ mkdirSync(target, { recursive: true });
+
+ for (const entry of entries) {
+ cpSync(join(packageRoot, entry), join(target, entry), { recursive: true });
+ }
+
+ console.log(`Installed ${skillName} for ${targetDefinition.label}: ${target}`);
+}
diff --git a/agents/skills/gpt-image-2-style-library/package.json b/agents/skills/gpt-image-2-style-library/package.json
index 3ed766d..4bafc78 100644
--- a/agents/skills/gpt-image-2-style-library/package.json
+++ b/agents/skills/gpt-image-2-style-library/package.json
@@ -1,7 +1,7 @@
{
"name": "gpt-image-2-style-library",
- "version": "1.0.0",
- "description": "Codex skill for choosing GPT-Image2 visual styles, prompt templates, categories, and scene tags.",
+ "version": "1.0.1",
+ "description": "Agent skill for choosing GPT-Image2 visual styles, prompt templates, categories, and scene tags.",
"type": "module",
"license": "MIT",
"repository": {
@@ -14,6 +14,8 @@
"url": "https://github.com/freestylefly/awesome-gpt-image-2/issues"
},
"keywords": [
+ "agent-skill",
+ "claude-code",
"codex",
"codex-skill",
"gpt-image-2",
diff --git a/scripts/install-style-skill.mjs b/scripts/install-style-skill.mjs
index 37d48cc..20c81a4 100644
--- a/scripts/install-style-skill.mjs
+++ b/scripts/install-style-skill.mjs
@@ -6,16 +6,53 @@ import { fileURLToPath } from 'node:url';
const root = dirname(dirname(fileURLToPath(import.meta.url)));
const skillName = 'gpt-image-2-style-library';
const source = join(root, 'agents', 'skills', skillName);
-const codexHome = process.env.CODEX_HOME || join(homedir(), '.codex');
-const targetRoot = join(codexHome, 'skills');
-const target = join(targetRoot, skillName);
+const targetDefinitions = {
+ codex: {
+ label: 'Codex',
+ root: join(process.env.CODEX_HOME || join(homedir(), '.codex'), 'skills')
+ },
+ 'claude-code': {
+ label: 'Claude Code',
+ root: join(process.env.CLAUDE_HOME || join(homedir(), '.claude'), 'skills')
+ },
+ agents: {
+ label: 'Shared agent skills',
+ root: join(process.env.AGENTS_HOME || join(homedir(), '.agents'), 'skills')
+ }
+};
+const targetAliases = {
+ all: Object.keys(targetDefinitions),
+ codex: ['codex'],
+ claude: ['claude-code'],
+ 'claude-code': ['claude-code'],
+ agents: ['agents'],
+ shared: ['agents']
+};
+const rawTargets = process.argv.slice(2);
if (!existsSync(join(source, 'SKILL.md'))) {
throw new Error(`Skill source is missing: ${source}`);
}
-mkdirSync(targetRoot, { recursive: true });
-rmSync(target, { recursive: true, force: true });
-cpSync(source, target, { recursive: true });
+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]);
+}
+
+for (const targetDefinition of selectedTargets()) {
+ const target = join(targetDefinition.root, skillName);
+ mkdirSync(targetDefinition.root, { recursive: true });
+ rmSync(target, { recursive: true, force: true });
+ cpSync(source, target, { recursive: true });
-console.log(`Installed ${skillName} to ${target}`);
+ console.log(`Installed ${skillName} for ${targetDefinition.label}: ${target}`);
+}