Skip to content

Add pester-migration skill (experimental)#2163

Open
nohwnd wants to merge 5 commits into
github:mainfrom
nohwnd:add-pester-migration-skill
Open

Add pester-migration skill (experimental)#2163
nohwnd wants to merge 5 commits into
github:mainfrom
nohwnd:add-pester-migration-skill

Conversation

@nohwnd

@nohwnd nohwnd commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have read and followed the Guidance for submissions involving paid services. (N/A — no paid services.)
  • My contribution adds a new skill file in the correct directory (skills/pester-migration/).
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my skill with GitHub Copilot. (See notes — validated against repo rules and grounded in official docs; not yet exercised end-to-end in a live session.)
  • I have run npm start and verified that the generated index (docs/README.skills.md) is up to date.
  • I am targeting the main branch for this pull request.

Description

Adds pester-migration, a self-contained skill that helps upgrade Pester (the PowerShell test framework) test suites across major versions: v3→v4, v4→v5, and v5→v6.

It is built as a single router skill rather than several near-duplicate skills, because all the jumps share one workflow (detect version → baseline → mechanical fixes → manual review → verify). One SKILL.md routes to a per-jump reference loaded on demand:

File Purpose
SKILL.md Router: version detection, install commands, migrate-one-major-at-a-time workflow, scope/difficulty table, inline cheat sheets, safety rules
references/v4-to-v5.md The hard jump — Discovery/Run two-phase model, BeforeAll setup, $PSScriptRoot vs $MyInvocation, BeforeDiscovery/-ForEach, mock scoping, Should -Throw wildcards, full Invoke-PesterNew-PesterConfiguration map
references/v5-to-v6.md Every v6 breaking change as symptom → fix (mocks no longer fall through, empty -ForEach throws, removed Assert-MockCalled, etc.)
references/v3-to-v4.md Should BeShould -Be, ContainFileContentMatch, renames

The content is grounded in the official Pester migration and usage guides (pester.dev). It complements the existing powershell-pester-5.instructions.md (which covers authoring v5 tests, not migrating between versions).

Marked experimental/preview: the v5→v6 guidance tracks Pester 6, which is still a release candidate (6.0.0-rc*), so those specifics may change before GA. The v3→v4 and v4→v5 guidance covers shipped, stable releases. The skill's frontmatter description and a status callout at the top of SKILL.md both state this.


Type of Contribution

  • New skill file.

Additional Notes

  • Validated against eng/validate-skills.mjs rules: frontmatter name (pester-migration) matches the folder and is lowercase-hyphen; description is within length limits and parses as YAML; references/ is recognized as bundled assets. All internal links resolve.
  • docs/README.skills.md was regenerated via npm start and is included in this PR.
  • I'm a Pester maintainer, so the migration content reflects the framework's actual behavior; corrections welcome.

By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

nohwnd and others added 2 commits June 30, 2026 17:41
A self-contained, experimental skill that helps upgrade PowerShell Pester
test suites across major versions (v3->v4, v4->v5, v5->v6). One router
SKILL.md plus per-jump references. The v5->v6 guidance tracks Pester 6,
which is still a release candidate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 30, 2026 15:42
@nohwnd nohwnd requested a review from aaronpowell as a code owner June 30, 2026 15:42
@github-actions github-actions Bot added new-submission PR adds at least one new contribution skills PR touches skills labels Jun 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔒 PR Risk Scan Results

Scanned 5 changed file(s).

Severity Count
🔴 High 0
🟠 Medium 1
ℹ️ Info 0
Severity Rule File Line Match
🟠 package-exec-command docs/README.skills.md 31 | [acreadiness-assess](../skills/acreadiness-assess/SKILL.md)&lt;br /&gt;`gh skills install github/awesome-copilot acreadiness-assess` | Run the AgentRC readiness assessment on the curre

This is an automated soft-gate report. Findings indicate review targets and do not block merge by themselves.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

🔴 Contributor Reputation Check: HIGH risk

Check Risk
Profile HIGH
Credential audit NONE

Maintainers: please review this contributor before merging.
See the workflow run for full details.
Automated check powered by AGT.

@github-actions github-actions Bot added the needs-review:HIGH Contributor reputation check flagged HIGH risk label Jun 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new experimental skill, pester-migration, to guide users through upgrading PowerShell Pester test suites across major versions (v3→v4, v4→v5, v5→v6), with detailed per-jump reference guides and an updated skills index entry.

Changes:

  • Introduces skills/pester-migration/SKILL.md as a router skill with version detection, migration workflow, cheat sheets, and safety rules.
  • Adds three bundled reference guides covering the v3→v4, v4→v5, and v5→v6 migration paths.
  • Updates docs/README.skills.md to include the new skill and its bundled reference assets.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
skills/pester-migration/SKILL.md New router skill and workflow for migrating Pester across major versions.
skills/pester-migration/references/v3-to-v4.md New reference guide for v3→v4 migration.
skills/pester-migration/references/v4-to-v5.md New reference guide for v4→v5 migration (Discovery/Run model changes).
skills/pester-migration/references/v5-to-v6.md New reference guide for v5→v6 migration (RC-era breaking changes).
docs/README.skills.md Adds the new skill entry to the generated skills index.

Comment thread skills/pester-migration/SKILL.md Outdated
Comment thread skills/pester-migration/SKILL.md
Comment thread skills/pester-migration/SKILL.md Outdated
Comment thread skills/pester-migration/references/v5-to-v6.md
@nohwnd

nohwnd commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Quick note on the two red checks — both look unrelated to the skill itself:

  • validate-readme: the README generator can't run on current main because of a small js-yaml 5.x ESM compatibility issue in the tooling. I opened Fix README generation: make yaml-parser compatible with js-yaml 5.x #2165 with a one-line fix for it (kept separate from this PR).
  • skill-check: fails at setup while resolving the pinned actions/setup-node, before any skill logic runs.

The skill passes the main check job. Thanks for taking a look! 🙏

@nohwnd

nohwnd commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

🔴 Contributor Reputation Check: HIGH risk

Check Risk
Profile HIGH
Credential audit NONE
Maintainers: please review this contributor before merging. See the workflow run for full details. Automated check powered by AGT.

Hello, I own the Pester framework, and also work at Microsoft on testing tools! 👋

- Pin the stable-v5 install to -MaximumVersion 5.99.99 so it keeps
  installing v5 after Pester 6 goes GA (SKILL.md).
- Make the baseline run command version-agnostic (bare Invoke-Pester)
  and note that parameters differ across majors (SKILL.md).
- Replace the '->' mapping arrows inside powershell fences with
  comment + valid replacement lines so snippets are copy/paste-safe
  (SKILL.md v5->v6 cheat sheet, v5-to-v6.md, and v3-to-v4.md).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aaronpowell

Copy link
Copy Markdown
Contributor

🔴 Contributor Reputation Check: HIGH risk
Check Risk
Profile HIGH
Credential audit NONE
Maintainers: please review this contributor before merging. See the workflow run for full details. Automated check powered by AGT.

Hello, I own the Pester framework, and also work at Microsoft on testing tools! 👋

Sounds like totally high risk then 🤣.

I need to review with the team who manage AGT on how they raise warnings.

Copilot AI review requested due to automatic review settings July 1, 2026 01:25
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🔍 Vally Lint Results

✅ All checks passed

Scope Checked
Skills 1
Agents 0
Total 1
Severity Count
❌ Errors 0
⚠️ Warnings 0
ℹ️ Advisories 0

Summary

Level Finding
ℹ️ npm warn EBADENGINE Unsupported engine {
ℹ️ npm warn EBADENGINE package: 'commander@15.0.0',
ℹ️ npm warn EBADENGINE required: { node: '>=22.12.0' },
ℹ️ npm warn EBADENGINE current: { node: 'v20.20.2', npm: '10.8.2' }
ℹ️ npm warn EBADENGINE }
ℹ️ npm warn deprecated prebuild-install@7.1.3: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
ℹ️ ✅ pester-migration (3/3 checks passed)
ℹ️ ✓ [spec-compliance] All 1 skill(s) are spec-compliant.
ℹ️ ✓ spec-compliance: All spec checks passed.
ℹ️ ✓ [valid-refs] All file references across 1 skill(s) are valid.
Full linter output
### Linting skills/pester-migration
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'commander@15.0.0',
npm warn EBADENGINE   required: { node: '>=22.12.0' },
npm warn EBADENGINE   current: { node: 'v20.20.2', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn deprecated prebuild-install@7.1.3: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
✅ pester-migration (3/3 checks passed)
    ✓ [spec-compliance] All 1 skill(s) are spec-compliant.
        ✓ spec-compliance: All spec checks passed.
    ✓ [valid-refs] All file references across 1 skill(s) are valid.
        ✓ valid-refs: All file references resolve to existing files within the skill directory.
    ✓ [orphan-files] No orphan files found across 1 skill(s).
        ✓ orphan-files: All 3 file(s) in references/ are reachable from SKILL.md.

1 skill(s) linted, 1 passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment thread skills/pester-migration/SKILL.md Outdated
Comment thread skills/pester-migration/SKILL.md Outdated
Comment thread skills/pester-migration/references/v5-to-v6.md Outdated

@aaronpowell aaronpowell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of small suggestions

Comment thread skills/pester-migration/SKILL.md Outdated
Comment thread skills/pester-migration/SKILL.md Outdated
… references

- Drop -SkipPublisherCheck from the default install commands; scope it to
  Windows PowerShell 5.1 (installing over the OS's Microsoft-signed built-in
  Pester 3) per pester.dev install docs, instead of an unconditional default.
- Trim the experimental status callout: keep the preview marker, drop the
  date-based, human-oriented wording.
- Reorder the References table into version progression order (v3->v4, v4->v5,
  v5->v6).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review:HIGH Contributor reputation check flagged HIGH risk new-submission PR adds at least one new contribution skills PR touches skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants