aspnet-api-development

Diagnose and remediate ASP.NET Core API authentication and EF Core schema failures.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/ecnepsyroc-bot/Dejavara --skill aspnet-api-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aspnet-api-development
Source: https://github.com/ecnepsyroc-bot/Dejavara/tree/main/deploy/skills/aspnet-api-development
Command: npx skills add https://github.com/ecnepsyroc-bot/Dejavara --skill aspnet-api-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides targeted operational patterns and remediation steps for ASP.NET Core APIs in Cambium to prevent and recover from authentication failures, EF Core schema drift, startup migration breakages, and connection string/configuration misparsing that cause widespread endpoint outages.

Core Features & Use Cases

  • Smart PolicyScheme (Dual Auth): Guidance to implement a selector that chooses JWT or cookie authentication based on the Authorization header to avoid SPA redirects and ensure correct 401 handling.
  • EF Core Column-Drift Detection & Recovery: Practices to detect PostgreSQL 42703 column-missing failures, a per-ALTER self-healing pattern that isolates failures, and a post-heal verification step to assert expected columns exist.
  • Safe Startup & Migration Policy: Instructions to run non-destructive ALTER statements with individual try/catch, avoid MigrateAsync to prevent destructive Railway behavior, and manage migrations via scripts or manual application.
  • Railway DATABASE_URL Parsing & DataProtection Persistence: Exact parsing approach for Railway's DATABASE_URL and the requirement to persist DataProtection keys to the database to avoid silent cookie invalidation after restarts.
  • Use Case Examples: Recover from a 42703 error that crashes logins, stop SPA clients receiving 302 redirects on API calls, and rehydrate DataProtection keys after a fresh Railway deploy.

Quick Start

Use the aspnet-api-development skill to analyze a Cambium API issue (401, 42703, or missing DataProtection keys) and produce a prioritized remediation plan with self-heal ALTER statements and verification queries.

Frequently Asked Questions about aspnet-api-development

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

FAQPage Schema
Why does my ASP.NET Core API return 302 redirects instead of 401 Unauthorized for SPA clients?

ASP.NET Core APIs return 302 redirects for SPA clients when authentication schemes are misconfigured. Implementing a Smart PolicyScheme selector that dynamically chooses JWT or cookie authentication based on the Authorization header ensures correct 401 handling and prevents unwanted redirects.

How do I fix PostgreSQL 42703 column-missing errors in EF Core?

To fix PostgreSQL 42703 column-missing errors in EF Core, apply a per-statement self-healing ALTER routine. This non-destructive pattern isolates failures with individual try/catch blocks and includes a post-heal verification step to assert expected columns exist.

Should I use MigrateAsync for database schema changes on Railway?

You should not use MigrateAsync for database schema changes on Railway to prevent destructive behavior. Manage migrations via scripts or manual application instead, using non-destructive ALTER statements with per-alter error handling to safely update schemas.

How do I parse Railway DATABASE_URL for Npgsql connection strings in ASP.NET Core?

Parse Railway DATABASE_URL for Npgsql connection strings by explicitly extracting the database credentials from the URL format. This exact parsing approach ensures ASP.NET Core APIs correctly configure database connections and avoid misconfiguration startup failures.

Why are user cookies invalidated after an ASP.NET Core app restart on Railway?

User cookies are invalidated after an ASP.NET Core app restart on Railway because DataProtection keys are lost. Persisting DataProtection keys to the PostgreSQL database ensures keys rehydrate after fresh deploys and prevents silent cookie invalidation.

Can I use this Skill to diagnose EF Core schema drift on platforms other than Railway?

You can use the EF Core schema drift detection patterns for any PostgreSQL setup, but the explicit DATABASE_URL parsing and DataProtection persistence instructions are tailored for ASP.NET Core 8 APIs using Npgsql specifically deployed on Railway.