Skip to content

Commit 696cbdb

Browse files
chore(skills): package Codex plugin upload (#2668)
* chore(skills): package Codex plugin upload * chore(skills): harden Codex plugin content * fix(skills): satisfy plugin quality gates * fix(skills): address plugin packaging review * fix(plugin): simplify asset validation * fix(skills): correct embedded-captions catalog count to 35 after nightcity removal The nightcity theme removal left SKILL.md claiming 36 identities in four places, including the frontmatter description the router reads. The catalog now has 35 entries (10 classic + 25 themed). --------- Co-authored-by: Miao Yang <[email protected]>
1 parent 84841b8 commit 696cbdb

51 files changed

Lines changed: 246 additions & 560 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
code: ${{ steps.filter.outputs.code }}
3535
cli: ${{ steps.filter.outputs.cli }}
3636
skills: ${{ steps.filter.outputs.skills }}
37+
codex_plugin: ${{ steps.filter.outputs.codex_plugin }}
3738
steps:
3839
# Force git-based change detection instead of the pull_request REST API.
3940
# The API path can fail the whole workflow on transient listFiles
@@ -68,6 +69,13 @@ jobs:
6869
- "scripts/check-skill-mirror.mjs"
6970
- "package.json"
7071
- ".github/workflows/ci.yml"
72+
codex_plugin:
73+
- ".codex-plugin/**"
74+
- "assets/**"
75+
- "skills/**"
76+
- "scripts/package-codex-plugin.mjs"
77+
- "package.json"
78+
- ".github/workflows/ci.yml"
7179
7280
build:
7381
name: Build
@@ -339,6 +347,20 @@ jobs:
339347
- name: Verify .claude/skills/ and .agents/skills/ are byte-identical
340348
run: node scripts/check-skill-mirror.mjs
341349

350+
codex-plugin-package:
351+
name: "Codex plugin package"
352+
needs: changes
353+
if: needs.changes.outputs.codex_plugin == 'true'
354+
runs-on: ubuntu-latest
355+
timeout-minutes: 3
356+
steps:
357+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
358+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
359+
with:
360+
node-version: 22
361+
- name: Build upload-ready Codex plugin
362+
run: node scripts/package-codex-plugin.mjs
363+
342364
cli-npx-shim:
343365
name: "CLI: npx shim (${{ matrix.os }})"
344366
needs: changes

‎README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ Default to the **core set** — the router installs each creation workflow on de
5959

6060
Installs stay lean after that: `npx hyperframes init` keeps the **core set** fresh (the router, the `hyperframes-*` domain skills, and `media-use` — plus whatever is already installed; `/figma` stays on demand) and never expands a partial install; the creation workflows install **on demand** — the router runs `npx hyperframes skills update <workflow>` before entering one. Nothing re-pulls the full set behind your back.
6161

62+
### Upload to Codex
63+
64+
Build the upload-ready Codex plugin archive from the committed `HEAD` version of the manifest, brand assets, and skills:
65+
66+
```bash
67+
bun run package:codex-plugin
68+
```
69+
70+
This writes `dist/hyperframes-plugin.zip` with a `hyperframes/` root folder and fails if the archive exceeds Codex's 100 MB upload limit.
71+
6272
### Router
6373

6474
| Skill | Use when |

‎docs/superpowers/specs/2026-07-13-media-use-sfx-cli-advisory-design.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ When SFX resolution succeeds through the bundled fallback because the HeyGen CLI
99
- Reuse the existing HeyGen CLI error classification produced by the failed catalog provider call.
1010
- Retain only the latest actionable `not_found` or `outdated` remediation for the current resolver process.
1111
- When `bundled.sfx` wins after that failure, include a structured advisory in JSON output and print the same concise hint in human output.
12-
- Use the existing canonical commands:
13-
- Missing: `curl -fsSL https://static.heygen.ai/cli/install.sh | bash && heygen auth login --oauth`
12+
- Use the existing canonical remediation:
13+
- Missing: install the [HeyGen CLI](https://developers.heygen.com/cli), then run `heygen auth login --oauth`
1414
- Outdated: `heygen update`
1515
- Do not emit this advisory for authentication, quota, network, or legitimate empty-catalog results; `--local-only`; or an explicitly forced bundled provider.
1616
- Do not execute the install or update command.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"test:skills": "node --test 'skills/**/*.test.mjs'",
5252
"generate:previews": "tsx scripts/generate-template-previews.ts",
5353
"generate:catalog-previews": "tsx scripts/generate-catalog-previews.ts",
54+
"package:codex-plugin": "node scripts/package-codex-plugin.mjs",
5455
"upload:docs-images": "bash scripts/upload-docs-images.sh",
5556
"prepare": "test -d .git && lefthook install || true"
5657
},

‎scripts/package-codex-plugin.mjs‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env node
2+
3+
import { execFileSync, spawnSync } from "node:child_process";
4+
import { mkdirSync, readFileSync, rmSync, statSync } from "node:fs";
5+
import { join } from "node:path";
6+
7+
const REPO_ROOT = join(import.meta.dirname, "..");
8+
const OUTPUT = join(REPO_ROOT, "dist", "hyperframes-plugin.zip");
9+
// Codex reports its upload limit in decimal MB.
10+
const MAX_UPLOAD_BYTES = 100 * 1_000_000;
11+
const pluginManifest = JSON.parse(readFileSync(join(REPO_ROOT, ".codex-plugin", "plugin.json")));
12+
const assetPaths = [
13+
...new Set(
14+
Object.values(pluginManifest.interface)
15+
.filter((value) => typeof value === "string")
16+
.map((value) => value.replace(/^\.\//, ""))
17+
.filter((value) => value.startsWith("assets/")),
18+
),
19+
].sort();
20+
if (assetPaths.some((assetPath) => assetPath.split("/").includes(".."))) {
21+
throw new Error("Plugin manifest contains an unsafe asset path.");
22+
}
23+
const PLUGIN_PATHS = [".codex-plugin", ...assetPaths, "skills"];
24+
25+
for (const pluginPath of PLUGIN_PATHS) {
26+
execFileSync("git", ["cat-file", "-e", `HEAD:${pluginPath}`], {
27+
cwd: REPO_ROOT,
28+
stdio: "inherit",
29+
});
30+
}
31+
32+
const dirtyCheck = spawnSync("git", ["diff", "--quiet", "HEAD", "--", ...PLUGIN_PATHS], {
33+
cwd: REPO_ROOT,
34+
});
35+
if (dirtyCheck.error || (dirtyCheck.status !== 0 && dirtyCheck.status !== 1)) {
36+
throw dirtyCheck.error ?? new Error("Unable to inspect the plugin working tree state.");
37+
}
38+
if (dirtyCheck.status === 1) {
39+
console.warn("Warning: packaging committed HEAD; uncommitted plugin changes are excluded.");
40+
}
41+
42+
mkdirSync(join(REPO_ROOT, "dist"), { recursive: true });
43+
44+
execFileSync(
45+
"git",
46+
[
47+
"archive",
48+
"--format=zip",
49+
"--prefix=hyperframes/",
50+
"--output",
51+
OUTPUT,
52+
"HEAD",
53+
"--",
54+
...PLUGIN_PATHS,
55+
],
56+
{ cwd: REPO_ROOT, stdio: "inherit" },
57+
);
58+
59+
const bytes = statSync(OUTPUT).size;
60+
if (bytes > MAX_UPLOAD_BYTES) {
61+
rmSync(OUTPUT);
62+
throw new Error(
63+
`Codex plugin archive is ${(bytes / 1_000_000).toFixed(1)} MB; the upload limit is 100 MB.`,
64+
);
65+
}
66+
67+
console.log(`Wrote ${OUTPUT} (${(bytes / 1_000_000).toFixed(1)} MB).`);

‎skills-manifest.json‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22
"source": "heygen-com/hyperframes",
33
"skills": {
44
"embedded-captions": {
5-
"hash": "cabda69328a29062",
6-
"files": 144
5+
"hash": "a30d5691b4389ec1",
6+
"files": 140
77
},
88
"faceless-explainer": {
9-
"hash": "ff47c02598dc7947",
9+
"hash": "d53bcc3cbcfaa7bb",
1010
"files": 22
1111
},
1212
"figma": {
13-
"hash": "0e6e96f5a76ff824",
13+
"hash": "517e4dc53c13ea05",
1414
"files": 2
1515
},
1616
"general-video": {
17-
"hash": "94fd399a0dd0b6ce",
17+
"hash": "3303742225924078",
1818
"files": 4
1919
},
2020
"hyperframes": {
2121
"hash": "ab268ec1eca15ae9",
2222
"files": 17
2323
},
2424
"hyperframes-animation": {
25-
"hash": "b4adace47d4fa1b1",
25+
"hash": "3d9855346af7d51c",
2626
"files": 121
2727
},
2828
"hyperframes-cli": {
2929
"hash": "b1a0725560016894",
3030
"files": 11
3131
},
3232
"hyperframes-core": {
33-
"hash": "23f64febbc5cae37",
33+
"hash": "85004c9571ed19ce",
3434
"files": 19
3535
},
3636
"hyperframes-creative": {
37-
"hash": "b9e2cbfa49e6ed6c",
37+
"hash": "bacb5205ea5eb3d8",
3838
"files": 78
3939
},
4040
"hyperframes-keyframes": {
@@ -46,7 +46,7 @@
4646
"files": 10
4747
},
4848
"media-use": {
49-
"hash": "b10751149c9ea1da",
49+
"hash": "f7f0ad56a0477a09",
5050
"files": 145
5151
},
5252
"motion-graphics": {
@@ -58,11 +58,11 @@
5858
"files": 132
5959
},
6060
"pr-to-video": {
61-
"hash": "d37f9f5411c34089",
61+
"hash": "17ed27aa2cc32501",
6262
"files": 29
6363
},
6464
"product-launch-video": {
65-
"hash": "9557c9b86f4239b9",
65+
"hash": "84b33f077fff496d",
6666
"files": 26
6767
},
6868
"remotion-to-hyperframes": {
@@ -74,7 +74,7 @@
7474
"files": 2
7575
},
7676
"talking-head-recut": {
77-
"hash": "0d0ede12041c51b7",
77+
"hash": "2f5d99f823c48e75",
7878
"files": 28
7979
}
8080
}

‎skills/embedded-captions/.gitignore‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,3 @@ matte.fps
1919
safe-zones.json
2020

2121
.DS_Store
22-
# CDPR fan-kit source SVG (528KB) — only its extracted metrics
23-
# (assets/brand/cyberpunk-widths.json) are consumed at runtime.
24-
assets/brand/Cyberpunk2077.svg

0 commit comments

Comments
 (0)