Claude GitHub Copilot Skill

powershell-new-module

Create a new PowerShell module with a manifest, a root module, Public and Private folders, a first function, and Pester tests, following this repository's PowerShell standards. Use when asked to create, scaffold, or start a PowerShell module.

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Download fadwen-ai-powershell-standards-.agents_skills_powershell-new-module-fbf1a17.zip · 1 KB

Install

skills CLI npx skills add https://github.com/fadwen/ai-powershell-standards/tree/main/.agents/skills/powershell-new-module
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install fadwen-ai-powershell-standards@llmmart
Git git clone https://github.com/fadwen/ai-powershell-standards.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole fadwen/ai-powershell-standards collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Create a new PowerShell module

Read these before writing files, unless they are already loaded:

  • .github/copilot-instructions.md, or AGENTS.md if the repository has no such file (the core rules and the function template)
  • .github/instructions/powershell-modules.instructions.md
  • .github/instructions/powershell-version.instructions.md

Steps

  1. Ask for, or confirm, the module name, what it is for, and whether it must run on Windows PowerShell 5.1. Without a 5.1 requirement, target PowerShell 7.6.
  2. Create the layout from the module rules: ModuleName.psd1, ModuleName.psm1, Public/, Private/, and Tests/, with the unit tests under Tests/Unit/ (MOD-01). Add Tests/Integration/ and Tests/Performance/ when the module has such tests, and Classes/ only if the module defines a class. Do not create empty folders for things the module does not have.
  3. Write the manifest with literal values only. Generate the GUID once with New-Guid and paste the result. Set PowerShellVersion and CompatiblePSEditions for the target. List exported functions by name. Take Author, CompanyName, and the copyright holder from .github/powershell-attribution.md when the project has one (DOC-18), and the project links from the user or the repository; leave out what you do not know.
  4. Write the root module exactly as the module rules show it: a #Requires -Version line that matches the manifest's PowerShellVersion (MOD-08), strict mode, then Classes, Private, and Public dot-sourced in that order, failing the import if a file fails to load.
  5. Add the first function with the powershell-new-function skill, or follow its steps.
  6. Import the module in a new session with Import-Module ./ModuleName.psd1 -Force, confirm that Get-Command -Module ModuleName lists exactly the exported functions, and run the tests.
  7. Add a README.md that follows .github/instructions/powershell-readme.instructions.md.

Report

List the files you created, the target version, and the results of the import check and the tests. Do not add dependencies or CI workflows unless the user asked for them; mention them as possible next steps instead. Every module generates its command help with PlatyPS (PLT-10): do that with the powershell-module-help skill, or say that it is still to do.

Files (ai-powershell-standards)
  • SKILL.md 2.6 KB
    ---
    name: powershell-new-module
    description: Create a new PowerShell module with a manifest, a root module, Public and Private folders, a first function, and Pester tests, following this repository's PowerShell standards. Use when asked to create, scaffold, or start a PowerShell module.
    ---
    
    # Create a new PowerShell module
    
    Read these before writing files, unless they are already loaded:
    
    - `.github/copilot-instructions.md`, or `AGENTS.md` if the repository has no such file (the core rules
      and the function template)
    - `.github/instructions/powershell-modules.instructions.md`
    - `.github/instructions/powershell-version.instructions.md`
    
    ## Steps
    
    1. Ask for, or confirm, the module name, what it is for, and whether it must run on Windows PowerShell
       5.1. Without a 5.1 requirement, target PowerShell 7.6.
    2. Create the layout from the module rules: `ModuleName.psd1`, `ModuleName.psm1`, `Public/`,
       `Private/`, and `Tests/`, with the unit tests under `Tests/Unit/` (MOD-01). Add
       `Tests/Integration/` and `Tests/Performance/` when the module has such tests, and `Classes/` only
       if the module defines a class. Do not create empty folders for things the module does not have.
    3. Write the manifest with literal values only. Generate the GUID once with `New-Guid` and paste the
       result. Set `PowerShellVersion` and `CompatiblePSEditions` for the target. List exported functions
       by name. Take `Author`, `CompanyName`, and the copyright holder from
       `.github/powershell-attribution.md` when the project has one (DOC-18), and the project links from
       the user or the repository; leave out what you do not know.
    4. Write the root module exactly as the module rules show it: a `#Requires -Version` line that
       matches the manifest's `PowerShellVersion` (MOD-08), strict mode, then `Classes`, `Private`, and
       `Public` dot-sourced in that order, failing the import if a file fails to load.
    5. Add the first function with the `powershell-new-function` skill, or follow its steps.
    6. Import the module in a new session with `Import-Module ./ModuleName.psd1 -Force`, confirm that
       `Get-Command -Module ModuleName` lists exactly the exported functions, and run the tests.
    7. Add a `README.md` that follows `.github/instructions/powershell-readme.instructions.md`.
    
    ## Report
    
    List the files you created, the target version, and the results of the import check and the tests. Do
    not add dependencies or CI workflows unless the user asked for them; mention them as possible next
    steps instead. Every module generates its command help with PlatyPS (PLT-10): do that with the
    `powershell-module-help` skill, or say that it is still to do.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.