Prompt Template Patterns
# Prompt Template Patterns Reusable patterns for structuring prompts. Covers delimiter conventions, system prompt architecture, few-shot formatting, output schema design, and provider-specific adaptations. ## Delimiter Conventions Delimiters separate instructions from data from examples. Critical for both clarity and injection defense. ### Recommended Delimiters by Purpose | Purpose | Delimiter | Example | |---|---|---| | **Sections** (role, context, instructions) | XML tags | `<system>`, `<context>`, `<instructions>` | | **Data blocks** (user input, documents) | XML tags or triple backticks | `<user_input>...</user_input>`, ` ```...``` ` | | **Examples** (few-shot) | Numbered with headers | `Example 1:`, `Input:`, `Output:` | | **Output format** | Code block with schema | ` ```json { ... } ``` ` | | **Internal reasoning** | XML tags | `<thinking>...</thinking>` | | **Separators** (between sections) | `---` or blank lines | Visual separation for readability | ### XML Tags — Best Practice XML tags are the most reliable delimiter for LLMs. They: - Are unambiguous — clear open/close boundaries - Nest naturally — `<context><document>...</document></context>` - Are injection-resistant — attacker must match exact tag names - Are model-agnostic — all major providers handle XML tags well
fill the variables
This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.
{...}
Unlock with Pro →when to use it
Community prompt sourced from the open-source GitHub repo alex-voloshin-dev/ai-skills (MIT). A "Prompt Template Patterns" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
roleplaycommunitygeneral
source
alex-voloshin-dev/ai-skills · MIT