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
- Define the exact task and scope in
<task> - Choose the smallest output contract that still makes the result usable
- Decide whether Codex should keep going by default or stop for missing details
- Add verification, grounding, or safety blocks only where the task needs them
- Remove redundant instructions before sending
References
references/prompt-blocks.md— reusable block templatesreferences/codex-prompt-recipes.md— end-to-end prompt examplesreferences/codex-prompt-antipatterns.md— common failure modes to avoid