managing-global-usings
Centralizes external namespace imports into a single GlobalUsings.cs file to reduce code clutter in .NET projects.
Install
mkdir -p .claude/skills/managing-global-usings && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16448" && unzip -o skill.zip -d .claude/skills/managing-global-usings && rm skill.zipInstalls to .claude/skills/managing-global-usings
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Centralize external namespace imports (BCL, FCL, NuGet) in a GlobalUsings.cs file per project, keeping individual files clean.Key capabilities
- →Create a GlobalUsings.cs file per project
- →Register .NET BCL/FCL namespaces as global usings
- →Register NuGet package namespaces as global usings
- →Remove redundant using statements from individual files
- →Sort global using statements alphabetically
- →Apply to all projects within a solution
How it works
The skill centralizes external namespace imports into a GlobalUsings.cs file, reducing redundant using statements in individual C# files and improving code readability.
Inputs & outputs
When to use managing-global-usings
- →Clean up duplicate using statements in a solution
- →Standardize NuGet package imports across multiple projects
- →Improve code readability by removing boilerplate imports
About this skill
GlobalUsings.cs로 외부 네임스페이스 중앙 관리
설명
프로젝트 내에서 반복적으로 사용되는 외부 네임스페이스(System.*, NuGet 패키지 등)를 GlobalUsings.cs 파일에 global using으로 선언하여 개별 파일의 using 문을 최소화합니다.
규칙
- 각 프로젝트 루트에
GlobalUsings.cs파일을 생성합니다 - .NET BCL/FCL 네임스페이스(
System.*,Microsoft.*등)는global using으로 등록합니다 - NuGet 패키지 네임스페이스(
Bogus,Moq,Scalar.AspNetCore등)는global using으로 등록합니다 - 솔루션 내부 프로젝트의 네임스페이스(예:
CompanyC.Api)는global using에 등록하지 않습니다 - 개별 파일에서는
GlobalUsings.cs에 등록된 네임스페이스의using문을 제거합니다 - 알파벳 순으로 정렬합니다
Worst Case (나쁜 예)
// EmployeeApiTests.cs - 모든 파일마다 동일한 using 반복
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using Microsoft.AspNetCore.Mvc.Testing;
namespace CompanyC.Api.IntegrationTests;
public class EmployeeApiTests { ... }
// EmployeeBogusTests.cs - 같은 using 또 반복
using System.Net;
using System.Text;
using System.Text.Json;
using CompanyC.Api;
using Microsoft.AspNetCore.Mvc.Testing;
namespace CompanyC.Api.IntegrationTests;
public class EmployeeBogusTests { ... }
Best Case (좋은 예)
// GlobalUsings.cs - 외부 네임스페이스를 한 곳에서 관리
global using System.Net;
global using System.Net.Http.Headers;
global using System.Text;
global using System.Text.Json;
global using Bogus;
global using Microsoft.AspNetCore.Mvc.Testing;
global using Microsoft.Extensions.DependencyInjection;
global using Moq;
// EmployeeApiTests.cs - 외부 using 없이 깔끔
namespace CompanyC.Api.IntegrationTests;
public class EmployeeApiTests { ... }
// EmployeeBogusTests.cs - 내부 네임스페이스만 유지
using CompanyC.Api;
namespace CompanyC.Api.IntegrationTests;
public class EmployeeBogusTests { ... }
적용 대상
- 솔루션 내 모든 프로젝트 (API, 테스트, 도구)
- .NET BCL/FCL 네임스페이스 (
System.*,Microsoft.*) - NuGet 패키지 네임스페이스
- 2개 이상의 파일에서 사용되는 외부 네임스페이스
제외 대상
- 솔루션 내부 프로젝트 네임스페이스 (예:
using CompanyC.Api;) - 단일 파일에서만 사용되는 특수 네임스페이스
When not to use it
- →When managing internal solution project namespaces
- →When a namespace is used only in a single file
Limitations
- →Does not manage internal solution project namespaces
- →Does not manage namespaces used only in a single file
How it compares
This skill automates the consolidation and management of using statements into a single global file, which is more efficient and consistent than manually managing them across numerous files.
Compared to similar skills
managing-global-usings side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| managing-global-usings (this skill) | 0 | 6mo | No flags | Beginner |
| complexity | 0 | 3mo | No flags | Intermediate |
| dotnet-solid-principles | 0 | 5mo | No flags | Advanced |
| csharp | 0 | 2mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
complexity
managedcode
Use free built-in .NET maintainability analyzers and code metrics configuration to find overly complex methods and coupled code. USE FOR: the team wants to find overly complex methods; cyclomatic complexity thresholds are needed in CI; maintainability metrics or coupling thresholds need to be config
dotnet-solid-principles
rudironsoni
>-
csharp
The1nk
|
dotnet-dev
GitTools
Expert guidance for .NET development in this repository. Use this skill for building, testing, debugging, and understanding project structure, coding conventions, dependency injection patterns, and testing practices.
generator.equals
diegofrata
Guidance for using Generator.Equals — a C# source generator for auto-generating Equals, GetHashCode, operators, and Diff/Inequalities methods via attributes.
format
managedcode
Use the free first-party `dotnet format` CLI for .NET formatting and analyzer fixes. Use when a .NET repo needs formatting commands, `--verify-no-changes` CI checks, or `.editorconfig`-driven code style enforcement.