Prompt Variables
Feed app data into prompts through declared, typed variables rather than string assembly.
What it adds
A typed variable layer for prompt templates, with declarations, validation, escaping, and a preview of the rendered prompt.
What your agent is told to do
5
What your agent is told to do
5-
1
Give every template an explicit declaration of the values it takes, each with a name, a type, and whether it is required, optional, secret, or a list. A template that silently accepts anything cannot be validated or previewed.
-
2
Validate every value against its declaration before rendering: type, length ceiling, and list size. Reject rather than truncate, since a value cut in half changes the meaning of the instruction that contains it.
-
3
Wrap substituted values in clear delimiters and neutralise anything that looks like an instruction, so text drawn from a record cannot redirect the model. Treat every value sourced from user input, uploaded files, or third-party records as hostile.
-
4
Give authors a preview of the rendered prompt with the task content and substituted values visible and the system portion withheld. Storage, scoping, and ownership of the templates themselves belong to Prompt Template Library; this feature owns declaration, substitution, and validation only.
-
5
Do not let a missing optional value collapse into an empty string inside a sentence. Define what the template says when a value is absent, or the model reads a truncated instruction as a complete one.
Edge cases it handles
8
Edge cases it handles
8- Values coming from records, uploads, or third-party data must be delimited and escaped before substitution. Text that reads as a new instruction will be followed, and this is the most common way an app's own data attacks its prompts.
- The declaration must distinguish required, optional, secret, and list variables, because each needs different handling at validation, preview, and logging time.
- Type and length must be checked before rendering, so an oversized value fails loudly instead of consuming the context window and pushing the real instructions out of scope.
- The preview must show what will actually be substituted while withholding hidden system instructions, so an author can debug a template without being handed the safety rules to edit around.
- A missing value must never render as an empty gap in a sentence. Either block the run or substitute an explicit statement that the value is unavailable.
- Secret values must be excluded from previews, logs, error messages, and stored request records, and must never be placed in client-visible code or a template body a user can read back.
- A list variable of unbounded length must be capped, with the truncation stated in the prompt itself rather than performed silently.
- Values containing the delimiter characters must be handled so they cannot close the wrapper early and escape into the instruction body.
Definition of done
8
Definition of done
8- Every template declares its variables with a name, a type, and required, optional, secret, or list status.
- Values are validated for type, length, and list size before any request is made, and invalid input is rejected rather than truncated.
- Substituted values are delimited and neutralised so embedded instructions are not followed.
- Authors can preview the rendered prompt without seeing or editing system instructions.
- Missing values block the run or render an explicit unavailable statement, never a silent gap.
- Secret values never appear in previews, logs, error output, or stored requests.
- The feature matches the existing design system.
- No existing functionality is broken.
Related features
Multi-Model Routing
Multi-Model Routing
Send each AI request to the right model using rules you can read and test.
What it does
A deterministic routing layer that picks a model per request from task type, context size, latency budget, and data sensitivity.
How it works
- 1 Express routing as explicit, ordered rules over inputs the app can measure: task type, estimated context size, latency budget, and the sensitivity classification of the data involved. A rule set that can be read line by line can be reviewed and tested.
- 2 Make routing deterministic. The same inputs must always produce the same route, so a bad output can be reproduced and a rule change can be evaluated. Randomised or load-based selection turns every incident into guesswork.
- 3 Classify data before routing and refuse to route restricted content to any destination not approved for it. This check is a hard block, not a preference, and it must run before the request is assembled.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/multi-model-routing
AI Cost Budgets
AI Cost Budgets
Cap what AI features are allowed to spend before the bill arrives.
What it does
Monetary spending limits on AI work, scoped by workspace, feature, and time period, enforced before a run starts.
How it works
- 1 Find every place the app calls a model and route all of them through one accounting point that records estimated and actual spend against a scope. A budget that only covers the chat feature is not a budget.
- 2 Estimate the cost of a run from the size of its input before dispatching it, and refuse anything that would exceed the remaining budget on its own.
- 3 Reserve the estimate against the budget when the run starts, then reconcile to the real usage figures when it finishes, releasing whatever was over-reserved.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/ai-cost-budgets
Model Selection
Model Selection
Let each AI task run on the model that suits its quality, speed, and cost needs.
What it does
A per-task model choice, drawn from the models the app already has configured, with capability filtering and safe defaults.
How it works
- 1 Enumerate the models the app already has access to and record what each one can actually do: context capacity, whether it can return the structured output the task requires, whether it supports the tools the task calls, and its relative cost and speed.
- 2 Offer only the models that satisfy the task's requirements. A task that needs structured output must not list a model that cannot reliably produce it, because the failure appears later as malformed responses rather than as an unavailable option.
- 3 Store the choice against the specific task, not as one global setting. A single default forces a summarisation task and a classification task onto the same tier when they have opposite needs.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/model-selection
How it works
-
1
Copy the link
Grab the Markdown instruction URL for this feature.
-
2
Give it to your AI
Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.
-
3
It inspects, then implements
Your agent reads your existing app first, then adds the feature to fit it.
Works with your stack
These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.
Need it tighter than that? Customize the feature and tell it exactly what you're running.