askill
erroror-generator-specialist

erroror-generator-specialistSafety 90Repository

Specialized agent for ErrorOrX source generator - endpoint generation, parameter binding, Results() union types, and AOT compatibility

0 stars
1.2k downloads
Updated 2/8/2026

Package Files

Loading files...
SKILL.md

Source Metadata

frontmatter:
  model: opus
original_description: |
  Specialized agent for ErrorOrX source generator - endpoint generation, parameter binding, Results<> union types, and AOT compatibility

ErrorOrX Generator Specialist

Specialized agent for working with the ErrorOrX source generator.

When to Use

  • Modifying endpoint generation logic
  • Adding new diagnostics (EOE00XX)
  • Changing parameter binding rules
  • Extending middleware emission
  • AOT compatibility issues
  • Results<> union type generation

Repository Context

Path: /Users/ancplua/ErrorOrX Purpose: Source generator converting ErrorOr → ASP.NET Minimal API endpoints Targets: net10.0 (runtime), netstandard2.0 (generator)

Architecture

src/
├── ErrorOrX/                    # Runtime library
│   ├── ErrorOr.cs               # Core type
│   ├── ErrorOr.*.cs             # Extension methods
│   └── ErrorType.cs             # Error categories
└── ErrorOrX.Generators/         # Source generator
    ├── Core/
    │   ├── *.Initialize.cs      # Pipeline setup
    │   ├── *.Extractor.cs       # Syntax → model
    │   ├── *.Emitter.cs         # Model → code
    │   └── *.ParameterBinding.cs # Smart binding
    ├── Models/
    │   ├── EndpointModels.cs    # All data structures
    │   ├── ErrorMapping.cs      # Error → HTTP mapping
    │   └── Enums.cs             # Binding sources
    ├── TypeResolution/
    │   └── WellKnownTypes.cs    # FQN constants
    ├── Validation/
    │   ├── RouteValidator.cs    # Route validation
    │   └── DuplicateRouteDetector.cs
    └── Analyzers/
        └── Descriptors.cs       # All EOE diagnostics

Key Patterns

Minimal Interface Principle

// ✅ Correct - uses only IsError/Errors/Value
if (result.IsError) return ToProblem(result.Errors);
return TypedResults.Ok(result.Value);

// ❌ Avoid - creates dependency on convenience API
return result.Match(v => Ok(v), e => ToProblem(e));

AOT Wrapper Pattern

// Wrapper matches RequestDelegate (HttpContext → Task)
private static async Task Invoke_Ep1(HttpContext ctx)
{
    var __result = await Invoke_Ep1_Core(ctx);
    await __result.ExecuteAsync(ctx);
}

// Core returns typed Results<...> for OpenAPI
private static Task<Results<Ok<T>, NotFound<ProblemDetails>>> Invoke_Ep1_Core(...)

Smart Parameter Binding

PriorityConditionBinding
1Explicit attributeAs specified
2Special typesAuto-detected
3Name matches route {param}Route
4Primitive not in routeQuery
5Interface/AbstractService
6POST/PUT/PATCH + complexBody
7GET/DELETE + complexEOE025 error

Big Picture

  • Source of Truth: ANcpLua.Roslyn.Utilities for generator helpers
  • Uses: EquatableArray, DiagnosticFlow, TypeSymbolExtensions
  • Consumed by: Any project wanting ErrorOr → Minimal API conversion

Build & Test

dotnet build ErrorOrX.slnx
dotnet test --solution ErrorOrX.slnx

Diagnostics (EOE001-EOE054)

RangeCategory
EOE001-005Core validation
EOE006-016Parameter binding
EOE023-025Route constraints
EOE030-033Result types
EOE040-041JSON/AOT
EOE050-054API versioning

Key Files

FilePurpose
Models/EndpointModels.csAll data structures
Models/ErrorMapping.csError → HTTP mapping
TypeResolution/WellKnownTypes.csFQN constants
Analyzers/Descriptors.csAll diagnostics

Ecosystem Context

For cross-repo relationships and source-of-truth locations, invoke:

/ancplua-ecosystem

This skill provides the full dependency hierarchy, what NOT to duplicate from upstream, and version coordination requirements.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

88/100Analyzed 2/13/2026

A high-quality, specialized technical reference for the ErrorOrX source generator. It provides excellent context, architectural details, specific coding patterns, and diagnostic references. While highly specific to a single project (indicated by the .codex path and local file references), the content is dense, accurate, and highly actionable for an agent working in that context.

90
95
30
92
88

Metadata

Licenseunknown
Version-
Updated2/8/2026
PublisherANcpLua

Tags

apici-cdtesting