VS Code and the CLI
Using with AI agents
Because RAS lets you go around the "write → run → verify" loop with ras alone, even where there is no Excel, it is easy to hand work to an AI agent (such as Claude Code). ras init creates AGENTS.md in the project, a guide for AI agents (work procedure, writing conventions, what cannot be used).
Work procedure
- Know the workbook:
ras book dump(sheets, code names, used ranges, formulas, names, tables),ras book dump --sheet Sheet1 --range A1:F20(cell values and formulas). Do not let the agent guess the sheet layout or cell contents. - Write:
src/*.ras(user forms go informs/). Check the syntax withras cheatsheet. - Check:
ras check. For an error code,ras explain E0301shows the explanation and how to fix it.ras check --fixfixes mechanically fixable warnings.--message-format jsongives JSON. Do not guess members of Excel and VBA: look them up withras doc Range.find(--list Excel.Worksheetlists the members). - Run:
ras run Module.func. It prints the output ofdebug.print, run-time errors (number, description, position in the.ras) and the diff of changed cells. Respond to dialogs with--msgbox vbYes --inputbox "...". - Verify:
ras test(test/*.test.ras). Compare the resulting workbook withras book diff original-workbook build/debug/workbooks/workbook-name. To show it to a person, useras run ... --view/ras book view(HTML grid view).
ras check --target stand-in tells you whether you are using features the stand-in lacks. To check in the real Excel (Windows only), use ras excel run Module.func / ras excel compile: they run on a copy of the workbook, read and close the dialogs, and show where the errors are in the .ras sources.
Reference material
| Material | Contents |
|---|---|
| AGENTS.md | The guide ras init puts in the project |
| Cheat sheet | Differences from TypeScript, types, syntax, Excel operations, tests, commands (also shown by ras cheatsheet; all code examples pass ras check) |
| llms.txt | List of the sections of the specification (for AI) |
| Language specification | All the rules |