feat(codex-plugin): add @hyperframes/codex-plugin package#387
feat(codex-plugin): add @hyperframes/codex-plugin package#387jrusso1020 merged 7 commits intomainfrom
Conversation
Bundles the 5 hyperframes skills (hyperframes, hyperframes-cli, hyperframes-registry, gsap, website-to-hyperframes) as an OpenAI Codex plugin per developers.openai.com/codex/plugins/build. Users can install directly: codex plugin marketplace add heygen-com/hyperframes --sparse packages/codex-plugin The skills/ directory under packages/codex-plugin/ is a built copy of the repo-root skills/. A lefthook pre-commit hook auto-rebuilds when any skill file changes, and `bun run lint` runs a drift check so CI fails if the committed plugin copy diverges.
Review findings from /simplify:
- Replace execSync('diff -r') with in-process tree compare. Removes the
POSIX diff dependency, eliminates the temp-dir dance, and yields a
structured drift list (changed/missing/extra per path) instead of a
2000-char-truncated blob.
- Use fileURLToPath for __dirname so paths work on Windows.
- Replace existsSync+statSync TOCTOU with a single statSync in try/catch,
and fix the error message for the non-directory case.
- Switch readdirSync to { withFileTypes: true } to avoid per-entry
statSync when scanning for extras.
- lefthook: exclude packages/codex-plugin/skills/** from the
codex-plugin-sync glob. Without this, editing the built copy (e.g.
during a conflict resolution) would trigger the hook to rebuild and
overwrite the user's edit.
Both sync-schemas.ts and packages/codex-plugin/build.mts were hand-rolling
the same "compare source to target, print drift, exit 1 in --check mode"
pattern with slightly different output shapes. Extract:
- walkFiles(root, filter?) — recursive relative-path lister shared with
the codex-plugin drift checker
- reportAndExit(drifted, { checkMode, label, fixCommand }) — prints a
unified ✓/✗ summary, caps drift list, exits non-zero in check mode
Both callers now produce the same output shape so contributors see the
same UI whether they're syncing schemas or the codex plugin:
✗ <label> is out of sync:
changed <path>
missing <path>
extra <path>
Run `<fix command>` and commit the result.
Verified: lint, format:check, sync-schemas:check, check:codex-plugin all
pass. Drift injection tests pass on both sync paths. Pre-commit hook still
auto-rebuilds the plugin skills/ copy on source changes and correctly
skips when only the plugin copy is edited (no clobber cycle).
CI lint failed on PR #387 because root .gitignore has `examples/` for test artifacts, and that rule also matched packages/codex-plugin/skills/ hyperframes-registry/examples/. The two add-block.md + add-component.md files in the plugin copy were silently skipped by `git add`, so local --check passed (files exist on disk) but CI drift check failed (files missing from the committed tree). - Add a targeted negation so the plugin copy can commit `examples/` dirs: !packages/codex-plugin/skills/**/examples/ !packages/codex-plugin/skills/**/examples/** - Re-stage the two rescued files. - Add a build-time guard: `build.mts` now runs `git check-ignore --stdin --no-index` on every file in the plugin copy. If any file would be gitignored, the build (and --check) fail fast with the conflicting path and a hint to add a negation. Prevents this class of silent commit loss for any future skill content that collides with a root ignore rule.
Feedback: eliminate the skills/ copy by moving the plugin root to repo rootThe current structure commits 60 files copied from Proposed restructureMove the plugin identity to the repo root so Install commandBefore: After:
What this deletes
Why it works
TradeoffTwo small files at repo root ( |
…eline
Per PR feedback: eliminate the skills/ copy by making the repo root the
plugin root. `.codex-plugin/plugin.json` and `assets/` move from
packages/codex-plugin/ to repo root; the existing `skills/` directory is
referenced in place via `"skills": "./skills/"`. One source of truth.
Install with multi-sparse checkout:
codex plugin marketplace add heygen-com/hyperframes \
--sparse .codex-plugin --sparse skills --sparse assets
Deleted:
- packages/codex-plugin/ (60 duplicated skill files, build.mts, package.json)
- scripts/lib/sync.ts (was only used by the codex-plugin build)
Reverted to pre-plugin state (no longer needed without the copy):
- scripts/sync-schemas.ts (restored to its original shape)
- lefthook.yml (no auto-sync hook)
- .gitignore (no examples/ negation — nothing collides anymore)
- package.json (lint no longer chains check:codex-plugin; removed
build:codex-plugin + check:codex-plugin scripts)
Net: -6831 / +19 lines. The plugin is now just 3 tracked additions at
repo root (.codex-plugin/plugin.json, assets/icon.png, assets/logo.png)
plus one README paragraph documenting the install command.
|
Done — restructure pushed in 2a004d8. The plugin now lives at repo root: codex plugin marketplace add heygen-com/hyperframes --sparse .codex-plugin --sparse skills --sparse assets(Verified in the Codex docs: Deleted:
Reverted to pre-plugin state (no longer needed without the copy):
Net: -6831 / +19 lines. The plugin is now 3 tracked additions at repo root (manifest, icon, logo) plus one README paragraph. No drift to manage, no build step, no CI check. I'll update the PR description to reflect the new structure. |
What
Add HyperFrames as an OpenAI Codex plugin using the existing repo-root
skills/directory as-is, with a new.codex-plugin/plugin.jsonmanifest andassets/icon.png+assets/logo.pngat repo root.This PR packages the plugin itself. It does not turn this repo into a Codex marketplace source.
Why
OpenAI reached out asking HeyGen to publish the HyperFrames skills as a Codex plugin so they can list it in their plugin directory.
The structure keeps
skills/as the single source of truth — no copy, no build step, no drift to guard against..codex-plugin/plugin.jsonsits at repo root and references the canonicalskills/directly via"skills": "./skills/".How
Repo-root layout (3 files added):
Manifest follows OpenAI's plugin spec:
name: hyperframes,category: Design, Apache-2.0,brandColor: #0a0a0a(fromdocs/docs.jsonprimary),homepage: hyperframes.heygen.com. Points at./skills/and shipscomposerIcon+logoassets.Assets —
icon.pngandlogo.pngrendered from the existingdocs/logo/*.svgfiles via puppeteer (one-time; not part of any build).No build step, no drift check. The plugin doesn't need one —
skills/IS the plugin's skills/ dir. Any skill edit is a plugin edit automatically.Testing / Local Iteration
Current Codex CLI behavior distinguishes between:
.codex-plugin/plugin.jsonSo the correct local iterative test flow for this PR is:
.agents/plugins/marketplace.jsoncodex plugin marketplace add <local-marketplace-root>For this reason, this PR does not claim that the following works by itself today:
That direct owner/repo install flow depends on a separate marketplace/catalog entry that points at this plugin.
Plugin-scoped local testing notes now live in
.codex-plugin/TESTING.md.Test plan
oxlint .passesoxfmt --check README.md .codex-plugin/plugin.json .codex-plugin/TESTING.mdpasses for the plugin-related docs/filesplugin.jsonpaths resolve:./skills/exists,./assets/icon.pngexists,./assets/logo.pngexists512x512and1024x308skills/directory + its subtree remain the single source of truthFollow-ups (not in this PR)
openai/pluginsor equivalent marketplace/catalog entry adding a discoverable install surface for this plugininterface.screenshots— the spec allows it but no plugin in the current OpenAI directory ships any, so skipping for v0.1History
Initial revision had
packages/codex-plugin/as a build target that copiedskills/into a plugin layout; per PR feedback, moved the plugin root to repo root instead. Deleted ~6800 lines of build/sync infrastructure and the duplicated skill files. See commit2a004d8.