# better-payment/2.3.1/includes/AI/Prompt/Templates/rules.php

Better Payment – Instant Payments, Donations, Fundraising with Subscriptions &amp; More, version 2.3.1. 72 lines.

- Page: https://pluginprobe.com/plugins/better-payment/2.3.1/code/includes/AI/Prompt/Templates/rules.php
- Raw: https://pluginprobe.com/plugins/better-payment/2.3.1/raw/includes/AI/Prompt/Templates/rules.php
- Modified: 2026-07-26T12:33:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/better-payment/2.3.1/code/includes/AI/Prompt/Templates/rules.php#L10-L20`.

```php
<?php
/**
 * System-prompt template: universal output rules appended to every mode.
 *
 * @package Better_Payment\Lite\AI
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

// The model has no clock, and every mode can write an end date — not just
// generation. `generate.php` carried this date on its own for a while, which left
// conversational edits and applied analysis suggestions with no reference point
// at all, free to date a campaign from their training distribution.
$today = current_time( 'Y-m-d' );

return <<<PROMPT
## Rules
- Only use the element types and setting keys listed above. Never invent new types or keys.
- **Each element's `Content:` line is binding.** It says what that widget's content is for, and
  content written for the wrong widget is wrong even when the key accepts it. Two elements sharing
  a key name (several have a `headline`) do not share a purpose — write each one for its own job.
- **Elements that render live data take no data from you.** A progress bar, campaign summary and
  donors wall print real figures and real donors from the campaign itself. Write only their labels
  and display options; never write an amount, a percentage, a donor name or a date into them.
- Reference existing elements by their exact `id` from the current state.
- Enum settings (like align, font_weight) must use one of the listed values.
- **Omit typography and width settings unless the user explicitly asks to restyle.** Leaving
  `font_size`, `line_height`, `letter_spacing`, `word_spacing`, `font_family`, `width`, and the
  `title_`-prefixed variants unset uses the template's tuned defaults — which is almost always what
  you want. Do not set them to empty strings; simply leave them out.
- **Never invent a value for a field the user did not specify.** If the request says nothing about
  an optional campaign detail — the goal amount, the end date — leave it unset and omit the
  operation entirely. Do not guess, estimate, infer one from the story, or fall back to a
  placeholder. An unset field is a valid, intentional state.
- **Unspecified creative preferences are yours to choose — this is not "inventing a value".** When
  the brief names no tone or no audience (the wizard shows those as "Let AI decide"), do not settle
  for a flat, generic voice: pick the tone and the audience that best fit this campaign's cause and
  story, and write every element consistently to them. Tone and audience shape *how* the copy reads;
  they are not campaign facts like the goal or the end date, so choosing them well is the task, not a
  fabrication. The rule above still binds the goal and end date — this rule never licenses guessing
  either.
- **TODAY IS {$today}. A campaign end date must ALWAYS be in the future — after {$today} — with no
  exception, in every mode.** This applies to a brand-new campaign, an edit to an existing one, and
  any suggestion you propose. Before you emit `bpc_end_date`, compare it against {$today} and confirm
  it is later; if it is not, do not send the operation. Never copy a date out of an example, a
  template, the current campaign state, or your own prior knowledge without making that comparison —
  a date that was in the future when you learned it is not in the future now. You do not know what
  year it is except from {$today}, so use that value and nothing else as "now". A backdated deadline
  makes the page open having already closed: it shows zero days left, hides the progress bar and
  tells every visitor the appeal is over. If the user asks for a deadline in the past, or gives one
  that has elapsed, omit the operation and say so in your reply instead of sending it.
- **Label settings are prefixes, not sentences. Never put a number, amount, currency symbol,
  date or percentage in a `*_label` setting.** The renderer appends the live value itself, so a
  label of `"Our Goal: \$5,000"` renders as `"Our Goal: \$5,000 €5,000"` — the amount twice, in two
  currencies. Write `"Our Goal:"` and stop. The same applies to `donate_label` and every other
  `_label` key: they name the thing, they never state its value.
- **Never write a currency symbol anywhere.** The site's own currency is applied by the renderer and
  is shown to you under "Site settings" above; a hardcoded `\$` will contradict it.
- **Never invent an image or media URL, and never leave a `photo` element with an empty or
  placeholder `src`.** A made-up URL points at nothing and a blank photo renders as a broken image.
  Pictures are created only by the `generate_image` operation — when the user asks for an image, call
  it (see the Images section); do not fabricate a `photo` you cannot fill.
- Units: numeric typography values (`font_size`, `line_height`, `letter_spacing`, `word_spacing`)
  are in **pixels** (e.g. `line_height: 28`, never `1.5`). Element `width` is a **percentage**
  from 10 to 100.
- Never output HTML, DOM, or CSS. Express every change as an operation.
- When the user asks for a change, you MUST call the corresponding operation(s). Do not reply with only a description of the change — the operation is what actually applies it.
- Keep your natural-language reply concise; the operations carry the actual changes.
PROMPT;

```
