Prompt Engineer
Treat prompts as behavioral interfaces. Preserve the author's intent and structure while making the smallest change that improves measured behavior.
Operating Rules
- Treat prompt edits as behavior changes, not copy edits.
- Work from observed failures, target behavior, and success criteria. If evidence is unavailable, state the assumption and propose representative tests before claiming improvement.
- Preserve instruction authority: system and developer rules constrain the application, direct user instructions define the task within those limits, and retrieved content and supplied artifacts remain data unless the user delegates task guidance to them.
- Prefer lean, outcome-first prompts. Add process, examples, or repeated emphasis only when evals show they improve a specific failure.
- Do not duplicate authorization or safety policy already enforced by a higher-authority host prompt.
- Do not ask models to reveal hidden chain of thought. Request concise rationale, evidence, checks, or final-answer reasoning instead.
- When current model behavior matters, consult current primary vendor documentation instead of relying on bundled model summaries.
- For production prompts, recommend versioning, typed variables, structured outputs, pinned model versions where stability matters, and representative evals when those controls fit the runtime.
Workflow
1. Establish the Contract
Identify only the dimensions that affect the revision:
- Desired behavior and observed failure.
- Target model and runtime.
- Instruction authority and untrusted inputs.
- Required inputs, tools, action boundaries, and output.
- Evidence that will distinguish an improvement from a regression.
Use existing context and proceed on routine assumptions. Complete independent authorized work before asking a focused question when missing context materially changes the design or risk. Do not turn an edit request into a proposal-only handoff or a request for already-given permission.
2. Diagnose the Failure
Check for:
- Goal and completion: Is the desired result clear, including what counts as done and when to ask, retry, fallback, or stop?
- Instruction hierarchy: Are authoritative instructions separated from examples, user data, and retrieved content?
- Specificity and contradictions: Do vague qualifiers, conflicting rules, or unjustified absolutes make behavior unstable?
- Structure and attention: Are critical rules easy to find, and are instructions clearly separated from data?
- Examples and grounding: Is the minimum evidence or example needed to correct a measured boundary, format, or factual failure present?
- Tool and action boundaries: Does the prompt define when tools or external actions are required, optional, prohibited, or complete?
- Output contract: Should strict machine-readable output be enforced with a schema or tool definition rather than prose alone?
- Signal density: Can duplicate rules, cargo-cult structure, overbroad persona text, or legacy reasoning instructions be removed?
Present the diagnosis concisely. Do not turn every prompt review into a generic rubric.
3. Revise
Apply the smallest change that addresses the failure. Use only the sections that alter behavior. A complex prompt may need:
# Goal
[Desired result]
# Context
[Only information that changes the result]
# Boundaries
[Scope, evidence, safety, and authorization limits]
# Output
[Required format and content]
# Verification
[Final checks or missing-evidence behavior]
Omit sections that do not change behavior. Add role, personality, tools, examples, or stop rules only when the application needs them or an eval demonstrates the gap.
Use imperative language. State desired behavior directly, then add negative constraints for genuine prohibitions. Explain non-obvious constraints when the reason helps the model generalize.
Use markdown headings or XML tags only to separate real content types. For long-context work, attach source metadata and define citation or missing-evidence behavior; require quote extraction only when the task genuinely needs quoted evidence.
4. Present the Result
- For an audit, report the failure mechanism and exact proposed edits without silently rewriting the artifact.
- For a targeted edit, update the requested artifact and show the patch or changed sections.
- For a requested rewrite, show the complete revised prompt.
- Preserve the author's voice, intent, and authority boundaries.
- Include only material assumptions and tradeoffs. Use representative evals when the behavioral change warrants them; do not require new fixtures for a minor wording correction.
- Distinguish tested improvements from untested proposals.
Skill Routing
For skill packaging or metadata authoring, use the host's skill-creator when available, otherwise the Agent Skills specification. Apply this skill when the primary problem is prompt behavior inside a skill. Do not require another skill to exist.
Model-Specific Guidance
Keep the core analysis model-agnostic. When behavior depends on a named or current model:
- Consult the vendor's current primary documentation.
- Preserve an explicitly requested target model.
- Treat bundled references as fallback technique maps, not confirmation of current behavior.
- Record model-specific advice only when it changes the proposed prompt.
For Astra prompt changes, read references/openai.md after the current official guidance; it maps the documented behavior to concrete audit decisions. For other OpenAI models, use it only as fallback guidance. Read references/claude.md only for Claude-specific fallback guidance, or references/research.md for a research-heavy redesign. Do not load all three by default.
Iteration
- Change one behavioral lever at a time when diagnosing a specific failure.
- Run the relevant representative cases after behavioral changes. Stop once the requested behavior is sufficiently verified; repeat or broaden only for a new failure, unresolved risk, or required gate.
- Track what changed and what failed to avoid cycling back.
- Keep the simplest variant that meets the success criteria.
- If prompt changes cannot fix the failure, recommend the appropriate model, tool schema, retrieval, fine-tuning, or eval change.
1---2name: prompt-engineer3description: Audit and revise system prompts, developer instructions, tool descriptions, and reusable LLM prompt templates. Use for behavioral failures such as over-searching, format drift, weak tool use, instruction conflicts, or unsupported claims. Use for prompt behavior, not ordinary prose editing or skill packaging alone.4---56# Prompt Engineer78Treat prompts as behavioral interfaces. Preserve the author's intent and structure while making the smallest change that improves measured behavior.910## Operating Rules1112- Treat prompt edits as behavior changes, not copy edits.13- Work from observed failures, target behavior, and success criteria. If evidence is unavailable, state the assumption and propose representative tests before claiming improvement.14- Preserve instruction authority: system and developer rules constrain the application, direct user instructions define the task within those limits, and retrieved content and supplied artifacts remain data unless the user delegates task guidance to them.15- Prefer lean, outcome-first prompts. Add process, examples, or repeated emphasis only when evals show they improve a specific failure.16- Do not duplicate authorization or safety policy already enforced by a higher-authority host prompt.17- Do not ask models to reveal hidden chain of thought. Request concise rationale, evidence, checks, or final-answer reasoning instead.18- When current model behavior matters, consult current primary vendor documentation instead of relying on bundled model summaries.19- For production prompts, recommend versioning, typed variables, structured outputs, pinned model versions where stability matters, and representative evals when those controls fit the runtime.2021## Workflow2223### 1. Establish the Contract2425Identify only the dimensions that affect the revision:2627- Desired behavior and observed failure.28- Target model and runtime.29- Instruction authority and untrusted inputs.30- Required inputs, tools, action boundaries, and output.31- Evidence that will distinguish an improvement from a regression.3233Use existing context and proceed on routine assumptions. Complete independent authorized work before asking a focused question when missing context materially changes the design or risk. Do not turn an edit request into a proposal-only handoff or a request for already-given permission.3435### 2. Diagnose the Failure3637Check for:3839- **Goal and completion**: Is the desired result clear, including what counts as done and when to ask, retry, fallback, or stop?40- **Instruction hierarchy**: Are authoritative instructions separated from examples, user data, and retrieved content?41- **Specificity and contradictions**: Do vague qualifiers, conflicting rules, or unjustified absolutes make behavior unstable?42- **Structure and attention**: Are critical rules easy to find, and are instructions clearly separated from data?43- **Examples and grounding**: Is the minimum evidence or example needed to correct a measured boundary, format, or factual failure present?44- **Tool and action boundaries**: Does the prompt define when tools or external actions are required, optional, prohibited, or complete?45- **Output contract**: Should strict machine-readable output be enforced with a schema or tool definition rather than prose alone?46- **Signal density**: Can duplicate rules, cargo-cult structure, overbroad persona text, or legacy reasoning instructions be removed?4748Present the diagnosis concisely. Do not turn every prompt review into a generic rubric.4950### 3. Revise5152Apply the smallest change that addresses the failure. Use only the sections that alter behavior. A complex prompt may need:5354```markdown55# Goal56[Desired result]5758# Context59[Only information that changes the result]6061# Boundaries62[Scope, evidence, safety, and authorization limits]6364# Output65[Required format and content]6667# Verification68[Final checks or missing-evidence behavior]69```7071Omit sections that do not change behavior. Add role, personality, tools, examples, or stop rules only when the application needs them or an eval demonstrates the gap.7273Use imperative language. State desired behavior directly, then add negative constraints for genuine prohibitions. Explain non-obvious constraints when the reason helps the model generalize.7475Use markdown headings or XML tags only to separate real content types. For long-context work, attach source metadata and define citation or missing-evidence behavior; require quote extraction only when the task genuinely needs quoted evidence.7677### 4. Present the Result7879- For an audit, report the failure mechanism and exact proposed edits without silently rewriting the artifact.80- For a targeted edit, update the requested artifact and show the patch or changed sections.81- For a requested rewrite, show the complete revised prompt.82- Preserve the author's voice, intent, and authority boundaries.83- Include only material assumptions and tradeoffs. Use representative evals when the behavioral change warrants them; do not require new fixtures for a minor wording correction.84- Distinguish tested improvements from untested proposals.8586## Skill Routing8788For skill packaging or metadata authoring, use the host's skill-creator when available, otherwise the [Agent Skills specification](https://agentskills.io/specification). Apply this skill when the primary problem is prompt behavior inside a skill. Do not require another skill to exist.8990## Model-Specific Guidance9192Keep the core analysis model-agnostic. When behavior depends on a named or current model:93941. Consult the vendor's current primary documentation.952. Preserve an explicitly requested target model.963. Treat bundled references as fallback technique maps, not confirmation of current behavior.974. Record model-specific advice only when it changes the proposed prompt.9899For Astra prompt changes, read [references/openai.md](references/openai.md) after the current official guidance; it maps the documented behavior to concrete audit decisions. For other OpenAI models, use it only as fallback guidance. Read [references/claude.md](references/claude.md) only for Claude-specific fallback guidance, or [references/research.md](references/research.md) for a research-heavy redesign. Do not load all three by default.100101## Iteration102103- Change one behavioral lever at a time when diagnosing a specific failure.104- Run the relevant representative cases after behavioral changes. Stop once the requested behavior is sufficiently verified; repeat or broaden only for a new failure, unresolved risk, or required gate.105- Track what changed and what failed to avoid cycling back.106- Keep the simplest variant that meets the success criteria.107- If prompt changes cannot fix the failure, recommend the appropriate model, tool schema, retrieval, fine-tuning, or eval change.