Skip to content

Variable Type Reference

Variables in Codraft have a type that controls how Claude asks for the value during the interview. Types are either inferred automatically from the variable name, or declared explicitly in config.yaml.

Name suffixInferred typeNotes
*_nametext
*_addresstextPresented as multi-line input
*_datedateAccepts "today" as a default value in config
*_emailemailValidated for email format
*_amountnumber
*_pricenumber
*_feenumber
*_phonephone
*_telphone
*_mobilephone
(no match)textDefault for all unrecognised suffixes

Variables used only as {% if %} gate conditions — and never rendered with {{ }} — are inferred as boolean. If the same variable appears in both a condition and a {{ }} reference, its suffix-inferred type applies instead. Variables used as {% for %} collections are treated as list types.

Use the type field in config.yaml to override the inferred type or to set a type not expressible through naming:

variables:
payment_method:
type: choice
choices: [bank_transfer, cheque, crypto]

Free text input. The default type. No format validation.

governing_law:
type: text
label: "Governing Law"

A calendar date. The special default value "today" resolves to the current date at interview time.

effective_date:
type: date
default: "today"

A numeric value — currency amounts, quantities, percentages. Accepts decimal values.

service_fee:
type: number
label: "Service Fee (SGD)"

An email address. Claude validates the format before accepting.

client_email:
type: email

A phone number. Accepts international formats.

contact_phone:
type: phone

A yes/no question. Used as the gate for {% if %} conditional sections. Claude presents this as a yes/no choice.

include_ip_assignment:
type: boolean
default: false
question: "Does this engagement involve IP assignment?"

One of a fixed set of options. Claude presents the choices as a list; the user selects one.

payment_method:
type: choice
choices: [bank_transfer, cheque, crypto]
default: bank_transfer

The selected value is substituted as a plain string into the template. For equality conditions ({% if payment_method == 'bank_transfer' %}), the value must match exactly.

Types do not change how the value is inserted into the template — all values are substituted as strings. Types only affect:

  1. How Claude asks the question — the input format and validation applied during the interview
  2. How defaults behave"today" is only meaningful for date types
  3. What the manifest records — for downstream tooling and validation