Dotnet Csharp Source Generators
Generates C# code at compile time from attributes, boosting performance and reducing boilerplate in .NET projects.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add dotnet-csharp-source-generators npx -- -y @trustedskills/dotnet-csharp-source-generators
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"dotnet-csharp-source-generators": {
"command": "npx",
"args": [
"-y",
"@trustedskills/dotnet-csharp-source-generators"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill leverages .NET C# source generators to automate code generation at compile time. It allows for the creation of boilerplate code, reduces repetitive tasks, and improves overall development efficiency by generating classes, properties, or methods based on attributes or other metadata. This results in cleaner, more maintainable code with less manual effort.
When to use it
- Generating Data Transfer Objects (DTOs): Automatically create DTOs from database schemas.
- Implementing Interfaces: Generate implementations of interfaces based on defined attributes.
- Creating Validation Logic: Produce validation logic for data models based on schema definitions.
- Reducing Boilerplate in APIs: Automate the creation of API endpoint classes and related code.
Key capabilities
- Compile-time code generation
- Attribute-driven code generation
- Reduces boilerplate code
- Improves development efficiency
Example prompts
- "Generate a DTO class for the 'Customers' table in my database."
- "Create an implementation of the 'IValidator' interface for the 'Product' class, using attributes to define validation rules."
- "Automate the creation of API endpoint classes based on this Swagger definition."
Tips & gotchas
- Requires a .NET development environment.
- Source generators are executed during compilation; errors in generator code can impact build success.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.