
Meziantou Analyzer
- 17 installs
- 466 repo stars
- Updated July 25, 2026
- managedcode/dotnet-skills
Helps with ai & agent building tasks.
About
meziantou-analyzer is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- meziantou-analyzer
- AI & Agent Building
- AI-coding skill
Meziantou Analyzer by the numbers
- 17 all-time installs (skills.sh)
- +1 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #10,886 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/managedcode/dotnet-skills --skill meziantou-analyzerAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 17 |
|---|---|
| repo stars | ★ 466 |
| Last updated | July 25, 2026 |
| Repository | managedcode/dotnet-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
Meziantou.Analyzer
Trigger On
- the repo uses or wants
Meziantou.Analyzer - the team wants one analyzer pack that covers design, usage, security, performance, and style
Value
- produce a concrete project delta: code, docs, config, tests, CI, or review artifact
- reduce ambiguity through explicit planning, verification, and final validation skills
- leave reusable project context so future tasks are faster and safer
Do Not Use For
- repos that already enforce an overlapping analyzer baseline and do not want extra diagnostics
- formatting-only work
Inputs
- the nearest
AGENTS.md - current analyzer packages
.editorconfig
Quick Start
1. Read the nearest AGENTS.md and confirm scope and constraints. 2. Run this skill's Workflow through the Ralph Loop until outcomes are acceptable. 3. Return the Required Result Format with concrete artifacts and verification evidence.
Workflow
1. Add Meziantou.Analyzer when the repo wants broader rules than the SDK baseline. 2. Keep rule severity in the repo-root .editorconfig. 3. Review overlaps with SDK analyzers and Roslynator before mass-enabling everything as errors.
Bootstrap When Missing
If Meziantou.Analyzer is not configured yet:
1. Detect current state:
rg -n "Meziantou\\.Analyzer" -g '*.csproj' .
2. Add the package to the intended scope (project-level or shared props strategy):
dotnet add PROJECT.csproj package Meziantou.Analyzer
3. Set severity in root .editorconfig for the enabled MAxxxx rules. 4. Keep overlap with SDK analyzers and Roslynator explicit to avoid duplicate noise. 5. Run dotnet build SOLUTION_OR_PROJECT and return status: configured or status: improved. 6. If the repo intentionally keeps a smaller analyzer surface, return status: not_applicable.
Deliver
- explicit Meziantou package setup
- repo-owned severity and warning policy
Validate
- the added rules are understood by the team
- CI runs stay actionable instead of noisy
Ralph Loop
Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.
1. Plan first (mandatory):
- analyze current state
- define target outcome, constraints, and risks
- write a detailed execution plan
- list final validation skills to run at the end, with order and reason
2. Execute one planned step and produce a concrete delta. 3. Review the result and capture findings with actionable next fixes. 4. Apply fixes in small batches and rerun the relevant checks or review steps. 5. Update the plan after each iteration. 6. Repeat until outcomes are acceptable or only explicit exceptions remain. 7. If a dependency is missing, bootstrap it or return status: not_applicable with explicit reason and fallback path.
Required Result Format
status:complete|clean|improved|configured|not_applicable|blockedplan: concise plan and current iteration stepactions_taken: concrete changes madevalidation_skills: final skills run, or skipped with reasonsverification: commands, checks, or review evidence summaryremaining: top unresolved items ornone
For setup-only requests with no execution, return status: configured and exact next commands.
Load References
- references/meziantou-analyzer.md
- references/rules.md
- references/config.md
Example Requests
- "Add Meziantou analyzers to the repo."
- "Use Meziantou for extra quality and security checks."
{
"version": "1.0.0",
"category": "Code Quality",
"packages": [
"Meziantou.Analyzer"
]
}
Meziantou.Analyzer EditorConfig Configuration
Basic Setup
Add configuration to the root .editorconfig file to control rule severities.
Severity Levels
none- Disable the rulesilent- Hidden from user, still runssuggestion- Shows as info messagewarning- Shows as warningerror- Shows as error, fails build
Recommended Starter Configuration
[*.cs]
# === Meziantou.Analyzer Configuration ===
# String handling - enforce explicit culture
dotnet_diagnostic.MA0001.severity = warning
dotnet_diagnostic.MA0002.severity = warning
dotnet_diagnostic.MA0006.severity = warning
dotnet_diagnostic.MA0011.severity = warning
dotnet_diagnostic.MA0074.severity = warning
dotnet_diagnostic.MA0076.severity = warning
# Async best practices
dotnet_diagnostic.MA0004.severity = warning
dotnet_diagnostic.MA0040.severity = warning
dotnet_diagnostic.MA0042.severity = warning
dotnet_diagnostic.MA0045.severity = warning
dotnet_diagnostic.MA0067.severity = warning
# Performance
dotnet_diagnostic.MA0005.severity = warning
dotnet_diagnostic.MA0020.severity = warning
dotnet_diagnostic.MA0028.severity = warning
dotnet_diagnostic.MA0029.severity = warning
dotnet_diagnostic.MA0031.severity = warning
dotnet_diagnostic.MA0063.severity = suggestion
# Design
dotnet_diagnostic.MA0015.severity = warning
dotnet_diagnostic.MA0025.severity = warning
dotnet_diagnostic.MA0047.severity = warning
# Security
dotnet_diagnostic.MA0014.severity = error
dotnet_diagnostic.MA0035.severity = error
dotnet_diagnostic.MA0055.severity = warning
# Regex
dotnet_diagnostic.MA0009.severity = suggestion
dotnet_diagnostic.MA0110.severity = suggestion
# Style - often project-specific
dotnet_diagnostic.MA0003.severity = none
dotnet_diagnostic.MA0026.severity = none
dotnet_diagnostic.MA0048.severity = none
dotnet_diagnostic.MA0051.severity = none
dotnet_diagnostic.MA0053.severity = noneLibrary Configuration
Libraries should be stricter about async patterns and public API design:
[*.cs]
# Library-specific: require ConfigureAwait
dotnet_diagnostic.MA0004.severity = error
# Public API design
dotnet_diagnostic.MA0011.severity = error
dotnet_diagnostic.MA0015.severity = error
dotnet_diagnostic.MA0016.severity = error
dotnet_diagnostic.MA0018.severity = warningApplication Configuration
Applications can be more relaxed about some rules:
[*.cs]
# Applications may not need ConfigureAwait
dotnet_diagnostic.MA0004.severity = none
# More relaxed on certain design rules
dotnet_diagnostic.MA0053.severity = suggestionTest Project Configuration
Test projects often need different rules:
[**/Tests/**/*.cs]
[**/Test/**/*.cs]
[**/*.Tests/**/*.cs]
# Disable sealed class requirement for test fixtures
dotnet_diagnostic.MA0053.severity = none
# Allow longer methods in tests
dotnet_diagnostic.MA0051.severity = none
# Allow TODO comments in tests
dotnet_diagnostic.MA0026.severity = none
# Tests may have blocking calls
dotnet_diagnostic.MA0042.severity = suggestion
dotnet_diagnostic.MA0045.severity = suggestionGenerated Code Configuration
Exclude generated files from analysis:
[*.Generated.cs]
[*.g.cs]
[*.designer.cs]
generated_code = trueCombining with Other Analyzers
When using Meziantou.Analyzer with other analyzers, avoid duplicate diagnostics:
With Roslynator
# Roslynator RCS1197 overlaps with MA0020 (LINQ optimization)
# Pick one and disable the other
dotnet_diagnostic.RCS1197.severity = none
dotnet_diagnostic.MA0020.severity = warning
# Roslynator RCS1075 overlaps with MA0042 (async blocking)
dotnet_diagnostic.RCS1075.severity = none
dotnet_diagnostic.MA0042.severity = warningWith StyleCop
# StyleCop SA1649 overlaps with MA0048 (file naming)
# Pick one and disable the other
dotnet_diagnostic.SA1649.severity = none
dotnet_diagnostic.MA0048.severity = warningRule-Specific Options
Some Meziantou rules support additional configuration:
MA0051 - Method Length
# Configure maximum method length
MA0051.maximum_lines_per_method = 60
MA0051.maximum_statements_per_method = 40MA0053 - Sealed Classes
# Configure when to suggest sealing
MA0053.public_class_should_be_sealed = trueMigration Strategy
When adding Meziantou.Analyzer to an existing project:
Phase 1: Start with suggestions
[*.cs]
dotnet_analyzer_diagnostic.category-Meziantou.severity = suggestionPhase 2: Gradually increase severity
[*.cs]
# Keep most as suggestions
dotnet_analyzer_diagnostic.category-Meziantou.severity = suggestion
# Promote critical rules to warnings
dotnet_diagnostic.MA0001.severity = warning
dotnet_diagnostic.MA0004.severity = warning
dotnet_diagnostic.MA0040.severity = warningPhase 3: Enforce in CI
[*.cs]
dotnet_analyzer_diagnostic.category-Meziantou.severity = warning
# Security rules as errors
dotnet_diagnostic.MA0014.severity = error
dotnet_diagnostic.MA0035.severity = errorCI Integration
Build with warnings as errors for enforced rules:
dotnet build -warnaserror:MA0001,MA0004,MA0014,MA0035,MA0040Or use the global setting:
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>Sources
Meziantou.Analyzer
Open/Free Status
- open source
- free to use
Install
dotnet add package Meziantou.AnalyzerVerify First
Before adding the package, check whether the repo already references it:
rg -n "Meziantou\\.Analyzer" -g '*.csproj' .Common Usage
dotnet build MySolution.sln -warnaserrorConfigure severity in .editorconfig, for example:
[*.cs]
dotnet_diagnostic.MA0004.severity = warningCI Fit
- use
dotnet buildas the main enforcement gate - keep severities explicit in repo config
When Not To Use
- when the repo already decided the analyzer surface is intentionally smaller
Sources
Meziantou.Analyzer Rules
Rule Categories
Meziantou.Analyzer organizes rules into several categories:
- Design - API design and architecture patterns
- Usage - Correct API usage and common pitfalls
- Security - Security best practices
- Performance - Performance optimizations
- Style - Code style and readability
Commonly Used Rules
Design Rules
| Rule ID | Description |
|---|---|
| MA0004 | Use ConfigureAwait(false) in library code |
| MA0006 | Use string.Equals instead of == for case-insensitive comparisons |
| MA0011 | IFormatProvider is missing |
| MA0015 | Specify the parameter name in ArgumentException |
| MA0025 | Implement the functionality instead of throwing NotImplementedException |
| MA0026 | Fix TODO comment |
| MA0051 | Method is too long |
| MA0053 | Make class sealed |
Usage Rules
| Rule ID | Description |
|---|---|
| MA0001 | StringComparison is missing |
| MA0002 | IEqualityComparer<string> or StringComparer is missing |
| MA0003 | Add parameter name to improve readability |
| MA0005 | Use Array.Empty<T>() instead of a new empty array allocation |
| MA0009 | Add RegexOptions.ExplicitCapture to Regex |
| MA0010 | Mark attributes with AttributeUsageAttribute |
| MA0018 | Do not declare static members on generic types |
| MA0020 | Use direct methods instead of LINQ when available |
Security Rules
| Rule ID | Description |
|---|---|
| MA0007 | Add a comma after the last value |
| MA0008 | Add StructLayoutAttribute |
| MA0014 | Do not raise reserved exceptions |
| MA0035 | Do not use dangerous threading methods |
| MA0036 | Make class static |
| MA0055 | Do not use finalizer |
| MA0067 | Use Task.FromResult instead of creating a new Task |
Performance Rules
| Rule ID | Description |
|---|---|
| MA0028 | Optimize StringBuilder usage |
| MA0029 | Combine LINQ methods |
| MA0031 | Optimize Enumerable.Count() usage |
| MA0032 | Use an overload with a StringComparer parameter |
| MA0033 | Do not convert implicitly to DateTimeOffset |
| MA0040 | Forward the CancellationToken parameter to methods that take one |
| MA0041 | Make property static |
| MA0042 | Do not use blocking calls in an async method |
| MA0045 | Do not use blocking calls in an async method |
| MA0063 | Use Where before OrderBy |
| MA0110 | Use the Regex source generator |
Style Rules
| Rule ID | Description |
|---|---|
| MA0038 | Make method static |
| MA0043 | Use nameof operator |
| MA0047 | Declare types in namespaces |
| MA0048 | File name must match type name |
| MA0049 | Type should not implement ToString() with IFormatProvider parameter |
| MA0050 | Validate arguments correctly in iterator methods |
| MA0052 | Replace Substring with Range indexer |
| MA0076 | Do not use implicit culture-sensitive ToString() |
High-Value Rules for New Projects
When starting a new project, consider enabling these rules as errors:
# Async best practices
dotnet_diagnostic.MA0004.severity = error
dotnet_diagnostic.MA0040.severity = error
dotnet_diagnostic.MA0042.severity = error
# String handling
dotnet_diagnostic.MA0001.severity = error
dotnet_diagnostic.MA0006.severity = error
dotnet_diagnostic.MA0011.severity = error
# Performance
dotnet_diagnostic.MA0005.severity = error
dotnet_diagnostic.MA0020.severity = error
dotnet_diagnostic.MA0029.severity = error
# Design
dotnet_diagnostic.MA0015.severity = error
dotnet_diagnostic.MA0053.severity = errorRules to Consider Disabling
Some rules may conflict with project style or be too strict:
| Rule ID | Reason to Disable |
|---|---|
| MA0003 | Parameter names may clutter simple method calls |
| MA0026 | TODO comments are valid during development |
| MA0051 | Method length thresholds may be too restrictive |
| MA0053 | Sealed classes may conflict with testing frameworks |
| MA0048 | File naming conventions may differ |
Rule Interaction Notes
- MA0001 and MA0006 both deal with string comparisons; enable both for complete coverage
- MA0004 is essential for library code but can be disabled for application code
- MA0040, MA0042, and MA0045 all relate to async patterns; keep them aligned
- MA0020, MA0029, MA0031, and MA0063 overlap with LINQ optimization; configure consistently