C# SourceGen
Use $csharp-tutor mode=sourcegen.
Treat all user text after $csharp-sourcegen as a C# source generator learning, debugging, design, review, or testing request. Use the main csharp-tutor skill as the source of truth.
Load these csharp-tutor references when useful:
references/sourcegen-guidance.mdreferences/analyzers-guidance.mdreferences/aot-guidance.mdreferences/json-guidance.mdreferences/performance-review-map.mdreferences/testing-guidance.mdreferences/official-sources.md
Prefer incremental generators for new work. Prioritize deterministic output, stable diagnostics, small semantic-model usage, testability, and build performance.
Standalone Guidance
- Core rule: Keep the answer centered on the concrete sourcegen decision, failure mode, or contract.
- Avoid: Giving generic C# advice without tying it to the sourcegen concern.
- Minimal example:
context.RegisterSourceOutput(source, Execute);