polyfill-dotnet-api

Identify missing .NET BCL APIs on net472 and apply the appropriate polyfill source.

9|1|Updated Jun 6, 2025
One-click install
npx skills add https://github.com/JeremyKuhne/touki --skill polyfill-dotnet-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: polyfill-dotnet-api
Source: https://github.com/JeremyKuhne/touki/tree/main/.agents/skills/polyfill-dotnet-api
Command: npx skills add https://github.com/JeremyKuhne/touki --skill polyfill-dotnet-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Polyfill a modern .NET BCL API for .NET Framework to enable downlevel usage of newer APIs missing on net472 by selecting the correct source (Microsoft package, PolySharp, or hand-rolled polyfill) and capturing recurring design gotchas.

Core Features & Use Cases

  • Source selection: chooses between Microsoft-shipped packages, PolySharp source-gen, and hand-rolled polyfills based on availability.
  • Design rules & parity: ensures behavior parity with modern BCL surfaces including edge cases and allocation strategies.
  • Use Case: when a required API is absent on net472, automatically determine the best polyfill and surface a compatible API surface.

Quick Start

Identify a missing API on net472 and apply the appropriate polyfill source to restore parity.

Frequently Asked Questions about polyfill-dotnet-api

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

FAQPage Schema
How do I use modern .NET BCL APIs in .NET Framework 4.72?

To use modern .NET BCL APIs in .NET Framework 4.72, you need to apply a polyfill that restores API parity by selecting the correct source like Microsoft packages, PolySharp, or hand-rolled code. This identifies the exact missing API surface and implements the appropriate compatibility layer.

What is the best way to polyfill missing .NET APIs across frameworks?

The best way to polyfill missing .NET APIs is to evaluate availability and select the optimal source, choosing between Microsoft-shipped packages, PolySharp source generators, or hand-rolled polyfills. This approach ensures behavior parity with modern BCL surfaces while capturing recurring design gotchas.

How do I choose between PolySharp and Microsoft packages for .NET polyfills?

Choosing between PolySharp and Microsoft packages depends on availability and your project's source-selection rules. PolySharp provides source-generated polyfills, while Microsoft packages offer shipped binaries, and hand-rolled polyfills handle custom edge cases to ensure full behavior parity.

Does polyfilling .NET BCL APIs ensure behavior parity with modern frameworks?

Polyfilling .NET BCL APIs ensures behavior parity with modern frameworks by matching the modern API surface including edge cases and allocation strategies. It updates tests, documentation, and compatibility notes to accurately reflect the selected polyfill approach.

When do I need a hand-rolled polyfill instead of a source generator for .NET?

You need a hand-rolled polyfill when Microsoft packages or PolySharp source generation cannot adequately cover the required API surface or handle specific edge cases. It restores downlevel usage by manually implementing the missing BCL API behavior for net472.