powershell-ci-pipeline
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.
Install
npx skills add https://github.com/fadwen/ai-powershell-standards/tree/main/standards/skills/powershell-ci-pipeline
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install fadwen-ai-powershell-standards@llmmart
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
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
- 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.
- Establish what the project supports from its manifest and
#requireslines: 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. - 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.
- Put the test gate in a script in the repository,
Tests/Invoke-Tests.ps1unless 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-CodeCoveragein 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. - 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. - If the repository has no
.gitattributesfile, add one that contains* text=auto eol=lf(CIC-11), so that the tests see the same line endings on every runner. - If the module ships compiled help, add the help checks from
.github/instructions/powershell-platyps.instructions.md. - 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.
Files (ai-powershell-standards)
-
SKILL.md 2.7 KB
--- name: powershell-ci-pipeline description: 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. --- # 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.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.