fix(codex-marketplace): restructure to plugins/ subdir + repo-root auto-discovery#51
fix(codex-marketplace): restructure to plugins/ subdir + repo-root auto-discovery#51
Conversation
…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>
There was a problem hiding this comment.
💡 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".
| pluginSubdir := target.PluginSubdir | ||
| if pluginSubdir == "" { | ||
| pluginSubdir = ".agents/plugins/htmlgraph" | ||
| pluginSubdir = "plugins/htmlgraph" |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Per
CodexPlugins.mdlines 186-188, Codex resolvessource.pathrelative to the marketplace root — not relative to.agents/plugins/. Our generator nested the plugin tree inside.agents/plugins/htmlgraph/while emittingsource.path: "./htmlgraph", which resolved topackages/codex-marketplace/htmlgraph/— a path that never existed.codex marketplace addsilently failed the install step;~/.codex/plugins/cache/htmlgraph/was never created; TUI surfaced zero of our 8 skills.Changes
packages/codex-marketplace/.agents/plugins/htmlgraph/→packages/codex-marketplace/plugins/htmlgraph/source.path: "./plugins/htmlgraph"policy.installationtoINSTALLED_BY_DEFAULTso the plugin auto-installs when Codex reads the marketplace.agents/plugins/marketplace.jsonfor contributor auto-discovery (Codex reads it when launched inside the repo per docs line 266-270)Related
htmlgraph codex --inittracked separately)Test plan
plugins/htmlgraph/populated,.agents/plugins/htmlgraph/removedplugin.jsonhas"skills": "./skills/";marketplace.jsonhas"source.path": "./plugins/htmlgraph";policy.installation: "INSTALLED_BY_DEFAULT"$htmlgraph— verify our skills populate~/.codex/plugins/cache/htmlgraph/htmlgraph/local/exists after Codex launch🤖 Generated with Claude Code