Summary
This skill focuses only on writing high-quality prompts and formatting them for clarity, consistency, and better model steerability.
It helps define prompt structure, wording quality, examples, and formatting patterns for reliable outputs.
See references for detailed OpenAI prompt engineering guides.
When to use
- You want better-written prompts with clear instruction hierarchy.
- You need consistent prompt formatting across tasks or teams.
- You want reusable prompt templates with strong examples and constraints.
- You need to improve ambiguous prompts that produce inconsistent output.
- You are standardizing a stable, repeatable procedure that multiple agents or teams should share.
- You want reusable behavior that can be versioned and improved independently over time.
When not to use
- You are asking for API integration code, deployment, or version rollout strategy.
- You need runtime implementation details instead of prompt writing guidance.
- The request is truly one-off and does not need reusable structure.
- The procedure changes daily and has not stabilized yet.
- The task primarily requires live external state or side effects; use tools or APIs for that.
Required inputs
Provide or infer:
- Outcome: what the prompt must produce.
- Audience or task type: who uses the output and for what.
- Output contract: free text, markdown, JSON, or schema-constrained output.
- Constraints: style, tone, safety limits, and forbidden behavior.
If relevant, also capture example inputs and expected outputs.
If details are missing, ask only the minimum needed to author a usable v1 template.
Routing guidance and edge cases
- Prefer triggering this skill for reusable procedures, stable writing standards, or organization-wide prompt conventions.
- Avoid triggering this skill when the user asks for ad hoc brainstorming that does not require strict structure.
- Include both positive and negative examples in your authored prompt package to improve routing accuracy.
- If routing is inconsistent, iterate on frontmatter
name,description, and examples before changing scripts or runtime code.
Procedure
-
Define the target behavior
- Write a one-sentence objective for the prompt.
- Define success as observable output criteria.
-
Set instruction hierarchy
- Put high-priority behavior first.
- Separate required rules from preferences.
- State what the model must do and must not do.
- Put reusable application rules in the Responses API
instructionsparameter or adevelopermessage; they take priority overuserinput. - Do not rely on
instructionsfrom a prior turn when usingprevious_response_id; send them again.
-
Draft the prompt with consistent formatting
- Use clear section headers in this order when useful:
Identity,Instructions,Examples,Context. - Keep instructions explicit and testable.
- Use placeholders for dynamic values, for example
{{customer_name}}. - Keep stable, repeated content near the beginning to improve prompt-cache savings.
- Use clear section headers in this order when useful:
-
Strengthen formatting discipline
- Use bullet lists for constraints and output rules.
- Use XML-style delimiters for example I/O blocks when helpful.
- Avoid long paragraphs that hide requirements.
-
Add examples that teach behavior
- Use a diverse handful of examples when they materially improve reliability, especially for strict formats.
- Cover common and edge inputs.
- Keep examples consistent with stated rules.
-
Add output contract checks
- Specify exact format expectations (fields, ordering, allowed labels).
- Add explicit negative constraints to reduce drift.
-
Revise for clarity and brevity
- Remove redundant instructions.
- Replace vague wording with measurable requirements.
- Keep only context that changes model decisions.
- For GPT models, use precise instructions. For reasoning models, begin with higher-level goals and add detail only when evaluation results require it.
-
Add operational readiness notes when the prompt will be used as a skill artifact
- Include when to use, how to run, expected outputs, and gotchas.
- Add explicit verification steps and output checks for brittle multi-step workflows.
Branching logic
-
If output must follow strict schema: Use explicit field-level formatting rules and schema-like examples.
-
If behavior differs by customer or locale: Keep global rules stable and isolate locale-specific rules in dedicated context blocks.
-
If the prompt is long and complex: Split sections clearly and remove non-essential context.
-
If task is reasoning-heavy and under-specified: Start with goal + constraints, then tighten with examples after observing failures.
-
If task is deterministic and format-sensitive: Use strict format instructions and highly specific examples.
Quality criteria
A skill run is complete when all are true:
- Prompt objective and output contract are explicit.
- Instruction hierarchy is clear (must vs should).
- Formatting is consistent across sections.
- Examples reinforce the required behavior and format.
- Ambiguous wording has been removed.
- Negative trigger examples are present for routing precision.
- Verification steps and output checks are defined when workflow execution is multi-step.
- Representative fixtures, tests, and evaluation checks cover production prompt changes.
API deployment guidance
- For new OpenAI API work, manage prompts in application code, not reusable prompt objects.
- Keep a small prompt-builder module near the feature it supports.
- Use typed function inputs or schemas for dynamic values.
- Pass generated
instructionsandinputdirectly to the Responses API. - Pin a specific production model snapshot and evaluate behavior before changing the prompt or model.
- Roll out changes through normal deployment controls; use feature flags or configuration for staged releases.
- Reusable prompt objects are deprecated: creation was de-emphasized on June 3, 2026, and
v1/promptsis scheduled to shut down on November 30, 2026. Use the OpenAI migration guide only for existing prompt-object integrations.
Agent skill packaging
Apply these when the prompt template is packaged as an agent skill, not as an OpenAI API prompt object.
-
Keep skills discoverable.
- Use clear frontmatter
nameanddescription. - Keep explicit "Use when" and "Do not use when" guidance.
- Include negative examples with positive examples.
- Use clear frontmatter
-
Keep system prompts lean.
- Put stable, reusable procedures in skills.
- Keep global policies and always-on behavior in system prompts.
- Do not duplicate full skill procedures in system prompts.
-
Design script-backed skills like tiny CLIs.
- Ensure commands run from the command line.
- Require deterministic stdout for key status and results.
- Fail loudly with clear usage or validation errors.
- Write outputs to known, documented file paths.
-
Include worked examples in skill assets.
- Provide inputs, commands, and expected outputs.
- Cover normal cases and at least one edge case.
-
Add explicit verification gates.
- Validate output format and required fields.
- Confirm artifacts exist at expected paths.
- Add checks that catch partial completion.
-
Be cautious with network access.
- Prefer no-network execution when possible.
- If network access is required, use strict allowlists and explicit data-egress constraints.
-
Use a model that can reliably complete multi-step workflows.
- If execution is brittle, simplify the workflow and strengthen verification guidance.
Reproducibility and versioning
- Keep prompts and prompt builders in source control and change them through code review.
- Pin a specific production model snapshot when reproducibility matters.
- Maintain representative fixtures, tests, and evaluation suites for prompt behavior.
- Version and deploy prompt changes with the application; use feature flags or configuration for staged rollouts.
- When this guidance is also packaged as an agent skill, version the skill independently of the API prompt.
Deliverables
Produce:
- Reusable prompt template text for a code-managed
instructionsordevelopermessage (Procedure steps 1-4) - Prompt formatting checklist (Procedure step 6)
- Improved example set (good and edge cases; Procedure step 5)
- Prompt rewrite notes explaining key clarity changes (Procedure step 7)
- Operational readiness notes (how to run, expected outputs, gotchas, verification checks; Procedure step 8)
Code-managed prompt template
Use this as the instructions value or developer message sent to the Responses API. Keep it in source control near the feature it supports.
For an existing saved prompt object, migrate it to code; do not create a new reusable prompt object.
# Identity
You are an assistant that {role-purpose}.
# Instructions
- Primary objective: {objective}
- Required constraints: {constraints}
- Output requirements: {format-rules}
- Never do: {prohibited-behaviors}
# Examples
<input id="example-1">
{example-input-1}
</input>
<output id="example-1">
{example-output-1}
</output>
# Context
{stable-reference-context}
Skill authoring add-on template (for runnable skill workflows)
Use this companion template when the prompt package will be executed as a skill with scripts or assets.
# When to use
- {positive-trigger-1}
- {positive-trigger-2}
# Do not use when
- {negative-trigger-1}
- {negative-trigger-2}
# Inputs
- {input-contract}
# How to run
- {install-command}
- {run-command}
# Expected outputs
- {path-1}: {artifact-description}
- {path-2}: {artifact-description}
# Gotchas
- {failure-mode-1}
- {failure-mode-2}
# Verification checks
- {check-1}
- {check-2}
# Worked examples
<input id="example-1">
{example-input-1}
</input>
<run id="example-1">
{example-command-1}
</run>
<output id="example-1">
{example-output-1}
</output>
Prompt formatting checklist
Use this checklist for every prompt revision.
- [ ] Objective is one sentence and testable
- [ ] Required behavior is listed before optional preferences
- [ ] Output format is explicit and easy to verify
- [ ] Examples are diverse and included when they materially improve reliability
- [ ] Negative constraints are included
- [ ] Context is minimal and relevant
- [ ] No contradictory instructions
- [ ] "Use when" and "Do not use when" routing guidance is explicit
- [ ] At least one negative trigger example is included
- [ ] Prompt is code-managed, model snapshot is pinned when needed, and rollout intent is defined
- [ ] Verification steps and output checks are defined for multi-step workflows
Prompt starter patterns
- "Rewrite this prompt using Identity, Instructions, Examples, Context sections while preserving intent: {prompt}."
- "Tighten this prompt to eliminate ambiguity and enforce this format: {format-rules}."
- "Add high-quality examples to teach this behavior: {objective}."
- "Convert this long paragraph prompt into a concise, structured prompt with explicit constraints."
Guardrails
- Do not include secrets or private data in prompt text.
- Do not mix conflicting instructions in multiple sections.
- Do not leave output format implied when precision is required.
- Do not overfit to one example; use diverse examples.
- Do not duplicate full skill procedures inside reusable developer instructions.
- Do not rely on open network access without strict allowlists and explicit data-egress rules.
- Do not leave output paths undefined for script-backed workflows.