codex-prompt-optimize

Analyze vague Codex CLI prompts and generate structured XML task definitions.

1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/discountry/ritmex-skills --skill codex-prompt-optimize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codex-prompt-optimize
Source: https://github.com/discountry/ritmex-skills/tree/main/skills/codex-prompt-optimize
Command: npx skills add https://github.com/discountry/ritmex-skills --skill codex-prompt-optimize

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vague, ambiguous, or incomplete prompts sent to the Codex CLI often lead to guesswork, incorrect outputs, and wasted iteration time. This skill eliminates that friction by automatically detecting low-quality prompts, inferring missing context, and generating optimized, structured prompts that produce reliable, accurate results.

Core Features & Use Cases

  • Low-quality prompt detection: Auto-activates when user input has 2 or more signals of being vague, such as missing goals, undefined scope, unclear success criteria, or mixed unrelated asks.
  • 4-dimension prompt analysis: Extracts and fills gaps in intent, scope, constraints, and done-state to create complete task definitions.
  • Structured prompt assembly: Generates XML-formatted Codex prompts with tailored contracts, verification loops, and safety rules matched to the task type (debug, refactor, implement, review, etc.).
  • Use case: If you submit the prompt "fix the auth bug" to Codex, this skill will ask one targeted clarifying question if needed, then produce a prompt with explicit scope, verification steps, and safety guardrails to deliver a correct, minimal fix without unnecessary changes.

Quick Start

Use the codex-prompt-optimize skill to transform your vague Codex request like "make the backend faster" into a clear, actionable prompt with defined scope and success criteria.

Frequently Asked Questions about codex-prompt-optimize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix vague Codex prompts that produce incorrect or unreliable outputs?

To fix vague Codex prompts, use prompt optimization to detect low-quality input, infer missing context, and generate structured XML task definitions with explicit scope, constraints, and success criteria for reliable outputs.

What is the best way to structure a Codex CLI prompt for a complex refactoring task?

Structure a Codex CLI prompt using reusable XML blocks that define intent, scope, constraints, and done-state, adding verification loops and safety contracts to guide the refactoring task accurately.

How does prompt optimization handle ambiguous requests like "fix the auth bug" in Codex?

Prompt optimization handles ambiguous requests by detecting missing goals, asking one targeted clarifying question, and producing a prompt with explicit boundaries to deliver a correct, minimal fix without unnecessary changes.

Can I use structured prompt assembly for write-capable tasks in Codex CLI?

Yes, structured prompt assembly generates XML-formatted Codex prompts with tailored contracts, verification loops, and safety rules specifically matched to write-capable task types like implementation and debugging.

Why does Codex make incorrect guesses when I submit incomplete prompts?

Codex makes incorrect guesses because incomplete prompts lack defined scope and clear success criteria, forcing the AI to infer intent, which leads to wasted iteration time and incorrect outputs.

When do I need prompt optimization for my AI coding tasks?

You need prompt optimization for AI coding tasks when user input exhibits two or more signals of being vague, such as missing goals, undefined scope, unclear success criteria, or mixed unrelated asks.