Dotnet Standards
pnp/powershell
C 12 / .NET 8 and PowerShell cmdlet design rules for this repository - naming, output and error channels, parameter validation, ShouldProcess, async, culture, cross-platform and ALC constraints.
Run file-based C apps with the .NET CLI when the user explicitly wants C/.NET code without creating a project.
$ npx skills add dotnet/skills --skill csharp-scripts -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install dotnet/skills csharp-scripts --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dotnet-advanced/skills/csharp-scripts .claude/skills/csharp-scripts && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "csharp-scripts" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-advanced/skills/csharp-scripts into .claude/skills/csharp-scripts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "csharp-scripts", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/dotnet/skills/tree/main/plugins/dotnet-advanced/skills/csharp-scriptsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add dotnet/skills --skill csharp-scripts -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install dotnet/skills csharp-scripts --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/dotnet-advanced/skills/csharp-scripts .agents/skills/csharp-scripts && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "csharp-scripts" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-advanced/skills/csharp-scripts into .agents/skills/csharp-scripts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "csharp-scripts", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add dotnet/skills --skill csharp-scripts -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install dotnet/skills csharp-scripts --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/dotnet-advanced/skills/csharp-scripts .cursor/skills/csharp-scripts && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "csharp-scripts" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-advanced/skills/csharp-scripts into .cursor/skills/csharp-scripts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "csharp-scripts", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/dotnet/skills.git --path plugins/dotnet-advanced/skills/csharp-scripts--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add dotnet/skills --skill csharp-scripts -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install dotnet/skills csharp-scripts --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/dotnet-advanced/skills/csharp-scripts .gemini/skills/csharp-scripts && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "csharp-scripts" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-advanced/skills/csharp-scripts into .gemini/skills/csharp-scripts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "csharp-scripts", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install dotnet/skills csharp-scriptsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add dotnet/skills --skill csharp-scripts -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/dotnet-advanced/skills/csharp-scripts .github/skills/csharp-scripts && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "csharp-scripts" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-advanced/skills/csharp-scripts into .github/skills/csharp-scripts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "csharp-scripts", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add dotnet/skills --skill csharp-scripts -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install dotnet/skills csharp-scripts --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/dotnet-advanced/skills/csharp-scripts .opencode/skills/csharp-scripts && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "csharp-scripts" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-advanced/skills/csharp-scripts into .opencode/skills/csharp-scripts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "csharp-scripts", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
csharp-scriptsRun file-based C apps with the .NET CLI when the user explicitly wants C/.NET code without creating a project.
Csharp Scripts is an agent skill from dotnet/skills, published by the product's own GitHub organization. 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.
Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It works with C#, .NET, PowerShell and Python. The repository describes itself as: Repository for skills to assist AI coding agents with .NET and C. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit a660de8. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
dotnetFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
learn.microsoft.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Csharp Scripts loads about 2.9k tokens when it runs. Until then it costs about 111 tokens; SKILL.md has 1,212 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from dotnet/skills at commit a660de8, republished under its MIT licence (© dotnet). 1,212 words, ~2,931 tokens.
.claude/skills/csharp-scripts/SKILL.md (or your agent's skills folder)..cs files.csproj| Input | Required | Description |
|---|---|---|
| C# code or intent | Yes | The code to run, or a description of what the file-based app should do |
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.0.200 builds can run single-file apps but do not support those multi-file directives. If the version is below 10, follow the fallback for older SDKs instead.
Create an entry-point .cs file using top-level statements. Place it outside any existing project directory to avoid conflicts with .csproj files.
#!/usr/bin/env dotnet
// hello.cs
Console.WriteLine("Hello from a file-based app!");
var numbers = new[] { 1, 2, 3, 4, 5 };
Console.WriteLine($"Sum: {numbers.Sum()}");Guidelines:
Main method, class, or namespace boilerplate)using directives at the top of the file (after the #! line and any #: directives if present)dotnet hello.csBuilds and runs the file automatically. Cached so subsequent runs are fast. Pass arguments after --:
dotnet hello.cs -- arg1 arg2 "multi word arg"Place directives at the top of the file (immediately after an optional shebang line), before any using directives or other C# code. All directives start with #:.
#:package — NuGet package referencesSpecify a version unless the app intentionally uses central package management. Use @* when the latest available package is acceptable (or @*-* for pre-release):
#:package Humanizer@2.14.1
using Humanizer;
Console.WriteLine("hello world".Titleize());#:property — MSBuild propertiesSet any MSBuild property inline. Syntax: #:property PropertyName=Value
#:property AllowUnsafeBlocks=true
#:property PublishAot=false
#:property NoWarn=CS0162MSBuild expressions and property functions are supported:
#:property LogLevel=$([MSBuild]::ValueOrDefault('$(LOG_LEVEL)', 'Information'))Common properties:
| Property | Purpose |
|---|---|
AllowUnsafeBlocks=true | Enable unsafe code |
PublishAot=false | Disable native AOT (enabled by default) |
NoWarn=CS0162;CS0219 | Suppress specific warnings |
LangVersion=preview | Enable preview language features |
InvariantGlobalization=false | Enable culture-specific globalization |
#:project — Project referencesReference another project by relative path:
#:project ../MyLibrary/MyLibrary.csproj#:ref — File-based app referencesReference another .cs file as a separate file-based app project when it should compile into a separate assembly instead of being included in the same compilation. Use #:include for ordinary helper files that should share the same assembly as the entry point; use #:ref when you want project-reference-like boundaries.
#:property ExperimentalFileBasedProgramEnableRefDirective=true
#:ref ../Shared/Formatter.cs
Console.WriteLine(Formatter.Title("hello world"));Guidelines:
#:property OutputType=Library in that referenced file.#:ref is transitive: a referenced file can contain its own #:ref and other #: directives.#:property ExperimentalFileBasedProgramEnableRefDirective=true; remove that property if the SDK accepts #:ref without it.#:sdk — SDK selectionOverride the default SDK (Microsoft.NET.Sdk):
#:sdk Microsoft.NET.Sdk.Web#:include and #:exclude — Multi-file appsIn .NET SDK 10.0.300 and later, file-based apps can include additional files in the same virtual project. Check the full dotnet --version output before using these directives; a 10.0.100 or 10.0.200 SDK is still .NET 10 but does not support them. Use #:include for helper source files and supported assets, and #:exclude to remove files from an include pattern or default item set.
#!/usr/bin/env dotnet
#:include Helpers.cs
#:include Models/*.cs
#:exclude Models/Generated/*.cs
Console.WriteLine(Formatter.Title("hello world"));Guidelines:
dotnet as the entry point; put top-level statements there..cs files.Helpers.cs or Models/*.cs over broad recursive globs.#:package, #:property, #:sdk, #:project, #:ref, #:include, or #:exclude directives.#:package, #:property, #:sdk, #:include, and #:exclude entries can fail.#:include, add a shebang (#!/usr/bin/env dotnet) to the entry-point file on Unix-like systems to make the entry point clear to tools. Use LF line endings and no BOM for shebang files.Example layout:
scratch/
hello.cs
Helpers.cs
Models/
Person.cs#!/usr/bin/env dotnet
// hello.cs
#:include Helpers.cs
#:include Models/*.cs
var person = new Person("Ada");
Console.WriteLine(Formatter.Title(person.Name));// Helpers.cs
static class Formatter
{
public static string Title(string value) => value.ToUpperInvariant();
}// Models/Person.cs
record Person(string Name);Remove the app files when the user is done. To clear cached build artifacts:
dotnet clean hello.csOn Unix platforms, make a .cs file directly executable:
Add a shebang as the first line of the file:
#!/usr/bin/env dotnet
Console.WriteLine("I'm executable!");Set execute permissions:
chmod +x hello.csRun directly:
./hello.csUse LF line endings (not CRLF) when adding a shebang. This directive is ignored on Windows.
File-based apps enable native AOT by default. Reflection-based APIs like JsonSerializer.Serialize<T>(value) fail at runtime under AOT. Use source-generated serialization instead:
using System.Text.Json;
using System.Text.Json.Serialization;
var person = new Person("Alice", 30);
var json = JsonSerializer.Serialize(person, AppJsonContext.Default.Person);
Console.WriteLine(json);
var deserialized = JsonSerializer.Deserialize(json, AppJsonContext.Default.Person);
Console.WriteLine($"Name: {deserialized!.Name}, Age: {deserialized.Age}");
record Person(string Name, int Age);
[JsonSerializable(typeof(Person))]
partial class AppJsonContext : JsonSerializerContext;When a file-based app outgrows this workflow, convert it to a full project:
dotnet project convert hello.csIf the .NET SDK version is below 10, file-based apps are not available. Use a temporary console project instead:
mkdir -p /tmp/csharp-file-based-app && cd /tmp/csharp-file-based-app
dotnet new console -o . --forceReplace the generated Program.cs with the app content and run with dotnet run. Add NuGet packages with dotnet add package <name>. Remove the directory when done.
dotnet --version reports 10.0 or later (or fallback path is used)#:include, #:exclude, or transitive directives from included files, dotnet --version reports SDK 10.0.300 or laterdotnet build <file>.cs)dotnet <file>.cs produces the expected output| Pitfall | Solution |
|---|---|
.cs file is inside a directory with a .csproj | Move the app outside the project directory, or use dotnet run --file file.cs |
#:package without a version | Specify a version: #:package PackageName@1.2.3 or @* for latest |
#:property with wrong syntax | Use PropertyName=Value with no spaces around = and no quotes: #:property AllowUnsafeBlocks=true |
| Directives placed after C# code | All #: directives must appear immediately after an optional shebang line (if present) and before any using directives or other C# statements |
| Helper file is not compiled | Add #:include Helper.cs or an appropriate glob to the entry-point file |
| Shared file needs an assembly boundary | Use #:ref Shared.cs instead of #:include Shared.cs, and set #:property OutputType=Library in the referenced file if it has no entry point |
| Broad include pulls in unrelated files | Prefer narrow include patterns and use #:exclude for generated, backup, or experimental files |
| Duplicate directives in included files | Keep package, property, SDK, include, and exclude directives unique across the entry point and included C# files |
| Reflection-based JSON serialization fails | Use source-generated JSON with JsonSerializerContext (see Source-generated JSON) |
| Unexpected build behavior or version errors | File-based apps inherit global.json, Directory.Build.props, Directory.Build.targets, and nuget.config from parent directories. Move the app to an isolated directory if the inherited settings conflict |
See https://learn.microsoft.com/en-us/dotnet/core/sdk/file-based-apps for a full reference on file-based apps.
© dotnet, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in plugins/dotnet-advanced/skills/csharp-scripts of dotnet/skills.
Open the folder on GitHubat commit a660de8
We found 6 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in dotnet/skills, which our catalogue first saw on October 7, 2026.
Csharp Scripts next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Csharp Scripts this skilldotnet/skills | 5.6k | 2 repos | ~2.9k | Automated safety check: Pass | MIT | |
| Dotnet Standardspnp/powershell | 905 | — | ~2.1k | Automated safety check: Pass | MIT | |
| Git HooksProrise-cool/Claude-Code-Multi-Agent | 305 | — | ~3.6k | Automated safety check: Notes | None | |
| Precheckayutaz/piper-plus | 220 | — | ~647 | Automated safety check: Pass | MIT | |
| Read DOCX Reviewdaymade/claude-code-skills | 1.4k | — | ~993 | Automated safety check: Pass | MIT | |
| Minimax DOCXpoco-ai/poco-claw | 1.4k | 7 repos | ~3.9k | Automated safety check: Pass | MIT |
pnp/powershell
C 12 / .NET 8 and PowerShell cmdlet design rules for this repository - naming, output and error channels, parameter validation, ShouldProcess, async, culture, cross-platform and ALC constraints.
Prorise-cool/Claude-Code-Multi-Agent
Central authority on git hook implementations, modern best practices, and tooling for .NET/C, JavaScript/TypeScript, Python, and polyglot repositories.
ayutaz/piper-plus
PR 作成前の lint + format + test 一括実行。引数で scope (python/rust/cs/go/js/cpp/all) を指定可能。未指定なら git diff から自動判定。
daymade/claude-code-skills
读取 Word/WPS 审阅后的 docx,把批注(comments)与修订(track changes)提取成可逐条裁决的 markdown 对账表或 JSON。触发场景:对方批注完的合同/协议/书稿/报告回来了要读意见;「提取 docx 批注」「审阅意见对账」「读一下修订」「谁批了什么、批在哪」;WPS 云文档/Word 在线协作…
poco-ai/poco-claw
Professional DOCX document creation, editing, and formatting using OpenXML SDK (.NET).
WeihanLi/WeihanLi.Common
Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
dotnet/skills
Resolves .NET runtime frames in Apple .ips crash logs to function names, source files and line numbers using dSYM symbols, atos and the Microsoft symbol server.
dotnet/skills
Resolves native crash frames from .NET Android tombstones to function names, source files and line numbers using BuildIds, Microsoft's symbol server and llvm-symbolizer.
dotnet/skills
Scans C# and .NET code for about 50 performance anti-patterns and reports prioritized findings with concrete fixes, at a scan depth you choose.
dotnet/skills
Statically pairs source files with test files to list code that no test references, using Roslyn for C# or tree-sitter for many languages, with no build.
dotnet/skills
Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks.
dotnet/skills
Makes .NET projects compatible with Native AOT and trimming by resolving IL trim and AOT analyzer warnings through annotations rather than suppressions.
Works with
Run file-based C apps with the .NET CLI when the user explicitly wants C/.NET code without creating a project. Csharp Scripts is an agent skill from dotnet/skills, published by the product's own GitHub organization.NET code without creating a project.
Csharp Scripts fits situations like: explicitly wants C/.NET code without creating a project; C language/API experiments; one-file C apps; small multi-file C apps composed with :include/:exclude.
Run `npx skills add dotnet/skills --skill csharp-scripts -a claude-code`. Or copy the skill folder (plugins/dotnet-advanced/skills/csharp-scripts in dotnet/skills) into .claude/skills/csharp-scripts in your project. Claude Code loads it when a task matches its description.
Run `npx skills add dotnet/skills --skill csharp-scripts -a codex`. Or copy the skill folder (plugins/dotnet-advanced/skills/csharp-scripts in dotnet/skills) into .agents/skills/csharp-scripts in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dotnet/skills --skill csharp-scripts -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/csharp-scripts, .gemini/skills/csharp-scripts, .github/skills/csharp-scripts and .opencode/skills/csharp-scripts in your project.
Going by SKILL.md and its folder, Csharp Scripts needs the command-line tools its instructions call (dotnet).
SKILL.md names 1 domain. As links in the text: learn.microsoft.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Csharp Scripts is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Csharp Scripts: Dotnet Standards (pnp/powershell, 905 stars), Git Hooks (Prorise-cool/Claude-Code-Multi-Agent, 305 stars), Precheck (ayutaz/piper-plus, 220 stars) and Read DOCX Review (daymade/claude-code-skills, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
dotnet (a GitHub organization, an official publisher) maintains it in dotnet/skills, which has 5,576 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 8, 2026.
Source: dotnet/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.