agentleFS
fadwenfadwen/ai-powershell-standards/.github/skills/powershell-ci-pipeline/SKILL.md

powershell-ci-pipeline

Skill24 starsChanged 5 days agoMITView on GitHub

Add or fix a CI workflow for a PowerShell project that runs PSScriptAnalyzer and Pester with a coverage gate. Use when asked to set up, create, or repair CI, GitHub Actions, or quality gates for PowerShell code.

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. Very specific:

    Read .github/instructions/powershell-cicd.instructions.md first, unless it is already loaded.

    line 8
  2. Distinctive:

    Look at what exists: workflow files, a build script, the test folder, and the module manifest.

    line 13
  3. Distinctive:

    Add the pull request workflow from the CI rules: install PSScriptAnalyzer and Pester at fixed versions, run PSScriptAnalyzer and fail on …

    line 18
  4. Very specific:

    Put the test gate in a script in the repository, Tests/Invoke-Tests.ps1 unless the project keeps its build scripts elsewhere, so that …

    line 20
  5. Very specific:

    If the repository has no PSScriptAnalyzerSettings.psd1, offer to add the one shown in the CI rules.

    line 26
  6. Very specific:

    If the repository has no .gitattributes file, add one that contains * text=auto eol=lf (CIC-11), so that the tests see the same line …

    line 28
  7. Very specific:

    If the module ships compiled help, add the help checks from .github/instructions/powershell-platyps.instructions.md.

    line 30
  8. Very specific:

    Do not add publishing, signing, or deployment steps unless the user asked for them.

    line 38

≈ “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

Set up CI for a PowerShell project

Read .github/instructions/powershell-cicd.instructions.md first, unless it is already loaded. It holds the rules, a pull request workflow, and a publishing workflow.

Steps

  1. Look at what exists: workflow files, a build script, the test folder, and the module manifest. Extend an existing workflow instead of adding a second one that does the same job.
  2. Establish what the project supports from its manifest and #requires lines: PowerShell 7.6 only, or also Windows PowerShell 5.1, and which operating systems. Build the job list from that. Do not add a version or operating system the project does not claim to support.
  3. Add the pull request workflow from the CI rules: install PSScriptAnalyzer and Pester at fixed versions, run PSScriptAnalyzer and fail on findings, and run the test gate.
  4. Put the test gate in a script in the repository, Tests/Invoke-Tests.ps1 unless the project keeps its build scripts elsewhere, so that developers can run the same check locally. Use the runner in .github/instructions/pester-supporting-docs/test-execution.md, and pass -CodeCoverage in the job that holds the coverage gate; the alternative is the minimal gate in .github/instructions/powershell-pester.instructions.md, which takes no parameters. Set its test path and coverage paths to the project's real folders.
  5. If the repository has no PSScriptAnalyzerSettings.psd1, offer to add the one shown in the CI rules. Adding it can surface many layout findings in existing code, so say that first.
  6. If the repository has no .gitattributes file, add one that contains * text=auto eol=lf (CIC-11), so that the tests see the same line endings on every runner.
  7. If the module ships compiled help, add the help checks from .github/instructions/powershell-platyps.instructions.md.
  8. Validate the workflow file's syntax, and run the gate script locally if you can.

Report

Say which files you added or changed, what each job runs, and what you were able to run locally. A workflow is not verified until it has run on the CI system; say so, and do not claim that it passes. Do not add publishing, signing, or deployment steps unless the user asked for them. When the project has no credential scan (CIC-23), say so and name the powershell-credential-scan skill. Do not add a scan unasked: it uses the project's CI time, and the user chooses the scanner.

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.