Skip to content

Commit d5d2ec0

Browse files
Scope template checks to consumer repositories
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent cfb6558 commit d5d2ec0

4 files changed

Lines changed: 172 additions & 271 deletions

File tree

.github/plugin/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ skill for upgrading Process-PSModule consumer repositories to framework v8.
3030
It also provides
3131
[`psmodule-zensical-migration`](./psmodule/skills/psmodule-zensical-migration/SKILL.md)
3232
for migrating legacy MkDocs sites to the standard Zensical design, and
33-
[`psmodule-template-reconciliation`](./psmodule/skills/psmodule-template-reconciliation/SKILL.md)
34-
for comparing or reconciling module repositories with the current
33+
[`psmodule-repository-audit`](./psmodule/skills/psmodule-repository-audit/SKILL.md)
34+
for auditing or aligning module repositories with the current
3535
Template-PSModule baseline.
3636
Verify the installation with:
3737

.github/plugin/psmodule/skills/psmodule-template-reconciliation/SKILL.md renamed to .github/plugin/psmodule/skills/psmodule-repository-audit/SKILL.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
---
2-
name: psmodule-template-reconciliation
3-
description: Compare or reconcile a PSModule repository with the current Template-PSModule baseline while preserving repository-owned code, tests, settings, and content. Use for one-repository audits and fleet-wide template alignment.
2+
name: psmodule-repository-audit
3+
description: Audit a PSModule repository against the current Template-PSModule baseline and align the consumer when requested while preserving repository-owned code, tests, settings, and content.
44
---
55

6-
# Reconcile a PSModule repository with Template-PSModule
6+
# Audit a PSModule repository against Template-PSModule
77

8-
Use this skill when checking or updating an established PowerShell module
9-
repository against the standard files in
8+
Use this skill when checking an established PowerShell module repository
9+
against the standard files in
1010
[`PSModule/Template-PSModule`](https://github.com/PSModule/Template-PSModule).
11-
Use the same procedure for one repository or as the repository-level operation
11+
Apply confirmed consumer updates only when the requested scope includes them.
12+
Use the same procedure for one repository or as the repository-level audit
1213
inside a fleet campaign.
1314

15+
This skill does not maintain or reconcile `Template-PSModule`. Changes to
16+
Process-PSModule include an impact evaluation that determines whether the
17+
template also needs a coordinated update. Template changes are made and
18+
validated in the template repository before consumer alignment begins.
19+
1420
## Authority and precedence
1521

1622
Apply sources in this order:
@@ -29,20 +35,17 @@ Use that one commit throughout the run. Do not embed a snapshot of template
2935
file contents in this skill.
3036

3137
When a higher-precedence standard and the template disagree, do not propagate
32-
the discrepancy. Correct the template first, then reconcile consumers against
33-
the corrected template commit. When prose and template implementation merely
34-
express the same requirement differently, use the template as the byte-level
35-
source.
38+
the discrepancy and do not repair the template from this skill. Report the
39+
upstream gap and block consumer alignment until the template is corrected.
40+
When prose and template implementation merely express the same requirement
41+
differently, use the template as the byte-level source.
3642

3743
## Modes
3844

3945
- **Audit** reports drift without changing the target.
40-
- **Reconcile** applies confirmed template-owned changes to one target
41-
repository.
42-
- **Maintain the template** changes `Template-PSModule` itself when the
43-
executable baseline does not satisfy the governing standards.
46+
- **Align** applies confirmed template-owned changes to one consumer repository.
4447

45-
State the selected mode before editing. A fleet run invokes Audit or Reconcile
48+
State the selected mode before editing. A fleet run invokes Audit or Align
4649
once per repository; it does not combine many repositories into one branch or
4750
pull request.
4851

@@ -115,14 +118,14 @@ Template comparison does not prove that an established test suite is compatible
115118
with the template's Pester version. If the target does not already meet the
116119
template's Pester baseline, invoke
117120
[`psmodule-pester-migration`](../psmodule-pester-migration/SKILL.md) and migrate
118-
every test set before declaring reconciliation complete.
121+
every test set before declaring alignment complete.
119122

120123
When the Process-PSModule caller requires a major-version migration, invoke
121124
[`psmodule-v8-upgrade`](../psmodule-v8-upgrade/SKILL.md). Preserve supported
122125
`TestData` and repository-owned automation instead of replacing them with
123126
template examples.
124127

125-
## Reconciliation output
128+
## Audit output
126129

127130
Report each compared path with:
128131

@@ -131,7 +134,7 @@ Report each compared path with:
131134
| Path | Repository-relative path. |
132135
| Class | One of the comparison classes above. |
133136
| Status | Aligned, missing, drifted, extra, accepted difference, or blocked. |
134-
| Action | None, add, update, preserve, remove, or fix template first. |
137+
| Action | None, add, update, preserve, remove, or report upstream. |
135138
| Evidence | Template commit and governing standard or documented exception. |
136139

137140
Do not count an extra repository-owned file as drift. Do not call a repository

.github/plugin/psmodule/skills/psmodule-v8-upgrade/SKILL.md

Lines changed: 52 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: psmodule-v8-upgrade
3-
description: Upgrade a Process-PSModule consumer repository to framework version 8 while preserving repository intent, enforcing the caller workflow contract, migrating Pester tests to v6, and retaining the repository's Zensical documentation design.
3+
description: Upgrade a Process-PSModule consumer repository to framework version 8, audit it against Template-PSModule, migrate every test set to Pester 6.1.0, and align its Zensical profile without changing repository-owned intent.
44
---
55

66
# Upgrade a Process-PSModule consumer to v8
@@ -15,12 +15,18 @@ consumer repositories while developing or validating this skill.
1515
1. Inspect the consumer repository before editing. Read its local guidance,
1616
workflow, documentation configuration and content, tests, settings,
1717
dependencies, and existing validation commands.
18-
2. Work on a dedicated branch, open a draft pull request early, and use small
18+
2. Invoke
19+
[`psmodule-repository-audit`](../psmodule-repository-audit/SKILL.md) in Audit
20+
mode and record the resolved `Template-PSModule` commit.
21+
3. Invoke
22+
[`psmodule-pester-migration`](../psmodule-pester-migration/SKILL.md) for
23+
every test set that does not already meet the Pester 6.1.0 contract.
24+
4. Work on a dedicated branch, open a draft pull request early, and use small
1925
commits. Include the required Copilot co-author trailer in every commit.
20-
3. Preserve test intent, fixtures, secrets, variables, documentation content,
26+
5. Preserve test intent, fixtures, secrets, variables, documentation content,
2127
custom theme assets, and repository-owned automation unless the upgrade
2228
requires a direct change.
23-
4. Report preserved TestData, Pester migration details, Zensical/theme changes,
29+
6. Report preserved TestData, Pester migration details, Zensical/theme changes,
2430
validation results, and blockers in the pull request.
2531

2632
Use the repository's applicable MSX workflow and PR format guidance. Do not
@@ -50,90 +56,19 @@ the obsolete configuration only after the generated site validates.
5056
Use [`PSModule/Template-PSModule`](https://github.com/PSModule/Template-PSModule)
5157
and the [PSModule Repository Standard](https://github.com/PSModule/Process-PSModule/blob/main/docs/content/reference/repository-standard.md)
5258
as the structural baseline for module repositories. Compare the consumer with
53-
the template's default files before adding, removing, or relocating anything.
54-
The template is a starting point, not a reason to overwrite module-specific
55-
content.
56-
57-
The current template's default repository anatomy is:
58-
59-
```text
60-
<ModuleName>/
61-
├── .github/
62-
│ ├── CODEOWNERS
63-
│ ├── dependabot.yml
64-
│ ├── linters/
65-
│ │ ├── .codespellrc
66-
│ │ ├── .markdown-lint.yml
67-
│ │ ├── .powershell-psscriptanalyzer.psd1
68-
│ │ └── .textlintrc
69-
│ ├── PSModule.yml
70-
│ ├── pull_request_template.md
71-
│ ├── release.yml
72-
│ ├── workflows/
73-
│ └── Process-PSModule.yml
74-
│ └── zensical.toml
75-
├── examples/
76-
├── icon/
77-
├── src/
78-
│ ├── classes/
79-
│ ├── data/
80-
│ ├── formats/
81-
│ ├── functions/
82-
│ │ ├── private/
83-
│ │ └── public/
84-
│ ├── init/
85-
│ ├── modules/
86-
│ ├── scripts/
87-
│ ├── types/
88-
│ └── variables/
89-
├── tests/
90-
│ ├── AfterAll.ps1
91-
│ ├── BeforeAll.ps1
92-
│ └── <ModuleName>.Tests.ps1
93-
├── .gitattributes
94-
├── .gitignore
95-
├── AGENTS.md
96-
├── CONTRIBUTING.md
97-
├── LICENSE
98-
└── README.md
99-
```
59+
the template's default files at one resolved commit before adding, removing, or
60+
relocating anything. Do not duplicate the template tree or file contents in
61+
this skill; the template default branch is the executable source.
62+
63+
Use the audit's classifications. Template-owned and parameterized files follow
64+
the template. Established `src/`, tests, examples, documentation content,
65+
settings overrides, and local automation remain repository-owned. Do not copy
66+
starter source or starter tests over working module code.
10067

101-
Treat files and directories as follows:
102-
103-
- Required baseline files should be present in the consumer and remain
104-
repository-local; do not rely on organization-level fallback files.
105-
- `src/`, especially `src/functions/public/` and `src/functions/private/`,
106-
along with `tests/`, `examples/`, and `icon/`, is module-owned content.
107-
Preserve its intent and only migrate paths when the framework contract
108-
requires it.
109-
- `.github/PSModule.yml`, linters, Dependabot, CODEOWNERS, release metadata,
110-
pull-request templates, and repository guidance are configuration surfaces.
111-
Inspect and preserve them independently of the caller workflow.
112-
- `tests/BeforeAll.ps1` and `tests/AfterAll.ps1` are optional root-level
113-
module-local phases, not recursively discovered test files.
114-
- Optional source folders such as `assemblies`, `formats`, `types`, `variables`,
115-
`data`, `modules`, and `scripts` are added when the module needs them; do not
116-
create empty placeholders solely to match the tree.
117-
- The template's starter test declares Pester 6 with `#Requires` and uses the
118-
native `Describe`, `It`, and `Should-Be` syntax. Preserve that requirement
119-
when the consumer already has the Pester 6 baseline.
120-
- The template's `.github/PSModule.yml` sets a zero code-coverage target and
121-
carries explicit linter environment defaults; compare these settings before
122-
replacing or deleting a consumer settings file.
123-
- The template's `AGENTS.md` points to Template-PSModule quickstart, repository
124-
defaults, module anatomy, build/test/pack/publish, and standards guidance.
125-
Preserve the consumer's local onboarding contract while updating stale links.
126-
127-
If the template revision and the consumer's existing layout disagree, record
128-
the difference and migrate only the requested integration surface. In
129-
particular, the current template uses `.github/zensical.toml`, while this v8
130-
upgrade request uses `docs/zensical.toml`, `docs/content/`, and
131-
`docs/overrides/` (including `docs/overrides/assets/`) as its documentation
132-
contract; a separate `docs/assets/` directory is optional. When that requested
133-
documentation migration is in scope, move the template's Zensical settings
134-
and custom assets into the `docs/` contract rather than maintaining both
135-
configurations. When it is not in scope, preserve the consumer's existing
136-
working configuration and report the difference.
68+
If the template conflicts with the MSX or PSModule Repository Standard, block
69+
consumer alignment and report the upstream gap. The Process-PSModule change
70+
that introduced a new framework default is responsible for evaluating and
71+
coordinating the corresponding template update.
13772

13873
For a documentation-only MkDocs migration, use the dedicated
13974
[`psmodule-zensical-migration`](../psmodule-zensical-migration/SKILL.md) skill
@@ -142,49 +77,11 @@ the caller workflow upgrade.
14277

14378
## Caller workflow contract
14479

145-
Replace `.github/workflows/Process-PSModule.yml` with exactly this template:
146-
147-
```yaml
148-
name: Process-PSModule
149-
150-
on:
151-
workflow_dispatch:
152-
schedule:
153-
- cron: '0 0 * * *'
154-
push:
155-
branches:
156-
- main
157-
pull_request:
158-
branches:
159-
- main
160-
types:
161-
- closed
162-
- opened
163-
- reopened
164-
- synchronize
165-
- labeled
166-
- unlabeled
167-
168-
concurrency:
169-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
170-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
171-
172-
permissions: {}
173-
174-
jobs:
175-
Process-PSModule:
176-
permissions:
177-
contents: read
178-
pages: write
179-
id-token: write
180-
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v8
181-
secrets:
182-
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
183-
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
184-
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
185-
```
80+
Copy `.github/workflows/Process-PSModule.yml` from the recorded
81+
`Template-PSModule` commit. Confirm that its reusable-workflow reference targets
82+
`PSModule/Process-PSModule/.github/workflows/workflow.yml@v8`.
18683

187-
The only permitted variation is an optional `TestData` entry under
84+
The only permitted consumer variation is an optional `TestData` entry under
18885
`jobs.Process-PSModule.secrets`. Do not add `with:` inputs, extra jobs,
18986
conditions, schedule changes, `run-name`, permission changes, trigger changes,
19087
concurrency changes, debug options, or version overrides. Repository-owned
@@ -226,49 +123,33 @@ uses.
226123

227124
## Documentation integration
228125

229-
Treat `docs/zensical.toml` as authoritative. Do not create or maintain
230-
`mkdocs.yml`, introduce MkDocs configuration, or replace the consumer's
231-
documentation design with a parallel theme.
126+
For a standard module repository,
127+
`Template-PSModule/.github/zensical.toml` is authoritative. Keep that path
128+
because Process-PSModule resolves it before `docs/zensical.toml` and root
129+
`zensical.toml`. Do not leave multiple active configurations.
232130

233-
Compare the consumer's configuration with the Process-PSModule template and
234-
preserve or migrate these surfaces deliberately:
131+
The standard module profile omits `nav`. Zensical derives navigation from the
132+
staged folder structure, places index pages first, and sorts remaining pages
133+
alphabetically. Preserve repository-owned content and supported assets, but do
134+
not retain a manual navigation array merely because the legacy site had one.
235135

236-
- `docs/zensical.toml`, including `docs_dir` and navigation.
237-
- `docs/content/` as the documentation source directory.
238-
- `docs/overrides/` and custom templates.
239-
- `docs/overrides/assets/stylesheets/navigation.css`.
240-
- `docs/overrides/assets/`, any optional `docs/assets/`, logo, favicon, palette,
241-
fonts, and custom JavaScript/CSS.
242-
- Existing navigation labels, page paths, and custom theme behavior.
243-
244-
Do not delete existing custom CSS/assets merely because the default theme also
245-
provides an equivalent feature. Resolve duplicate configuration in favor of
246-
the existing consumer source of truth, then validate the generated site.
136+
Invoke `psmodule-zensical-migration` when the repository has MkDocs, multiple
137+
documentation configurations, or a layout that must be migrated.
247138

248139
## Pester v6 migration
249140

250141
The framework upgrade does not permit leaving tests on an undeclared or
251-
unsupported Pester version. Inspect module requirements, dependency manifests,
252-
local setup, CI installation, and every test entry point. Declare and run the
253-
repository's supported Pester 6 dependency. If Pester 6 is already declared,
254-
retain the declaration and focus on configuration, discovery, assertions,
255-
setup/teardown, and output compatibility.
256-
257-
Rewrite tests using native Pester v6 terminology and APIs:
258-
259-
- Prefer `New-PesterConfiguration` and
260-
`Invoke-Pester -Configuration`.
261-
- Update discovery, run configuration, output, result, and coverage handling
262-
without changing test intent.
263-
- Make each test file safe under Pester v6 per-file discovery and execution.
264-
- Preserve explicit fixture ownership and loading; do not silently import the
265-
target module as a fallback for a broken framework setup.
266-
- Keep setup and teardown deterministic and scoped.
267-
- Preserve data-driven cases, mocks, pending behavior, names, tags, coverage,
268-
and result reporting while applying the v6 compatibility rules.
269-
270-
Do not merely rename commands. Run the migrated tests with the declared Pester
271-
6 dependency and investigate failures as migration or repository issues.
142+
unsupported Pester version. The dedicated `psmodule-pester-migration` skill is
143+
a required subprocedure, not an optional reference.
144+
145+
Inventory and execute every test entry point, including hidden and nested test
146+
sets. Migrate discovery, configuration, setup and teardown, data-driven cases,
147+
mocks, pending behavior, tags, results, and coverage as that skill requires.
148+
Classic `Should -Be` syntax remains compatible and does not need a cosmetic
149+
rewrite; Pester 6 breaking changes and deterministic per-file execution do.
150+
151+
Run every migrated test set with Pester 6.1.0. A declared dependency or one
152+
green default workflow is not evidence that every test set was migrated.
272153

273154
## Repository integration inventory
274155

@@ -281,7 +162,7 @@ Before editing, record the current state and the intended v8 result for:
281162
| Pester dependency | `#Requires`, manifests, install steps, lockfiles | Pester 6 is declared and installed consistently |
282163
| Pester configuration | `Invoke-Pester`, output, result, coverage | Native configuration object and v6-compatible output |
283164
| Test setup | Before/After blocks, module load, fixtures, services | Explicit ownership and deterministic per-file behavior |
284-
| Documentation | Zensical config, content, overrides, assets | Existing Zensical design remains authoritative |
165+
| Documentation | Active config, content, supported overrides and assets | Template module profile with native navigation, or a documented exception |
285166
| Repository automation | Other workflows and scripts | Unrelated automation remains separate and unchanged |
286167
| Validation | Existing tests, lint, site build, workflow checks | Existing repository-native validation is rerun |
287168

@@ -295,13 +176,9 @@ when a targeted check reveals a broader dependency:
295176
equivalent when available.
296177
3. Run the Pester v6 test suites with the repository's declared configuration.
297178
4. Run the repository's existing lint and test commands.
298-
5. When documentation exists, run:
299-
300-
```powershell
301-
Push-Location docs
302-
zensical build --clean
303-
Pop-Location
304-
```
179+
5. When documentation exists, run the repository's Process-PSModule site
180+
staging and build path. Do not substitute a direct `docs/` build when the
181+
module profile is stored in `.github/zensical.toml`.
305182

306183
6. Review the diff for accidental workflow permissions, trigger changes,
307184
secret exposure, fixture removal, generated files, or unrelated refactoring.
@@ -313,6 +190,7 @@ workflow validation.
313190
## References
314191

315192
- [PSModule repository standard](https://github.com/PSModule/Process-PSModule/blob/main/docs/content/reference/repository-standard.md)
193+
- [Template-PSModule](https://github.com/PSModule/Template-PSModule)
316194
- [PSModule workflow inputs](https://github.com/PSModule/Process-PSModule/blob/main/docs/content/reference/workflow-inputs.md)
317195
- [PSModule pipeline stages](https://github.com/PSModule/Process-PSModule/blob/main/docs/content/reference/pipeline-stages.md)
318196
- [PSModule module test guidance](https://github.com/PSModule/Process-PSModule/blob/main/docs/content/guides/writing-module-tests.md)

0 commit comments

Comments
 (0)