roslyn-source-generators

Create compile-time code generators with Roslyn Incremental Generators.

Updated Jan 4, 2026
One-click install
npx skills add https://github.com/keithdv/ClaudeSkills --skill roslyn-source-generators
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: roslyn-source-generators
Source: https://github.com/keithdv/ClaudeSkills/tree/main/skills/roslyn-source-generators
Command: npx skills add https://github.com/keithdv/ClaudeSkills --skill roslyn-source-generators

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill introduces compile-time code generation using Roslyn Incremental Generators to reduce boilerplate, improve build times, and enable safer, more maintainable code.

Core Features & Use Cases

  • Incremental Pipeline: Build reliable generators that cache and reuse results for faster builds.
  • Semantic Analysis: Leverage Roslyn's semantic model without runtime overhead.
  • Marker Attributes & DI: Create marker attributes and dependency-injection-friendly patterns for generators.
  • Diagnostics & Troubleshooting: Emit diagnostics and diagnose performance issues in generators.

Quick Start

  1. Create a generator project implementing IIncrementalGenerator and hook into ForAttributeWithMetadataName.
  2. Define a marker attribute, then generate code for annotated types.
  3. Consume the generated code in a consumer project and build.