Skip to content

Commit 1910e48

Browse files
committed
Publish style skill package
1 parent c5769e5 commit 1910e48

6 files changed

Lines changed: 174 additions & 2 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish GPT-Image2 Style Skill
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'gpt-image-2-style-library-v*'
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
jobs:
14+
github-packages:
15+
name: GitHub Packages
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
registry-url: https://npm.pkg.github.com
26+
scope: '@freestylefly'
27+
28+
- name: Publish scoped package
29+
working-directory: agents/skills/gpt-image-2-style-library
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: |
33+
npm pkg set name=@freestylefly/gpt-image-2-style-library
34+
npm pkg set publishConfig.registry=https://npm.pkg.github.com
35+
npm publish --registry=https://npm.pkg.github.com

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,38 @@ The core goal is simple: compress prose-style prompts into structured protocols.
4040

4141
## 🤖 Agent Skill
4242

43-
This repository now includes a source-level Codex skill for choosing GPT-Image2 styles, templates, categories, and scene tags from the same data used by the website.
43+
This repository includes a Codex skill for choosing GPT-Image2 styles, templates, categories, and scene tags from the same data used by the website.
44+
45+
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)
46+
47+
Install from npm:
48+
49+
```bash
50+
npx gpt-image-2-style-library install
51+
```
52+
53+
Or install globally:
54+
55+
```bash
56+
npm install -g gpt-image-2-style-library
57+
gpt-image-2-style-library install
58+
```
59+
60+
Install from GitHub Packages:
61+
62+
```bash
63+
npm login --scope=@freestylefly --registry=https://npm.pkg.github.com
64+
npm install -g @freestylefly/gpt-image-2-style-library --registry=https://npm.pkg.github.com
65+
gpt-image-2-style-library install
66+
```
67+
68+
Use it in Codex with a request like:
69+
70+
```text
71+
Use gpt-image-2-style-library to create an infographic prompt about Codex.
72+
```
73+
74+
For local source development:
4475

4576
```bash
4677
npm run generate:style-skill

README.zh-CN.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,38 @@ GPT-Image2 全量开放后,AI 画图从“能不能出图”变成了“能不
4040

4141
## 🤖 Agent Skill
4242

43-
仓库内新增了 Codex skill,用同一份风格库数据为 Agent 选择 GPT-Image2 模板、分类、风格和场景标签。
43+
仓库内提供了 Codex skill,用同一份风格库数据为 Agent 选择 GPT-Image2 模板、分类、风格和场景标签。
44+
45+
包地址:[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)
46+
47+
从 npm 安装:
48+
49+
```bash
50+
npx gpt-image-2-style-library install
51+
```
52+
53+
也可以全局安装:
54+
55+
```bash
56+
npm install -g gpt-image-2-style-library
57+
gpt-image-2-style-library install
58+
```
59+
60+
从 GitHub Packages 安装:
61+
62+
```bash
63+
npm login --scope=@freestylefly --registry=https://npm.pkg.github.com
64+
npm install -g @freestylefly/gpt-image-2-style-library --registry=https://npm.pkg.github.com
65+
gpt-image-2-style-library install
66+
```
67+
68+
在 Codex 里这样调用:
69+
70+
```text
71+
使用 gpt-image-2-style-library 技能,帮我生成介绍 Codex 的信息图
72+
```
73+
74+
本地源码开发时使用:
4475

4576
```bash
4677
npm run generate:style-skill
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env node
2+
import { cpSync, existsSync, mkdirSync, rmSync } from 'node:fs';
3+
import { dirname, join } from 'node:path';
4+
import { homedir } from 'node:os';
5+
import { fileURLToPath } from 'node:url';
6+
7+
const skillName = 'gpt-image-2-style-library';
8+
const command = process.argv[2] || 'install';
9+
const allowedCommands = new Set(['install', 'sync']);
10+
11+
if (!allowedCommands.has(command)) {
12+
console.error(`Usage: gpt-image-2-style-library install`);
13+
process.exit(1);
14+
}
15+
16+
const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
17+
const codexHome = process.env.CODEX_HOME || join(homedir(), '.codex');
18+
const targetRoot = join(codexHome, 'skills');
19+
const target = join(targetRoot, skillName);
20+
const entries = ['SKILL.md', 'agents', 'references'];
21+
22+
for (const entry of entries) {
23+
const source = join(packageRoot, entry);
24+
if (!existsSync(source)) {
25+
throw new Error(`Missing package entry: ${entry}`);
26+
}
27+
}
28+
29+
mkdirSync(targetRoot, { recursive: true });
30+
rmSync(target, { recursive: true, force: true });
31+
mkdirSync(target, { recursive: true });
32+
33+
for (const entry of entries) {
34+
cpSync(join(packageRoot, entry), join(target, entry), { recursive: true });
35+
}
36+
37+
console.log(`Installed ${skillName} to ${target}`);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "gpt-image-2-style-library",
3+
"version": "1.0.0",
4+
"description": "Codex skill for choosing GPT-Image2 visual styles, prompt templates, categories, and scene tags.",
5+
"type": "module",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/freestylefly/awesome-gpt-image-2.git",
10+
"directory": "agents/skills/gpt-image-2-style-library"
11+
},
12+
"homepage": "https://github.com/freestylefly/awesome-gpt-image-2#agent-skill",
13+
"bugs": {
14+
"url": "https://github.com/freestylefly/awesome-gpt-image-2/issues"
15+
},
16+
"keywords": [
17+
"codex",
18+
"codex-skill",
19+
"gpt-image-2",
20+
"prompt",
21+
"image-generation",
22+
"style-library"
23+
],
24+
"bin": {
25+
"gpt-image-2-style-library": "bin/install.mjs"
26+
},
27+
"files": [
28+
"SKILL.md",
29+
"agents",
30+
"bin",
31+
"references"
32+
],
33+
"publishConfig": {
34+
"access": "public"
35+
}
36+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"generate:site-data": "node scripts/generate-site-data.mjs",
88
"generate:style-skill": "node scripts/generate-style-skill.mjs",
99
"install:skill": "node scripts/install-style-skill.mjs",
10+
"pack:skill": "npm pack ./agents/skills/gpt-image-2-style-library --dry-run",
11+
"publish:skill:npm": "npm publish ./agents/skills/gpt-image-2-style-library --access public",
1012
"predev": "npm run generate:site-data && npm run generate:style-skill",
1113
"dev": "vite",
1214
"prebuild": "npm run generate:site-data && npm run generate:style-skill",

0 commit comments

Comments
 (0)