-
Notifications
You must be signed in to change notification settings - Fork 727
feat: add /codex:run-skill command to invoke Codex skillsFeat/run skill #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,3 +148,9 @@ vite.config.ts.timestamp-* | |
|
|
||
| output/ | ||
| plugins/codex/.generated/ | ||
|
|
||
| # Development workflow | ||
| .dev-flow/ | ||
|
|
||
| # IDE | ||
| .idea/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| --- | ||
| description: Run a Codex skill through the shared runtime | ||
| argument-hint: '[--skill <name>] [--list] [--background|--wait] [--write] [prompt]' | ||
| allowed-tools: Read, Glob, Grep, Bash(node:*), AskUserQuestion | ||
| --- | ||
|
|
||
| Run a Codex skill through the shared runtime. | ||
|
|
||
| Raw slash-command arguments: | ||
| `$ARGUMENTS` | ||
|
|
||
| Core constraint: | ||
| - This command is a thin forwarder to the Codex companion script. | ||
| - Do not fix issues, apply patches, or add independent analysis. | ||
| - Your only job is to run the skill and return Codex's output verbatim to the user. | ||
|
|
||
| Execution mode rules: | ||
| - If the raw arguments include `--list`, run the command immediately and return the output. | ||
| - If the raw arguments include `--wait`, do not ask. Run the skill in the foreground. | ||
| - If the raw arguments include `--background`, do not ask. Run the skill in a Claude background task. | ||
| - If the raw arguments do not include `--skill <name>` and do not include `--list`, use `AskUserQuestion` exactly once to ask: | ||
| - Question: "Which Codex skill would you like to run, and what should it do?" | ||
| - Provide a free-text answer option. | ||
| - After receiving the answer, construct the full command with `--skill <name>` and the user's prompt. Do NOT use `$ARGUMENTS` for this execution path. | ||
| - Otherwise (raw arguments include `--skill`), use `AskUserQuestion` exactly once with two options, putting the recommended option first and suffixing its label with `(Recommended)`: | ||
| - `Run in background (Recommended)` | ||
| - `Wait for results` | ||
|
|
||
| Argument handling: | ||
| - When `--skill` is provided in `$ARGUMENTS`, preserve the user's arguments exactly. | ||
| - When `--skill` was obtained via AskUserQuestion, build the command from the user's answer instead of `$ARGUMENTS`. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| - Do not strip `--wait`, `--background`, or `--write` yourself. | ||
| - `--write` allows the skill to modify files (default is read-only sandbox). | ||
| - The companion script parses these flags, but Claude Code's `Bash(..., run_in_background: true)` is what actually detaches the run. | ||
|
|
||
| List mode: | ||
| - When `--list` is present, run the command and return the output verbatim. | ||
| - Do not paraphrase or add commentary. | ||
|
|
||
| Foreground flow: | ||
| - If `--skill` was in the raw arguments, run: | ||
| ```bash | ||
| node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" run-skill "$ARGUMENTS" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the user omits Useful? React with 👍 / 👎. |
||
| ``` | ||
| - If `--skill` was obtained via AskUserQuestion, build and run the command from the user's answer instead of `$ARGUMENTS`: | ||
| ```bash | ||
| node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" run-skill --skill "<name>" <prompt> | ||
| ``` | ||
| - Return the command stdout verbatim, exactly as-is. | ||
| - Do not paraphrase, summarize, or add commentary before or after it. | ||
|
|
||
| Background flow: | ||
| - If `--skill` was in the raw arguments, launch with: | ||
| ```typescript | ||
| Bash({ | ||
| command: `node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" run-skill "$ARGUMENTS"`, | ||
| description: "Codex skill run", | ||
| run_in_background: true | ||
| }) | ||
| ``` | ||
| - If `--skill` was obtained via AskUserQuestion, build the command from the user's answer instead of `$ARGUMENTS`: | ||
| ```typescript | ||
| Bash({ | ||
| command: `node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" run-skill --skill "<name>" <prompt>`, | ||
| description: "Codex skill run", | ||
| run_in_background: true | ||
| }) | ||
| ``` | ||
| - Do not call `BashOutput` or wait for completion in this turn. | ||
| - After launching the command, tell the user: "Codex skill run started in the background. Check `/codex:status` for progress." | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The execution rules prioritize
--wait/--backgroundbefore the missing-skill branch, so/codex:run-skill --background(or--wait) without--skillskipsAskUserQuestionand forwards incomplete args to the companion, which then fails with “Specify a skill…”. This breaks the documented guided flow for users who choose mode first; the command should still collect--skill <name>whenever--listis not present.Useful? React with 👍 / 👎.