Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/codex/agents/codex-rescue.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ model: sonnet
tools: Bash
skills:
- codex-cli-runtime
- gpt-5-4-prompting
- codex-prompting
---

You are a thin forwarding wrapper around the Codex companion task runtime.
Expand All @@ -22,7 +22,7 @@ Forwarding rules:
- Use exactly one `Bash` call to invoke `node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" task ...`.
- If the user did not explicitly choose `--background` or `--wait`, prefer foreground for a small, clearly bounded rescue request.
- If the user did not explicitly choose `--background` or `--wait` and the task looks complicated, open-ended, multi-step, or likely to keep Codex running for a long time, prefer background execution.
- You may use the `gpt-5-4-prompting` skill only to tighten the user's request into a better Codex prompt before forwarding it.
- You may use the `codex-prompting` skill only to tighten the user's request into a better Codex prompt before forwarding it.
- Do not use that skill to inspect the repository, reason through the problem yourself, draft a solution, or do any independent work beyond shaping the forwarded prompt text.
- Do not inspect the repository, read files, grep, monitor progress, poll status, fetch results, cancel jobs, summarize output, or do any follow-up work of your own.
- Do not call `review`, `adversarial-review`, `status`, `result`, or `cancel`. This subagent only forwards to `task`.
Expand Down
2 changes: 1 addition & 1 deletion plugins/codex/skills/codex-cli-runtime/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Execution rules:
- Prefer the helper over hand-rolled `git`, direct Codex CLI strings, or any other Bash activity.
- Do not call `setup`, `review`, `adversarial-review`, `status`, `result`, or `cancel` from `codex:codex-rescue`.
- Use `task` for every rescue request, including diagnosis, planning, research, and explicit fix requests.
- You may use the `gpt-5-4-prompting` skill to rewrite the user's request into a tighter Codex prompt before the single `task` call.
- You may use the `codex-prompting` skill to rewrite the user's request into a tighter Codex prompt before the single `task` call.
- That prompt drafting is the only Claude-side work allowed. Do not inspect the repo, solve the task yourself, or add independent analysis outside the forwarded prompt text.
- Leave `--effort` unset unless the user explicitly requests a specific effort.
- Leave model unset by default. Add `--model` only when the user explicitly asks for one.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
name: gpt-5-4-prompting
description: Internal guidance for composing Codex and GPT-5.4 prompts for coding, review, diagnosis, and research tasks inside the Codex Claude Code plugin
name: codex-prompting
description: Internal guidance for composing Codex prompts for coding, review, diagnosis, and research tasks inside the Codex Claude Code plugin
user-invocable: false
---

# GPT-5.4 Prompting
# Codex Prompting

Use this skill when `codex:codex-rescue` needs to ask Codex or another GPT-5.4-based workflow for help.
Use this skill when `codex:codex-rescue` needs to ask Codex or another Codex-model workflow for help.

Prompt Codex like an operator, not a collaborator. Keep prompts compact and block-structured with XML tags. State the task, the output contract, the follow-through defaults, and the small set of extra constraints that matter.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Codex Prompt Anti-Patterns

Avoid these when prompting Codex or GPT-5.4.
Avoid these when prompting Codex or other Codex models.

## Vague task framing

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Codex Prompt Recipes

Use these as starting templates for Codex task prompts or other Codex/GPT-5.4 prompt construction.
Use these as starting templates for Codex task prompts or other Codex-model prompt construction.
Copy the smallest recipe that fits the task, then trim anything you do not need.
In `codex:codex-rescue`, run diagnosis and fix-oriented recipes in write mode by default unless the user explicitly asked for read-only behavior.

Expand Down Expand Up @@ -128,7 +128,7 @@ Prefer primary sources.

```xml
<task>
Diagnose why this existing prompt is underperforming and propose the smallest high-leverage changes to improve it for Codex or GPT-5.4.
Diagnose why this existing prompt is underperforming and propose the smallest high-leverage changes to improve it for Codex or other Codex models.
</task>

<structured_output_contract>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prompt Blocks

Use these blocks selectively when composing Codex or GPT-5.4 prompts.
Use these blocks selectively when composing Codex or Codex-model prompts.
Wrap each block in the XML tag shown in its heading.

## Core Wrapper
Expand Down
8 changes: 4 additions & 4 deletions tests/commands.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ test("rescue command absorbs continue semantics", () => {
assert.match(agent, /If the user asks for a concrete model name such as `gpt-5\.4-mini`, pass it through with `--model`/i);
assert.match(agent, /Return the stdout of the `codex-companion` command exactly as-is/i);
assert.match(agent, /If the Bash call fails or Codex cannot be invoked, return nothing/i);
assert.match(agent, /gpt-5-4-prompting/);
assert.match(agent, /codex-prompting/);
assert.match(agent, /only to tighten the user's request into a better Codex prompt/i);
assert.match(agent, /Do not use that skill to inspect the repository, reason through the problem yourself, draft a solution, or do any independent work/i);
assert.match(runtimeSkill, /only job is to invoke `task` once and return that stdout unchanged/i);
assert.match(runtimeSkill, /Do not call `setup`, `review`, `adversarial-review`, `status`, `result`, or `cancel`/i);
assert.match(runtimeSkill, /use the `gpt-5-4-prompting` skill to rewrite the user's request into a tighter Codex prompt/i);
assert.match(runtimeSkill, /use the `codex-prompting` skill to rewrite the user's request into a tighter Codex prompt/i);
assert.match(runtimeSkill, /That prompt drafting is the only Claude-side work allowed/i);
assert.match(runtimeSkill, /Leave `--effort` unset unless the user explicitly requests a specific effort/i);
assert.match(runtimeSkill, /Leave model unset by default/i);
Expand Down Expand Up @@ -183,8 +183,8 @@ test("result and cancel commands are exposed as deterministic runtime entrypoint

test("internal docs use task terminology for rescue runs", () => {
const runtimeSkill = read("skills/codex-cli-runtime/SKILL.md");
const promptingSkill = read("skills/gpt-5-4-prompting/SKILL.md");
const promptRecipes = read("skills/gpt-5-4-prompting/references/codex-prompt-recipes.md");
const promptingSkill = read("skills/codex-prompting/SKILL.md");
const promptRecipes = read("skills/codex-prompting/references/codex-prompt-recipes.md");

assert.match(runtimeSkill, /codex-companion\.mjs" task "<raw arguments>"/);
assert.match(runtimeSkill, /Use `task` for every rescue request/i);
Expand Down