From a2f52c09602cc6f752c510e1224d4cf5df4e8208 Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 19 Feb 2026 09:55:01 -0600 Subject: [PATCH] Add example-correction formatting rule to all agent prompts Agents now show example corrections in the format they're recommending (e.g. sentence case examples when recommending sentence case) to avoid contradictions between advice and examples. Co-Authored-By: Claude Opus 4.6 --- backend/app/agents/brand_agent.py | 1 + backend/app/agents/channel_best_practices_agent.py | 1 + backend/app/agents/channel_tech_specs_agent.py | 1 + backend/app/agents/lead_agent.py | 1 + backend/app/agents/legal_agent.py | 1 + 5 files changed, 5 insertions(+) diff --git a/backend/app/agents/brand_agent.py b/backend/app/agents/brand_agent.py index 4589794..57adc5a 100755 --- a/backend/app/agents/brand_agent.py +++ b/backend/app/agents/brand_agent.py @@ -153,6 +153,7 @@ If the proof is nonsensical, not a marketing material, or cannot be analyzed, se (a) Always capitalise the first word after a full stop, including labels like "Recommendation:" and "Issue:". (b) End every bullet point with a full stop if it is a complete sentence. If bullets are short fragments, omit the full stop — but be consistent within the same output. (c) Write "e.g." with no comma after it (e.g. "Apply rotation" not "e.g., Apply rotation"). +- IMPORTANT: When providing example corrections in recommendations, always show the example in the format you are recommending. If recommending sentence case, write the example in sentence case (e.g. "Apply now" not "Apply Now"). If quoting the user's original error, show it first, then the corrected version: "Change 'Apply Now' to 'Apply now' (sentence case)." - IMPORTANT: Always spell out acronyms in full on first use, with the abbreviation in parentheses. Use the short form only for subsequent mentions within the same output. Common acronyms to expand include: WCAG (Web Content Accessibility Guidelines), FSCS (Financial Services Compensation Scheme), GDE (Global Digital Expression), APR (Annual Percentage Rate), CTA (Call-to-Action), FCA (Financial Conduct Authority), PRA (Prudential Regulation Authority), T&Cs (Terms and Conditions). Apply this rule to any acronym, not only those listed here. """ diff --git a/backend/app/agents/channel_best_practices_agent.py b/backend/app/agents/channel_best_practices_agent.py index 28fc1ed..2e293b0 100644 --- a/backend/app/agents/channel_best_practices_agent.py +++ b/backend/app/agents/channel_best_practices_agent.py @@ -146,6 +146,7 @@ If the proof is nonsensical, not a marketing material, or cannot be analyzed, se (a) Always capitalise the first word after a full stop, including labels like "Recommendation:" and "Issue:". (b) End every bullet point with a full stop if it is a complete sentence. If bullets are short fragments, omit the full stop — but be consistent within the same output. (c) Write "e.g." with no comma after it (e.g. "Apply rotation" not "e.g., Apply rotation"). +- IMPORTANT: When providing example corrections in recommendations, always show the example in the format you are recommending. If recommending sentence case, write the example in sentence case (e.g. "Apply now" not "Apply Now"). If quoting the user's original error, show it first, then the corrected version: "Change 'Apply Now' to 'Apply now' (sentence case)." - IMPORTANT: Always spell out acronyms in full on first use, with the abbreviation in parentheses. Use the short form only for subsequent mentions within the same output. Common acronyms to expand include: WCAG (Web Content Accessibility Guidelines), FSCS (Financial Services Compensation Scheme), GDE (Global Digital Expression), APR (Annual Percentage Rate), CTA (Call-to-Action), FCA (Financial Conduct Authority), PRA (Prudential Regulation Authority), T&Cs (Terms and Conditions). Apply this rule to any acronym, not only those listed here. """ diff --git a/backend/app/agents/channel_tech_specs_agent.py b/backend/app/agents/channel_tech_specs_agent.py index f5ae546..8bd5cb7 100644 --- a/backend/app/agents/channel_tech_specs_agent.py +++ b/backend/app/agents/channel_tech_specs_agent.py @@ -154,6 +154,7 @@ If the proof is nonsensical, not a marketing material, or cannot be analyzed, se (a) Always capitalise the first word after a full stop, including labels like "Recommendation:" and "Issue:". (b) End every bullet point with a full stop if it is a complete sentence. If bullets are short fragments, omit the full stop — but be consistent within the same output. (c) Write "e.g." with no comma after it (e.g. "Apply rotation" not "e.g., Apply rotation"). +- IMPORTANT: When providing example corrections in recommendations, always show the example in the format you are recommending. If recommending sentence case, write the example in sentence case (e.g. "Apply now" not "Apply Now"). If quoting the user's original error, show it first, then the corrected version: "Change 'Apply Now' to 'Apply now' (sentence case)." - IMPORTANT: Always spell out acronyms in full on first use, with the abbreviation in parentheses. Use the short form only for subsequent mentions within the same output. Common acronyms to expand include: WCAG (Web Content Accessibility Guidelines), FSCS (Financial Services Compensation Scheme), GDE (Global Digital Expression), APR (Annual Percentage Rate), CTA (Call-to-Action), FCA (Financial Conduct Authority), PRA (Prudential Regulation Authority), T&Cs (Terms and Conditions). Apply this rule to any acronym, not only those listed here. """ diff --git a/backend/app/agents/lead_agent.py b/backend/app/agents/lead_agent.py index 111a9c4..1a7f686 100755 --- a/backend/app/agents/lead_agent.py +++ b/backend/app/agents/lead_agent.py @@ -160,6 +160,7 @@ Your summary should: (a) Always capitalise the first word after a full stop, including labels like "Recommendation:" and "Issue:". (b) End every bullet point with a full stop if it is a complete sentence. If bullets are short fragments, omit the full stop — but be consistent within the same output. (c) Write "e.g." with no comma after it (e.g. "Apply rotation" not "e.g., Apply rotation"). +- IMPORTANT: When providing example corrections in recommendations, always show the example in the format you are recommending. If recommending sentence case, write the example in sentence case (e.g. "Apply now" not "Apply Now"). If quoting the user's original error, show it first, then the corrected version: "Change 'Apply Now' to 'Apply now' (sentence case)." - IMPORTANT: Always spell out acronyms in full on first use, with the abbreviation in parentheses. Use the short form only for subsequent mentions within the same output. Common acronyms to expand include: WCAG (Web Content Accessibility Guidelines), FSCS (Financial Services Compensation Scheme), GDE (Global Digital Expression), APR (Annual Percentage Rate), CTA (Call-to-Action), FCA (Financial Conduct Authority), PRA (Prudential Regulation Authority), T&Cs (Terms and Conditions). Apply this rule to any acronym, not only those listed here. {revision_context} Here are the specialist reviews: diff --git a/backend/app/agents/legal_agent.py b/backend/app/agents/legal_agent.py index c28bc14..e2cf12f 100755 --- a/backend/app/agents/legal_agent.py +++ b/backend/app/agents/legal_agent.py @@ -156,6 +156,7 @@ If the proof is nonsensical, not a marketing material, or cannot be analyzed, se (a) Always capitalise the first word after a full stop, including labels like "Recommendation:" and "Issue:". (b) End every bullet point with a full stop if it is a complete sentence. If bullets are short fragments, omit the full stop — but be consistent within the same output. (c) Write "e.g." with no comma after it (e.g. "Apply rotation" not "e.g., Apply rotation"). +- IMPORTANT: When providing example corrections in recommendations, always show the example in the format you are recommending. If recommending sentence case, write the example in sentence case (e.g. "Apply now" not "Apply Now"). If quoting the user's original error, show it first, then the corrected version: "Change 'Apply Now' to 'Apply now' (sentence case)." - IMPORTANT: Always spell out acronyms in full on first use, with the abbreviation in parentheses. Use the short form only for subsequent mentions within the same output. Common acronyms to expand include: WCAG (Web Content Accessibility Guidelines), FSCS (Financial Services Compensation Scheme), GDE (Global Digital Expression), APR (Annual Percentage Rate), CTA (Call-to-Action), FCA (Financial Conduct Authority), PRA (Prudential Regulation Authority), T&Cs (Terms and Conditions). Apply this rule to any acronym, not only those listed here. """