# Optimize Prompt

> One deliberate rewrite pass that applies Anthropic's current prompt-engineering best practices to an existing draft prompt (SKILL.md, scheduled-task prompt, API/system prompt, one-off task prompt). Use when the user types /optimize-prompt or says "optimize this prompt" / "improve this prompt" / "tune this prompt" / "apply prompt best practices to X". Input is a pasted prompt, @-mentioned file, or…

- **Type:** Skill
- **Install:** `agentstack add skill-dtiger1889-ops-claude-harness-toolbox-optimize-prompt`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [dtiger1889-ops](https://agentstack.voostack.com/s/dtiger1889-ops)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [dtiger1889-ops](https://github.com/dtiger1889-ops)
- **Source:** https://github.com/dtiger1889-ops/claude-harness-toolbox/tree/main/skills/optimize-prompt

## Install

```sh
agentstack add skill-dtiger1889-ops-claude-harness-toolbox-optimize-prompt
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# optimize-prompt -- one-pass prompt rewrite

Grounded in platform.claude.com prompting best-practices + prompting-tools (the Console
prompt improver's 4-step transform) + the model-specific pages (Fable 5, Sonnet 5, Opus 4.8);
community: arxiv 2601.22025 (generic rewrites measured net-negative), Decagon GEPA production
notes (length caps = regularization), DreamHost 25-technique test (emphasis devices dead;
XML/few-shot/ordering alive). When maintaining this skill, re-verify against the LIVE docs,
not memory.

## Step 1 -- target + context
- Get the draft: pasted text, @-mentioned file, or a described location (find it, Read to EOF).
- If context is absent AND material, ask ONCE, one message: target surface (Claude Code
  SKILL / API system prompt / scheduled-task prompt / chat one-off) and latency-vs-accuracy
  preference. Defaults: accuracy; Claude 4.6+/Fable-era models.
- `--check` flag → run Step 2 only, report the defect list, stop. No rewrite.
- **SKILL.md detection:** if the target is a Claude Code SKILL.md, additionally apply the
  skill-authoring conventions: description in third person carrying the WHEN-triggers
  (discovery lives in YAML, execution in the body); body is a procedure to run, not
  reference prose; `, ``, ``, ``); variable parts →
  `{{template_variables}}`; long data ABOVE instructions/query (20k+ context: query-at-end
  is worth up to ~30%); multi-doc inputs → nested `` shape.
- **Instructions:** negative constraints → positive equivalents ("write flowing prose" not
  "no markdown"); add the WHY to rules so the model generalizes; vague scope → explicit
  ("every section, not just the first"); strip MUST/CRITICAL/ALL-CAPS emphasis (4.5+ models
  overtrigger on it); explicit output-format spec; imperative verbs for tool actions.
- **Examples:** wrap in `` tags; flag if 5; ensure at least one edge case;
  reasoning tasks get a `` block inside examples; flag examples written for older
  model generations as stale.
- **Reasoning:** complex tasks get numbered analysis steps + a self-check line ("before
  finishing, verify against "); prefer "consider/evaluate" over "think" when
  extended thinking is off.
- **Model-currency sweep (4.6+/Fable):** remove assistant prefills (400 error now);
  `budget_tokens` → adaptive thinking + `effort`; remove "reproduce your reasoning in the
  response" asks (Fable refusal trigger); dial back anti-laziness/over-prescriptive language
  carried from 3.x-era prompts — newer models DEGRADE under it, so cutting old instructions
  is often the optimization.
- **Anti-bloat regulator:** compress examples aggressively, instructions barely (asymmetric
  compression); if the rewrite exceeds 1.5x the input length, cut before delivering.

## Step 4 -- report
Output to chat:
1. The optimized prompt in a fenced block.
2. Bulleted "what changed and why" — each bullet names the rule applied.
3. Deliberate non-changes ("kept your negative constraint because it carries a why").
If the source is a file and the user asks for a file, write a SIBLING `.optimized.md`.
Never overwrite the source; the user applies it.

## Never (failed approaches, pre-encoded)
- No eval loops, golden sets, or LLM-as-judge iteration — judges carry systematic biases
  and loops degrade past iteration 2-3. One pass, human reviews.
- No generic "helpful assistant" framing added to task prompts (measured net-negative).
- No multi-candidate tournaments / token-burning fan-out.
- No blank-page generation from a vague wish — require a draft or a concrete task description.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [dtiger1889-ops](https://github.com/dtiger1889-ops)
- **Source:** [dtiger1889-ops/claude-harness-toolbox](https://github.com/dtiger1889-ops/claude-harness-toolbox)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-dtiger1889-ops-claude-harness-toolbox-optimize-prompt
- Seller: https://agentstack.voostack.com/s/dtiger1889-ops
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
