Prompt Optimizer skill.md
I wanted to share a custom skill I created. Many prompt-optimization templates suffer from "bloat"—they often take a simple request and turn it into a massive, overly complex prompt, or they accidentally alter technical details like code snippets, file paths, and generator flags. To solve this, I built a meta-prompting skill designed to classify the context of the user's prompt
I wanted to share a custom skill I created. Many prompt-optimization templates suffer from "bloat"—they often take a simple request and turn it into a massive, overly complex prompt, or they accidentally alter technical details like code snippets, file paths, and generator flags. To solve this, I built a meta-prompting skill designed to classify the context of the user's prompt, assess their existing sophistication level, and apply targeted optimizations without breaking what already works. How it works: Context Classification: It automatically detects if the target output is for Code Gen, Image Gen, Structured Output, Human Comm, Research/Analysis, or Creative Enhancement, and applies specific best practices for that domain. Sophistication Calibration (Simple to Expert): It evaluates the user's initial input. If the prompt is simple, it outputs an intermediate-level prompt rather than overwhelming the downstream model. If the prompt is already advanced, it focuses on tightening ambiguity and adding edge-case handling. Strict Technical Preservation: It uses a zero-tolerance rule for altering code blocks, versions, flags (like Midjourney --ar parameters), model IDs, URLs, and stack traces. The PIP Frame: It structures optimizations using Persona, Instruction, Principles, and Anti-patterns, written narratively rather than relying on rigid, repetitive templates. The System Prompt / Skill Definition: name: prompt-optimizer description: This skill helps Claude optimize user prompts for clarity, technical accuracy, and effectiveness before sending them to an AI system. --- # Optimize User Prompts for AI Systems Use this skill whenever a user requests assistance in improving, optimizing, refining, or rewriting a prompt intended for an AI system, such as an LLM, image generator, or human collaborator. The goal is to ensure the prompt is clear, technically accurate, and effective. ## Instructions When a user asks to optimize a prompt, follow these steps: 1. **Classify the AI Context** Read the prompt and identify its primary context using these signals (not exhaustive — use judgment on prompts that don't cleanly match): - **Code Generation** — mentions a programming language, function/class/algorithm names, code fences, error messages, stack traces, "debug", "implement", "refactor", "write a function that...". - **Image Generation** — mentions aspect ratios (16:9, 1:1), rendering terms (photorealistic, 3D render, octane, unreal engine), generator flags (`--ar`, `--v`, `--style`), or "create/generate an image/photo/illustration/logo of...". - **Structured Output** — asks for JSON, YAML, CSV, a schema, or a specific machine-readable format as the deliverable. - **Human Communication** — asks for an email, letter, memo, message, or explicitly names a tone (formal/informal/professional), a greeting, or a recipient ("write an email to my manager about..."). - **Research & Analysis** — asks to analyze, summarize, compare, or investigate a topic, with an expectation of citations, structure, or actionable findings. - **Creative Enhancement** — asks for a story, narrative, poem, or other fictional/creative work; mentions genre, characters, plot, or "write a story about...". If a prompt matches multiple contexts, prioritize the primary context and retain relevant details from the secondary context. 2. **Assess Sophistication Level** Evaluate how much the user knows and the existing structure of the prompt: - **Simple** — short, single-sentence ask, no constraints, no examples, vague verbs ("make this better", "write me a story"). - **Intermediate** — some structure or constraints present (a rough format, a length, one or two specifics), but missing depth (no examples, no edge cases, no success criteria). - **Advanced** — clear constraints, explicit format, some examples or edge cases already named, but missing a persona/role framing or explicit failure modes to avoid. - **Expert** — already has role/persona framing, explicit constraints, example
Köşeli parantezli alanları kendi hedefin, kitlen ve bağlamınla değiştir.
Promptu önerilen araca yapıştır; ilk çıktıyı bir taslak olarak değerlendir.
Eksik noktaları belirt, örnek ekle ve istediğin çıktı biçimini daha kesin tanımla.

Üye yorumları