DEV Community

Yaroslav
Yaroslav

Posted on

A programming language for AI on top of C# and Roslyn

Honestly — making AI read source files and count brackets to edit code
feels insane to me. Imagine having full access to a building's blueprints
— every wall, every pipe, every wire mapped out — but instead of using
them, you hand the builder a photo of the building and say "figure it
out." That's what we're doing when AI edits raw text while the compiler
already has the complete structured model of the code.

Visual Studio AI coding

What AI gets access to

  • VisualStudioWorkspace — same Roslyn semantic model that powers IntelliSense
  • DTE2 — VS IDE control: build, debug, breakpoints, locals
  • System.Windows.Automation — desktop UI automation

Code navigation

Roslyn indexes the entire solution on load. AI finds any class instantly
and can trace all dependencies — up (base types, interfaces, callers) and
down (derived types, implementations, callees). Every search is
semantic, resolved by the compiler — not text grep.

Visual Studio coding with RoslynMCP

How code editing works

AI doesn't edit text. It requests class structure as JSON — fields,
methods, types, modifiers. Then targets specific methods by name. Roslyn
generates syntax, formats, returns compiler diagnostics in the same
response.

Block-level navigation: AI can address any nested block by path —
TaskService.AddTask.if[0].else — and modify just that block without
touching anything else.

Debugger

AI sets breakpoints, starts debug, steps through code, reads locals — all
through DTE API. Full runtime inspection, not just static analysis.

Bigger picture

I think eventually there will be programming languages designed
specifically for AI — not for humans to type, but for AI to manipulate as
structured objects. This is an early experiment in that direction, built
on top of C# and Roslyn. And it already works.

Roslyn AI coding

Note on skills

Just like a person needs to read the manual before using a tool — AI also needs instructions. That's what skills are. They teach AI how to use
each Roslyn tool correctly: parameters, workflows, what to do when
something fails. For Claude Code, skills are available on GitHub and can
be copied to your project's .claude/skills/ directory. They are also
bundled inside the extension at Skills/.claude/skills/ for the built-in
Claude Chat panel.

Roslyn logo

Demo Video
https://www.youtube.com/watch?v=skvnHbm2lpk
https://www.youtube.com/watch?v=6d6Kx-MnXOc

Marketplace
https://marketplace.visualstudio.com/items?itemName=YaroslavHorokhov.RoslynMcp

Source
https://github.com/yarhoroh/RoslynMCP-Public

Top comments (0)