Agent skill

New Cmdlet

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

MITAuto-check passedDevelopment

Install New Cmdlet

skills CLI
$ npx skills add pnp/powershell --skill new-cmdlet -a claude-code

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

GitHub CLI
$ gh skill install pnp/powershell new-cmdlet --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/new-cmdlet .claude/skills/new-cmdlet && 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
new-cmdlet
GitHub stars
905
Token cost
~1.6k tokens
SKILL.md length
531 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

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…

  • Works in 5 steps: Class — correct base class, [Cmdlet],… → Parameters — PipeBinds, validation… → documentation/.md — full platyPS page:… → …
  • Reviewing cmdlet code
  • SKILL.md covers Pick the base class first, Shape, Permission attributes and Common patterns, plus 2 more sections
  • Calls dotnet

What it does

New Cmdlet is an agent skill from 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 changelog artefacts that make a cmdlet complete. Use when writing, modifying or reviewing cmdlet code, or when deciding which base class or permission attribute applies.

Its SKILL.md is about 1.6k 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, covering Changelog and release notes. It works with PowerShell, Microsoft 365 and Microsoft SharePoint. The licence is MIT.

When your agent uses it

  • Reviewing cmdlet code
  • Deciding which base class
  • Permission attribute applies

Example prompts

  • “/new-cmdlet”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Class — correct base class, [Cmdlet], [OutputType], permission attributes, [Alias] if
  2. Parameters — PipeBinds, validation attributes, deliberate Mandatory/Position/pipeline
  3. documentation/.md — full platyPS page: front matter, ## SYNOPSIS — carrying
  4. CHANGELOG.md — a line under [Current nightly] → Added / Changed / Fixed /
  5. Build clean — dotnet build src/PnP.PowerShell.sln, no new warnings.

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

New Cmdlet loads about 1.6k tokens when it runs. Until then it costs about 93 tokens; SKILL.md has 531 words of instructions outside code blocks.

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

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). 531 words, ~1,635 tokens.

Download SKILL.mdSave it as .claude/skills/new-cmdlet/SKILL.md (or your agent's skills folder).
name
new-cmdlet
description
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 changelog artefacts that make a cmdlet complete. Use when writing, modifying or reviewing cmdlet code, or when deciding which base class or permission attribute applies.

Playbook: new-cmdlet

The conventions a cmdlet in this repository must satisfy. A reference — read it before writing or reviewing cmdlet code. For the step-by-step generation procedure see cmdlet-scaffolder; for language-level rules see dotnet-standards.

Pick the base class first

It determines the connection, the resource, the permission flavour and which helpers exist.

Base classUse forGives you
PnPWebCmdletOperations on the connected site/webCurrentWeb, ClientContext
PnPWebRetrievalsCmdlet<T>The above, returning objects with selectable propertiesRetrievalExpressions, -Includes
PnPSharePointCmdletGeneral SharePoint, no web context neededClientContext
PnPSharePointOnlineAdminCmdletTenant admin operationsTenant, AdminContext
PnPGraphCmdletMicrosoft GraphConnection, AccessToken, GraphRequestHelper
PnPAzureManagementApiCmdletAzure Management API
PnPOfficeManagementApiCmdletOffice 365 Management API
PnPGcsCmdlet, PnPTasksCmdletConsumer storage, Planner/Tasks
PnPConnectedCmdletNeeds a connection, none of the above
BasePSCmdletNo connection at all

Choosing wrong is a real defect: a tenant-admin operation on PnPWebCmdlet will use the wrong context and fail confusingly in someone's tenant.

Shape

csharp
using System.Management.Automation;
using PnP.PowerShell.Commands.Attributes;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;

namespace PnP.PowerShell.Commands.FeatureArea
{
    [Cmdlet(VerbsCommon.Get, "PnPSomething")]
    [OutputType(typeof(SomeType))]
    [RequiredApiDelegatedPermissions("sharepoint/AllSites.Read")]
    [RequiredApiApplicationPermissions("sharepoint/Sites.Read.All")]
    public class GetSomething : PnPWebRetrievalsCmdlet<SomeType>
    {
        [Parameter(Mandatory = false, ValueFromPipeline = true, Position = 0)]
        [ValidateNotNull]
        public SomePipeBind Identity { get; set; }

        protected override void ExecuteCmdlet()
        {
            // ...
            WriteObject(result, true);
        }
    }
}
  • Namespace mirrors the folder: src/Commands/Lists/ → PnP.PowerShell.Commands.Lists.
  • Override ExecuteCmdlet(), never ProcessRecord() — the base class owns connection handling and error translation.
  • Renaming an existing cmdlet requires [Alias("Old-PnPName")] for backward compatibility.

Permission attributes

"<resource>/<scope>". Multiple attributes are ORed; multiple scopes inside one attribute are ANDed.

csharp
[RequiredApiDelegatedPermissions("sharepoint/AllSites.FullControl", "sharepoint/User.ReadWrite.All")]
[RequiredApiApplicationPermissions("sharepoint/Sites.FullControl.All", "sharepoint/User.ReadWrite.All")]

Also available: RequiredApiDelegatedOrApplicationPermissions, ApiNotAvailableUnderDelegatedPermissions, ApiNotAvailableUnderApplicationPermissions, ApiPermissionsNotRequired, ApiPermissionsDependOnResource.

An unrecognised resource prefix is silently treated as SharePoint. TokenHandler.DefineResourceTypeFromAudience defaults every audience it does not recognise to SharePoint (only blank input becomes Unknown), so "garph/Group.Read.All" declares a SharePoint Group.Read.All rather than failing. A string with no / at all fails the regex and is dropped. Declare least privilege, and verify the scope against Microsoft Learn rather than from memory. See permissions-auditor.

Common patterns

SharePoint retrievals

csharp
DefaultRetrievalExpressions = [l => l.Id, l => l.Title, l => l.RootFolder.ServerRelativeUrl];

var list = Identity.GetList(CurrentWeb);
list?.EnsureProperties(RetrievalExpressions);
WriteObject(list);

Graph

csharp
var result = GraphRequestHelper.GetResultCollection<SomeType>(this, "v1.0/groups?$select=id,displayName");
WriteObject(result, true);

Use GetResultCollection for collections — it follows @odata.nextLink. Get returns the first page only. Match the signature of a neighbouring cmdlet in the same folder; these helpers have evolved and older call shapes still exist in the tree.

CSOM — always ExecuteQueryRetry(), never ExecuteQuery().

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

Definition of done

A cmdlet is not finished until all of these exist in the same PR:

  1. Class — correct base class, [Cmdlet], [OutputType], permission attributes, [Alias] if renaming.
  2. Parameters — PipeBinds, validation attributes, deliberate Mandatory/Position/pipeline binding; ParameterSpecified where a default is meaningful.
  3. documentation/<Verb-PnPNoun>.md — full platyPS page: front matter, ## SYNOPSIS — carrying a Required Permissions block only when the cmdlet declares API permissions; a cmdlet marked ApiPermissionsNotRequired must not have one, and none of the ten such pages does — ## SYNTAX (one block per parameter set), ## DESCRIPTION, ## EXAMPLES (at least one, ```powershell fenced, each with a sentence of explanation), ## PARAMETERS **alphabetical, YAML blocks only**, including the standard -Connection and -Verbose sections, then ## RELATED LINKS. Copy the structure from a sibling page.
  4. CHANGELOG.md — a line under [Current nightly] → Added / Changed / Fixed / Removed, naming the cmdlets in backticks and linking the PR or issue.
  5. Build clean — dotnet build src/PnP.PowerShell.sln, no new warnings.

Removing a cmdlet means deleting its documentation page too.

"In the same PR" means the same working tree. Never commit, push, or open the PR yourself — see Human in the loop.

What an agent cannot do here

You cannot run the cmdlet. Anything calling an API you have not invoked is a draft: say which API shapes, response fields and permission scopes you inferred rather than verified, so a maintainer knows exactly what to check against a tenant.

© 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/new-cmdlet of pnp/powershell.

Open the folder on GitHubat commit 947ac5e

Compare with similar skills

New Cmdlet 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.

New Cmdlet compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
New Cmdlet this skillpnp/powershell905—~1.6kAutomated safety check: PassMIT
CLI Microsoft365 Scriptpnp/cli-microsoft365-mcp-server131—~3.3kAutomated safety check: PassMIT
Release PreparationMichaelGrafnetter/DSInternals2k—~752Automated safety check: PassMIT
Validate Release-Note Code Samplesdotnet/core22k—~1.4kAutomated safety check: PassMIT
Entra Agent Idmicrosoft/GitHub-Copilot-for-Azure2553 repos~4kAutomated safety check: PassMIT
CLI Microsoft365pnp/cli-microsoft365-mcp-server131—~3.5kAutomated safety check: PassMIT

Similar skills

  • CLI Microsoft365 Script

    pnp/cli-microsoft365-mcp-server

    Write PowerShell scripts using CLI for Microsoft 365 commands to automate Microsoft 365 management tasks.

    131 GitHub stars~3.3k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • Release Preparation

    MichaelGrafnetter/DSInternals

    Prepare the DSInternals project for a new release by updating version numbers, release notes, and changelog.

    2k GitHub stars~752 tokensUpdated 26 days ago
    DevelopmentAuto-check passed
  • Builds and runs the code snippets behind .NET release-note features against the exact milestone SDK, and records what must change to move maintained samples to a new preview.

    22k GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Entra Agent Id

    microsoft/GitHub-Copilot-for-Azure

    Official

    Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant)…

    255 GitHub starsUsed in 3 repos~4k tokens
    Backend & APIsAuto-check passed
  • CLI Microsoft365

    pnp/cli-microsoft365-mcp-server

    Use CLI for Microsoft 365 to manage Microsoft 365 tenants from the terminal.

    131 GitHub stars~3.5k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • Spfx Release

    pnp/docker-spfx

    Automate SPFx version releases - branch, update files, commit, open PR, then tag after merge

    134 GitHub stars~572 tokensUpdated 3 mo ago
    Documents & OfficeAuto-check: notes

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
  • 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.

    905 GitHub stars~2.1k 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
  • 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 New Cmdlet

What does New Cmdlet do?

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…. New Cmdlet is an agent skill from 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 changelog artefacts that make a cmdlet complete.

When should I use New Cmdlet?

New Cmdlet fits situations like: reviewing cmdlet code; deciding which base class; permission attribute applies.

How do I install New Cmdlet in Claude Code?

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

How do I install New Cmdlet in Codex?

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

Can I use New Cmdlet 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 new-cmdlet -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/new-cmdlet, .gemini/skills/new-cmdlet, .github/skills/new-cmdlet and .opencode/skills/new-cmdlet in your project.

What does New Cmdlet need to run?

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

Does New Cmdlet 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 New Cmdlet 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 New Cmdlet use?

New Cmdlet 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 New Cmdlet use?

About 1.6k tokens (SKILL.md is roughly 6.5k 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 New Cmdlet?

Skills that share tags, products or a category with New Cmdlet: CLI Microsoft365 Script (pnp/cli-microsoft365-mcp-server, 131 stars), Release Preparation (MichaelGrafnetter/DSInternals, 2k stars), Validate Release-Note Code Samples (dotnet/core, 22k stars) and Entra Agent Id (microsoft/GitHub-Copilot-for-Azure, 255 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains New Cmdlet?

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.