/bricelam:csharp-primary-constructorsfrom bricelam
Don't use C# primary constructors on classes or structs. Use whenever writing a C# class or struct with constructor parameters, or when an IDE/analyzer suggests converting to a primary constructor.
Ships in bricelam. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Don't use primary constructors on classes or structs. Parameter scope is unclear: the parameters are captured implicitly, may be mutable, and read like fields without being declared as fields.
Declare fields (or properties) explicitly and assign them in a regular constructor.
Prefer:
public class BlogService
{
private readonly BlogContext _db;
public BlogService(BlogContext db)
{
_db = db;
}
}
Over:
public class BlogService(BlogContext db)
{
}
Records may use their positional (primary) syntax, since it declares public properties rather than captured parameters.
What SKILL.md sets; muted values are Claude Code's defaults
15 skills in this plugin
/csharp-collectionsC# collection conventions---choosing between ToList, new List, and collection-expression spread to materialize or copy a sequence, and which collection interface to use for method parameters and return types. Use whenever materializing an enumerable into a list or declaring a collection-typed parameter or return type (arrays, `List<T>`, `IEnumerable<T>`, dictionaries, etc.)./csharp-csvhelperConventions for using CsvHelper in C#---aliasing its generically named attribute types. Use whenever writing or reviewing code that reads or writes CSV with CsvHelper, or whenever using CsvHelper's `FormatAttribute`, `IgnoreAttribute`, `NameAttribute`, or `TypeConverterAttribute`---even if CsvHelper isn't named explicitly./csharp-Other plugins' skills for the same job
npx claudepluginhub bricelam/bricelam-plugins --plugin bricelam