add-dotnet-aot-command

Migrate and validate dotnet CLI commands for Native AOT execution with managed fallback.

1.2k|337|Updated Oct 13, 2022
One-click install
npx skills add https://github.com/dotnet/dotnet --skill add-dotnet-aot-command
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-dotnet-aot-command
Source: https://github.com/dotnet/dotnet/tree/main/src/sdk/.github/skills/add-dotnet-aot-command
Command: npx skills add https://github.com/dotnet/dotnet --skill add-dotnet-aot-command

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrating a dotnet CLI command into the Native AOT CLI (src/Cli/dotnet-aot) requires preserving the managed CLI contract, defining eligibility allowlists with a clean fallback commit point, and proving the actual native artifact works. This Skill provides the author and reviewer workflow, closure rules, and validation ladder to do that correctly.

Core Features & Use Cases

  • AOT Migration Workflow: Measure the managed behavior contract, define eligibility allowlists, reuse shared managed sources, and extend AotSourceFiles.props and AotDependencies.props without duplicating command definitions.
  • Review Rubric: Reconstruct both execution paths, attack the allowlist with unknown options and ambiguous operands, audit closure and binary size, and challenge claims against the validation matrix.
  • Validation Ladder: Run focused parser tests, clean closure builds, Native AOT publish, native-published test suites, dn integration with Compare mode, separated SDK-root layouts, and size/platform evidence.
  • Use Case: When enabling a new command in the Native AOT CLI, follow the workflow to add sources to the props files, write fallback predicates before any mutation, and prove parity with run-dn.ps1 in Compare mode.

Quick Start

Ask the AI to migrate a specific dotnet CLI command to the Native AOT CLI and validate it with the dn harness in Compare mode.

Frequently Asked Questions about add-dotnet-aot-command

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

FAQPage Schema
How do I add a dotnet CLI command to the Native AOT CLI?

Measure the managed command's behavior contract first, then define an eligibility allowlist, reuse the managed owner's shared sources, and extend AotSourceFiles.props and AotDependencies.props. Validate with clean builds, Native AOT publish, native tests, and the dn harness in Compare mode.

How do I review a Native AOT migration PR for the dotnet CLI?

Trace both execution paths and confirm every fallback predicate completes before output, mutation, or process launch. Attack the allowlist with unknown options and ambiguous operands, audit the dependency closure and binary size, and require native test evidence rather than compilation alone.

Why does AppContext.BaseDirectory fail in the Native AOT CLI?

In the AOT bubble, AppContext.BaseDirectory and ProcessPath point to the muxer install root, and Assembly.Location is empty with an IL3000 error. Use SdkPaths.SdkDirectory or the Microsoft.DotNet.Sdk.Root AppContext value published by NativeEntryPoint instead.

When should a command fall back to managed execution in dotnet-aot?

Fallback is required for unknown options, ambiguous operands, dynamic parser extensions, and unsupported input combinations. All fallback predicates must complete before any output, telemetry ownership, file mutation, restore, build, or process launch.

What are the limitations of Native AOT CLI validation?

Compilation does not prove ILC compatibility, and managed or in-process tests do not prove native behavior. Cross-OS publish is not an execution result, flat layouts hide SDK-root defects, and skipped native tests provide no evidence.