# Gpt 5 4 Prompting

> Internal guidance for composing Codex prompts for coding, review, diagnosis, and research tasks inside codex-rescue

- Skill: `ray0907/gpt-5-4-prompting` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add ray0907/gpt-5-4-prompting`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ray0907/gpt-5-4-prompting/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Research & Search
- Author: ray0907 (https://skillmd.com/u/ray0907)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/ray0907/gpt-5-4-prompting

---


# GPT-5.4 Prompting

Use this skill when `codex-rescue` needs to tighten the user's request into a better Codex prompt before the single CLI call. This is the only Claude-side work allowed in the subagent.

## Core rules

Prompt Codex like an operator, not a collaborator:
- State the task, the output contract, and the small set of constraints that matter
- One clear task per Codex run — split unrelated asks into separate runs
- Tell Codex what "done" looks like; don't assume it will infer the desired end state
- Use XML tags for stable internal structure
- Prefer tighter prompt contracts over longer natural-language explanations

## Default prompt recipe

```
<task>
  The concrete job and the relevant repository or failure context.
</task>

<structured_output_contract>
  Exact shape, ordering, and brevity requirements for the response.
</structured_output_contract>

<default_follow_through_policy>
  What Codex should do by default instead of asking routine questions.
</default_follow_through_policy>
```

Add blocks based on task type:

| Task type | Add these blocks |
|-----------|-----------------|
| Coding / debugging | `<completeness_contract>`, `<verification_loop>`, `<missing_context_gating>` |
| Review / adversarial | `<grounding_rules>`, `<structured_output_contract>`, `<dig_deeper_nudge>` |
| Research / recommendation | `<research_mode>`, `<citation_rules>` |
| Write-capable tasks | `<action_safety>` — keeps Codex narrow, avoids unrelated refactors |

## Key blocks

**`<verification_loop>`** — for implementation and debugging:
```
After implementing, verify: run tests, check for type errors, confirm each criterion is met.
Fix failures before finishing. Do not wrap up while errors remain.
```

**`<grounding_rules>`** — for review and research:
```
Every finding must cite a specific file and line from the provided context.
Do not invent files, code paths, or incidents not present in the repository.
If a conclusion is an inference, say so explicitly.
```

**`<action_safety>`** — for write-capable tasks:
```
Only modify files directly required by the task.
Do not refactor, rename, or clean up code outside the task scope.
```

**`<missing_context_gating>`** — for debugging:
```
If you cannot reproduce the issue with the provided context, say so and list what is missing.
Do not guess at root causes without evidence.
```

## Prompt assembly checklist

1. Define the exact task and scope in `<task>`
2. Choose the smallest output contract that still makes the result usable
3. Decide whether Codex should keep going by default or stop for missing details
4. Add verification, grounding, or safety blocks only where the task needs them
5. Remove redundant instructions before sending

## References

- `references/prompt-blocks.md` — reusable block templates
- `references/codex-prompt-recipes.md` — end-to-end prompt examples
- `references/codex-prompt-antipatterns.md` — common failure modes to avoid

