WebSorobandocs v1
Open IDE

Docs

AI Copilot

Generate, debug, and optimize Soroban contracts from chat, five modes, slash commands, @-context, model switching, and reviewable diffs.


The Copilot is a chat and agent panel docked on the right of the IDE. Describe a change in plain English; it reads your project, writes edits as reviewable diffs, and validates them against the real compile and security pipeline before you accept anything.

Press ⌘I (or Ctrl+I) to focus it. The dock holds two tabs at the top, Copilot and Contract, switch between chatting and invoking your deployed contract without losing either's state.

Conversations as tabs#

Open several conversations at once with the + button in the tab strip, and click a tab to switch. Each tab keeps its own messages, mode, model, and any in-flight generation, a tab that's mid-build keeps running while you work in another. New tabs are titled automatically from your first message.

Modes#

A mode decides which tools the Copilot may use, so the limits are real, not cosmetic. Switch mode from the dropdown in the composer, or press Shift+Tab to rotate. Each mode starts a fresh conversation.

ModeWhat it doesEdits code?
AgentGenerates and edits, then self-corrects against the compiler until it builds. This is where "generate a contract from a prompt" lives.Yes, as diffs
Ask read-onlyAnswers questions about your contract. Reads files; never edits.No
PlanResearches, asks up to three clarifying questions, then writes an editable build plan. Hit Build to hand it to Agent.No
DebugGathers evidence, names the root cause, and proposes the smallest fix.Minimal diff
MultitaskRuns several agents in parallel on independent sub-tasks.Yes, per task

Slash commands#

Type / in the composer to open the command menu. A command sets a mode and pre-fills the prompt.

CommandDoes
/generateScaffold a new contract from a description
/fixResolve the current compile errors (attaches @errors)
/optimizeReduce Wasm size, storage, and host calls
/auditRun a security review
/testWrite unit and integration tests, then run them
/explainExplain the current file
/docAdd doc comments
/refactorRestructure for clarity
/specSummarize the contract's interface

@-context#

Type @ to attach context to your message. Attached items show as chips above the composer.

  • @file, a specific file's contents
  • @folder, the file list under a folder
  • @symbol, matches for an identifier across the project
  • @errors, the current compiler diagnostics
  • @selection, the active file
  • @docs, relevant Soroban / soroban-sdk documentation

Choosing a model#

Open the model switcher in the composer to pick a model per conversation, Claude, GPT, Gemini, DeepSeek, Qwen and more. Auto routes to a strong coding default; MAX Mode raises the reasoning effort and the context budget for harder problems. Your choice is remembered for next time. Use Add models to search the full list.

Reviewing changes#

Agent and Debug never write to your files silently. Every edit is produced as a unified diff:

Read the diff

Each changed file shows its hunks with +/ lines and an add/remove count.

Accept or reject

Toggle individual hunks, or use Accept all / Reject all.

Apply

Apply writes the accepted hunks to your project. The editor swaps to the new content.

Undo

Undo restores the project to the checkpoint taken before the run, so a whole change set reverts in one click.

Validated, not guessed#

After any generation or edit, Agent and Debug run the real pipeline and feed the results back to the model:

edit → compile → read diagnostics → fix → repeat
     → clippy   (lint)
     → tests    (when present or written)

A result is only "done" once it builds for the testnet Wasm target and its contract interface extracts, the same checks Deploy uses. The tool timeline in the chat shows each step as it happens: Read lib.rs, Ran compile, 2 errors, Edited storage.rs, Ran compile, clean.

Security audit#

/audit (and the run_security_audit step) checks the contract against a Soroban rule set and reports findings with a severity, the file and line, and a suggested fix:

  • Missing require_auth on state-changing or admin functions
  • Unchecked arithmetic on token amounts (i128/u128)
  • Persistent storage with no TTL extension (data can expire)
  • Panics reachable from user input
  • Unbounded loops over user-growable collections
  • Secrets or keys hardcoded in source

Deploying is always your call

The Copilot never deploys on its own. To ship a contract, use the Deploy button, it signs with your testnet wallet and requires your confirmation. Everything here is testnet only.

Next#

  • Compile and read per-file diagnostics.
  • Deploy the contract the Copilot built.
  • Invoke its functions from the contract console.