csharp_error_policy_extraction

Extracts the de-facto error handling policy from C# source into a structured Markdown report.

4|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/synthaicode/XRefKit --skill csharp-error-policy-extraction-synthaicode
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: csharp_error_policy_extraction
Source: https://github.com/synthaicode/XRefKit/tree/main/skills/csharp_error_policy_extraction
Command: npx skills add https://github.com/synthaicode/XRefKit --skill csharp-error-policy-extraction-synthaicode

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? C# codebases accumulate inconsistent error handling over time—mixed catch strategies, silent swallows, and contradictory retry policies—making it risky to change error handling or unify conventions without first knowing what the code actually does. This Skill scans C# source and makes the implemented error policy explicit as evidence-backed documentation. ## Core Features & Use Cases - Error-Handling Inventory: Catalogs throw sites (distinguishing throw; from throw ex;), catch blocks by kind, custom exception types, global handlers, and .NET-specific paths like async void, fire-and-forget tasks, sync-over-async, and DI composition root throws. - Category x Disposition Matrix: Classifies each item into error categories (configuration, transient, invariant_violation, external_input) and dispositions (fail-fast, propagate, translate, retry, degrade, swallow, log-only), presenting majority dispositions as de-facto policy candidates. - Contradiction Detection and Coverage Limits: Records same-category behavioral contradictions with adjudication material for human decisions, plus a mandatory coverage-limits section documenting what the scan could not see. - Use Case: Before unifying exception handling across a .NET solution, run this Skill on the repository to get a report showing that transient errors are mostly retried in one module but swallowed in another, with file:line evidence for each contradiction. ## Quick Start Ask the AI to extract the de-facto error policy from your C# solution at a given path and produce the error-policy report at an output path you specify.

Frequently Asked Questions about csharp_error_policy_extraction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I document the error handling policy of a C# codebase?▼

Run this Skill against the repository, solution, or project path. It scans throw sites, catch blocks, custom exceptions, and global handlers, then produces a Markdown report with an inventory, category-by-disposition matrix, and de-facto policy candidates backed by file:line evidence.

How to find inconsistent exception handling in .NET projects?▼

The Skill's Phase 3 contradiction detection groups same-category items with differing dispositions, records each behavior, checks whether placement explains the difference, and compiles adjudication material so a human can decide which disposition should become the rule.

Does this tool fix or refactor C# error handling code?▼

No. It performs extraction only and never modifies code or decides what the policy should be. Suspected defects are handed off to a code review Skill and security gaps to a security review Skill instead of being fixed in place.

What .NET-specific error paths does the analysis cover?▼

It covers async void methods, fire-and-forget tasks, sync-over-async calls like .Result and .Wait(), DI composition root throws including IOptions validation and IHostedService failures, and Dispose/DisposeAsync exception handling, plus global handlers such as ASP.NET Core middleware.

What are the limitations of static error policy extraction?▼

Omission policies like null returns and Try* patterns are detected only within declared search patterns and are not exhaustive. Dynamic exception paths through reflection or delegates and third-party library internal swallowing are invisible, and these limits are recorded in the mandatory coverage-limits section.