agentleFS
fadwenfadwen/ai-powershell-standards/.github/skills/powershell-new-module/SKILL.md

powershell-new-module

Skill24 starsChanged 4 days agoMITView on GitHub

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.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

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

    line 8
  2. Distinctive:

    Ask for, or confirm, the module name, what it is for, and whether it must run on Windows PowerShell 5.1.

    line 17
  3. Very specific:

    Create the layout from the module rules: ModuleName.psd1, ModuleName.psm1, Public/, Private/, and Tests/, with the unit tests under …

    line 19
  4. Very specific:

    Write the manifest with literal values only.

    line 23
  5. Very specific:

    Write the root module exactly as the module rules show it: a #Requires -Version line that matches the manifest's PowerShellVersion …

    line 28
  6. Very specific:

    Add the first function with the powershell-new-function skill, or follow its steps.

    line 31
  7. Very specific:

    Import the module in a new session with Import-Module ./ModuleName.psd1 -Force, confirm that Get-Command -Module ModuleName lists exactly …

    line 32
  8. Very specific:

    Add a README.md that follows .github/instructions/powershell-readme.instructions.md.

    line 34

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.