一键导入
managing-global-usings
Centralize external namespace imports (BCL, FCL, NuGet) in a GlobalUsings.cs file per project, keeping individual files clean.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Centralize external namespace imports (BCL, FCL, NuGet) in a GlobalUsings.cs file per project, keeping individual files clean.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Force Regex to use GeneratedRegex Source Generator attribute instead of runtime Regex construction for compile-time optimization.
Force all DTO (Data Transfer Object) types to be declared as record instead of class for immutability and value-based equality.
Force record instantiation via positional constructor with named arguments instead of property initializer syntax for stronger immutability expression.
Enforce branch-based workflow with meaningful Korean commits and PR creation for traceable decision history.
Force JsonSerializerOptions to be declared as static readonly or readonly fields instead of creating new instances inside methods.
| name | managing-global-usings |
| description | Centralize external namespace imports (BCL, FCL, NuGet) in a GlobalUsings.cs file per project, keeping individual files clean. |
프로젝트 내에서 반복적으로 사용되는 외부 네임스페이스(System.*, NuGet 패키지 등)를 GlobalUsings.cs 파일에 global using으로 선언하여 개별 파일의 using 문을 최소화합니다.
GlobalUsings.cs 파일을 생성합니다System.*, Microsoft.* 등)는 global using으로 등록합니다Bogus, Moq, Scalar.AspNetCore 등)는 global using으로 등록합니다CompanyC.Api)는 global using에 등록하지 않습니다GlobalUsings.cs에 등록된 네임스페이스의 using 문을 제거합니다// 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 { ... }
// 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 { ... }
System.*, Microsoft.*)using CompanyC.Api;)