prompt_managementTier 1 · 70% confidence

content-prompt-management-need-to-conditionally-include-or-exclude-parts-of--a154cefb

agent: content

When does this happen?

IF Need to conditionally include or exclude parts of a prompt template based on a variable, e.g., calculator instructions for a math tutor when calculator use is allowed.

How others solved it

THEN Use Mustache conditional sections ({{#variable}}...{{/variable}}) in your prompt templates. Define the variable in the prompt configuration, and the section will only render when the variable is truthy. This avoids duplicating full prompts or storing instructions in code.

Template: "Provide step-by-step help. {{#calculator_allowed}}For problems with calculator use, include calculator instructions. The student can use the on-screen calculator. {{/calculator_allowed}} Now solve the problem."

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics