Agent skill

Dotnet Standards

by pnp in 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.

MITAuto-check passedDevelopment

Install Dotnet Standards

skills CLI
$ npx skills add pnp/powershell --skill dotnet-standards -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pnp/powershell dotnet-standards --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pnp/powershell.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/dotnet-standards .claude/skills/dotnet-standards && rm -rf skills-src

Use ~/.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/

Facts

Skill name
dotnet-standards
GitHub stars
905
Token cost
~2.1k tokens
SKILL.md length
964 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Reviewing any C in this repo
  • SKILL.md covers PowerShell cmdlet design, C# 12 / .NET 8 and Build
  • Calls dotnet

What it does

Dotnet Standards is an agent skill from 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. Use when writing or reviewing any C in this repo, cmdlet or otherwise.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with .NET, PowerShell, C# and Microsoft 365. The licence is MIT.

When your agent uses it

  • Reviewing any C in this repo

Example prompts

  • “/dotnet-standards”

What it can do on your machine

Read from SKILL.md and the folder at commit 947ac5e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dotnet Standards loads about 2.1k tokens when it runs. Until then it costs about 71 tokens; SKILL.md has 964 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from pnp/powershell at commit 947ac5e, republished under its MIT licence (© pnp). 964 words, ~2,085 tokens.

Download SKILL.mdSave it as .claude/skills/dotnet-standards/SKILL.md (or your agent's skills folder).
name
dotnet-standards
description
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. Use when writing or reviewing any C# in this repo, cmdlet or otherwise.

Playbook: dotnet-standards

C# 12 / .NET 8 and PowerShell cmdlet design rules for this repository. Referenced by code-review, new-cmdlet and cmdlet-scaffolder.

Two rule sets apply at once, and where they disagree the PowerShell one wins: this is a module whose users are shell users, not a class library.


PowerShell cmdlet design

These come from Microsoft's cmdlet development guidelines. Violations are user-facing.

Naming

  • Verb-PnPNoun, one approved verb (Get-Verb), singular noun even when returning many objects.
  • PnP prefix always. New cmdlet names should not collide with other modules' nouns.
  • Parameter names should match the ones used by comparable cmdlets in this module before inventing a new one — -Identity, -Connection, -Force, -Includes, -Batch have established meanings.

Output

  • Emit objects, never formatted text. WriteObject(x) — and WriteObject(collection, true) to enumerate, so the pipeline sees items rather than one array.
  • [OutputType(typeof(T))] on every cmdlet that returns something.
  • Never Console.WriteLine. Channels: WriteObject (data), WriteWarning (recoverable), WriteVerbose (diagnostics), WriteDebug, WriteProgress (long operations).
  • Do not return null to mean "not found" where the user asked for a specific item — write an error. Returning nothing for a filter that matched nothing is correct.

Input

  • [Parameter] per parameter with deliberate Mandatory, Position, ValueFromPipeline. Positional only for the one obvious parameter; everything else named.
  • Use PipeBind types (ListPipeBind, SitePipeBind, …) so a name, an ID or an object all bind.
  • ParameterSpecified(nameof(X)) to distinguish "not supplied" from "supplied as the default".
  • [ValidateNotNull] on any reference-typed parameter dereferenced in ExecuteCmdlet — otherwise -Param $null is a NullReferenceException rather than a message.
  • [ValidateSet] / [ValidateRange] / [ValidateCount] rather than hand-rolled checks in the body.
  • Prefer SwitchParameter over bool for flags. A bool parameter forces -Flag $true and reads wrong in PowerShell.

Safety

  • Anything destructive or overwriting: SupportsShouldProcess = true, then actually call ShouldProcess. Adding a prompt where none existed breaks unattended scripts — see api-surface-diff.

  • -Force may bypass ShouldContinue, never ShouldProcess. ShouldProcess is what implements -WhatIf and -Confirm, so short-circuiting it breaks simulation:

    csharp
    if (Force || ShouldContinue($"Remove {Identity}?", Resources.Confirm))   // correct — the repo's pattern
    if (Force || ShouldProcess($"{target}", "Remove"))                       // WRONG — -Force -WhatIf deletes

    In the second form -Force short-circuits the ||, ShouldProcess is never called, and -Force -WhatIf performs the operation instead of simulating it. Where both are wanted, gate on ShouldProcess first and use Force || only on the inner ShouldContinue. This is a live defect in src/Commands/Apps/RemoveEntraIDServicePrincipalAppRoleAssignment.cs:52 — flag it if you touch that file, and never copy that line as a model.

  • Never hardcode credentials, tenant names or endpoints.

Errors

  • ThrowTerminatingError(new ErrorRecord(...)) for fatal errors, with a meaningful ErrorCategory and the object that caused it. Prefer it over a bare throw — and this is not only style, it changes what the user receives:
    • WriteError and ThrowTerminatingError surface under -ErrorAction Stop as a pipeline stop, which PnPConnectedCmdlet.ProcessRecord rethrows untouched (src/Commands/Base/PnPConnectedCmdlet.cs:57-60). Your ErrorRecord, its category and its target object survive intact.
    • A raw throw reaches the generic catch. Under the default error action it becomes PSInvalidOperationException with the original as inner; under -ErrorAction Stop or SilentlyContinue it becomes new ErrorRecord(new Exception(message), source, ErrorCategory.NotSpecified, null) — type, inner exception, category and target object are all lost, so everything the user needs must be in the message text. Under -ErrorAction Ignore LogError is skipped, so nothing is written at all.
  • Error messages belong in Resources.resx, referenced as Resources.MessageName.

Show full SKILL.md (453 more words)Show less

C# 12 / .NET 8

EnforceCodeStyleInBuild and EnableNETAnalyzers are on. Warnings are findings.

Style

  • 4 spaces, not tabs. Braces on their own line (Allman), as the existing files do.
  • PascalCase for types/methods/properties; camelCase for locals and parameters; _camelCase for private fields; I prefix on interfaces.
  • var where the type is evident from the right-hand side.
  • One type per file. Enums go in src/Commands/Enums/, models in their own files — do not group several types in one model file.
  • XML doc comments on utility classes, models and enums. Cmdlet classes do not need them; the markdown documentation is their reference.
  • File-scoped namespaces and collection expressions ([a, b]) are fine in new code; do not churn existing files to adopt them.

Correctness

  • ?. and ?? over nested null checks; do not use ! to silence a nullable warning you have not actually reasoned about.
  • using/await using for everything IDisposable. HttpClient is not per-call disposable — use the connection's existing client rather than newing one up.
  • CultureInfo.InvariantCulture on every ToString/Parse of a date or number that crosses a wire or a file. A format string like "yyyy-MM-ddTHH:mm:ssZ" takes its separators from the current culture and yields 13.53.41 under some locales.
  • StringComparison.OrdinalIgnoreCase for identifiers, URLs and property names. Never culture-sensitive comparison for machine-readable strings.
  • Prefer LINQ for collection work, but not inside a loop that re-enumerates a remote collection.

Async

  • The cmdlet pipeline is synchronous. The established pattern here is SomethingAsync(...).GetAwaiter().GetResult(). Do not use .Result or .Wait(), and do not introduce async void.
  • Do not add ConfigureAwait churn to existing call sites.

Cross-platform — .NET 8 on Windows, Linux and macOS

  • Path.Combine, Path.DirectorySeparatorChar. No backslash string surgery, no drive letters.
  • Case-sensitive file systems: filename casing must match exactly.
  • Do not mix Environment.NewLine (what StringBuilder.AppendLine writes) with hardcoded \r\n in generated files — the output then churns purely from changing OS.
  • File permissions: anything written containing a private key must be owner-only on Unix.

Dependencies and the ALC

  • New package references have assembly-load-context consequences. The module assembly and CSOM live in Core; every other dependency is private and goes to Common. Adding a reference without placing it correctly breaks loading at runtime, not at build.
  • Do not add a dependency for something the existing helpers already do.

Performance

  • Request only the properties needed — DefaultRetrievalExpressions / EnsureProperties, $select on Graph. Do not fetch a full field collection to read one field.
  • ExecuteQueryRetry(), never ExecuteQuery().
  • Batch where the API supports it rather than calling per item in a loop.
  • Graph collections: GraphRequestHelper.GetResultCollection follows @odata.nextLink; Get does not and silently returns the first page only.

Build

dotnet build src/PnP.PowerShell.sln

Must be warning-clean. src/Tests is off limits — do not add or modify files there.

A clean build is where your work stops. Never commit, push, or open a PR — see Human in the loop.

© pnp, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/dotnet-standards of pnp/powershell.

Open the folder on GitHubat commit 947ac5e

Compare with similar skills

Dotnet Standards 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.

Dotnet Standards compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dotnet Standards this skillpnp/powershell905—~2.1kAutomated safety check: PassMIT
Speckit ConstitutionWeihanLi/WeihanLi.Common24211 repos~2.1kAutomated safety check: PassApache-2.0
Analyzing .NET Performancedotnet/skills5.6k3 repos~3.1kAutomated safety check: PassMIT
Add Analyzerdotnet/roslynator3.5k—~1.3kAutomated safety check: PassCustom licence
GitVersion .NET DevelopmentGitTools/GitVersion3.1k—~1.7kAutomated safety check: PassMIT
Code Reviewdotnet/macios2.9k—~1.7kAutomated safety check: PassCustom licence

Similar skills

  • Speckit Constitution

    WeihanLi/WeihanLi.Common

    Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.

    242 GitHub starsUsed in 11 repos~2.1k tokens
    DevelopmentAuto-check passed
  • Official

    Scans C# and .NET code for about 50 performance anti-patterns and reports prioritized findings with concrete fixes, at a scan depth you choose.

    5.6k GitHub starsUsed in 3 repos~3.1k tokens
    DevelopmentAuto-check passed
  • Add Analyzer

    dotnet/roslynator

    Official

    A skill your agent uses when adding a new RCS diagnostic in roslynator (RCS0 formatting, RCS1 general, RCS9 code-analysis), wiring roslynator EditorConfig options, or when docs say CHANGELOG.md…

    3.5k GitHub stars~1.3k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • GitVersion .NET Development

    GitTools/GitVersion

    Gives repository-specific .NET guidance for GitVersion: build and test commands, central package management, project layout and coding conventions.

    3.1k GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Code Review

    dotnet/macios

    Official

    Review dotnet/macios PRs against established rules. An agent skill from dotnet/macios.

    2.9k GitHub stars~1.7k tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses when adding a Roslynator code fix for C compiler error CS or RCF, editing Diagnostics.xml or CodeFixes.xml, or when compiler-diagnostic-fixes-testing.md shows…

    3.5k GitHub stars~1k tokensUpdated 3 days ago
    DevelopmentAuto-check passed

More from pnp/powershell

All 9 skills in this repo
  • Cmdlet Scaffolder

    pnp/powershell

    Generate a new PnP PowerShell cmdlet modelled on an existing sibling - class with the right base class and permission attributes, the documentation page, and the changelog entry.

    905 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Issue Triage

    pnp/powershell

    Take a PnP PowerShell GitHub issue, find the cmdlet that owns it, trace the code path, and decide whether the cause is in this repo or in PnP Framework, PnP Core SDK or the service.

    905 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • New Cmdlet

    pnp/powershell

    The conventions a PnP PowerShell cmdlet must satisfy - base class selection, permission attributes, PipeBinds, parameter validation, Graph and CSOM call patterns, and the documentation plus…

    905 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Permissions Auditor

    pnp/powershell

    Audit PnP PowerShell permission attributes against the APIs a cmdlet actually calls and against its documentation.

    905 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • API Surface Diff

    pnp/powershell

    Compare the public cmdlet surface of the current branch against dev - names, aliases, parameters, types, mandatory flags, parameter sets, output types, permissions - and classify each change as…

    905 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Code Review

    pnp/powershell

    Review changes to PnP PowerShell for the failure modes this repository actually ships - silently ignored input, unpaged Graph collections, the wrong base class, permission attributes that do not…

    905 GitHub stars~2.3k tokensUpdated today
    Auto-check passed

Categories

Questions about Dotnet Standards

What does Dotnet Standards do?

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. Dotnet Standards is an agent skill from pnp/powershell.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.

When should I use Dotnet Standards?

Dotnet Standards fits situations like: reviewing any C in this repo.

How do I install Dotnet Standards in Claude Code?

Run `npx skills add pnp/powershell --skill dotnet-standards -a claude-code`. Or copy the skill folder (.agents/skills/dotnet-standards in pnp/powershell) into .claude/skills/dotnet-standards in your project. Claude Code loads it when a task matches its description.

How do I install Dotnet Standards in Codex?

Run `npx skills add pnp/powershell --skill dotnet-standards -a codex`. Or copy the skill folder (.agents/skills/dotnet-standards in pnp/powershell) into .agents/skills/dotnet-standards in your project. Codex loads it when a task matches its description.

Can I use Dotnet Standards in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pnp/powershell --skill dotnet-standards -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dotnet-standards, .gemini/skills/dotnet-standards, .github/skills/dotnet-standards and .opencode/skills/dotnet-standards in your project.

What does Dotnet Standards need to run?

Going by SKILL.md and its folder, Dotnet Standards needs the command-line tools its instructions call (dotnet).

Does Dotnet Standards access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dotnet Standards safe to install?

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.

What licence does Dotnet Standards use?

Dotnet Standards is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dotnet Standards use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dotnet Standards?

Skills that share tags, products or a category with Dotnet Standards: Speckit Constitution (WeihanLi/WeihanLi.Common, 242 stars), Analyzing .NET Performance (dotnet/skills, 5.6k stars), Add Analyzer (dotnet/roslynator, 3.5k stars) and GitVersion .NET Development (GitTools/GitVersion, 3.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dotnet Standards?

pnp (a GitHub organization) maintains it in pnp/powershell, which has 905 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 7, 2026.

Source: pnp/powershell on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.