RoslynMcpServer / rules
Cursor rule8 starsChanged 46 days agoMITView on GitHub
SDK pinning, DotNet CLI, build/test parsers, MSBuild bitness
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 4,181 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/roslyn-mcp-ci.mdcCursor rule
- .cursor/rules/roslyn-mcp-decompile.mdcCursor rule
- .cursor/rules/roslyn-mcp-dev-conventions.mdcCursor rule
- .cursor/rules/roslyn-mcp-docs-agents.mdcCursor rule
- .cursor/rules/roslyn-mcp-docs-lifecycle.mdcCursor rule
- .cursor/rules/roslyn-mcp-github-release.mdcCursor rule
- .cursor/rules/roslyn-mcp-overview.mdcCursor rule
- .cursor/rules/roslyn-mcp-paths.mdcCursor rule
- .cursor/rules/roslyn-mcp-pitfalls.mdcCursor rule
- .cursor/rules/roslyn-mcp-structural-tests.mdcCursor rule
- .cursor/rules/roslyn-mcp-tools.mdcCursor rule
- .cursor/rules/roslyn-mcp-version-bump.mdcCursor rule
- epoch-subagent-loopSkill
- epoch-subagent-loopSkill
- prepare-github-releaseSkill
The file
We split this roslyn-mcp-build-sdk.mdc into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Run metadata includes inherited overrides, strip/pin SDK env action, and SDK version inferred from MSBuild/NETSDK log paths.
- Very specific: line 23
Default noIncremental=true → --no-incremental on every build step (agent verification must not trust MSBuild up-to-date).
≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: SDK pinning, DotNet CLI, build/test parsers, MSBuild bitness globs: Services/Build/DotNet*.cs,Services/Build/GlobalJson*.cs,Services/Workspace/Workspace*.cs,Diagnostics/**/*.cs,Tools/BuildTools.cs,Tools/TestTools.cs,Tools/RunTools.cs alwaysApply: false --- # Build / SDK / DotNet CLI ## Bitness MCP process is 64-bit. x86 MSBuild/SDK → `BadImageFormatException`. Use 64-bit `dotnet` (`DotNetHostResolver`). `MsBuildBootstrapper.Register()` before workspace use. ## `global.json` pinning `DotNetSdkEnvironment` / `GlobalJsonSdkReader`: pin via `MSBUILD_EXE_PATH`, `MSBuildSDKsPath`, `DOTNET_MSBUILD_SDK_RESOLVER_SDKS_*`, `DOTNET_ROOT`, inherit full process env. Working directory = nearest ancestor with `global.json` when possible. Without a resolved pin, **strip** inherited `MSBuildSDKsPath` / `MSBUILD_EXE_PATH` / resolver vars (MSBuildLocator and Cursor/VS often leave SDK 9.x overrides → `NETSDK1045` on net10). Run metadata includes inherited overrides, strip/pin **SDK env action**, and SDK version inferred from MSBuild/NETSDK log paths. ## `run_dotnet_build` (`DotNetBuildProbe`) Escalate when diagnostics missing: `build -v:minimal` → `restore` → `build -v:normal`. Parse MSBuild `path(line,col): error|warning` **and** NuGet `NU####` / GHSA. Surface `MCP_MSBUILD_SDK_MISMATCH` if log SDK ≠ pin. Deduplicate repeated NU lines. Optional tool arg `configuration` → `-c` on build steps only (multi-config `.slnx`: `Sit-Debug`, `Dit-Debug`, …). Omit to inherit `load_workspace` configuration. Optional `platform` → `-p:Platform=` (same inherit). Default `noIncremental=true` → `--no-incremental` on every build step (agent verification must not trust MSBuild up-to-date). Effective exit = **last** `dotnet build` step — never let restore exit 0 mask a failed build with no rebuild. Report `Configuration` / `NoIncremental` in metadata. While a step lives, `run_dotnet_build` emits MCP `notifications/progress` heartbeats (step label, elapsed, previous exit; no stdout) through `DotNetCliRunner`/`DotNetBuildProbe`; the SDK-injected `IProgress<ProgressNotificationValue>` parameter is schema-excluded (`McpToolHelpFormatter.IsMcpBoundParameter`). UX only — never claim it raises the host `tools/call` timeout. ## Tests (`VstestOutputParser` / `TestTools`) Success often has `Test Run Successful` / `Total tests` + `Passed` **without** `Failed:` line — treat missing Failed/Skipped as 0. `.slnx` fail output often has `Total tests` + `Failed:` **without** `Passed:` — infer Passed = Total − Failed − Skipped. Avoid false `partial` status. `run_specific_test` filter match: xUnit may print method-only names or Theory `FQN(args)` while the needle is `Ns.Class.Method`. Do not require a dotted FQN on the Passed line or `line.Contains(fullNeedle)`; match a display suffix with a `.` boundary. False **no matching tests** after `Passed: 1` sends agents into workspace/filter retries. `run_dotnet_test` / `run_specific_test` / `run_test_by_filter`: `timeoutSeconds` (default 300, shared by pre-test build + test); optional `noBuild` / `noRestore`; optional `configuration` (`-c`) and `platform` (`-p:Platform=`), same as build (inherit from `load_workspace` when omitted). Failed-test Standard Output/Error are separate report blocks (default 2500/1000 chars head+tail; `includeFullOutput` / `maxOutputChars` raise the cap, safety 100000). Do not drop StdOut to protect the assertion. When `noBuild=false`, run incremental `dotnet build` then `dotnet test --no-build --no-restore` so `VstestOutputParser` never sees MSBuild warning dumps. Do not use `DotNetBuildProbe` for that compile. `noBuild=true` skips the extra build. Same MCP progress heartbeats as build (`dotnet build` / `dotnet test`; 5 s; no VSTest lines). ## Other - `run_dotnet_run` — timeout, truncated stdout, stderr tail; MCP progress heartbeat (`dotnet run`, 5 s, no stdout) via `RunSeparatedAsync` + `CliProgressWatch`. - `run_nuget_audit` — `dotnet list package --vulnerable`, structured table. - `load_workspace` NuGet audit, prune/unused PackageReference, NU1701 TFM-compat, **and** design-time MSBuild advisories (ASPDEPR007 / IncludeOpenAPIAnalyzers, MSB3270, analyzer project without metadata) → warnings, not hard Failure; do not treat the word `failed` in the MSBuildWorkspace wrapper as fatal unless inner text has `error NU|MSB|NETSDK` or a known-hard pattern. Health block shows SDK/restore/tool count. - Logs: summary + highlight lines; `ROSLYN_MCP_LOG_TOOL_OUTPUT=full` for verbose; `read_log_tail` / `tail_tool_log`.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

