All skills
getsentry avatar

/prompt-optimizer

@c190d36 official
by Sentrygetsentry/skills1k stars
53

Creates, optimizes, and iteratively refines agent prompts, system prompts, developer prompts, and reusable prompt templates. Use when asked to improve a prompt, optimize a system prompt, rewrite an agent prompt, tune prompt wording, make a prompt more reliable, port prompts between OpenAI, Claude, or Gemini, or build prompt evals.

Use this Skill: https://skilld.dev/gh/getsentry/skills/prompt-optimizer

This session only. Nothing lands on disk.

referencestransformed-examples.md

≈901 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Transformed Examples

Use these examples when the task is under-specified or when you need a stronger default shape.

Example 1: Happy-path new agent prompt

Input brief

"Write a system prompt for a coding agent that should act by default, use tools, and keep the user updated."

Transformed prompt

<role>
You are a pragmatic coding agent working in the user's repository.
</role>

<goal>
Implement the user's requested change end-to-end when feasible.
Do not stop at analysis if you can safely gather facts and act.
</goal>

<tool_policy>
Use tools to inspect the workspace before assuming facts.
Read before write. Validate the changed surface before finishing.
</tool_policy>

<external_files>
Reference exact repo files such as `AGENTS.md`, `CONTRIBUTING.md`, or
`docs/api.md` when they govern the task.
</external_files>

<workflow>
1. Restate the objective briefly.
2. Inspect the relevant files or state.
3. Implement the change.
4. Run the most relevant validation.
5. Report the outcome and any remaining risks.
</workflow>

<constraints>
Ask before destructive actions or risky scope expansion.
Keep progress updates brief and factual.
</constraints>

Why it is better:

  • explicit default behavior
  • explicit tool-use trigger
  • path-backed external context
  • explicit validation step
  • explicit escalation boundary

Example 2: Robust variant for a weak existing prompt

Before

"Be helpful, think step by step, and suggest changes to the repo."

After

<default_behavior>
Default to implementation when the user's intent is execution rather than discussion.
Use tools to discover missing facts instead of guessing.
</default_behavior>

<tool_rules>
Use repository tools whenever correctness depends on current files, logs, or config.
If a validation command exists for the changed surface, run it before finalizing.
</tool_rules>

<progress_updates>
Send short progress updates during long tasks.
Keep them factual and tied to concrete work completed.
</progress_updates>

<ask_first>
Ask before destructive actions, network-dependent actions, or major scope changes.
</ask_first>

Why it is better:

  • replaces vague helpfulness with actionable defaults
  • removes unnecessary chain-of-thought instruction
  • moves tool use from implication to policy
  • calibrates user-facing updates

Example 3: Anti-pattern and corrected version

Anti-pattern

You are the world's best genius agent.
Think step by step and explain every internal thought.
Never ask questions.
Always ask questions before acting.
Use tools only if absolutely necessary, but always use tools before answering.
Do not be verbose.
Provide extremely detailed explanations.

Corrected version

<role>
You are a reliable implementation agent.
</role>

<goal>
Complete the user's task accurately and efficiently.
</goal>

<tool_use>
Use tools when current repository facts, logs, or external state are needed.
</tool_use>

<external_files>
List exact files for stable specs, docs, and policies. Paste excerpts only
when the runtime cannot retrieve them.
</external_files>

<clarification>
Ask only when required information is missing or the action is risky.
</clarification>

<output_format>
Keep progress updates brief.
Keep the final answer concise and include validation plus open risks.
</output_format>

Why it is better:

  • removes contradictory instructions
  • removes chain-of-thought demand
  • replaces vague context with exact file rules
  • replaces absolute slogans with operational rules
  • turns style goals into specific output behavior

Source: SKILL.md on GitHub

No alerts16d3 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    No security issues detected. The skill provides a structured framework for prompt optimization, using patterns to isolate user input and referencing official documentation from trusted technology providers.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

Signed by skilld at c190d36. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 5 months ago
  • prompt-engineering
  • prompt-optimization
  • claude
  • openai
  • gemini
  • system-prompts
  • evals
  • agent-prompts
  • llm

README badge

README badge for getsentry/skills/prompt-optimizer

Designs and refines agent prompts through structured evals, inventorying external context, and iterating on prompt layers (system, developer, user) without editing before defining success criteria. Covers porting prompts across OpenAI, Claude, and Gemini model families, debugging repeated failures, and building eval sets to validate changes.

Generated from the current SKILL.md.

Does this skill work with Claude, GPT, and Gemini?
Yes. The skill includes model-family-specific notes and adapters for OpenAI, Claude, and Gemini, and can port prompts between them.
What do I need to provide to start optimizing a prompt?
At minimum: the current prompt, target model family, task type (new/refine/port/debug), success criteria, and failure cases. If success criteria are missing, the skill guides you to build a small eval set first.
Does this skill handle tool-use and schema optimization?
The skill addresses tool-policy wording in prompts and identifies when failures stem from weak tool descriptions or schemas rather than prompt text alone, but delegates schema changes to provider-native tool definitions.
Can I use this skill to debug a prompt that's failing repeatedly?
Yes. The skill includes a meta-optimization loop for clustering failures by root cause, generating candidate rewrites, and comparing them on the same eval cases to find the fix.
Does this skill create evals, or just optimize existing prompts?
It does both. If you lack success criteria or examples, the skill guides you to build a small eval set before optimization begins.

Generated from the current SKILL.md. These answers refresh after source changes.