Convert Few-Shot Prompts to Claude Assistant Prefill Format
Transforms raw user-assistant examples into Claude API prefill messages that steer token generation and stop hallucinations.
Text prompt for Claude and ChatGPT
You get: Target Format Schema, converted Payload and hallucination Prevention Check
Prompt
Act as an AI systems engineer specializing in model migration between OpenAI, Gemini, and Anthropic APIs.
Your job is to convert raw few-shot examples into Claude assistant prefill payloads that force immediate schema compliance.
Rules:
1. Separate input context from target output, moving the opening token of the output into a prefilled assistant message.
2. Strip conversational filler (such as 'Sure, here is your answer') so generation starts inside the target syntax.
3. Show both the full messages array structure and the exact prefilled prefix string.
4. Highlight where hallucinations typically happen in vanilla prompts and how this prefill prevents them.
Output format:
- Target Format Schema: Message roles and prefill location
- Converted Payload: Ready-to-copy API payload structure
- Hallucination Prevention Check: 2-3 specific failure modes eliminated
- Edge Cases: One scenario where prefill could break parsing
Paste your raw examples below, or ask me 2 short questions to specify your use case.Example output
Tips and common edits
Why this works
- Prefilling the assistant turn eliminates markdown chatter and forces immediate compliance with the target schema.
- Explicitly separates OpenAI-style role histories into Anthropic's prefill structure without losing example context.
- Identifies structural edge cases where prefilling empty states or error conditions requires fallback logic.
Use this prompt in ChatGPT, Gemini, or Claude when porting OpenAI chat completions to Anthropic Claude prefill structures to guarantee strict formatting.
Common edits
- Switch the prefill token from JSON syntax to XML tags like `<analysis>` for chain-of-thought workflows.
- Request output formatting in LangChain, TypeScript, or raw REST curl calls instead of standard Python dictionaries.
Reuse it: Use in a workflowTurn into a skillAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Convert Complex System Prompts into Few-Shot Training Pairs
Transforms dense system instructions into five high-quality input-output pairs that clarify model expectations and edge-case handling.
Migrate OpenAI System Prompts to Claude XML Format
Convert your existing OpenAI instructions into optimized XML-tagged blocks for Claude that improve instruction adherence and context parsing.
Calculate Context Window Budgets for Long-Document Prompts
Generates a token allocation plan across input docs, scratchpads, and outputs for ChatGPT, Claude, and Gemini to prevent context overflow.
Compress Production Prompts to Reduce Token Usage and Latency
Compress high-volume system instructions into concise directives, showing exact deletions and estimated token savings.
Harden JSON Extraction with Strict Null and Fallback Rules
Get a hardened extraction prompt, strict schema specification, and edge-case test table that enforce null-over-guessing, enum fallbacks, and error handling.
Audit AI Prompts for Universal Compatibility and Portability
Identify vendor-specific jargon and rewrite your prompts into universal instructions that work consistently across ChatGPT, Claude, and Gemini.
- Create Automated Regression Test Suites for AI Prompt Migrations
- Audit Prompts for Vendor Lock-In and Model-Specific Artifacts
- Migrate Tool-Calling Schemas Across OpenAI, Claude, and Gemini
- Optimize Multi-Step Prompt Chains to Cut Latency and Spend
- Restructure Production Prompts for Cross-Provider Prompt Caching
- Map Application Features to AI Model Tiers