| name | build-fixer |
| description | Analyze build errors from the build skill and automatically fix them. Use after running build to resolve compilation errors quickly. (project, gitignored) |
Build Fixer Skill
This skill takes build errors from the build skill and automatically fixes them.
Tool Location: D:\FractalDataworks\RoslynTools\src\RoslynTools.BuildFixer
When to Use This Skill
- After running
buildskill when errors are found - "Fix the build errors"
- "Resolve compilation issues"
- When build output shows specific errors
- During refactoring when references break
- After merging branches with conflicts
CRITICAL: Prerequisite
ALWAYS run the build skill first to get error diagnostics.
If build hasn't been run yet:
- Invoke
buildskill - Parse the error output
- Then proceed with fixes
CRITICAL: When to Use Other Skills
For specific error types, invoke these skills:
CS0229 (Ambiguous reference) → Invoke
type-collision-detector- Find all types with same name
- Show user the options
- Ask which to use
CS0246 (Type not found) → Invoke
type-finder- Search for the missing type
- If found in project → Add using statement
- If not found → Suggest package or ask user
CS0535 (Missing interface member) → Invoke
member-identifier- Get full interface definition
- See exactly which members are missing
- Generate proper implementations
These skill invocations are MANDATORY for these error types.
API Endpoint
GET /analysis/build-errors
Response:
{
"isSuccess": true,
"data": {
"errors": [
{
"code": "CS0246",
"message": "The type or namespace name 'IRepository' could not be found",
"filePath": "src/Services/ProductService.cs",
"lineNumber": 15,
"severity": "Error",
"category": "MissingType",
"suggestedFix": "Add using statement or package reference"
}
]
}
}
How It Works
1. Start the Server
dotnet run --project D:\FractalDataworks\RoslynTools\src\CyberdineDevelopment.RoslynTools.Server
2. Load Solution
using CyberdineDevelopment.RoslynTools.Client;
var client = new RoslynWorkspaceClient("http://localhost:5000");
await client.LoadSolution(@"D:\MyProject\MyProject.sln");
3. Get Build Errors
// Get diagnostics from workspace
var result = await client.GetDiagnostics();
if (result.IsSuccess)
{
var errors = result.Data.Where(d => d.Severity == "Error");
foreach (var error in errors)
{
Console.WriteLine($"{error.Code}: {error.Message}");
Console.WriteLine($" File: {error.FilePath}:{error.LineNumber}");
if (!string.IsNullOrEmpty(error.SuggestedFix))
{
Console.WriteLine($" Fix: {error.SuggestedFix}");
}
}
}
Semantic Analysis Benefits
Using the Server API provides significant advantages:
- Real-Time Diagnostics: Get errors from compilation, not build output parsing
- Full Context: Access to semantic model for accurate error analysis
- Better Suggestions: Understand type resolution to suggest correct fixes
- Cross-Project Awareness: Know which project contains missing types
- Immediate Feedback: No need to run full build
- Fix Verification: Can apply fixes and re-check without disk writes
What This Skill Does
- Parses build errors from build skill output
- Categorizes errors by type and fixability
- Invokes appropriate skills for specific error types
- Automatically fixes common errors:
- Missing using statements
- Missing package references
- Type name mismatches
- Namespace issues
- Null reference warnings
- Accessibility issues
- Suggests fixes for complex errors
- Re-runs build to verify fixes
- Iterates until build succeeds or manual intervention needed
Error Categories
✅ Auto-Fixable Errors
CS0246: Type or namespace not found
Error: The type or namespace name 'IRepository' could not be found
Fix: Add using statement or package reference
CS0103: Name does not exist in current context
Error: The name 'JsonSerializer' does not exist
Fix: Add using System.Text.Json;
CS0161: Not all code paths return a value
Error: Method must return a value
Fix: Add return statement or throw NotImplementedException
CS8600-CS8629: Nullable reference warnings
Error: Cannot convert null to non-nullable type
Fix: Add null-forgiving operator or null check
CS0535: Class does not implement interface member
Error: Missing interface implementation
Fix: Add required methods/properties
⚠️ Semi-Auto-Fixable (Need User Decision)
CS0229: Ambiguous reference
Error: 'Product' is ambiguous between 'Domain.Product' and 'DTOs.Product'
Options:
1. Use fully qualified name
2. Rename one type
3. Remove conflicting using
User chooses, skill applies fix
CS0012: Assembly reference missing
Error: Type is defined in an assembly that is not referenced
Suggestion: dotnet add package [PackageName]
Ask user to confirm
Workflow
When this skill is invoked:
- Parse build errors from stdin or build output
- Categorize errors by type
- Invoke appropriate skills for specific errors
- Apply automatic fixes where possible
- Ask user for decisions on ambiguous fixes
- Re-run build to verify
- Iterate until success or max rounds reached
Integration with Other Skills
Full build-fix workflow:
1. build → Get errors
2. build-fixer → Fix errors automatically
3. build → Verify success
4. test-coverage → Ensure tests still pass
With type management:
1. build → Error: 'Product' is ambiguous
2. type-collision-detector → Find all Product types
3. build-fixer → Ask user which to use
4. Apply fix
5. build → Verify
Example Usage
User asks:
- "Fix the build"
- "Resolve these compilation errors"
Skill will:
- Parse build output
- Fix auto-fixable errors
- Ask about ambiguous cases
- Report results
Notes
- Uses Roslyn Workspace API diagnostics
- Understands C# error codes and semantic meaning
- Can fix multiple errors per round
- Validates fixes in-memory before committing
- Tracks success rate
- Maximum 5 rounds before stopping
- Server maintains workspace state between fix attempts