McBasic™Get McBasic™ ↗
Build 881
Guided workflow

Interview, revise and run a small AI plan

Use Plan mode to define a one-window app before generating it, then verify the event code and applied result.

Step 1Create a disposable blank project#

Use Welcome → Create with AI… and choose a new practice project. Configure a working provider, select Ask me first, and leave automatic dependency approval off. Review the initial document chips and Project map.

Step 2Start a bounded Plan interview#

Send in Plan mode
/plan Build a one-window greeting utility. Use txtName (TextBox), lblGreeting (Label) and cmdGreet (CommandButton). Clicking Greet trims the name; an empty name shows "Enter a name." and other names show "Welcome, " followed by the name. No files, network, database or packages. Include tests for blank input and surrounding spaces.

Answer the cards. Select Other… if the offered answers would add unwanted functionality. Inspect What we decided after each answer.

Step 3Review and revise the draft#

Choose Stop asking, draft the plan when the requirements are clear. In Details, verify one Form, the three named controls, the Click binding and no external services. Request a revision in Plan if anything differs. Only the newest draft should offer approval.

Step 4Approve execution, not an unseen final result#

Choose Approve and run. The mode changes to Build. Inspect each stage’s Check report and change card. Do not accept an unexpected plugin, migration or extra Form. Apply the checked stage only after inspecting its complete code and layout.

Step 5Check properties and complete event code#

ObjectRequired configuration
txtNameText = "", MultiLine = False
lblGreetingCaption = ""
cmdGreetCaption = "Greet"; Click bound to cmdGreet_Click
Expected complete cmdGreet_Click handler
Private Sub cmdGreet_Click()
    Dim name As String
    name = Trim$(txtName.Text)

    If Len(name) = 0 Then
        lblGreeting.Caption = "Enter a name."
        Exit Sub
    End If

    lblGreeting.Caption = "Welcome, " & name
End Sub

Keep Option Explicit at file scope. Generated geometry can vary, but all three controls must be visible, nonoverlapping and reachable with Tab. If the model chooses different behavior or names, request a correction rather than claiming this exercise passed.

Step 6Test behavior and retain a checkpoint#

Run with Ada, surrounding spaces and empty input. Expect Welcome, Ada for the first two and Enter a name. for the last. Repeat the Click, resize the window and test keyboard navigation. Stop, save, close and reopen the project, then run the same cases. Keep a Git checkpoint of the accepted result.

Source baseline 20f4bfed6b · Build manifest
Sources & maintenance

Original web explanation, reviewed against these repository sources. API tables and example files follow the implementation.

  • docs/manual/16-working-with-the-ai-assistant.md
  • samples/HelloForms.mcbproj/Forms/frmMain.bas
  • src/McBasic.Build/AiChatRequest.cs
  • src/McBasic.Build/AiScope.cs
  • src/McBasic.Build/ProcedurePatchValidationService.cs
  • macos/McBasicIDE/Sources/AIContextRecipe.swift
  • macos/McBasicIDE/Sources/AIProviderController.swift