LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

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.

5,204stars387forksUpdated 8/20/2026
Developer Tools#csharp#prototyping#dotnet#cli#scripting

Security Assessment

Safe(92/100)
Security Score92/100

About csharp-scripts

csharp-scripts is an official .NET skill for running file-based C# apps with the .NET CLI when a user explicitly wants to try C#/.NET code without scaffolding a full project. It solves the friction of quick C# experimentation: instead of creating a .csproj and solution, the user writes a single entry-point .cs file with top-level statements and runs it directly with `dotnet hello.cs`, which builds, caches, and executes automatically. It is scoped deliberately — for language/API experiments, prototypes, and small utilities — and explicitly not for language-agnostic throwaway scripts, generic computations, full projects, or integration into existing solutions.

The workflow verifies the SDK version (file-based apps require .NET 10+, with multi-file `#:include`/`#:exclude` needing SDK 10.0.300+), then writes the entry-point file and runs it, passing arguments after `--`. Its core capability is a set of `#:` directives placed at the top of the file: `#:package` for NuGet references (with version pinning), `#:property` for arbitrary MSBuild properties and expressions, `#:project` for project references, `#:ref` for compiling a referenced .cs file as a separate assembly, `#:sdk` for SDK selection (e.g. Microsoft.NET.Sdk.Web), and `#:include`/`#:exclude` for composing multi-file apps. Directives are transitive, so helper files can declare their own.

The target users are C# and .NET developers who want a fast, low-ceremony way to test ideas, prototype logic before integrating it, or build a small helper from a handful of files. It is a single-file documentation skill (MIT-licensed) that guides the agent through the modern file-based-app feature set, including guidance to place files outside existing project directories and to add a shebang for Unix executability.

FAQ

What .NET version do I need?

File-based apps require .NET SDK 10 or later. The `#:include`, `#:exclude`, and transitive directive processing features additionally require SDK 10.0.300+; a 10.0.100 or 10.0.200 SDK can run single-file apps but not those multi-file directives.

When should I NOT use this skill?

For language-agnostic throwaway scripts or shell/Python/PowerShell-style automation, for full projects or solution integration, when adding code inside an existing .NET solution, or when the app is large enough that a .csproj with build/test/publish config is warranted.

How do I add NuGet packages or set build options?

Use `#:` directives at the top of the file: `#:package Name@Version` for NuGet references, `#:property Name=Value` for MSBuild properties (including expressions), `#:project` for project references, and `#:sdk` to override the default SDK.

Can a file-based app span multiple files?

Yes. Use `#:include` for helper source files sharing the same assembly and `#:exclude` to trim an include pattern; use `#:ref` when a referenced file should compile into a separate assembly like a project reference. Directives are transitive across included files.

How do I pass command-line arguments?

Place them after `--`, e.g. `dotnet hello.cs -- arg1 arg2 "multi word arg"`.

Install csharp-scripts

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

dotnet/skills

Related Skills

short-form-video

14

multi-asset-morning-briefing

7,907

content-strategy

2,901

doherty-threshold

2,901