Skip to content

Commit cfb6558

Browse files
Add module template reconciliation skill
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 59e056c commit cfb6558

4 files changed

Lines changed: 177 additions & 4 deletions

File tree

.github/plugin/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ skill for migrating every Pester test set in a PSModule repository to Pester
2929
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)
32-
for migrating legacy MkDocs sites to the Process-PSModule Zensical design.
32+
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
35+
Template-PSModule baseline.
3336
Verify the installation with:
3437

3538
```console

.github/plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
},
77
"metadata": {
88
"description": "Agent plugins for the PSModule repository process.",
9-
"version": "1.0.0"
9+
"version": "1.1.0"
1010
},
1111
"plugins": [
1212
{
1313
"name": "psmodule",
1414
"description": "PSModule process guidance and reusable skills for PowerShell module repositories.",
15-
"version": "1.0.0",
15+
"version": "1.1.0",
1616
"source": ".github/plugin/psmodule"
1717
}
1818
]

.github/plugin/psmodule/plugin.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
33
"name": "psmodule",
44
"description": "PSModule process guidance and reusable skills for PowerShell module repositories.",
5-
"version": "1.0.0",
5+
"version": "1.1.0",
66
"author": {
77
"name": "PSModule",
88
"url": "https://github.com/PSModule"
@@ -14,6 +14,7 @@
1414
"powershell",
1515
"psmodule",
1616
"pester",
17+
"repository-template",
1718
"testing",
1819
"github-actions"
1920
],
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
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.
4+
---
5+
6+
# Reconcile a PSModule repository with Template-PSModule
7+
8+
Use this skill when checking or updating an established PowerShell module
9+
repository against the standard files in
10+
[`PSModule/Template-PSModule`](https://github.com/PSModule/Template-PSModule).
11+
Use the same procedure for one repository or as the repository-level operation
12+
inside a fleet campaign.
13+
14+
## Authority and precedence
15+
16+
Apply sources in this order:
17+
18+
1. The [MSX Repository Standard](https://msx.no/docs/Ways-of-Working/Repository-Standard/)
19+
owns enterprise policy.
20+
2. The [PSModule Repository Standard](https://psmodule.io/docs/reference/repository-standard/)
21+
adds or overrides requirements for PowerShell module repositories.
22+
3. The default branch of `PSModule/Template-PSModule` owns the executable
23+
implementation of those requirements.
24+
4. The target repository owns its module code, tests, documentation content,
25+
settings, secrets, and justified additions.
26+
27+
Resolve and record the template default-branch commit before comparing files.
28+
Use that one commit throughout the run. Do not embed a snapshot of template
29+
file contents in this skill.
30+
31+
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.
36+
37+
## Modes
38+
39+
- **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.
44+
45+
State the selected mode before editing. A fleet run invokes Audit or Reconcile
46+
once per repository; it does not combine many repositories into one branch or
47+
pull request.
48+
49+
## Inventory
50+
51+
Before comparing:
52+
53+
1. Read the target repository's local guidance, README, workflow, settings,
54+
documentation configuration, tests, and validation commands.
55+
2. Confirm that the target is a PowerShell module repository. Do not force the
56+
module template onto framework, documentation, action, archive, or other
57+
repository types.
58+
3. Resolve the current default branch and commit of `Template-PSModule`.
59+
4. Inventory every template path, including hidden files.
60+
5. Inventory every target path and any explicit local ownership or exception.
61+
6. Record the Process-PSModule caller version, Pester requirement, and
62+
documentation configuration.
63+
64+
## Classify before comparing
65+
66+
Classify every template path. Never infer that every template file can safely
67+
overwrite an established repository.
68+
69+
| Class | Treatment |
70+
| --- | --- |
71+
| Template-owned standard | Compare with the template and replace drift unless a documented target exception applies. |
72+
| Parameterized standard | Compare after applying only the substitutions declared by the template or framework. |
73+
| Configurable standard | Keep supported repository-specific values; compare the remaining structure and defaults. |
74+
| Creation scaffold | Use for new repositories. Do not overwrite established module source, tests, examples, or content. |
75+
| Repository-owned addition | Preserve it unless it violates a governing standard or breaks the framework contract. |
76+
77+
Treat governance files, caller workflows, linter settings, dependency
78+
configuration, agent entry points, and documentation-site defaults as
79+
template-owned or parameterized unless the template or PSModule standard says
80+
otherwise. Treat `src/`, established `tests/`, `examples/`, documentation
81+
content, and module-specific assets as repository-owned after creation.
82+
83+
Configuration is not automatically consumer-owned. For example,
84+
`.github/PSModule.yml` may contain valid module-specific overrides while its
85+
schema and unaffected defaults still come from the template. Compare fields,
86+
not only whole-file hashes, when the standard permits overrides.
87+
88+
## Zensical contract
89+
90+
For module repositories, `.github/zensical.toml` comes from the matching path
91+
in `Template-PSModule`.
92+
93+
- Preserve the template's repository placeholders when the framework resolves
94+
them during site staging.
95+
- Do not add a `nav` setting. Zensical generates navigation from the staged
96+
folder structure, places index pages first, and sorts the remaining pages
97+
alphabetically.
98+
- Keep the template's theme, palette, typography, icons, plugins, Markdown
99+
extensions, and supported assets together as one baseline.
100+
- Do not copy path-specific settings from `MSXOrg/docs` or
101+
`Process-PSModule/docs` directly into a generated module site. Their shared
102+
behavior must first be represented in `Template-PSModule` in a form the
103+
Process-PSModule site staging pipeline supports.
104+
- Preserve repository-specific documentation content. A deliberate visual or
105+
functional exception must be documented in the target and reported as an
106+
accepted difference.
107+
108+
Use
109+
[`psmodule-zensical-migration`](../psmodule-zensical-migration/SKILL.md) when
110+
the target still uses MkDocs or requires a documentation layout migration.
111+
112+
## Pester and workflow contracts
113+
114+
Template comparison does not prove that an established test suite is compatible
115+
with the template's Pester version. If the target does not already meet the
116+
template's Pester baseline, invoke
117+
[`psmodule-pester-migration`](../psmodule-pester-migration/SKILL.md) and migrate
118+
every test set before declaring reconciliation complete.
119+
120+
When the Process-PSModule caller requires a major-version migration, invoke
121+
[`psmodule-v8-upgrade`](../psmodule-v8-upgrade/SKILL.md). Preserve supported
122+
`TestData` and repository-owned automation instead of replacing them with
123+
template examples.
124+
125+
## Reconciliation output
126+
127+
Report each compared path with:
128+
129+
| Field | Meaning |
130+
| --- | --- |
131+
| Path | Repository-relative path. |
132+
| Class | One of the comparison classes above. |
133+
| Status | Aligned, missing, drifted, extra, accepted difference, or blocked. |
134+
| Action | None, add, update, preserve, remove, or fix template first. |
135+
| Evidence | Template commit and governing standard or documented exception. |
136+
137+
Do not count an extra repository-owned file as drift. Do not call a repository
138+
aligned when a required template-owned file is absent, a Pester migration is
139+
incomplete, or validation did not execute.
140+
141+
## Fleet operation
142+
143+
Follow the MSX Fleet Orchestration standard:
144+
145+
1. Discover repositories from authoritative organization metadata, such as the
146+
`Type: Module` custom property.
147+
2. Use one Task or Bug, branch, draft pull request, and review loop per
148+
repository.
149+
3. Put the campaign slug in every delivery issue and pull request title.
150+
4. Adopt an existing matching pull request instead of opening a duplicate.
151+
5. Store campaign state on GitHub. Local JSON or dashboards are disposable
152+
projections, not sources of truth.
153+
6. Record the template commit in every report and pull request so a later run
154+
can distinguish new template changes from unfinished work.
155+
156+
## Validation
157+
158+
1. Repeat the comparison against the same recorded template commit.
159+
2. Confirm no repository-owned content or secrets changed unintentionally.
160+
3. Run the target's smallest repository-native checks for every changed
161+
surface.
162+
4. Run Pester with the declared version when tests changed.
163+
5. Build the Zensical site when documentation settings or assets changed.
164+
6. Review the diff for unresolved placeholders, generated output, and unrelated
165+
changes.
166+
167+
Report blocked checks and their causes. A clean file comparison is not a
168+
substitute for repository tests, and a green build is not a substitute for
169+
checking template drift.

0 commit comments

Comments
 (0)