From 780422b18ea87059bc870852e144215b5846a9d3 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Wed, 4 Nov 2026 13:26:22 +0100 Subject: [PATCH 1/3] State Pester migration checks and version conditions directly Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../skills/psmodule-pester-migration/SKILL.md | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/plugin/psmodule/skills/psmodule-pester-migration/SKILL.md b/.github/plugin/psmodule/skills/psmodule-pester-migration/SKILL.md index 436d9f47..83716d4e 100644 --- a/.github/plugin/psmodule/skills/psmodule-pester-migration/SKILL.md +++ b/.github/plugin/psmodule/skills/psmodule-pester-migration/SKILL.md @@ -34,7 +34,8 @@ Required compatibility work: blocks in the same scope. - Replace removed `Assert-MockCalled` and `Assert-VerifiableMock`. - Add a default mock when a parameter-filtered mock must handle other calls. -- Review `<...>` name templates because their contents are now expressions. +- Review `<...>` name templates because Pester v6 evaluates their contents as + PowerShell expressions. - Replace `Set-ItResult -Pending` with `-Inconclusive`, `-Skipped`, or `It -Skip`. - Review coverage tracer and output format settings. @@ -42,7 +43,7 @@ Required compatibility work: `New-PesterConfiguration`. - Rename a real `None` tag; in v6 it is reserved for untagged tests. -Optional v6 adoption after compatibility is green: +Optional v6 adoption after the required compatibility checks pass: - Convert classic `Should -Be` assertions to `Should-Be` commands incrementally. Classic syntax remains supported. @@ -84,7 +85,7 @@ For each test set, add an inventory row to the migration report: | Baseline | Run command, result counts, known failures | Use the inventory to find test sets that are not reachable from the default -workflow. A green workflow is not evidence that every test set was migrated. +workflow. A workflow that passes is not evidence that every test set was migrated. ## Test-state and data contract @@ -146,7 +147,7 @@ Record fixture ownership and availability in the inventory: | Shared service | `tests/BeforeAll.ps1` | Before module-local matrix | Deterministic run-scoped name | | Cleanup state | `tests/AfterAll.ps1` | Always-run teardown | Same `TestData` and run identity | -Fail loudly when required data or state is absent. Do not use a broad +If required data or state is absent, fail the test. Do not use a broad `try/catch`, an empty default, or an implicit import to turn a missing fixture into a passing or skipped test. @@ -168,16 +169,16 @@ For every consumer repository, trace and record these surfaces before editing: | `Invoke-ScriptAnalyzer` integration | Publishes `PSModuleLint-*` results alongside test results | Treat lint suites as required result artifacts, not Pester test files | | Repository linter | Checks repository/workflow/Markdown files independently of Pester | Include skill and documentation paths in the repository lint inventory | -The current Process-PSModule flow specifically downloads the built module and -imports it before module-local tests, while `Test-PSModule` resolves source or -module paths for framework suites. The framework's own importability and -manifest tests may import/remove the module because import is their subject; -ordinary consumer tests must not copy that pattern as setup. +Process-PSModule downloads the built module and imports it before module-local +tests. `Test-PSModule` resolves source or module paths for framework suites. The +framework's own importability and manifest tests may import or remove the module +because import is their subject. Ordinary consumer tests must not copy that +pattern as setup. Record the `PSModule/Invoke-Pester` action revision separately from the Pester -module version. The current Process-PSModule workflows reference that action at -`v5.1.0`; its revision and its Pester installation policy must both be checked -when adopting Pester 6.1.0. Updating one does not prove that the other changed. +module version. When adopting Pester 6.1.0, check both the action revision and its +Pester installation policy. This includes workflows that reference `v5.1.0`. +Updating one does not prove that the other changed. Use this per-repository checklist: @@ -322,8 +323,8 @@ Should -Invoke Get-Thing -Times 1 -Exactly Should -InvokeVerifiable ``` -In v6, a call that matches no `-ParameterFilter` no longer falls through to -the real command. Add an unfiltered default mock when other calls are valid: +In v6, a call that matches no `-ParameterFilter` does not run the real command. +Add an unfiltered default mock when other calls are valid: ```powershell Mock Get-Thing { 'default' } @@ -348,8 +349,8 @@ should be reported for follow-up. ### Name templates -In v6, every `<...>` token in a `Describe`, `Context`, or `It` name is -evaluated as a PowerShell expression in the test scope. Review arithmetic, +In v6, Pester evaluates every `<...>` token in a `Describe`, `Context`, or `It` +name as a PowerShell expression in the test scope. Review arithmetic, method calls, and expressions that were literal in v5. Escape a leading `<` when literal text is intended: @@ -368,15 +369,15 @@ filters and reports. ### Coverage Pester 6 uses the Profiler tracer by default and `CodeCoverage.UseBreakpoints` -defaults to `$false`. Keep the new default unless compatibility with historical -coverage numbers requires: +defaults to `$false`. Keep this default. If compatibility with earlier coverage +numbers requires breakpoints, use: ```powershell $config.CodeCoverage.UseBreakpoints = $true ``` `CoverageGutters` is removed. Use `JaCoCo` or `Cobertura`; coverage paths are -already relative to `Run.RepoRoot`. +relative to `Run.RepoRoot`. ## Step 5: Standardize Invoke-Pester configuration @@ -403,7 +404,7 @@ Invoke-Pester -Configuration $config Set `Run.ExcludePath` for intentional exclusions, and keep paths relative to the repository root where CI and local runs share the same layout. Do not -disable failures globally to make a migration green. +disable failures globally to make migration checks pass. ## Step 6: Optional v6 features @@ -430,7 +431,7 @@ $value | Should -Be 1 # compatible and may remain $value | Should-Be 1 # optional v6 style ``` -If converting, review behavior rather than applying a blind rename: +If converting, review each assertion's behavior before changing its name: - `Should -Not -Be` becomes `Should-NotBe`. - Truthy/falsy expectations may need `Should-BeTruthy` or `Should-BeFalsy`; From fe6a441517e94f09296a10e0c83df18b75697dfc Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Wed, 4 Nov 2026 13:28:52 +0100 Subject: [PATCH 2/3] Separate plugin agent actions and stop conditions Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../SKILL.md | 32 +++++++++---------- .../skills/psmodule-skill-authoring/SKILL.md | 10 +++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/plugin/psmodule/skills/psmodule-module-development-orchestration/SKILL.md b/.github/plugin/psmodule/skills/psmodule-module-development-orchestration/SKILL.md index 92c04d52..ba079ed5 100644 --- a/.github/plugin/psmodule/skills/psmodule-module-development-orchestration/SKILL.md +++ b/.github/plugin/psmodule/skills/psmodule-module-development-orchestration/SKILL.md @@ -40,31 +40,31 @@ Each child must: 1. Inspect local guidance, the module layout, and the assigned surface before editing. 2. Stay within the handoff; make adjacent work a new child task. -3. Open a draft PR early, push small commits, and include the required Copilot +3. Open a draft PR early. Push small commits. Include the required Copilot co-author trailer in each commit. -4. Run the validation named in the handoff and record commands and outcomes. -5. Report the draft PR URL and target, changed and excluded files, validation, - decisions or risks, blockers, and follow-up work before requesting - integration. +4. Run the validation named in the handoff. Record commands and outcomes. +5. Before requesting integration, report the draft PR URL and target, changed and + excluded files, validation, decisions or risks, blockers, and follow-up work. -The parent reviews each child diff and acceptance criterion, integrates through -the normal PR flow, and reruns affected checks after each dependent merge. Do -not bypass review with a direct default-branch push or modify another session's -PR or issue without explicit ownership. +The parent reviews each child diff and acceptance criterion. The parent +integrates through the normal PR flow and reruns affected checks after each +dependent merge. Do not bypass review with a direct default-branch push or +modify another session's PR or issue without explicit ownership. Use the PSModule [validation before review](../../../../../docs/content/guides/validating-before-review.md) guidance and [versioning and releases](../../../../../docs/content/guides/versioning-and-releases.md) -for the common validation and release-readiness gates. Keep the coordinated PR -in draft when the integrated result is not ready. +for the common validation and release-readiness gates. When the integrated +result is not ready, keep the coordinated PR in draft. ## Stop conditions -Stop and report to the parent instead of guessing when scope, ownership, -acceptance evidence, branch target, release intent, or a required dependency is -ambiguous; when validation fails without a known owner; or when integration -would modify unrelated work. Do not silently expand scope, merge unreviewed -changes, or claim release readiness. +If scope, ownership, acceptance evidence, or the branch target is ambiguous, +stop and report to the parent. If release intent or a required dependency is +ambiguous, stop and report to the parent. If validation fails without a known +owner, stop and report to the parent. If integration would modify unrelated +work, stop and report to the parent. Do not guess, silently expand scope, merge +unreviewed changes, or claim release readiness. ## References diff --git a/.github/plugin/psmodule/skills/psmodule-skill-authoring/SKILL.md b/.github/plugin/psmodule/skills/psmodule-skill-authoring/SKILL.md index ea39b15a..d2c9f662 100644 --- a/.github/plugin/psmodule/skills/psmodule-skill-authoring/SKILL.md +++ b/.github/plugin/psmodule/skills/psmodule-skill-authoring/SKILL.md @@ -7,8 +7,8 @@ description: Author and maintain thin PSModule plugin skills that keep shared pr Use this skill when creating or updating a skill in the PSModule plugin. First read the shared -[writing plugin skills guide](../../../../../docs/content/guides/writing-plugin-skills.md); -it is the source of common authoring, structure, validation, and maintenance +[writing plugin skills guide](../../../../../docs/content/guides/writing-plugin-skills.md). +The guide is the source of common authoring, structure, validation, and maintenance guidance. ## Agent-specific contract @@ -19,7 +19,7 @@ guidance. only the skill's trigger, agent operating sequence, handoff/report contract, and stop conditions in `SKILL.md`. - Preserve the plugin's scope and make adjacent work a separate change. -- Open a draft PR early, use small commits, and report the PR URL, files, +- Open a draft PR early. Use small commits. Report the PR URL, files, validation, decisions, and blockers to the owning session. -- Stop and report instead of guessing when the skill boundary, source-of-truth - document, plugin ownership, or validation requirement is unclear. +- If the skill boundary, source-of-truth document, plugin ownership, or + validation requirement is unclear, stop and report. Do not guess. From 9c191e2669957ff5b3a9c4649222a07191b462ee Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Wed, 4 Nov 2026 13:33:14 +0100 Subject: [PATCH 3/3] Remove the obsolete Pester action revision example Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../plugin/psmodule/skills/psmodule-pester-migration/SKILL.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/plugin/psmodule/skills/psmodule-pester-migration/SKILL.md b/.github/plugin/psmodule/skills/psmodule-pester-migration/SKILL.md index 83716d4e..efe3ac0f 100644 --- a/.github/plugin/psmodule/skills/psmodule-pester-migration/SKILL.md +++ b/.github/plugin/psmodule/skills/psmodule-pester-migration/SKILL.md @@ -177,8 +177,7 @@ pattern as setup. Record the `PSModule/Invoke-Pester` action revision separately from the Pester module version. When adopting Pester 6.1.0, check both the action revision and its -Pester installation policy. This includes workflows that reference `v5.1.0`. -Updating one does not prove that the other changed. +Pester installation policy. Updating one does not prove that the other changed. Use this per-repository checklist: