# Optimize Prompts With Diagnostic Analysis

Prompt libraries often grow verbose, inconsistent, and hard to maintain. This skill diagnoses prompt quality issues and turns them into practical optimization steps.

## Install

```bash
npx skillstore add dnyoussef/when-optimizing-prompts-use-prompt-optimization-analyzer
```

## Metadata

- Status: approved
- Slug: dnyoussef-when-optimizing-prompts-use-prompt-optimization-analyzer
- Version: 1.0.0
- Author version: 1.0.0
- Skillstore revision: r1
- Version status: valid
- Tree hash: bdead1ebd3f0c78beda2b562c5416efc510dd35ed729586d95a89eb268c9072c
- Author: DNYoussef
- GitHub username: DNYoussef
- License: MIT
- Repository: https://github.com/DNYoussef/ai-chrome-extension/tree/main/.claude/skills/meta-tools/when-optimizing-prompts-use-prompt-optimization-analyzer
- Ref: c579efd02184f1128d6741d16e6c8d951d7d4208
- 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: 50
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/dnyoussef-when-optimizing-prompts-use-prompt-optimization-analyzer
- Manifest: https://skillstore.pages.dev/api/skills/dnyoussef-when-optimizing-prompts-use-prompt-optimization-analyzer/manifest

## Capabilities

- Measures token waste from redundancy, verbosity, and filler words.
- Detects vague instructions, undefined terms, conflicts, and missing context.
- Reviews trigger conditions for clarity, specificity, and scope.
- Produces prioritized recommendations with before and after comparisons.
- Estimates token savings and clarity improvements after optimization.

## Use Cases

- Prepare a Skill for Publication: Review a new skill prompt for clarity, token waste, and weak trigger conditions before release.
- Improve a Prompt Library: Compare prompts across a team and identify repeated wording, vague rules, and maintenance problems.
- Refine Support Instructions: Turn broad agent guidance into clear steps, measurable outcomes, and easier review criteria.

## Prompt Templates

### Find Basic Token Waste

```
Analyze this prompt for repeated phrases, filler words, and vague instructions. Return the top five fixes and estimated token savings: [paste prompt].
```

### Improve Skill Instructions

```
Review this skill prompt for token efficiency, trigger clarity, and conflicting requirements. Prioritize issues by severity: [paste skill content].
```

### Compare Before and After

```
Compare these prompt versions. Explain what improved, what became weaker, and whether the optimized version keeps the original intent: [paste both versions].
```

### Audit a Prompt Library Plan

```
Analyze these related prompts as a library. Identify shared anti-patterns, overlapping triggers, and a phased optimization plan: [paste prompt set].
```

## Limitations

- It does not guarantee exact model token counts.
- Heuristic scores need human review before publication decisions.
- The npx workflow examples require security review before use.
- It does not rewrite files unless an agent applies the changes.

## Best Practices

- Provide the full prompt, target user, model, and token goal.
- Fix high-severity clarity issues before optimizing only for length.
- Run the analysis again after major prompt changes.

## Anti Patterns

- Optimizing only for token count when precision is required.
- Treating heuristic scores as final quality guarantees.
- Running external workflow commands without approval and version pinning.

## Security Audit

- Audited at: 2026-07-05T13:14:44.895\+00:00
- Summary: Most static detections are false positives caused by Markdown fences and JavaScript template literals. The real issue is repeated guidance to run npx claude-flow@alpha hook and memory commands, which can execute mutable third-party package code. No prompt injection attempt was found.

## Stats

- Views: 221
- Downloads: 12
- Favorites: 1
- Popularity score: 0
