# Optimize LLM Prompts and Agent Instructions

Weak prompts create inconsistent model outputs and slow AI feature development. This skill helps structure prompts, examples, constraints, and output formats for Claude, Codex, and Claude Code.

## Install

```bash
npx skillstore add joseph obrien/89jobrien-prompt-optimization
```

## Metadata

- Status: approved
- Slug: 89jobrien-prompt-optimization
- Version: 1.0.1
- Author version: 1.0.1
- Skillstore revision: r1
- Version status: valid
- Tree hash: b09bcab4504512ed520c335580489da27a633be8606ea88577953a3eae7561a5
- Author: Joseph OBrien
- GitHub username: 89jobrien
- License: MIT
- Repository: https://github.com/89jobrien/steve/tree/main/steve/skills/prompt-optimization
- Ref: c4037264bbd363c572662d6154a3ab28f5ca4f53
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 82
- Quality tier: silver
- Public page: https://skillstore.pages.dev/skills/89jobrien-prompt-optimization
- Manifest: https://skillstore.pages.dev/api/skills/89jobrien-prompt-optimization/manifest

## Capabilities

- Defines prompt sections for role, task, constraints, output format, and examples.
- Adds few-shot input and output examples for desired style and edge cases.
- Converts vague requests into clear system prompts for agents and AI features.
- Specifies response formats and evaluation criteria for repeatable outputs.
- Suggests iteration practices for testing and refining prompts.

## Use Cases

- Design Agent Instructions: Create structured system prompts for AI agents with roles, boundaries, and expected outputs.
- Improve Review Workflows: Turn broad review requests into clear prompts with criteria, severity labels, and action-focused outputs.
- Standardize Prompt Patterns: Document reusable prompt structures for teams that need consistent model behavior across workflows.

## Prompt Templates

### Improve a Basic Prompt

```
Optimize this prompt for clarity, constraints, and output format: [paste prompt]. Explain the key changes in simple terms.
```

### Create a System Prompt

```
Create a system prompt for [agent or feature]. Include role, task, boundaries, inputs, output format, and two success criteria.
```

### Add Few-Shot Examples

```
Rewrite this task prompt with three few-shot examples. Cover a typical case, an edge case, and a failure case.
```

### Design an Agent Workflow

```
Optimize this multi-step AI workflow for [goal]. Define agent roles, handoffs, verification checks, and prompt sections for each step.
```

## Limitations

- It does not test prompts against live model responses.
- It does not provide model-specific benchmark scores or latency data.
- It does not replace safety review for prompts that handle sensitive data.
- Final quality depends on the provided task details and examples.

## Best Practices

- Start with the user goal, available inputs, and required output before adding examples.
- Include edge cases that show what the model should avoid or reject.
- Test revised prompts with representative tasks before using them in production.

## Anti Patterns

- Asking for better results without defining audience, constraints, or success criteria.
- Mixing task instructions, examples, and formatting rules in one unstructured paragraph.
- Treating a single good response as proof that a prompt is reliable.

## Security Audit

- Audited at: 2026-07-05T13:26:23.445\+00:00
- Summary: The static analyzer flagged Markdown code fences as Ruby or shell backtick execution. Review of SKILL.md shows these are prompt examples and fenced Markdown blocks, not executable commands. No prompt injection attempt or malicious intent was found.

## Stats

- Views: 177
- Downloads: 26
- Favorites: 0
- Popularity score: 0
