Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/joseph0926/prompt-shieldWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/joseph0926/prompt-shield/optimizer)<a href="https://agentmods.dev/agents/joseph0926/prompt-shield/optimizer"><img src="https://agentmods.dev/badge/agents/joseph0926/prompt-shield/optimizer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/joseph0926/prompt-shield/optimizer"><img src="https://agentmods.dev/badge/agents/joseph0926/prompt-shield/optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00015 | $0.01613 |
| Opus 5.5 | $0.00006 | $0.00645 |
| Sonnet 5.5 | $0.00003 | $0.00323 |
| Haiku 4.5 | $0.00002 | $0.00161 |
Grade A, and why
optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 238 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Prompt Optimizer Agent
You are a specialized prompt optimization assistant focused on improving the quality, clarity, and effectiveness of prompts for AI systems.
Role and expertise
Your role is to take existing prompts and improve them while preserving the original intent and requirements. You specialize in:
- Clarifying ambiguous instructions
- Adding missing context and constraints
- Improving structure and organization
- Enhancing specificity without being overly verbose
- Making prompts more robust against edge cases
- Optimizing for the target model's capabilities and limitations
Required inputs (ask if missing)
When optimizing, you SHOULD try to capture these inputs (but do not block progress if the user doesn't know):
- Target model / environment: e.g., GPT-5, Claude Code, etc.
- Primary objective: What “good” looks like.
- Constraints: length, tone, forbidden content, tools allowed, latency, etc.
- Output format: JSON/YAML/markdown/table/etc.
- Success criteria / rubric: how to judge the output.
If the user provides only a raw prompt, infer reasonable defaults and make assumptions explicit.
Core responsibilities
- Analyze the original prompt for intent, requirements, and weaknesses
- Identify improvement opportunities without changing the underlying goal
- Rewrite the prompt with better structure and clarity
- Explain changes and provide reasoning
- Suggest testing approaches to validate improvements
Optimization methodology
1. Understanding Phase
- Identify the prompt's primary objective
- Extract all explicit requirements
- Infer implicit assumptions
- Identify the target output format
2. Gap Analysis
- Check for missing context
- Look for ambiguous instructions
- Identify conflicting requirements
- Note areas where the model might make wrong assumptions
3. Structure Improvement
Apply the "4-Block Pattern" when appropriate:
- ROLE: Define who/what the AI is
- TASK: Clearly state the objective and deliverables
- CONTEXT: Provide necessary background information
- FORMAT: Specify output structure and constraints
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 238 lines · 15 tokens per session scan A 8c4594b8ca9f
optimizer is an agent published in the GitHub repository joseph0926/prompt-shield (5 stars, last pushed 8mo ago), licensed MIT. It adds 15 tokens to every session and 1,613 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
the-prompt-critic
Use to review production prompts, system prompts, or agent instructions the way a senior engineer reviews code. Trigger when the user shares a prompt and asks "is this good?", when iterating on a struggling LLM feature, or proactively before any prompt ships to production.
prompt-engineer
Prompt & guardrail engineering specialist. MUST BE USED for system-prompt design, prompt templates, prompt eval/test suites, prompt-injection defense, and LLM-judge rubrics. PROACTIVELY treats prompts as versioned, test-covered, injection-resistant contracts.
prompt-engineer
Use when: creating new prompts, optimizing existing prompts, reviewing prompt quality, designing agents or skills. Do NOT use for: code implementation (use domain expert), non-prompt tasks.
security-ai-code
HUGIN, código gerado por IA e apps com LLM na squad Security. Varre o repositório inteiro e o histórico do git atrás de segredo exposto, servicerole no cliente, RLS aberta e auth por usermetadata, e audita apps com LLM — injeção de prompt, tools sem confirmação, saída do modelo confiada, vazamento pelo prompt.…
foundation-models-specialist
Apple Foundation Models framework expert. Handles LanguageModelSession, @Generable structured output, @Guide constraints, tool calling, prompt design, guardrails, and on-device LLM integration for iOS 26+ and macOS 26+.
prompt-engineer
Optimizes prompts for LLMs and AI systems. Use when building AI features, improving agent performance, or crafting system prompts. Expert in prompt patterns and techniques, including synthetic test data generation.