Skip to content

Commit fd24c00

Browse files
authored
feat(skills): default plugin creator to personal share flow (#22221)
## Summary Plugin creation now defaults to the personal marketplace path and ends with a readable handoff back into Codex after a marketplace-backed scaffold. Before this change, `plugin-creator` centered repo-local marketplace updates and did not clearly guide the agent to return the user to the created plugin afterward. This PR updates the bundled system skill so marketplace-backed scaffolds default to `~/plugins/<plugin-name>` plus `~/.agents/plugins/marketplace.json`, ask for user intent only when an existing repo marketplace makes personal vs team scope ambiguous, and end with named Markdown deeplinks labeled `View <plugin-name>` and `Share <plugin-name>`. ## What changed - default marketplace-backed creation to the personal plugin location - document the explicit repo/team override path for codebases that should own the plugin entry - ask personal vs team only when the current Git repo already has `.agents/plugins/marketplace.json` and the user has not stated scope - require named Markdown deeplinks after marketplace-backed creation so the final response returns the user to the exact plugin cleanly - keep the deeplink targets precise with real absolute `marketplacePath` and normalized `pluginName` values - align the bundled prompt, scaffold help text, and marketplace reference spec with the new default ## Testing Tests: targeted skill validation, Python compile checks, personal-default scaffold smoke, repo-override scaffold smoke, and whitespace checks.
1 parent ed5944b commit fd24c00

3 files changed

Lines changed: 48 additions & 30 deletions

File tree

codex-rs/skills/src/assets/samples/plugin-creator/SKILL.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: plugin-creator
3-
description: Create and scaffold plugin directories for Codex with a required `.codex-plugin/plugin.json`, optional plugin folders/files, and baseline placeholders you can edit before publishing or testing. Use when Codex needs to create a new local plugin, add optional plugin structure, or generate or update repo-root `.agents/plugins/marketplace.json` entries for plugin ordering and availability metadata.
3+
description: Create and scaffold plugin directories for Codex with a required `.codex-plugin/plugin.json`, optional plugin folders/files, and baseline placeholders you can edit before publishing or testing. Use when Codex needs to create a new personal plugin, add optional plugin structure, or generate or update personal or repo-root `.agents/plugins/marketplace.json` entries for plugin ordering and availability metadata.
44
---
55

66
# Plugin Creator
@@ -13,44 +13,51 @@ description: Create and scaffold plugin directories for Codex with a required `.
1313
# Plugin names are normalized to lower-case hyphen-case and must be <= 64 chars.
1414
# The generated folder and plugin.json name are always the same.
1515
# Run from repo root (or replace .agents/... with the absolute path to this SKILL).
16-
# By default creates in <repo_root>/plugins/<plugin-name>.
16+
# By default creates in ~/plugins/<plugin-name>.
1717
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py <plugin-name>
1818
```
1919

2020
2. Open `<plugin-path>/.codex-plugin/plugin.json` and replace `[TODO: ...]` placeholders.
2121

22-
3. Generate or update the repo marketplace entry when the plugin should appear in Codex UI ordering:
22+
3. Generate or update the personal marketplace entry when the plugin should appear in Codex UI ordering:
2323

2424
```bash
25-
# marketplace.json always lives at <repo-root>/.agents/plugins/marketplace.json
25+
# Personal marketplace entries default to ~/.agents/plugins/marketplace.json.
2626
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin --with-marketplace
2727
```
2828

29-
For a home-local plugin, treat `<home>` as the root and use:
29+
If the current Git repo already has `.agents/plugins/marketplace.json` and the user has not said
30+
whether the plugin is personal or shared with their team, ask before generating a marketplace entry.
31+
When they choose the repo marketplace, use:
3032

3133
```bash
3234
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin \
33-
--path ~/plugins \
34-
--marketplace-path ~/.agents/plugins/marketplace.json \
35+
--path ./plugins \
36+
--marketplace-path ./.agents/plugins/marketplace.json \
3537
--with-marketplace
3638
```
3739

3840
4. Generate/adjust optional companion folders as needed:
3941

4042
```bash
41-
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin --path <parent-plugin-directory> \
43+
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin \
44+
--path <parent-plugin-directory> \
45+
--marketplace-path <marketplace-json-path> \
4246
--with-skills --with-hooks --with-scripts --with-assets --with-mcp --with-apps --with-marketplace
4347
```
4448

4549
`<parent-plugin-directory>` is the directory where the plugin folder `<plugin-name>` will be created (for example `~/code/plugins`).
4650

4751
## What this skill creates
4852

49-
- If the user has not made the plugin location explicit, ask whether they want a repo-local plugin or a home-local plugin before generating marketplace entries.
53+
- Default marketplace-backed scaffolds are personal: `~/plugins/<plugin-name>/` plus
54+
`~/.agents/plugins/marketplace.json`.
55+
- If the current Git repo already has `.agents/plugins/marketplace.json` and the user has not said
56+
personal vs team, ask which marketplace to update before generating a marketplace entry.
5057
- Creates plugin root at `/<parent-plugin-directory>/<plugin-name>/`.
5158
- Always creates `/<parent-plugin-directory>/<plugin-name>/.codex-plugin/plugin.json`.
5259
- Fills the manifest with the full schema shape, placeholder values, and the complete `interface` section.
53-
- Creates or updates `<repo-root>/.agents/plugins/marketplace.json` when `--with-marketplace` is set.
60+
- Creates or updates the selected marketplace when `--with-marketplace` is set.
5461
- If the marketplace file does not exist yet, seed top-level `name` plus `interface.displayName` placeholders before adding the first plugin entry.
5562
- `<plugin-name>` is normalized using skill-creator naming rules:
5663
- `My Plugin``my-plugin`
@@ -67,9 +74,8 @@ python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin -
6774

6875
## Marketplace workflow
6976

70-
- `marketplace.json` always lives at `<repo-root>/.agents/plugins/marketplace.json`.
71-
- For a home-local plugin, use the same convention with `<home>` as the root:
72-
`~/.agents/plugins/marketplace.json` plus `./plugins/<plugin-name>`.
77+
- Personal plugins use `~/.agents/plugins/marketplace.json`.
78+
- Repo/team plugins use `<repo-root>/.agents/plugins/marketplace.json`.
7379
- Marketplace root metadata supports top-level `name` plus optional `interface.displayName`.
7480
- Treat plugin order in `plugins[]` as render order in Codex. Append new entries unless a user explicitly asks to reorder the list.
7581
- `displayName` belongs inside the marketplace `interface` object, not individual `plugins[]` entries.
@@ -107,7 +113,7 @@ python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin -
107113
```
108114

109115
- Use `--force` only when intentionally replacing an existing marketplace entry for the same plugin name.
110-
- If `<repo-root>/.agents/plugins/marketplace.json` does not exist yet, create it with top-level `"name"`, an `"interface"` object containing `"displayName"`, and a `plugins` array, then add the new entry.
116+
- If the selected marketplace file does not exist yet, create it with top-level `"name"`, an `"interface"` object containing `"displayName"`, and a `plugins` array, then add the new entry.
111117

112118
- For a brand-new marketplace file, the root object should look like:
113119

@@ -143,7 +149,16 @@ python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin -
143149
- Preserve any existing marketplace `interface.displayName`.
144150
- When generating marketplace entries, always write `policy.installation`, `policy.authentication`, and `category` even if their values are defaults.
145151
- Add `policy.products` only when the user explicitly asks for that override.
146-
- Keep marketplace `source.path` relative to repo root as `./plugins/<plugin-name>`.
152+
- Keep marketplace `source.path` relative to the selected marketplace root as `./plugins/<plugin-name>`.
153+
- When the workflow created or updated a marketplace-backed plugin, end the final user-facing
154+
response with these two Markdown links, in this order, and do not add any text after them:
155+
- `[View <normalized plugin name>](codex://plugins/view-local?marketplacePath=<absolute marketplace.json path>&pluginName=<normalized plugin name>)`
156+
- `[Share <normalized plugin name>](codex://plugins/share-local?marketplacePath=<absolute marketplace.json path>&pluginName=<normalized plugin name>)`
157+
- Replace the link-label placeholder and both deeplink placeholders with the real normalized plugin
158+
name plus the real absolute marketplace path from the scaffolded plugin. URL-encode query
159+
parameter values when needed.
160+
- Do not emit the `View <normalized plugin name>` or `Share <normalized plugin name>` links when no marketplace entry was
161+
created or updated.
147162

148163
## Reference to exact spec sample
149164

codex-rs/skills/src/assets/samples/plugin-creator/references/plugin-json-spec.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@
9999

100100
`marketplace.json` depends on where the plugin should live:
101101

102-
- Repo plugin: `<repo-root>/.agents/plugins/marketplace.json`
103-
- Local plugin: `~/.agents/plugins/marketplace.json`
102+
- Personal plugin: `~/.agents/plugins/marketplace.json`
103+
- Repo/team plugin: `<repo-root>/.agents/plugins/marketplace.json`
104104

105105
```json
106106
{
@@ -143,9 +143,9 @@
143143
- `source` (`object`): Plugin source descriptor.
144144
- `source` (`string`): Use `local` for this repo workflow.
145145
- `path` (`string`): Relative plugin path based on the marketplace root.
146-
- Repo plugin: `./plugins/<plugin-name>`
147-
- Local plugin in `~/.agents/plugins/marketplace.json`: `./plugins/<plugin-name>`
148-
- The same relative path convention is used for both repo-rooted and home-rooted marketplaces.
146+
- Personal plugin in `~/.agents/plugins/marketplace.json`: `./plugins/<plugin-name>`
147+
- Repo/team plugin: `./plugins/<plugin-name>`
148+
- The same relative path convention is used for both personal and repo/team marketplaces.
149149
- Example: with `~/.agents/plugins/marketplace.json`, `./plugins/<plugin-name>` resolves to `~/plugins/<plugin-name>`.
150150
- `policy` (`object`): Marketplace policy block. Always include it.
151151
- `installation` (`string`): Availability policy.
@@ -165,6 +165,9 @@
165165
- Treat `policy.products` as an override and omit it unless explicitly requested.
166166
- Append new entries unless the user explicitly requests reordering.
167167
- Replace an existing entry for the same plugin only when overwrite is intentional.
168-
- Choose marketplace location to match the plugin destination:
169-
- Repo plugin: `<repo-root>/.agents/plugins/marketplace.json`
170-
- Local plugin: `~/.agents/plugins/marketplace.json`
168+
- Default new plugin creation to the personal marketplace.
169+
- If the current Git repo already has `.agents/plugins/marketplace.json` and the user has not said
170+
personal or team, ask which marketplace to update before creating the entry.
171+
- Choose marketplace location to match the selected destination:
172+
- Personal plugin: `~/.agents/plugins/marketplace.json`
173+
- Repo/team plugin: `<repo-root>/.agents/plugins/marketplace.json`

codex-rs/skills/src/assets/samples/plugin-creator/scripts/create_basic_plugin.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212

1313
MAX_PLUGIN_NAME_LENGTH = 64
14-
DEFAULT_PLUGIN_PARENT = Path.cwd() / "plugins"
15-
DEFAULT_MARKETPLACE_PATH = Path.cwd() / ".agents" / "plugins" / "marketplace.json"
14+
DEFAULT_PLUGIN_PARENT = Path.home() / "plugins"
15+
DEFAULT_MARKETPLACE_PATH = Path.home() / ".agents" / "plugins" / "marketplace.json"
1616
DEFAULT_INSTALL_POLICY = "AVAILABLE"
1717
DEFAULT_AUTH_POLICY = "ON_INSTALL"
1818
DEFAULT_CATEGORY = "Productivity"
@@ -192,8 +192,8 @@ def parse_args() -> argparse.Namespace:
192192
"--path",
193193
default=str(DEFAULT_PLUGIN_PARENT),
194194
help=(
195-
"Parent directory for plugin creation (defaults to <cwd>/plugins). "
196-
"When using a home-rooted marketplace, use <home>/plugins."
195+
"Parent directory for plugin creation (defaults to <home>/plugins). "
196+
"Use <repo>/plugins when creating a repo/team plugin."
197197
),
198198
)
199199
parser.add_argument("--with-skills", action="store_true", help="Create skills/ directory")
@@ -206,7 +206,7 @@ def parse_args() -> argparse.Namespace:
206206
"--with-marketplace",
207207
action="store_true",
208208
help=(
209-
"Create or update <cwd>/.agents/plugins/marketplace.json. "
209+
"Create or update <home>/.agents/plugins/marketplace.json by default. "
210210
"Marketplace entries always point to ./plugins/<plugin-name> relative to the "
211211
"marketplace root."
212212
),
@@ -215,8 +215,8 @@ def parse_args() -> argparse.Namespace:
215215
"--marketplace-path",
216216
default=str(DEFAULT_MARKETPLACE_PATH),
217217
help=(
218-
"Path to marketplace.json (defaults to <cwd>/.agents/plugins/marketplace.json). "
219-
"For a home-rooted marketplace, use <home>/.agents/plugins/marketplace.json."
218+
"Path to marketplace.json (defaults to <home>/.agents/plugins/marketplace.json). "
219+
"Use <repo>/.agents/plugins/marketplace.json for a repo/team plugin."
220220
),
221221
)
222222
parser.add_argument(

0 commit comments

Comments
 (0)