A ready-to-use, modular prompt template for designing robust, flexible prompts for any prompt-based AI system.
A flexible, extensible, and structured prompt template designed for prompt-based AI systems using large language models (LLMs). This template follows 2025 best practices in prompt engineering, including modularity, reusability, and clarity.
- Title: Modular Prompt Template
- Version: 1.0
- Last Updated: 2025-07-15
- Author: Luis Alberto Martinez Riancho (@arenagroove)
- Affiliation: Less Rain GmbH
- Tags: prompt-engineering, LLM, modular, AI, template
- License: MIT
- Platform Compatibility:
- Not all modules are supported by every LLM provider—check your platform’s documentation.
[ADVANCED]tags indicate modules requiring advanced LLM capabilities.
This template provides a modular scaffold for building high-quality prompts that can be adapted across domains, tasks, and user contexts. It supports both core components (essential for most tasks) and optional modules (for advanced control, personalization, and robustness).
- Prompt engineering for LLM-based assistants, agents, or chatbots
- Workflow automation and task orchestration
- Prompt versioning and drift management
- Teaching or documenting best practices in prompt design
Each section is clearly marked as:
- [CORE] – Essential for most prompt-based tasks
- [OPTIONAL] – Add for flexibility, specificity, or robustness; include as needed and in any order
- [CONTEXT ENGINEERING] – Indicates modules reflecting advanced context-centric practices
- [ADVANCED] – Requires advanced LLM features; check platform support
Explanatory comments are included under each heading for guidance
Main task for the model; clear, actionable, and specific.
Instruction:
Summarize the following article in three bullet points, focusing on key facts only.All relevant background, data, or input needed for the task. Use clear delimiters for large blocks of text.
Context:
Article: """
[Paste article text here]
"""Assigns expertise, tone, or perspective to the model.
Role/Persona:
You are an experienced business analyst writing for a corporate audience.Specifies output format, length, style, and restrictions.
Output Constraints:
- Format: Bullet points
- Max 50 words
- No subjective languageAnchors expected output; always include for ambiguous or complex tasks.
Examples:
Input: "The company reported record profits..."
Output:
- Record profits reported for Q2.
- Revenue grew by 20% year-over-year.
- New products were key growth drivers.Applies a specific analytical or stylistic filter (e.g., "risk management lens").
Lens:
Analyze the article through a risk management lens.Specifies the intended reader/user (e.g., "for non-technical executives").
Audience:
Intended for senior executives with limited technical background.Explicitly sets the writing style or tone (e.g., "formal academic style").
Style Guide:
Use concise, persuasive business language.Detects and reports changes in meaning or output over time (prompt, concept, or output drift).
Drift Awareness:
- Prompt Drift: Changes due to prompt/model updates.
- Concept Drift: Shifts in meaning or context.
- Output Drift: Divergence from baseline summaries.
Compare your output to the baseline and flag any drift.Lists assumptions or known gaps; promotes transparency.
Assumptions & Limitations:
Assume all data is current as of 2025. If any data is missing, state “Data not available.”Guides the model through multi-step logic or chain-of-thought.
Step-by-Step Reasoning:
1. Identify the three most important facts.
2. Exclude opinions or minor details.
3. Phrase each point concisely.Specifies tool/API call syntax per platform; clarify fallback behavior if invocation fails.
Tool/Function Invocation:
- OpenAI: call function_name(args)
- Anthropic: [TOOL: tool_name] input
If calculations are required, use the calculator API and cite results.Instructions for missing/ambiguous data or task failure.
Error Handling/Fallback Output:
If unable to complete the summary due to insufficient information, respond: “Summary not possible with the provided data.”Avoid sensitive or biased content; flag any sensitive topics.
Ethics & Bias Mitigation:
Avoid subjective or potentially biased statements; flag any sensitive topics.Specifies language, region, or cultural context.
Localization/Internationalization:
Use UK English and adapt examples for the European market.Insert user data dynamically; note if not supported everywhere.
Personalization Hooks:
Include the user's name in the greeting if provided.Self-check for instruction adherence and output quality.
Meta/Reflection:
- Review your summary for alignment with the baseline.
- Ensure all constraints and the specified lens are applied.
- If any drift is detected, briefly describe it.Suggests next steps, clarifying questions, or prepares for multi-turn interaction.
Follow-Ups:
- Suggest two follow-up questions a user might ask based on your summary.
- Be prepared to expand any bullet point into a paragraph if requested.Request user feedback on the output and provide guidance for prompt iteration.
User Feedback Collection:
Please rate the usefulness of this summary on a scale from 1 to 5.
If users rate output below 3/5, log the prompt and output for review and revision.| Module | Purpose/Clarification | Platform Notes |
|---|---|---|
| Meta/Reflection | Self-check for instruction adherence and output quality | Universal |
| Drift Awareness | Detect/report changes in meaning or output over time | Advanced, not always present |
| Examples (Few-Shot) | Anchor expected output; include for all but the simplest tasks | Universal |
| Tool/Function Invocation | Specify tool/API call syntax per platform; clarify fallback | Platform-specific |
| Personalization Hooks | Insert user data dynamically; note if not supported everywhere | Advanced |
- Start with core modules, then add optional ones incrementally.
- Use this template as a base for prompt generators or toolkits.
- Regularly version your prompts to track changes and detect drift.
- Use clear delimiters (like """ or ---) to separate content sections in actual prompts.
License: MIT — Free to use, modify, and distribute.
