An advanced, intelligent context-awareness engine for Visual Studio 2022, designed to bridge the gap between your codebase and LLMs.
Nexus is a local "Context Daemon" that analyzes your active solution, compiles relevant code context into a specialized DSL (Domain Specific Language), and serves it to a lightweight Visual Studio extension. This allows AI assistants to understand not just the code you are looking at, but the architectural context, rules, and relationships surrounding it.
The system consists of two main components:
A high-performance .NET 9 Web API running locally.
- Responsibilities:
- Indexing: Parses C# code using Roslyn to extract semantic nodes (Classes, Methods, APIs).
- Context Compilation: Generates "DSL v0" bytecode optimized for LLM consumption.
- Security: Validates all file access to prevent path traversal attacks.
- Caching: Uses in-memory caching to ensure sub-millisecond response times for repeated queries.
- Tech Stack: ASP.NET Core 9, Roslyn, Microsoft.Extensions.Caching.Memory.
A Visual Studio 2022 VSIX extension.
- Responsibilities:
- Provides a chat interface within VS.
- Captures editor state (Active Solution, Active File, Selection).
- Communicates with the Daemon via HTTP (Port 5050).
- Tech Stack: .NET Framework 4.7.2, WPF (Windows Presentation Foundation).
- Smart Context: Doesn't just dump files. It selects relevant nodes based on your query and architectural rules.
- Security First:
- Strict path validation preventing unauthorized file access.
- Configurable "Authorized Root" (Defaults to
C:\for MVP, safest to run in isolated dev environments).
- Performance:
- Indexer Caching: Avoids re-parsing thousands of files on every request.
- Extensible:
- Rule Provider: Modular system to inject architectural rules (e.g., "No DB access in Controllers").
- Visual Studio 2022 (v17.0+)
- .NET 9.0 SDK
- .NET Framework 4.7.2 Dev Pack
The daemon must be running for the extension to work.
cd nexus-daemon/src/Nexus.Server
dotnet runThe daemon will start listening on http://localhost:5050.
- Open
nexus-vs-extension/NexusVS.slnin Visual Studio. - Set
NexusVSas the startup project. - Press F5 to launch the Experimental Instance of Visual Studio.
- In the new VS window, go to View -> Other Windows -> Nexus Context Chat.
- Open a C# solution in the Experimental Instance.
- Open a code file.
- In the Nexus Chat window, type a message or simply click Send to see the compiled context for the current file.
The daemon exposes a local API. By default, it binds to localhost.
- Path Traversal Protection: Attempts to access files like
../../windows/system32are blocked and logged. - Authorized Root: Constrained to allowed directory paths.
- Phase 1: Security Hardening & Daemon MVP
- Phase 2: Indexer Caching
- Phase 3: Smart Target Matching
- Phase 4: Rule Provider Pattern
- Phase 5: Unit Tests
- Phase 6: VS Extension Polish
- Phase 7: Production Release (Signed VSIX, Installer)
Built with ❤️ by the Nexus Team.