.claude/skills/gen-global-usings/SKILL.md
Use when setting up or cleaning up global using directives for a project. Generates a categorized GlobalUsings.cs based on the project's NuGet dependencies and internal namespaces, with section comments. Also invoke when the user mentions: global usings, add GlobalUsings.cs, organize usings, implicit usings. Domain: Code Generation. Level: Beginner.
npx skillsauth add klod68/littlerae gen-global-usingsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a GlobalUsings.cs for the project: ${1:ProjectName}.
${2|Library,Web App / API,Console,Test project|}${3|xUnit + FluentAssertions + Moq,MSTest,NUnit + FluentAssertions + Moq,N/A|}${4:e.g. Microsoft.Extensions.Logging, Polly, FluentValidation}${5:e.g. MyApp.Domain, MyApp.Application}${6:e.g. MyApp.Domain.Entities, MyApp.Application.Services}// ============================================================================
// Global Usings — ${1}
// ============================================================================
// ── System ──────────────────────────────────────────────────────────────────
// Include System.* namespaces used in 3+ files
// ── Microsoft Extensions ────────────────────────────────────────────────────
// DI, Logging, Configuration, Options — include with one-line comment
// ── Third-Party Libraries ───────────────────────────────────────────────────
// External NuGet packages — include library name and purpose
// ── Project — ${1} ─────────────────────────────────────────────────────────
// Internal namespaces used across multiple files
// ── Project References ──────────────────────────────────────────────────────
// Namespaces from referenced projects/packages
For test projects, prepend a test framework block:
xUnit + FluentAssertions + Moq:
// ── Test Frameworks ─────────────────────────────────────────────────────────
global using Xunit;
global using FluentAssertions;
global using Moq;
MSTest:
// ── Test Frameworks ─────────────────────────────────────────────────────────
global using Microsoft.VisualStudio.TestTools.UnitTesting;
NUnit + FluentAssertions + Moq:
// ── Test Frameworks ─────────────────────────────────────────────────────────
global using NUnit.Framework;
global using FluentAssertions;
global using Moq;
// ── Section Name ── headerglobal using line has an inline comment explaining what it provides
(e.g., // ILogger<T>, LogLevel or // ArgumentNullException.ThrowIfNull)GlobalUsings.cs if it already exists — extend it, don't replace valid entriesGlobalUsings.cs — no namespace declarationglobal using static unless the project already uses that patternglobal using that is already presenttools
Use when cross-cutting concerns (logging, metrics, validation, authorization) are tangled into command handlers or service methods, when building database command pipelines with reorderable concerns, or when HTTP client pipelines or message handlers need composable, independently-replaceable processing stages. Covers ICommandInterceptor interface, InterceptorPipeline with reverse-chain construction, zero-cost Empty sentinel to skip overhead when no interceptors are registered, and ConfigureAwait(false) discipline for library code. Domain: Architecture, Cross-Cutting Concerns. Level: Intermediate. Tags: interceptor, pipeline, middleware, decorator, cross-cutting-concerns.
development
Use when writing integration tests for Razor Pages, MVC, or Minimal API applications to validate routing, middleware, page rendering, and HTTP behavior without a browser or live server, or when adding fast smoke tests to a CI pipeline. Covers WebApplicationFactory<Program> setup with public partial class Program, in-memory test server, AngleSharp HTML parsing, CSS selector assertions, redirect and status code testing, and a shared static fixture pattern for minimal per-test startup overhead. Domain: Testing, ASP.NET Core. Level: Intermediate. Tags: integration-testing, webapplicationfactory, razor-pages, anglesharp, http-testing.
development
Use when designing indexes for new tables, diagnosing slow queries that are not using indexes efficiently, reviewing index fragmentation and maintenance, or when the current indexing strategy results in key lookups, table scans, or missing index warnings. Covers clustered index key selection (narrow, unique, ever-increasing), non-clustered index design for query patterns, covering indexes with INCLUDE columns, filtered indexes for subset queries, composite index column ordering, DMV-based monitoring for missing and unused indexes, and rebuild vs reorganize maintenance thresholds. Domain: Database, Performance. Level: Intermediate. Tags: index, sql-server, covering-index, filtered-index, performance, dmv, maintenance.
development
Use when building a searchable in-memory catalog or registry for documentation sites, admin panels, or type/API browsers where you need keyword matching, fuzzy search, and ranked results without an external search engine or database. Covers RegistryService with weighted scoring across name, description, keywords, and method names; Levenshtein fuzzy matching; synonym expansion; category and subcategory filtering; and singleton DI registration for datasets of hundreds to low thousands of items. Domain: Search, Data Access Patterns. Level: Intermediate. Tags: search, registry, fuzzy-matching, in-memory, catalog, filtering.