Brief

Brief mode interviews you one question at a time and writes the project contract that every other LEX AI mode builds against.

A
Written By Atakan KayaLast updated 3 months ago

Brief

Brief mode interviews you and writes the project contract every other mode builds against. It exists because the twenty fields of that contract are the right questions in the wrong form: a page of twenty expert-level boxes asks you to author a specification unaided, and nobody does. So the assistant asks instead — one thing at a time, drafting what it can already see and checking it with you. It writes no code and never touches git.

Slash command: /lex-brief.

The flow

/lex-brief
  ↓
kickstart_brief(project_path, scenario="new_full", ...)  # non-negotiable first call
loop:
    get_next_question(...)          # the server issues exactly one question
    submit_answer(question_id=..., answers=..., ...)
  ↓
finalize_brief()                    # writes .lex/contract.md and .lex/prompt.md
switch_to_mode(target_mode=...)     # hand off to the build mode

Seven topics cover the twenty contract fields: what we are making, who uses it, walking through using it, what must always be true, what it connects to, what must never happen, and how we will know it worked. The server owns which single question is outstanding, and submit_answer refuses any other id. That is a server rule rather than an instruction, because a model that pastes four questions at once and one that asks four times emit identical tool traffic.

Answers have to be usable

  • Filler is refused — a fixed list of 41 phrases ("standard", "best practice", "you decide", "tbd") is rejected, and the refusal names the field and supplies a sharper follow-up from that field's own escalation ladder. Ladders are per field, so three vague answers about one thing cannot exhaust the questions another field needs.
  • Essential fields have a floor — the business outcome must reach 30 characters, the ordered workflow 40. A field that gates completion is not satisfied by a fragment.
  • "I don't know yet" is a first-class answer — it is recorded as an open decision rather than pushed back at you.

Who answered what

Every field carries provenance, rendered into the contract with exactly this meaning:

Tag

Meaning

[USER-REQUIRED]

Only you can answer this

[LLM-FILLED]

The assistant drafted it and you confirmed the draft

[AUTO-FILLED]

A LEX default nobody has validated yet

A field only you may decide cannot be recorded as an assistant assumption, and recording a confirmation requires passing back the exact draft that was shown. Where your IDE can render a dialog, the server asks you directly and the answer never passes through the model — provenance then describes the transport instead of making a claim. See Tool surfaces.

Leaving early

finish_interview_now ends the interview at your word. Every question payload carries that exit ramp and a questions_remaining count, so the way out is advertised by construction. Unanswered in-scope fields are recorded as named gaps with your own reason, and in .lex/prompt.md each one renders as "[UNSPECIFIED] ... Do not invent it." Silence never reads as permission. skip_topic needs a written rationale and is refused for a topic still holding a field that gates completion.

open_interview_form is available on request: it puts the current topic's remaining questions on a real form, inline where the host supports it and on a local loopback page otherwise.

What you get

.lex/contract.md and .lex/prompt.md, plus session state in .lex-brief/manifest.json so a half-finished interview survives an IDE restart. The contract is meant to be hand-edited — parsing keys off HTML comment anchors rather than headings, so you can reword a heading or reflow a paragraph and your edits are adopted as your own words when the interview resumes, then validated again.

finalize_brief returns the mode and the first tool to call. Forward mode consumes the contract automatically: kickstart_workflow and kickstart_run take a contract_path defaulting to .lex/contract.md, record its path, digest and sha256, and point every step agent at it — you agreed to its statements, so they are requirements, not assumptions. See Mode chooser and Handoff.

Was this helpful?

Your feedback shapes what we write next.