Agent skill · Backend & API

csharp-scripts

Run file-based C# apps with the .NET CLI when the user explicitly wants C#/.NET code without creating a project. Use for C# language/API experiments, one-file C# apps, small multi-file C# apps composed with `#:include`/`#:exclude`, or C# file-based apps linked with `#:ref`. Do not use for language-agnostic throwaway scripts, generic computations, Python/PowerShell-style automation, full projects, or existing app integration.

dotnetgithub.com/dotnetGitHub ↗
claude-codeMIT
Install
npx skills add dotnet/skills --skill csharp-scripts --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 11 KB
Bundled scripts: none
Path: plugins/dotnet-advanced/skills/csharp-scripts/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 4,927
Language: C#
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# File-Based C# Apps ## When to Use - Testing a C# concept, API, or language feature with a quick file-based app - Prototyping logic before integrating it into a larger project - Building a small utility from one entry-point file and a few helper `.cs` files ## When Not to Use - The user asks for a language-agnostic quick script, throwaway computation, or shell/Python/PowerShell-style automation - The user needs a full project, solution integration, or project references in an existing app - The user is working inside an existing .NET solution and wants to add code there - The app is large enough that project structure, build customization, tests, or publish configuration should live in a `.csproj` ## Inputs | Input | Required | Description | |-------|----------|-------------| | C# code or intent | Yes | The code to run, or a description of what the file-based app should do | ## Workflow ### Step 1: Check the .NET SDK version Run `dotnet --version` to verify the SDK is installed and note the full version, including the feature band. File-based apps require .NET 10 or later. `#:include`, `#:exclude`, and transitive directive processing require SDK 10.0.300 or later; SDK 10.0.100/10.

What's inside
Steps it walks through
  1. When to Use
  2. When Not to Use
  3. Inputs
  4. Workflow
  5. Step 1: Check the .NET SDK version
  6. Step 2: Write the app file
  7. Step 3: Run the app
  8. Step 4: Add directives (if needed)
  9. Step 5: Clean up
  10. Unix shebang support
  11. Source-generated JSON
  12. Converting to a project
  13. Fallback for .NET 9 and earlier
  14. Validation
Commands it runs
dotnet hello.cs
dotnet hello.cs -- arg1 arg2 "multi word arg"
dotnet clean hello.cs
chmod +x hello.cs
dotnet project convert hello.cs
mkdir -p /tmp/csharp-file-based-app && cd /tmp/csharp-file-based-app
dotnet new console -o . --force
More from skills
All skills →
About this skill
What does the csharp-scripts skill do?

Run file-based C# apps with the .NET CLI when the user explicitly wants C#/.NET code without creating a project. Use for C# language/API experiments, one-file C# apps, small multi-file C# apps composed with `#:include`/`#:exclude`, or C# file-based apps linked with `#:ref`. Do not use for language-agnostic throwaway scripts, generic computations, Python/PowerShell-style automation, full projects, or existing app integration.

How do I install it?

Run `npx skills add dotnet/skills --skill csharp-scripts --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going