Refine Prompt
Use this skill to turn a rough user prompt into a copy-paste-ready prompt that another AI agent can execute well.
The refined prompt should preserve the user's intent, clarify missing structure, and use available project context without inventing facts.
Context Discovery
Before writing the refined prompt, inspect the current agent and project context that is safely available.
Prefer local context over assumptions:
- Codex: check active instructions, loaded skills, repository files such as
AGENTS.md, .codex/, .agents/, README.md, and nearby project docs.
- Claude: check
CLAUDE.md, project memories, repository docs, and available skills or commands.
- Gemini CLI: check
GEMINI.md, repository docs, configured memories, and available tools.
- Other agents: check their local instruction files, memory files, tool registry, and project documentation when available.
Use fast, scoped search. Do not scan huge dependency or build folders unless the user explicitly asks.
If context cannot be inspected, say that the prompt was refined from the provided text only.
Prompt Refinement Workflow
- Identify the user's real task from the raw prompt.
- Select the best role for the agent, such as
Senior Software Engineer, QA Engineer, Product Manager, Technical Writer, UX Designer, Security Reviewer, or Data Analyst.
- Extract constraints, success criteria, expected output format, files, technologies, risks, and required verification steps.
- Identify useful local or global skills, commands, tools, memories, or project docs. Mark these as suggestions, not requirements, unless the user explicitly requires them.
- Write a refined prompt that another agent can paste directly into a CLI or chat.
- Preserve uncertainty. Use phrases like "inspect and confirm" when the raw prompt lacks details.
Output Format
Return a short lead-in followed by one fenced text block containing the refined prompt.
After the fenced block, include a concise optional note only if context was unavailable or assumptions were important.
Do not include long explanations about prompt engineering.
Use this structure inside the copy-paste block:
Role: <specific expert role>
Task: <clear task distilled from the raw prompt>
Project Context To Use:
- <specific local files, memories, docs, tools, or "Inspect available project context first">
Suggested Skills / Tools:
- <skill/tool suggestion and why it may help>
Requirements:
- <concrete requirements from the raw prompt>
- <inferred requirements that are safe and useful>
Execution Guidance:
- <step-by-step guidance for the agent>
- <how to handle ambiguities>
- <how to avoid unsafe assumptions>
Output Format:
- <exact format the user should receive>
Verification:
- <tests, checks, review steps, or acceptance criteria>
Quality Bar
The refined prompt must be:
- Clear enough for a different agent to act on without seeing the raw prompt.
- Faithful to the user's request.
- Specific about role, task, context, deliverables, and verification.
- Practical for agent CLIs such as Codex, Claude, Gemini CLI, Cursor, and similar tools.
- Written as an instruction to the executing agent, not as commentary about the user.
Skill Suggestions
When suggesting skills, include:
- Skills already visible in the current agent context.
- Project-local skills discovered in directories such as
.agents/skills, .codex/skills, .claude/skills, or similar.
- Global skills only when known or discoverable.
If no relevant skill is found, include:
Suggested Skills / Tools:
- None found from available context. Inspect project-local and global skills before starting.
Handling Weak Raw Prompts
If the raw prompt is vague, still produce a useful refined prompt. Add an Assumptions To Confirm section inside the copy-paste block only when those assumptions materially affect execution.
Do not ask the user for clarification unless the raw prompt is impossible to refine safely.
1---2name: refine-prompt3description: Transform a user's raw prompt into a clear, expert-level prompt for an AI coding or reasoning agent. Use when the user asks to refine, improve, rewrite, or engineer a prompt, especially when they want the output to leverage project context, agent memories, local instruction files, or available skills.4license: MIT5---67# Refine Prompt89Use this skill to turn a rough user prompt into a copy-paste-ready prompt that another AI agent can execute well.1011The refined prompt should preserve the user's intent, clarify missing structure, and use available project context without inventing facts.1213## Context Discovery1415Before writing the refined prompt, inspect the current agent and project context that is safely available.1617Prefer local context over assumptions:1819- Codex: check active instructions, loaded skills, repository files such as `AGENTS.md`, `.codex/`, `.agents/`, `README.md`, and nearby project docs.20- Claude: check `CLAUDE.md`, project memories, repository docs, and available skills or commands.21- Gemini CLI: check `GEMINI.md`, repository docs, configured memories, and available tools.22- Other agents: check their local instruction files, memory files, tool registry, and project documentation when available.2324Use fast, scoped search. Do not scan huge dependency or build folders unless the user explicitly asks.2526If context cannot be inspected, say that the prompt was refined from the provided text only.2728## Prompt Refinement Workflow29301. Identify the user's real task from the raw prompt.312. Select the best role for the agent, such as `Senior Software Engineer`, `QA Engineer`, `Product Manager`, `Technical Writer`, `UX Designer`, `Security Reviewer`, or `Data Analyst`.323. Extract constraints, success criteria, expected output format, files, technologies, risks, and required verification steps.334. Identify useful local or global skills, commands, tools, memories, or project docs. Mark these as suggestions, not requirements, unless the user explicitly requires them.345. Write a refined prompt that another agent can paste directly into a CLI or chat.356. Preserve uncertainty. Use phrases like "inspect and confirm" when the raw prompt lacks details.3637## Output Format3839Return a short lead-in followed by one fenced text block containing the refined prompt.4041After the fenced block, include a concise optional note only if context was unavailable or assumptions were important.4243Do not include long explanations about prompt engineering.4445Use this structure inside the copy-paste block:4647```text48Role: <specific expert role>4950Task: <clear task distilled from the raw prompt>5152Project Context To Use:53- <specific local files, memories, docs, tools, or "Inspect available project context first">5455Suggested Skills / Tools:56- <skill/tool suggestion and why it may help>5758Requirements:59- <concrete requirements from the raw prompt>60- <inferred requirements that are safe and useful>6162Execution Guidance:63- <step-by-step guidance for the agent>64- <how to handle ambiguities>65- <how to avoid unsafe assumptions>6667Output Format:68- <exact format the user should receive>6970Verification:71- <tests, checks, review steps, or acceptance criteria>72```7374## Quality Bar7576The refined prompt must be:7778- Clear enough for a different agent to act on without seeing the raw prompt.79- Faithful to the user's request.80- Specific about role, task, context, deliverables, and verification.81- Practical for agent CLIs such as Codex, Claude, Gemini CLI, Cursor, and similar tools.82- Written as an instruction to the executing agent, not as commentary about the user.8384## Skill Suggestions8586When suggesting skills, include:8788- Skills already visible in the current agent context.89- Project-local skills discovered in directories such as `.agents/skills`, `.codex/skills`, `.claude/skills`, or similar.90- Global skills only when known or discoverable.9192If no relevant skill is found, include:9394```text95Suggested Skills / Tools:96- None found from available context. Inspect project-local and global skills before starting.97```9899## Handling Weak Raw Prompts100101If the raw prompt is vague, still produce a useful refined prompt. Add an `Assumptions To Confirm` section inside the copy-paste block only when those assumptions materially affect execution.102103Do not ask the user for clarification unless the raw prompt is impossible to refine safely.