csharp-scripts

Run C# file-based applications directly with the .NET CLI.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/1k-off/umbraco-observability-playground --skill csharp-scripts-1k-off
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-scripts
Source: https://github.com/1k-off/umbraco-observability-playground/tree/main/.agents/skills/csharp-scripts
Command: npx skills add https://github.com/1k-off/umbraco-observability-playground --skill csharp-scripts-1k-off

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the friction of turning small C# ideas into runnable code without creating a full .NET project with full boilerplate and configuration.

Core Features & Use Cases

  • Execute one-file (or small multi-file) C# apps via the .NET CLI, ideal for rapid experiments and utilities.
  • Compose apps using file directives such as #:include, #:exclude, and transitive directives for multi-file builds.
  • Add capabilities on demand with directives like #:package, #:property, #:sdk, and #:ref for package references, MSBuild tuning, SDK selection, and assembly-boundary composition.
  • Use-case example: verify how JSON serialization behaves under native AOT by writing a tiny console-style app that uses source-generated System.Text.Json context, then iterate quickly.

Quick Start

Ask the assistant to generate a file-based C# app that prints a result, then run it with dotnet <yourfile>.cs.

Frequently Asked Questions about csharp-scripts

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

FAQPage Schema
How do I run a C# file without creating a full .NET project?

You can run a C# file directly using the .NET CLI with the command dotnet <file>.cs, which executes file-based applications without requiring a full project structure or boilerplate configuration.

What are C# file directives like #:include and #:package used for?

C# file directives manage multi-file builds and capabilities in file-based apps. Use #:include or #:exclude for file composition, and #:package, #:property, #:sdk, or #:ref to add package references and tune MSBuild settings.

Does .NET CLI support running multi-file C# programs?

Yes, the .NET CLI supports small multi-file C# programs by using #:include and #:exclude directives to compose files transitively, enabling you to build complex utilities without a standard project structure.

Why must #: directives appear before using statements in C# file-based apps?

File directives must be placed before any using statements to ensure the .NET CLI correctly parses build instructions like #:package or #:sdk before compiling the C# code.

Can I test native AOT JSON serialization with a single C# file?

Yes, you can write a tiny console-style app using source-generated System.Text.Json context to verify how JSON serialization behaves under native AOT, then iterate quickly using dotnet <file>.cs.

Do I need a specific .NET SDK version for C# file-based apps?

Yes, the Skill performs an SDK version check to require .NET 10+ support for running C# file-based applications directly through the .NET CLI without a full project structure.