Skip to content

fix(codex-marketplace): restructure to plugins/ subdir + repo-root auto-discovery#51

Open
shakestzd wants to merge 1 commit intomainfrom
bug-b5b3c3ef-codex-plugin-layout
Open

fix(codex-marketplace): restructure to plugins/ subdir + repo-root auto-discovery#51
shakestzd wants to merge 1 commit intomainfrom
bug-b5b3c3ef-codex-plugin-layout

Conversation

@shakestzd
Copy link
Copy Markdown
Owner

Summary

Per CodexPlugins.md lines 186-188, Codex resolves source.path relative to the marketplace root — not relative to .agents/plugins/. Our generator nested the plugin tree inside .agents/plugins/htmlgraph/ while emitting source.path: "./htmlgraph", which resolved to packages/codex-marketplace/htmlgraph/ — a path that never existed. codex marketplace add silently failed the install step; ~/.codex/plugins/cache/htmlgraph/ was never created; TUI surfaced zero of our 8 skills.

Changes

  • Move plugin tree: packages/codex-marketplace/.agents/plugins/htmlgraph/packages/codex-marketplace/plugins/htmlgraph/
  • Update marketplace.json source.path: "./plugins/htmlgraph"
  • Flip policy.installation to INSTALLED_BY_DEFAULT so the plugin auto-installs when Codex reads the marketplace
  • Add repo-root .agents/plugins/marketplace.json for contributor auto-discovery (Codex reads it when launched inside the repo per docs line 266-270)

Related

  • Fixes bug-b5b3c3ef
  • Partial fix for bug-fc60b4a0 (end-user install via htmlgraph codex --init tracked separately)

Test plan

  • go build / vet / test pass
  • Regenerated tree: plugins/htmlgraph/ populated, .agents/plugins/htmlgraph/ removed
  • plugin.json has "skills": "./skills/"; marketplace.json has "source.path": "./plugins/htmlgraph"; policy.installation: "INSTALLED_BY_DEFAULT"
  • Reviewer: launch Codex inside htmlgraph repo, type $htmlgraph — verify our skills populate
  • Reviewer: verify ~/.codex/plugins/cache/htmlgraph/htmlgraph/local/ exists after Codex launch

🤖 Generated with Claude Code

…to-discovery

Per CodexPlugins.md lines 186-188, Codex resolves source.path relative
to the marketplace root, not relative to .agents/plugins/. Our
generator nested the plugin content inside .agents/plugins/htmlgraph/
while emitting source.path "./htmlgraph", which resolved to
packages/codex-marketplace/htmlgraph/ — a path that never existed.
`codex marketplace add` silently failed the install step and no cache
dir was ever created at ~/.codex/plugins/cache/htmlgraph/, so Codex's
TUI never surfaced any of our 8 skills.

Restructure to match the openai-curated layout:

    packages/codex-marketplace/
    ├── .agents/plugins/
    │   └── marketplace.json   # source.path: "./plugins/htmlgraph"
    └── plugins/
        └── htmlgraph/
            ├── .codex-plugin/plugin.json   # "skills": "./skills/"
            ├── skills/
            ├── .mcp.json
            ├── README.md
            └── ... (agents/, commands/, templates/, static/, config/)

Also sets policy.installation = INSTALLED_BY_DEFAULT so the plugin
auto-installs when Codex reads the marketplace (no interactive TUI
step required).

Adds an auto-discovery marketplace at .agents/plugins/marketplace.json
at the repo root so contributors who clone this repo and launch codex
from inside it get htmlgraph without running `codex marketplace add`.

Fixes bug-b5b3c3ef. Partial fix for bug-fc60b4a0 (end-user install
via htmlgraph codex --init tracked separately).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 181d21300c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 51 to +53
pluginSubdir := target.PluginSubdir
if pluginSubdir == "" {
pluginSubdir = ".agents/plugins/htmlgraph"
pluginSubdir = "plugins/htmlgraph"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Migrate legacy pluginSubdir values before choosing output path

This logic only switches to plugins/htmlgraph when target.PluginSubdir is empty, but the live source-of-truth manifest still sets targets.codex.pluginSubdir to .agents/plugins/htmlgraph (packages/plugin-core/manifest.json). In practice, htmlgraph plugin build-ports --target codex regenerates the plugin back into the old location and removes packages/codex-marketplace/plugins/htmlgraph, so the new repo-root discovery path (.agents/plugins/marketplace.json./packages/codex-marketplace/plugins/htmlgraph) no longer exists. That makes the restructuring non-reproducible and breaks local auto-discovery after regeneration.

Useful? React with 👍 / 👎.

},
"policy": {
"installation": "AVAILABLE",
"installation": "INSTALLED_BY_DEFAULT",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make installation policy generator-backed

This artifact now commits "installation": "INSTALLED_BY_DEFAULT", but the generator still hardcodes "AVAILABLE" in writeCodexMarketplace (internal/pluginbuild/codex.go). Any routine rebuild rewrites this file and drops auto-install behavior, so the change is not stable across build-ports runs. The installation policy should come from the same generator/manifest path as other marketplace fields.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant