Arkn.Analyzers 0.3.2

dotnet add package Arkn.Analyzers --version 0.3.2
                    
NuGet\Install-Package Arkn.Analyzers -Version 0.3.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Arkn.Analyzers" Version="0.3.2">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Arkn.Analyzers" Version="0.3.2" />
                    
Directory.Packages.props
<PackageReference Include="Arkn.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Arkn.Analyzers --version 0.3.2
                    
#r "nuget: Arkn.Analyzers, 0.3.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Arkn.Analyzers@0.3.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Arkn.Analyzers&version=0.3.2
                    
Install as a Cake Addin
#tool nuget:?package=Arkn.Analyzers&version=0.3.2
                    
Install as a Cake Tool

Arkn.Analyzers

Conventions you can read. Patterns you can enforce.

Roslyn analyzers that enforce Arkn patterns at compile time. Part of Arkn.Copilot — making your codebase ready for AI-assisted development.

Install

dotnet add package Arkn.Analyzers

This package is a development dependency — it doesn't ship with your application.

Rules

ID Description Severity
ARK001 Domain methods must return Result or Result<T> — not throw Warning
ARK002 Error codes must follow Namespace.Reason pattern (e.g. User.NotFound) Warning
ARK003 Result / Result<T> must not be silently discarded Warning
ARK004 IArknJob.ExecuteAsync must return Task<Result> or Task<Result<T>> Error
ARK005 Avoid using raw HttpClient — extend ArknHttpClient instead Warning
ARK006 Prefer IArknLogger over MEL ILogger or Console in Arkn components Warning
ARK007 Domain methods must not use throw new — return Result.Failure instead Warning
ARK008 catch blocks must not swallow exceptions silently Warning

ARK001 includes a code fix that wraps the return type in Result<T> automatically.

ARK005 — Avoid raw HttpClient

// ❌ ARK005
var client = new HttpClient();
client.GetAsync("https://api.example.com");

// ✅ Use typed client via AddArknHttp
builder.Services.AddArknHttp<PaymentClient>("https://api.pay.com");

ARK006 — Prefer IArknLogger

// ❌ ARK006
public class MyService(ILogger<MyService> logger) { ... }
// ❌ Also triggers
Console.WriteLine("something happened");

// ✅ Use IArknLogger for structured, sink-routed logging
public class MyService(IArknLogger logger) { ... }

Copilot-ready

Also ships with IDE instruction files in the Arkn repository:

  • .github/copilot-instructions.md — GitHub Copilot
  • .cursor/rules/arkn.mdc — Cursor
  • CLAUDE.md — Claude Code and AI agents

Suppressing a rule

#pragma warning disable ARK005
var client = new HttpClient(); // legacy code, tracked in #1234
#pragma warning restore ARK005

Part of the Arkn ecosystem

github.com/fernando-terra/arkn · nuget.org/packages/Arkn.Analyzers

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.2 134 5/30/2026
0.3.1 123 5/28/2026
0.3.0 113 5/6/2026
0.2.0 104 5/6/2026
0.1.6 104 5/4/2026
0.1.5 105 5/4/2026
0.1.4 111 5/4/2026
0.1.3 108 5/4/2026
0.1.2 106 5/4/2026
0.1.1 106 5/4/2026
0.1.0 109 5/4/2026