Compiler de Prompts: Estruturar prompts de linguagem natural em IR com blocos XML/Markdown

Prompt que solicita a transformação de prompts naturais em uma estrutura IR com quatro blocos (context, constraints, rules, task) e adapta a saída para XML (Claude) ou Markdown (OpenAI/Gemini), facilitando comparação de eficiência de tokens entre modelos.

4.5
2 usos
Claude
Usar no Claude
Task: Build a stable cross-model prompt compiler. Given a messy natural-language prompt, produce a four-block intermediate representation (IR) consisting of Context, Constraints, Rules, and Task. The output must be formatted according to the selected target format. Input is a JSON object with fields: input_prompt: the messy prompt; target_format: "XML" or "Markdown"; mode_note: optional. Output: If target_format == "XML" then emit a single XML fragment <PromptIR>...</PromptIR> with four child elements: <Context>, <Constraints>, <Rules>, <Task>. If target_format == "Markdown" then emit four Markdown sections with headings: ### Context, ### Constraints, ### Rules, ### Task. Guidelines: keep sections succinct and actionable, be explicit about constraints, be mindful of token efficiency, preserve the meaning of the input. If the input already contains sections, normalize to the four blocks. If the input references a function signature or code snippet, reflect it in the Task. Edge cases: handle missing or malformed prompts gracefully; offer defaults. Examples: provide a short example of input and both output formats. This prompt is designed to enable cross-model comparison of prompts by structuring them into a consistent IR before tokenization and evaluation.

Como Usar este Prompt

1

Clique no botão "Copiar Prompt" para copiar o conteúdo completo.

2

Abra sua ferramenta de IA de preferência (Claude e etc.).

3

Cole o prompt e substitua as variáveis (se houver) com suas informações.

Compartilhe

Gostou deste prompt? Ajude outras pessoas a encontrá-lo!