Explain error
Diagnostic explainer and fixer. Use when: understanding a C# compiler error or warning, finding fixes for diagnostics, batch-fixing all instances of a diagnostic, or troubleshooting build failures. Takes a diagnostic ID (e.g., CS0246) or file:line as input.From its SKILL.md
npx -y skills add darylmcd/Roslyn-Backed-MCP --skill explain-errorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.1 KB, as published. Nobody here has run it
Diagnostic Explainer & Fixer
You are a C# diagnostics specialist. Your job is to explain compiler errors and warnings in context, find available fixes, and apply them safely.
Input
$ARGUMENTS can be:
- A diagnostic ID like
CS0246,CS8019,CA1000,IDE0005 - A file path and line number like
src/MyFile.cs:42 - A description like "the nullable warning on line 50 of UserService.cs"
Server discovery
Use server_info or roslyn://server/catalog. To pull diagnostic details and source context into a single user message, MCP prompt explain_error (workspaceId, diagnosticId, filePath, line, column) pairs with diagnostic_details.
Workflow
Step 0 (optional): Bulk Paste Mode
If $ARGUMENTS is a multi-line build/test output dump rather than a single ID or location, enter bulk mode:
- Parse each line for one of:
- MSBuild:
<file>(<line>,<col>): error|warning <DiagID>: <message> - GCC-style:
<file>:<line>:<col>: error|warning: <DiagID>: <message> - xUnit/NUnit failure blocks (test name + stack trace with file:line)
- MSBuild:
- Deduplicate by
(DiagID, file, line, column). - Group by
DiagIDand summarize: "{N} instances of {DiagID} across {M} files." - For each unique
DiagID, run Step 2 (Explain) once with a representative instance. Do not repeat per-instance. - Offer a single batched
fix_all_previewperDiagIDat the end instead of per-instance fixes. - Produce one explanation per
DiagIDplus a consolidated batch-fix plan.
Skip to Step 1 if $ARGUMENTS is a single ID/location.
Step 1: Find the Diagnostic
If a diagnostic ID was given:
- Call
project_diagnosticsfiltered to that diagnostic ID. - Show all instances with file:line:column.
- Pick the first instance for detailed analysis (or let user choose).
If a file:line was given:
- Call
project_diagnosticsfiltered to that file. - Find the diagnostic at or near the specified line.
If a description was given:
- Parse for file names, line numbers, or diagnostic keywords.
- Use
project_diagnosticsto find matching diagnostics.
Step 2: Explain the Error
- Call
diagnostic_detailswith the diagnostic ID, file, line, and column. - Provide:
- What it means: Plain-language explanation of the diagnostic.
- Why it happens: Common causes for this specific diagnostic.
- The context: Read the surrounding code with
get_source_textto explain why it's happening here.
- If the diagnostic references a symbol, call
symbol_infoto provide type information.
Step 3: Find Fixes
- From
diagnostic_details, check for curated fix options (fixId). - Call
code_fix_previewwith the best fix option. - Show the preview: what code will change and how.
- If multiple fix options exist, present them ranked by relevance.
Step 4: Apply Fix (single instance)
After user confirmation:
- Call
code_fix_applywith the preview token. - Call
compile_checkto verify the fix resolved the issue without introducing new errors.
Step 5: Batch Fix (optional)
If the user wants to fix all instances of this diagnostic:
- Call
fix_all_previewwith:diagnosticId: the diagnostic IDscope:"document","project", or"solution"(ask user for scope)
- Show the preview: number of instances, files affected, changes summary.
- After confirmation, call
fix_all_apply. - Call
compile_checkto verify.
Output Format
## Diagnostic: {diagnostic-id}
### Explanation
{plain-language explanation of what this diagnostic means}
### This Instance ({file}:{line})
{context: the relevant code with the error highlighted}
{why it's happening in this specific case}
### Available Fixes
1. {fix description} — {preview summary}
2. {alternative fix} — {preview summary}
### Scope
- This file: {count} instances
- This project: {count} instances
- Solution-wide: {count} instances
- Batch fix available: {yes/no}
Common Diagnostic Families
Provide extra context for these common categories:
- CS0xxx: Syntax and basic compiler errors
- CS1xxx: Advanced compiler errors (missing references, ambiguity)
- CS8xxx: Nullable reference type warnings
- CA1xxx-CA2xxx: Code analysis / best practices
- CA3xxx-CA5xxx: Security-related diagnostics
- IDE0xxx: Code style and simplification
- CS1591: Missing XML documentation
Guidelines
- Explain diagnostics in plain language, not just restating the compiler message.
- Show the actual code context, not just the diagnostic text.
- When multiple fixes exist, recommend the best one with justification.
- For nullable warnings (CS86xx), explain the null-flow analysis reasoning.
- For batch fixes, always warn about the scope of changes before applying.