원클릭으로
static-analysis
.NET static analysis and code quality tools. Use when configuring analyzers, fixing warnings, or enforcing code standards.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
.NET static analysis and code quality tools. Use when configuring analyzers, fixing warnings, or enforcing code standards.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Interactively elicit, capture, and maintain software/system requirements as a living, traceable repository. Use whenever the user wants to gather, write, refine, or organize requirements — including producing or updating an SRS (software/system requirements specification), writing ADRs / architecture decision records, building a requirements traceability graph (DAG), or keeping a decision ledger. Trigger proactively when the working folder already holds requirements artifacts (a `requirements/` folder of YAML, `decisions/` ADRs, an `srs.md`, or `ledger.md`), or when the user shares documents that are clearly specs, RFCs, or feature briefs and wants them structured. Also use for phrases like "let's spec this out", "interview me about what we're building", "capture these requirements", "write a decision record", or "turn these notes into a spec". Not for project management, code review, application code, dependency manifests like requirements.txt, or hardware "system requirements" (RAM/CPU).
Use this skill whenever the user wants to create a bash script that drives an autonomous coding loop — scripts that run Claude Code on a schedule (cron, GitHub Actions, systemd timer) or on-demand to make repository improvements, execute plans, triage issues, or otherwise do agentic work with minimal human intervention. Triggers include phrases like "scout script", "autonomous script", "agent harness", "script that runs on a schedule", "script that implements a plan", ".scripts/*.sh", or any request for a bash script whose body is "run Claude Code with a prompt and commit the results". Always use this skill before writing such a script — it encodes the interview flow, the adversarial-reviewer pattern, and the locking/ledger conventions.
Task structure and atomic commit patterns for granular, verifiable work units
Conflict identification and resolution patterns for requirements, decisions, and plans
Context window management techniques for maintaining efficiency and preventing context bloat
Exploration map management for tracking discussed areas and uncharted territory during DISCUSS phase
| name | static-analysis |
| description | .NET static analysis and code quality tools. Use when configuring analyzers, fixing warnings, or enforcing code standards. |
| allowed-tools | Read, Grep, Glob, Bash |
.NET SDK includes analyzers for code quality and style. Enable in project file:
<PropertyGroup>
<!-- Enable all .NET analyzers -->
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<!-- Analysis level (latest, 8.0, 7.0, etc.) -->
<AnalysisLevel>latest</AnalysisLevel>
<!-- Analysis mode: Default, Minimum, Recommended, All -->
<AnalysisMode>Recommended</AnalysisMode>
</PropertyGroup>
| Category | Prefix | Focus |
|---|---|---|
| Design | CA1xxx | API design guidelines |
| Globalization | CA2xxx | Internationalization |
| Performance | CA18xx | Performance optimizations |
| Security | CA2xxx, CA3xxx | Security vulnerabilities |
| Usage | CA2xxx | Correct API usage |
| Naming | CA17xx | Naming conventions |
| Reliability | CA2xxx | Error handling, resources |
# Build with analyzers (default)
dotnet build
# Ensure analyzers run
dotnet build /p:RunAnalyzersDuringBuild=true
# Treat warnings as errors
dotnet build /p:TreatWarningsAsErrors=true
# Run only analyzers (no compile)
dotnet build /p:RunAnalyzers=true /p:RunCodeAnalysis=true
# Format check (style only)
dotnet format --verify-no-changes
# Format and fix
dotnet format
# Analyze specific project
dotnet build src/MyApp/MyApp.csproj /p:TreatWarningsAsErrors=true
# .editorconfig
root = true
[*.cs]
# Naming conventions
dotnet_naming_rule.private_fields_should_be_camel_case.severity = warning
dotnet_naming_rule.private_fields_should_be_camel_case.symbols = private_fields
dotnet_naming_rule.private_fields_should_be_camel_case.style = camel_case_style
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_style.camel_case_style.capitalization = camel_case
dotnet_naming_style.camel_case_style.required_prefix = _
# Code style
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_prefer_braces = true:warning
# Analyzer rules
dotnet_diagnostic.CA1062.severity = warning # Validate arguments
dotnet_diagnostic.CA2007.severity = none # Don't require ConfigureAwait
dotnet_diagnostic.IDE0044.severity = warning # Make field readonly
# .globalconfig
is_global = true
# Apply to all projects
dotnet_diagnostic.CA1062.severity = warning
dotnet_diagnostic.CA2000.severity = error
<PropertyGroup>
<!-- Suppress in entire project -->
<NoWarn>$(NoWarn);CA1062;CA2007</NoWarn>
<!-- Treat specific as error -->
<WarningsAsErrors>$(WarningsAsErrors);CA2000</WarningsAsErrors>
</PropertyGroup>
// Suppress on member
[SuppressMessage("Design", "CA1062:Validate arguments",
Justification = "Validated by framework")]
public void Process(Request request) { }
// Suppress on line
#pragma warning disable CA1062
public void Process(Request request) { }
#pragma warning restore CA1062
// Suppress all in file
[assembly: SuppressMessage("Design", "CA1062")]
// GlobalSuppressions.cs
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Design", "CA1062",
Scope = "namespaceanddescendants",
Target = "~N:MyApp.Controllers")]
// Warning: parameter 'request' is never validated
public void Process(Request request)
{
request.Execute(); // CA1062
}
// Fixed
public void Process(Request request)
{
ArgumentNullException.ThrowIfNull(request);
request.Execute();
}
// Warning in library code
await SomeAsync(); // CA2007
// Fixed
await SomeAsync().ConfigureAwait(false);
// Or suppress in application code (.editorconfig)
dotnet_diagnostic.CA2007.severity = none
// Warning: can be static
public int Calculate(int x) => x * 2; // CA1822
// Fixed
public static int Calculate(int x) => x * 2;
// Warning
private int _value; // IDE0044
// Fixed
private readonly int _value;
// Warning: not disposed
public void Process()
{
var stream = new FileStream("file.txt", FileMode.Open);
} // CA2000
// Fixed
public void Process()
{
using var stream = new FileStream("file.txt", FileMode.Open);
}
# Check without changes
dotnet format --verify-no-changes
# Check specific files
dotnet format --include "src/**/*.cs" --verify-no-changes
# Exclude paths
dotnet format --exclude "**/Migrations/**"
# Fix all issues
dotnet format
# Fix style issues only
dotnet format style
# Fix analyzers only
dotnet format analyzers
# Fix specific severity
dotnet format --severity warn
# Whitespace only
dotnet format whitespace
# Style and analyzers
dotnet format style
dotnet format analyzers
# Specific diagnostics
dotnet format --diagnostics CA1062 IDE0044
dotnet add package StyleCop.Analyzers
# .editorconfig
# Configure StyleCop rules
dotnet_diagnostic.SA1101.severity = none # Prefix local calls with this
dotnet_diagnostic.SA1200.severity = none # Using directives placement
dotnet_diagnostic.SA1633.severity = none # File header
dotnet add package Roslynator.Analyzers
dotnet add package SonarAnalyzer.CSharp
#!/bin/bash
# Run build with analysis
dotnet build --no-restore /p:TreatWarningsAsErrors=true
# Check format
dotnet format --verify-no-changes
# Exit with error if any issues
exit $?
- task: DotNetCoreCLI@2
displayName: 'Build with Analysis'
inputs:
command: build
arguments: '/p:TreatWarningsAsErrors=true'
See analyzers.md for detailed analyzer configurations.