Annotations

Field Comments

confiqure reads the comment adjacent to each field and uses it as the AI's prompt for that value. Good comments produce good conversations. Bad comments produce confused users.


The convention

Whatever your language treats as the field's documentation block becomes its prompt — single-line comments, Javadoc, KDoc, docstrings, doc comments. The CLI doesn't parse syntax; it captures the lines immediately preceding the field.

UserPreferences.java
@Confiqure.User.Setting
public class UserPreferences {

    // What's your preferred display name?
    private String displayName;

    // Which timezone should we use for scheduled emails?
    private ZoneId timezone;

    /**
     * Multi-line comments work too. The full block becomes
     * the prompt — including any constraints you mention.
     * Keep it under three sentences for best results.
     */
    private Locale locale;
}

How types shape the question

The field's static type drives the conversational modality. The AI generates a different question style for an enum than for a free-text string.

Field typeQuestion styleNotes
StringFree-text inputMention format hints in the comment ("e.g. an email address").
booleanYes/no togglePhrase the comment as a yes/no question.
int / long / doubleNumber inputState units and bounds in the comment ("between 1 and 100").
enumSingle-choice pickerThe enum values become the options. Add a comment on each value to refine its label.
List<Enum>Multi-selectUser can choose zero, one, or many.
List<String>Repeating inputAI keeps asking "anything else?" until the user is done.
Nested classSub-dialogEach field of the nested class becomes its own turn.

Controls and reply views

The chat picks one control for each question and one view for each reply, by name, from the lists below. An answer is saved to the field the question is about and appears in the chat as its label (the option's text, not its value). Secrets keep their masked field, and consent and delete questions keep their own confirm cards.

ControlWhat the user sees
yes_no · ok_cancel · start_stopTwo buttons with the labels the question needs; a click answers.
single_choice · selectorOne choice from the options; two or fewer answer on click, more pick then Confirm.
multiple_choiceSeveral choices from the options, then Done.
list_selectorA scrolling list of the options (10 by default, more when the class allows), with a search box past 10; one pick, or several then Done.
date_timeA date picker.
fileA "Choose a file" button that opens the chat's file picker, when the embed token allows attachments; Skip answers without a file.
Reply viewWhat the user sees
messageA plain reply.
greetingThe opening reply.
info · warning · errorA reply with a small mark for a note, a warning or an error.
resultThe outcome of an operation: the text first, then the rows it returned.

Write comments for users, not compilers

Avoid

// digestFrequency
private Frequency digestFrequency;

Restating the field name tells the AI nothing.

Prefer

// How often should digest emails be sent? Pick less often if you
// already get individual alerts.
private Frequency digestFrequency;

A question, plus context that helps the user choose.

Last updated May 2026