Prompt Template
A prompt template is a reusable, parameterized prompt structure containing fixed instructional components and variable placeholders that are dynamically populated with specific data at execution time. Prompt templates standardize the interaction between a business's operational data and AI models—encoding organizational knowledge, constraints, and standards into a reproducible format that consistently delivers high-quality outputs across different users, use cases, and contexts without requiring each user to understand advanced prompting techniques.
Business Context
Prompt templates are the operational infrastructure of AI-powered businesses. They solve the critical scaling problem in AI deployment: how do you ensure consistent, high-quality outputs from AI when different staff members have different prompting skills, when processes run automatically, and when the organization needs to maintain standards at scale? The answer is templates. Organizations that build comprehensive prompt template libraries report a 60-80% reduction in AI training overhead (because the template guides users through what the AI needs), 50-70% improvement in first-draft quality, and the ability to safely delegate AI use to junior team members who would otherwise produce unusable outputs. More strategically, prompt templates represent accumulated institutional knowledge—they encode months of iteration, testing, and refinement into repeatable assets that retain their value when staff turn over and compound in value as they are refined over time.
Oregon Market Application
Business Type: Bend-based real estate brokerage (32 agents, 280+ transactions/year)
Problem: After deploying AI writing tools, brokerage had an uneven experience:
- Top 5 agents (tech-savvy): AI dramatically improved their productivity
- Middle 20 agents: Inconsistent results, gave up after early failures
- Bottom 7 agents: Never adopted, continued doing everything manually
- Legal/compliance: Discovered 3 listings with missing or incorrect disclosure language
The fundamental problem: Each agent was expected to figure out prompting themselves. The variance in prompting skill directly produced variance in output quality.
Solution: Built comprehensive Prompt Template Library (PTL) integrated into their transaction management system:
Template Architecture:
REAL ESTATE AI PROMPT TEMPLATE LIBRARY
├── Listing Content
│ ├── Property Description - Residential
│ ├── Property Description - Commercial
│ ├── Property Description - Land
│ ├── HOA Disclosure Summary
│ └── Price Reduction Announcement
├── Client Communication
│ ├── Buyer Initial Outreach
│ ├── Offer Presentation Cover Letter
│ ├── Counter-Offer Response
│ ├── Post-Inspection Follow-up
│ └── Closing Congratulations
├── Market Analysis
│ ├── CMA Executive Summary
│ ├── Neighborhood Market Update
│ └── Investment Property Analysis
└── Legal/Compliance
├── Disclosure Checklist Summary
└── Earnest Money Dispute Summary
Sample Template: Residential Property Description
=== PROPERTY DESCRIPTION TEMPLATE - RESIDENTIAL ===
AGENT NOTE: Fill all {VARIABLES} before submitting.
Required fields marked *
PROPERTY DATA (from MLS):
*Address: {PROPERTY_ADDRESS}
*Bedrooms: {BEDS} | Bathrooms: {BATHS}
*Square Footage: {SQFT}
*Year Built: {YEAR_BUILT}
*Price: {LIST_PRICE}
*Property Type: {SINGLE_FAMILY/CONDO/TOWNHOME}
Garage: {GARAGE_SPACES} spaces
Lot Size: {LOT_SIZE}
HOA: {YES/NO - if YES: ${HOA_AMOUNT}/month}
STANDOUT FEATURES (list 3-5):
1. {FEATURE_1}
2. {FEATURE_2}
3. {FEATURE_3}
4. {FEATURE_4 - optional}
5. {FEATURE_5 - optional}
PROPERTY STORY (answer these prompts):
Biggest selling point: {MAIN_APPEAL}
Neighborhood character: {NEIGHBORHOOD_DESCRIPTION}
Recent upgrades: {UPGRADES_LAST_5_YEARS}
Unique features: {WHAT_MAKES_IT_SPECIAL}
TARGET BUYER PROFILE:
{YOUNG_COUPLE/GROWING_FAMILY/EMPTY_NESTERS/INVESTOR/FIRST_TIME_BUYER}
REQUIRED COMPLIANCE FIELDS:
Lead paint disclosure needed (pre-1978): {YES/NO}
HOA documentation available: {YES/NO}
Seller disclosure form: {COMPLETED/PENDING}
=== DO NOT MODIFY BELOW THIS LINE ===
SYSTEM INSTRUCTION: Using the property data above, write a compelling
MLS listing description that:
- Opens with most compelling feature (not the address or bed/bath count)
- Highlights the 3-5 standout features naturally in narrative
- Includes neighborhood context in paragraph 2
- Mentions upgrades and condition
- Ends with invitation to schedule showing
- Uses sensory language (light, space, feeling)
- Length: 250-300 words
- Tone: Professional but warm, aspirational not hyperbolic
- FORBIDDEN: "cozy" (code for small), "motivated seller", "as-is"
- REQUIRED: Must include "Contact [AGENT_NAME] to schedule your private tour"
- COMPLIANCE: Do not reference school ratings (Fair Housing Act)
DISCLOSURE REMINDER: Agent must verify all features stated in
description against actual property before publishing.
Template Delivery System:
Integrated into Dotloop (transaction management):
- Agent selects template from dropdown in transaction record
- MLS data auto-populates from property record
- Agent completes blank fields on web form (no direct prompt access)
- Template assembles prompt, submits to AI, returns draft
- Agent reviews in same interface, edits, approves
- Compliance checklist auto-generates based on property type
Results:
- Agent AI adoption: 15/32 agents → 30/32 agents (6 weeks after templates)
- Listing description quality (broker rating): 3.1/5 → 4.4/5
- Average description creation time: 45 min → 8 min (82% reduction)
- Compliance incidents: 3 in 4 months pre-templates → 0 in 9 months post-templates
- Photography + listing turnaround: 3.2 days → 1.1 days average
- Days on market: Average 28 → 22 (better listings = faster sales)
- Agent feedback: "It's just a form now. I don't have to think about how to talk to the AI."
Kenya Market Application
Context: Nakuru-based retail chain with 14 locations across Nakuru, Kisumu, and Eldoret counties in the Rift Valley region
Challenge: 14 store managers were responsible for creating weekly promotional content:
- WhatsApp broadcast messages (to their customer lists)
- SMS flash sale announcements
- Facebook posts for their local store pages
Results were chaotic:
- Some managers were great at it, others sent confusing messages
- Compliance issues: Prices quoted incorrectly, wrong dates, wrong locations
- Customer complaints: "I came to the Eldoret store but this was only Nakuru"
- Brand inconsistency: 14 different voices, 14 different quality levels
Implementation: Built regional prompt template system accessible via WhatsApp (so managers used familiar interface):
Template Delivery via WhatsApp Bot:
MANAGER SENDS: /promo
BOT RESPONDS:
"Karibu! Choose promotion type:
1️⃣ Flash Sale (24 hours)
2️⃣ Weekend Special
3️⃣ New Product Launch
4️⃣ Loyalty Reward
Reply with number"
MANAGER: 1
BOT: "Flash Sale Details - Reply with each:
Your store location? (Nakuru/Kisumu/Eldoret)"
MANAGER: Nakuru - Branch 3, Kenyatta Ave
BOT: "Product(s) on sale? (Be specific)"
MANAGER: Unga Premier 2kg flour, Kimbo 400g cooking fat
BOT: "Sale prices? (List each)"
MANAGER: Unga KES 95 (was 110), Kimbo KES 65 (was 80)
BOT: "Sale start and end time? (Today only - hours)"
MANAGER: Starts 9am ends 5pm today
BOT: [Generating your content...]
BOT: "✅ Your Flash Sale Content is Ready!
📱 WhatsApp Message (1 of 3):
🔥 FLASH SALE - TODAY ONLY 🔥
Nakuru Branch 3 (Kenyatta Ave)
9AM - 5PM ONLY
Unga Premier 2kg: KES 95 (Save KES 15!)
Kimbo 400g: KES 65 (Save KES 15!)
Come in TODAY or miss out!
📍 Kenyatta Ave, Nakuru
📞 [STORE PHONE]
[Message 2 and 3 variations follow...]
⚠️ COMPLIANCE CHECK:
✅ Location specified
✅ Times included
✅ Both prices shown
✅ Disclaimer included
Ready to send? Reply YES to approve or EDIT to modify"
Template Enforcement:
Templates enforced:
- Location specificity (preventing Nakuru customer going to Kisumu)
- Price verification (manager confirms actual price before broadcast)
- Date/time precision (no "this weekend" without specific dates)
- Bilingual output (English + Swahili automatically)
- Character limits per channel (SMS: 160, WhatsApp: 500)
Results:
- Customer complaints about wrong location: 22/month → 1/month
- Content quality (HQ rating): 2.8/5 → 4.3/5
- Manager content creation time: 35 min → 6 min
- Campaign response rates: +26% average across all stores
- Promotional price errors: 8/month → 0 in 8 months
- HQ oversight time: 6 hours/week reviewing content → 1 hour/week
- Best-performing manager's template shared chain-wide: Lifted all stores
Technical Details
Prompt Template Architecture:
1. Template Components:
FIXED COMPONENTS (never change):
- Task definition
- Output format requirements
- Quality standards
- Compliance constraints
- Brand voice guidelines
VARIABLE COMPONENTS (change per use):
{CUSTOMER_NAME}
{PRODUCT_NAME}
{SPECIFIC_DATA}
{DATE}
{LOCATION}
CONDITIONAL COMPONENTS (include/exclude based on conditions):
{% if product_type == "prescription" %}
Include: "Consult your pharmacist before use."
{% endif %}
{% if deal_value > 10000 %}
Include: "This offer requires manager approval."
{% endif %}
2. Template Management System:
class PromptTemplateLibrary:
def __init__(self, db_connection):
self.db = db_connection
def get_template(self, template_id, variables):
# Load template from database
template = self.db.query(
"SELECT template_text, required_vars, compliance_checks
FROM prompt_templates
WHERE id = %s AND active = true",
template_id
)
# Validate all required variables provided
missing = self.check_required_vars(template.required_vars, variables)
if missing:
raise MissingVariablesError(f"Required: {missing}")
# Run compliance checks
compliance = self.run_compliance_checks(
template.compliance_checks, variables
)
if not compliance.passed:
raise ComplianceError(compliance.issues)
# Populate template
populated = self.populate_template(template.template_text, variables)
# Log template usage
self.log_usage(template_id, variables, user_id)
return populated
def version_template(self, template_id, new_text, change_reason):
"""Template versioning - always preserve history"""
self.db.execute(
"INSERT INTO template_versions
(template_id, version_text, change_reason, changed_by, changed_at)
VALUES (%s, %s, %s, %s, NOW())",
(template_id, new_text, change_reason, self.current_user)
)
3. Template Testing Before Deployment:
TEST 1: Happy Path
- All variables populated correctly
- Expected output format received
- Compliance checks pass
TEST 2: Edge Cases
- Optional fields missing
- Maximum length inputs
- Special characters in variables
- Non-English variable content
TEST 3: Adversarial
- Variables containing prompt injection attempts
- Extremely long variable values
- Variables containing HTML/code
TEST 4: Regression
- Previous successful use cases still work after changes
- Performance benchmarking (latency)
4. Template Governance:
| Governance Activity | Frequency | Owner |
|---|---|---|
| Review for accuracy | Monthly | Subject matter expert |
| A/B test variations | Quarterly | Marketing/Ops |
| Compliance audit | Semi-annual | Legal/Compliance |
| Performance analysis | Monthly | AI team |
| User feedback collection | Ongoing | All users |
| Version archiving | On every change | Automated |