Agent skill
dotnet-runfile
How to use the .NET 10 `dotnet run app.cs` feature. Use this skill when you need to run an existing single-file C# script, create a new C# script, run an ad-hoc C# script (e.g. to test the behavior of a C# snippet), or work on an existing C# script already in the repo. Covers how to run C# scripts and their syntax.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/dotnet-runfile
SKILL.md
dotnet run app.cs
Run C# files directly without .csproj project files. Requires .NET 10 (SpeedReader uses .NET 10, so this should already be installed).
dotnet run hello.cs
Usage Examples
#!/usr/bin/env dotnet run // shebang (unix)
#:sdk Microsoft.NET.Sdk // sdk (default; also .Web, .Worker)
#:package [email protected] // nuget package (version required, wildcards ok)
#:property LangVersion=preview // msbuild property
#:project ../src/MyLibrary // project reference
Console.WriteLine("Hello, World!");
dotnet run hello.cs # run
dotnet run hello.cs -- arg1 arg2 # run with args
chmod +x hello.cs && ./hello.cs # run via shebang
cat hello.cs | dotnet run - # run from stdin
dotnet publish hello.cs -c Release # publish
dotnet project convert hello.cs # convert to full project w/ csproj
Shared Configuration
Share settings across multiple single-file apps by placing a Directory.Build.props file in the same or parent directory:
<Project>
<PropertyGroup>
<LangVersion>preview</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>
All .cs files in that directory tree inherit these settings.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?