/bricelam:csharp-collectionsfrom bricelam
C# 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.).
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.
These look interchangeable but signal different intent---pick based on what you mean, not habit.
| Expression | Meaning |
|---|---|
x.ToList() | Buffer/materialize a lazy IEnumerable; also the normal way to convert another collection type (array, HashSet<T>, etc.) into a List<T>. |
new List<T>(x) | Explicitly copy/snapshot an existing collection into a new, independent List<T>---signals "I need my own copy of this" rather than "I need to run the query." |
[..x] (collection-expression spread) | Don't use this to materialize or copy a list---use one of the two above instead. |
Favor the most general interface that still expresses what the implementation actually needs---this lets the caller choose between streaming and buffering instead of the signature forcing a choice.
Return types: favor IEnumerable<T>/IAsyncEnumerable<T> over T[], List<T>, Task<List<T>>, etc., unless the implementation requires results to already be buffered.
Parameter types: favor IEnumerable<T>/IAsyncEnumerable<T> unless the implementation requires multiple enumerations. Use IReadOnlyCollection<T> when only a count is needed, or IReadOnlyList<T> when random access is required.
For dictionary parameters, favor IEnumerable<KeyValuePair<TKey, TValue>> over IReadOnlyDictionary<TKey, TValue>, since IDictionary<TKey, TValue> doesn't implement IReadOnlyDictionary<TKey, TValue>.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub bricelam/bricelam-plugins --plugin bricelam15 skills in this plugin
/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-librariesWhich NuGet package or BCL API to use when several compete for the same job in C#/.NET (HTTP resilience, YAML, JSON, MVVM, ORM, logging, versioning, DB drivers, UI frameworks, etc.), which libraries to avoid, and situational libraries worth using. Use whenever choosing or adding a package, or writing C# code that depends on one./csharp-linq-query-syntaxHow to write a C# LINQ query expression (`from`...`select`) that ends in a method call like `Count()`, `ToList()`, or `First()`. Use whenever a query expression needs a trailing method call./csharp-lspWhen to use the LSP tool (Roslyn language server) while working in C# code---finding a symbol's definition, references, implementations, or callers, and checking a symbol's type or signature. Use whenever answering a question about how C# code is connected (who calls this, what implements this, where is this defined, what type is this) or before changing a C# member's signature---even if Grep seems sufficient./csharp-native-interopConventions for writing Win32 native interop code in C# using CsWin32 (the Microsoft.Windows.CsWin32 source generator). Use whenever writing or reviewing P/Invoke calls, Win32 API usage, or native interop code in C#---even if CsWin32 isn't named explicitly, e.g. requests to call a Win32 function, work with window handles/HWNDs, or add a `NativeMethods.txt` entry./csharp-primary-constructorsDon'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.