# Dspy Prompt Optimizer

> >

- **Type:** Skill
- **Install:** `agentstack add skill-stijnman-grok-custom-skills-dspy-prompt-optimizer`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Stijnman](https://agentstack.voostack.com/s/stijnman)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Stijnman](https://github.com/Stijnman)
- **Source:** https://github.com/Stijnman/grok-custom-skills/tree/main/.grok/skills/dspy-prompt-optimizer

## Install

```sh
agentstack add skill-stijnman-grok-custom-skills-dspy-prompt-optimizer
```

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

## About

# Dspy Prompt Optimizer

## When to Use

- User says **optimize this prompt** or task matches this capability
- User says **dspy tune** or task matches this capability
- User says **improve prompt with reflection** or task matches this capability

## Workflow

1. Capture baseline prompt and 2-3 example inputs with desired outputs.
2. Run baseline; score outputs against criteria.
3. Generate 3 prompt variants addressing failures.
4. Test variants; pick best by score.
5. Return optimized prompt with before/after metrics.

## Integrations

- `self-refine-loop`
- `auto-tester`
- `hyper-skill-tester`

## Error Handling

| Failure | Response |
|---------|----------|
| No examples | Ask for 2 input/output pairs minimum. |
| Overfitting one example | Require 3+ diverse examples. |

## Gotchas

- Keep prompt under 2000 tokens unless user needs longer.

## Example

**Input:** User request matching triggers above.
**Output:** Structured result per workflow with integrations invoked as needed.

## Source & license

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

- **Author:** [Stijnman](https://github.com/Stijnman)
- **Source:** [Stijnman/grok-custom-skills](https://github.com/Stijnman/grok-custom-skills)
- **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-stijnman-grok-custom-skills-dspy-prompt-optimizer
- Seller: https://agentstack.voostack.com/s/stijnman
- 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%.
