Official agent skill

Prompt Optimizer

by getsentry in getsentry/skills

Creates, optimizes, and iteratively refines agent prompts, system prompts, developer prompts, and reusable prompt templates.

OfficialApache-2.0Auto-check passedAI & LLM Engineering

Install Prompt Optimizer

skills CLI
$ npx skills add getsentry/skills --skill prompt-optimizer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install getsentry/skills prompt-optimizer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/getsentry/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/prompt-optimizer .claude/skills/prompt-optimizer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
prompt-optimizer
GitHub stars
1k
Token cost
~1.2k tokens
SKILL.md length
517 words
Files
7 (incl. references)
Skills in repo
27
Repo updated
First seen
Licence
Apache-2.0

At a glance

Creates, optimizes, and iteratively refines agent prompts, system prompts, developer prompts, and reusable prompt templates.

  • Works in 6 steps: Capture Contract → Inventory External Context → Choose Model Strategy → …
  • Asked to improve a prompt
  • SKILL.md covers Load Only What You Need, Step 1: Capture Contract, Step 2: Inventory External… and Step 3: Choose Model Strategy, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Prompt Optimizer is an agent skill from getsentry/skills, published by the product's own GitHub organization. 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.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `SOURCES.md`, `SPEC.md` and `references/core-patterns.md`).

It sits in AI & LLM Engineering, covering Prompt engineering. It works with OpenAI. The repository describes itself as: Agent Skills used by the Sentry team for development. The licence is Apache-2.0.

When your agent uses it

  • Asked to improve a prompt
  • Optimize a system prompt
  • Rewrite an agent prompt
  • Tune prompt wording

Example prompts

  • “/prompt-optimizer”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Capture Contract
  2. Inventory External Context
  3. Choose Model Strategy
  4. Shape Prompt
  5. Optimize
  6. Return Package

What it can do on your machine

Read from SKILL.md and the folder at commit d18b7aa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Prompt Optimizer loads about 1.2k tokens when it runs, and up to ~5.2k if it reads all its reference files. Until then it costs about 87 tokens; SKILL.md has 517 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~87
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from getsentry/skills at commit d18b7aa, republished under its Apache-2.0 licence (© getsentry). 517 words, ~1,154 tokens.

Download SKILL.mdSave it as .claude/skills/prompt-optimizer/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
prompt-optimizer
description
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.

Prompt Optimizer

Optimize prompts with evals. Keep every instruction, example, and external context reference causal.

Load Only What You Need

NeedRead
New promptreferences/core-patterns.md, references/model-family-notes.md, references/transformed-examples.md
Existing promptreferences/meta-optimization-loop.md, references/core-patterns.md, references/model-family-notes.md
Model-family portreferences/model-family-notes.md, references/core-patterns.md
Repeated failuresreferences/meta-optimization-loop.md, references/core-patterns.md
Weak or ambiguous draftreferences/transformed-examples.md
ProvenanceSOURCES.md

Step 1: Capture Contract

Record before editing:

  • task type: new, refine, port, or debug
  • target model family and snapshot, if known
  • prompt surface: system, developer, user, tool descriptions, examples, schemas
  • layer owners: platform, deployer/persona, retrieved context, user payload
  • objective and non-goals
  • inputs, tools, and external files available
  • required output shape
  • success criteria and failure cases
  • hard constraints: latency, verbosity, safety, budget, tool use, style

If success criteria or examples are missing, create a small eval set first. If the bottleneck is model choice, retrieval, tool schema, or missing evals, say so before rewriting.

Step 2: Inventory External Context

For repo or agent prompts, list stable context by exact path:

Context typeExamples
Agent rulesAGENTS.md, CLAUDE.md
Specsspecs/*.md, docs/api.md
PoliciesSECURITY.md, docs/releasing.md
Examplesexamples/, tests/fixtures/

Rules:

  • Reference stable files by repo-relative path instead of copying them.
  • Paste only excerpts needed for the prompt or eval case.
  • Mark whether a file is loaded, referenced, or out of scope.
  • Avoid vague context pointers such as "read the docs".

Step 3: Choose Model Strategy

Read references/model-family-notes.md.

  • Known family: optimize for that family.
  • Unknown family: write a portable base plus short adapter notes.
  • Snapshot changes: rerun evals.
  • Cross-family divergence: specialize only the failing layer.

Step 4: Shape Prompt

Read references/core-patterns.md.

  • Put stable policy in system or developer.
  • Put task-local facts, retrieved context, and variables in user-facing sections.
  • Keep one owner per behavior rule.
  • Use headings or tags only to separate content types.
  • Put tool policy in prompt text; keep schemas in provider-native tools.
  • Keep persona light unless it changes behavior.
  • Use the shortest wording that preserves the constraint.
  • Cut filler, repeated reminders, dead examples, and rationale that does not affect evals.
Show full SKILL.md (193 more words)Show less

Step 5: Optimize

Read references/meta-optimization-loop.md for refinements.

  1. Baseline the current prompt on the same eval slice.
  2. Cluster failures by root cause.
  3. Write concrete edit criticisms.
  4. Generate two to four candidates:
    • minimal-diff repair
    • structure-first rewrite
    • examples-first or tool-rule variant
    • provider adapter when needed
  5. Compare candidates on the same cases.
  6. Keep a short optimization log.
  7. Validate the winner on holdout cases.
  8. Stop on plateau, oscillation, overfit, excessive cost, or non-prompt bottleneck.

Step 6: Return Package

Return:

  1. Target
  2. Success Criteria
  3. External Context
  4. Optimized Prompt
  5. Adapter Notes
  6. Eval Set
  7. Optimization Log
  8. Residual Risks

For existing prompts, include a concise diff-style note of the main behavioral changes.

Failure Modes

  • editing before defining the eval target
  • mixing policy, examples, and raw context without boundaries
  • duplicating rules across layers
  • putting durable policy in user payloads
  • asking for chain-of-thought
  • keeping contradictory legacy instructions
  • overfitting to one or two examples
  • retaining examples that no longer improve evals
  • fixing tool-use failures only in prompt text when tool descriptions or schemas are weak
  • adding markup that does not reduce ambiguity
  • using persona as a substitute for behavior rules

© getsentry, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in skills/prompt-optimizer of getsentry/skills.

  • SKILL.md
  • SOURCES.md
  • SPEC.md
  • references/core-patterns.md
  • references/meta-optimization-loop.md
  • references/model-family-notes.md
  • references/transformed-examples.md

Open the folder on GitHubat commit d18b7aa

Compare with similar skills

Prompt Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Prompt Optimizer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Prompt Optimizer this skillgetsentry/skills1k—~1.2kAutomated safety check: PassApache-2.0
Codex Fable5baskduf/FableCodex437—~1.6kAutomated safety check: PassAGPL-3.0
System Prompt Writing Guidecashew-labs/libretto904—~570Automated safety check: PassMIT
AI Wrapper Productdavila7/claude-code-templates32k5 repos~1.7kAutomated safety check: PassMIT
Agents Best PracticesDenisSergeevitch/agents-best-practices2.4k—~7.4kAutomated safety check: PassMIT
Prompt Architectckelsoe/prompt-architect3101 repos~6.9kAutomated safety check: PassMIT

Similar skills

  • Codex Fable5

    baskduf/FableCodex

    Apply a Claude Fable 5 inspired operating style inside Codex.

    437 GitHub stars~1.6k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • System Prompt Writing Guide

    cashew-labs/libretto

    Lays out a minimal, iteration-first approach to writing system prompts for LLM agents, with model-specific notes for Claude, GPT, Gemini, and Codex.

    904 GitHub stars~570 tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • AI Wrapper Product

    davila7/claude-code-templates

    Expert in building products that wrap AI APIs (OpenAI, Anthropic, etc.) into focused tools people will pay for.

    32k GitHub starsUsed in 5 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Agents Best Practices

    DenisSergeevitch/agents-best-practices

    A skill your agent uses when designing, generating an MVP blueprint for, auditing, troubleshooting, refactoring, or explaining an agentic harness for any domain.

    2.4k GitHub stars~7.4k tokensUpdated 3 days ago
    AI & LLM EngineeringAuto-check passed
  • Prompt Architect

    ckelsoe/prompt-architect

    Analyzes and improves prompts using 31 frameworks across 7 intent categories.

    310 GitHub starsUsed in 1 repo~6.9k tokens
    AI & LLM EngineeringAuto-check passed
  • Agent Prompt Engineering

    agentailor/fullstack-langgraph-nextjs-agent

    Comprehensive guide for designing, refining, and auditing system prompts for autonomous AI agents based on Anthropic's production practices.

    132 GitHub stars~3.6k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed

More from getsentry/skills

All 27 skills in this repo
  • Gh Review Requests

    getsentry/skills

    Official

    Fetch unread GitHub notifications for open PRs where review is requested from a specified team or opened by a team member.

    1k GitHub starsUsed in 4 repos~621 tokens
    Auto-check: notes
  • Skill Scanner

    getsentry/skills

    Official

    Scan agent skills for security issues. An agent skill from getsentry/skills.

    1k GitHub starsUsed in 4 repos~2.5k tokens
    Auto-check: warnings
  • Security Review

    getsentry/skills

    Official

    Security code review for vulnerabilities. An agent skill from getsentry/skills.

    1k GitHub starsUsed in 4 repos~2.9k tokens
    Auto-check: notes
  • Skill Writer

    getsentry/skills

    Official

    Create, synthesize, and iteratively improve agent skills following the Agent Skills specification.

    1k GitHub stars~2.5k tokensUpdated 5 days ago
    Auto-check passed
  • Django Access Review

    getsentry/skills

    Official

    Django access control and IDOR security review. An agent skill from getsentry/skills.

    1k GitHub starsUsed in 3 repos~2.6k tokens
    Auto-check: notes
  • Gha Security Review

    getsentry/skills

    Official

    GitHub Actions security review for workflow exploitation vulnerabilities.

    1k GitHub starsUsed in 3 repos~2.2k tokens
    Auto-check: notes

Works with

Questions about Prompt Optimizer

What does Prompt Optimizer do?

Creates, optimizes, and iteratively refines agent prompts, system prompts, developer prompts, and reusable prompt templates. Prompt Optimizer is an agent skill from getsentry/skills, published by the product's own GitHub organization. Creates, optimizes, and iteratively refines agent prompts, system prompts, developer prompts, and reusable prompt templates.

When should I use Prompt Optimizer?

Prompt Optimizer fits situations like: asked to improve a prompt; optimize a system prompt; rewrite an agent prompt; tune prompt wording.

How do I install Prompt Optimizer in Claude Code?

Run `npx skills add getsentry/skills --skill prompt-optimizer -a claude-code`. Or copy the skill folder (skills/prompt-optimizer in getsentry/skills) into .claude/skills/prompt-optimizer in your project. Claude Code loads it when a task matches its description.

How do I install Prompt Optimizer in Codex?

Run `npx skills add getsentry/skills --skill prompt-optimizer -a codex`. Or copy the skill folder (skills/prompt-optimizer in getsentry/skills) into .agents/skills/prompt-optimizer in your project. Codex loads it when a task matches its description.

Can I use Prompt Optimizer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add getsentry/skills --skill prompt-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prompt-optimizer, .gemini/skills/prompt-optimizer, .github/skills/prompt-optimizer and .opencode/skills/prompt-optimizer in your project.

What does Prompt Optimizer need to run?

SKILL.md names no scripts, command-line tools or credentials: Prompt Optimizer is instructions for the agent only.

Does Prompt Optimizer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Prompt Optimizer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Prompt Optimizer use?

Prompt Optimizer is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Prompt Optimizer use?

About 1.2k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.1k tokens, read only when the agent opens those files.

What are the alternatives to Prompt Optimizer?

Skills that share tags, products or a category with Prompt Optimizer: Codex Fable5 (baskduf/FableCodex, 437 stars), System Prompt Writing Guide (cashew-labs/libretto, 904 stars), AI Wrapper Product (davila7/claude-code-templates, 32k stars) and Agents Best Practices (DenisSergeevitch/agents-best-practices, 2.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Prompt Optimizer?

getsentry (a GitHub organization, an official publisher) maintains it in getsentry/skills, which has 1,038 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on October 2, 2026.

Source: getsentry/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.