본문으로 건너뛰기
cccskills
무료GitHub에 공개

dotnet-roslyn-analyzers

Authors Roslyn analyzers. DiagnosticAnalyzer, CodeFixProvider, CodeRefactoring, multi-version.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Roslyn Analyzer Hooks

Overview

Comprehensive Roslyn analyzer integration for dotnet-agent-harness providing real-time code analysis through agent hooks and enforced quality gates via git hooks.

Architecture

Layer 1: Agent-Level Hooks (Real-time)

  • Trigger: Post-edit on .cs files
  • Execution: Async with 60s timeout
  • Scope: Single file analysis
  • Output: JSON with violations + skill recommendations

Layer 2: Git Hooks (Commit/Push)

  • pre-commit: Staged files analysis + dotnet format
  • pre-push: Full solution build + tests + doc validation
  • Enforcement: Blocks on errors and warnings

Configuration

Environment Variables

# Skip all analyzer checks (default: false, analyzers run by default)
export DOTNET_AGENT_HARNESS_SKIP_ANALYZERS=true

# Configure timeout (default: 60 seconds)
export DOTNET_AGENT_HARNESS_ANALYZER_TIMEOUT=120

# Minimum severity to report (Error/Warning/Info)
export DOTNET_AGENT_HARNESS_ANALYZER_SEVERITY=Warning

# Execution mode (sync/async)
export DOTNET_AGENT_HARNESS_ANALYZER_MODE=async

Project-Level (.editorconfig)

[*.cs]
# Enable all analyzers
dotnet_analyzer_diagnostic.severity = warning

# Category-based configuration
dotnet_analyzer_diagnostic.category-security.severity = error
dotnet_analyzer_diagnostic.category-performance.severity = warning

# Specific rule overrides
dotnet_diagnostic.CA2007.severity = suggestion  # ConfigureAwait
dotnet_diagnostic.CA1816.severity = error       # GC.SuppressFinalize

Analyzer Packages

Essential (Always Enabled)

  • Microsoft.CodeAnalysis.NetAnalyzers - Built-in .NET analyzers
  • Roslynator.Analyzers - Refactoring and code improvements
  • Roslynator.CodeAnalysis.Analyzers - Code analysis rules
  • Roslynator.Formatting.Analyzers - Formatting rules

Optional

  • StyleCop.Analyzers - Style consistency (enable/disable via EnableStyleCop)
  • Meziantou.Analyzer - Performance analyzers (EnableMeziantouAnalyzer)

CI Only (High Performance Impact)

  • SonarAnalyzer.CSharp - Security and code smells (+522% build time)

Analyzer-to-Skill Routing

Analyzer CodeSkillDescription
CA2007dotnet-csharp-async-patternsDo not directly await a Task
CA2008dotnet-csharp-async-patternsTaskScheduler required
CA1816dotnet-gc-memoryGC.SuppressFinalize
CA2000dotnet-gc-memoryDispose objects before losing scope
CA1822dotnet-performance-patternsMark members as static
CA1860dotnet-performance-patternsAvoid Enumerable.Any()
CA2100dotnet-security-owaspSQL injection prevention
CA5350dotnet-security-owaspWeak cryptographic algorithms
CA1001dotnet-architecture-patternsIDisposable pattern
CA1063dotnet-architecture-patternsImplement IDisposable correctly

Full mappings in .rulesync/analyzer-to-skill.json

Git Hooks Installation

Automatic (Recommended)

# Run setup script
bash .githooks/setup.sh

Manual

# Copy hooks to .git/hooks/
cp .githooks/pre-commit .git/hooks/
cp .githooks/pre-push .git/hooks/
chmod +x .git/hooks/pre-commit .git/hooks/pre-push

Bypass Hooks

# Skip analyzer checks for this commit
DOTNET_AGENT_HARNESS_SKIP_ANALYZERS=true git commit -m "message"

# Bypass all hooks (not recommended)
git commit --no-verify -m "message"

Performance Considerations

ConfigurationBuild Time ImpactWhen to Use
NetAnalyzers only+15%Development (default)
+ Roslynator+98%Development with refactoring
+ StyleCop+49%Style enforcement
Full Suite (CI)+522%CI/CD pipelines only

Troubleshooting

Analysis Timeouts

Increase timeout:

export DOTNET_AGENT_HARNESS_ANALYZER_TIMEOUT=120

Memory Issues

For large solutions, disable heavy analyzers:

<PropertyGroup>
  <RunSonarAnalyzer>false</RunSonarAnalyzer>
</PropertyGroup>

False Positives

Disable specific rules in .editorconfig:

dotnet_diagnostic.CA1707.severity = none

References

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Patterns and techniques for evaluating and improving AI agent outputs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

Comprehensive AI prompt engineering safety review and improvement prompt. Analyzes prompts for safety, bias, security vulnerabilities, and effectiveness while providing detailed improvement recommendations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

Use when user requests research requiring multiple sources, comprehensive analysis, or synthesis across topics - technical research, domain knowledge gathering, market analysis, or learning about complex subjects

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

deep-wiki

무료

AI-powered wiki generation for code repositories with commands, agents, and skills

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

Use when building .NET 10 or C# 14 applications; when using minimal APIs, modular monolith patterns, or feature folders; when implementing HTTP resilience, Options pattern, Channels, or validation; when seeing outdated patterns like old extension method syntax

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

Implements accessible .NET UI. SemanticProperties, ARIA, AutomationPeer, testing per platform.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

rudironsoni의 스킬 모두 보기

이 스킬의 문제 신고