Skip to content

Commit 548ac52

Browse files
feat: add MkDocs to Zensical migration skill
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent eed97de commit 548ac52

5 files changed

Lines changed: 175 additions & 6 deletions

File tree

.github/plugin/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ skill for migrating every Pester test set in a PSModule repository to Pester
2727
6.1.0, and the
2828
[`psmodule-v8-upgrade`](./psmodule/skills/psmodule-v8-upgrade/SKILL.md)
2929
skill for upgrading Process-PSModule consumer repositories to framework v8.
30+
It also provides
31+
[`psmodule-zensical-migration`](./psmodule/skills/psmodule-zensical-migration/SKILL.md)
32+
for migrating legacy MkDocs sites to the Process-PSModule Zensical design.
3033
Verify the installation with:
3134

3235
```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.4.0"
9+
"version": "1.5.0"
1010
},
1111
"plugins": [
1212
{
1313
"name": "psmodule",
1414
"description": "PSModule process guidance and reusable skills for PowerShell module repositories.",
15-
"version": "1.4.0",
15+
"version": "1.5.0",
1616
"source": ".github/plugin/psmodule"
1717
}
1818
]

.github/plugin/psmodule/plugin.json

Lines changed: 1 addition & 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.4.0",
5+
"version": "1.5.0",
66
"author": {
77
"name": "PSModule",
88
"url": "https://github.com/PSModule"

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,19 @@ Treat files and directories as follows:
127127
If the template revision and the consumer's existing layout disagree, record
128128
the difference and migrate only the requested integration surface. In
129129
particular, the current template uses `.github/zensical.toml`, while this v8
130-
upgrade request uses `docs/zensical.toml`, `docs/content/`, `docs/overrides/`,
131-
and `docs/assets/` as its documentation contract. When that requested
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
132133
documentation migration is in scope, move the template's Zensical settings
133134
and custom assets into the `docs/` contract rather than maintaining both
134135
configurations. When it is not in scope, preserve the consumer's existing
135136
working configuration and report the difference.
136137

138+
For a documentation-only MkDocs migration, use the dedicated
139+
[`psmodule-zensical-migration`](../psmodule-zensical-migration/SKILL.md) skill
140+
so content, theme, assets, and link validation are handled independently from
141+
the caller workflow upgrade.
142+
137143
## Caller workflow contract
138144

139145
Replace `.github/workflows/Process-PSModule.yml` with exactly this template:
@@ -231,7 +237,8 @@ preserve or migrate these surfaces deliberately:
231237
- `docs/content/` as the documentation source directory.
232238
- `docs/overrides/` and custom templates.
233239
- `docs/overrides/assets/stylesheets/navigation.css`.
234-
- `docs/assets/`, logo, favicon, palette, fonts, and custom JavaScript/CSS.
240+
- `docs/overrides/assets/`, any optional `docs/assets/`, logo, favicon, palette,
241+
fonts, and custom JavaScript/CSS.
235242
- Existing navigation labels, page paths, and custom theme behavior.
236243

237244
Do not delete existing custom CSS/assets merely because the default theme also
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
---
2+
name: psmodule-zensical-migration
3+
description: Migrate a PSModule repository from MkDocs to Zensical using the Process-PSModule documentation design as the default while preserving content, navigation, assets, and repository-specific behavior.
4+
---
5+
6+
# Migrate PSModule documentation from MkDocs to Zensical
7+
8+
Use this skill when a PSModule repository has a legacy MkDocs configuration,
9+
usually `.github/mkdocs.yml`, or needs its documentation site aligned with the
10+
Process-PSModule Zensical design. Keep the migration limited to documentation
11+
integration. Do not rewrite module code or tests unless a documentation build
12+
requires a directly related fix.
13+
14+
## Source-of-truth design
15+
16+
Use the current
17+
[`Process-PSModule` `docs/zensical.toml`](https://github.com/PSModule/Process-PSModule/blob/main/docs/zensical.toml)
18+
as the default style and configuration baseline. Reuse its behavior rather than
19+
inventing a second theme:
20+
21+
- `docs_dir = "content"` with content under `docs/content/`.
22+
- `docs/overrides/` as the custom theme directory.
23+
- `docs/overrides/assets/stylesheets/navigation.css` for navigation styling.
24+
- `docs/overrides/assets/` and any repository-owned `docs/assets/` directory
25+
when present as the asset source of truth.
26+
- Mona Sans text and Source Code Pro code fonts.
27+
- Material-style GitHub/link icons, light/dark/system palette toggles,
28+
black/slate/light-blue colors, and the established navigation features.
29+
- Instant navigation, prefetch/preview/progress, tabs, tracking, top navigation,
30+
search, code copy, tooltips, table of contents, and footer behavior.
31+
- TOC, attribute lists, abbreviations, admonitions, definition lists,
32+
footnotes, tables, HTML-in-Markdown, details, superfences, task lists, and
33+
snippets extensions.
34+
- Mermaid fenced blocks and the shared abbreviations snippet.
35+
- Existing social links, consent configuration, site metadata, edit URI, and
36+
custom tablesort JavaScript where those features apply.
37+
38+
Customize only repository identity and content-specific values such as
39+
`site_name`, `site_url`, `repo_name`, `repo_url`, `edit_uri`, copyright, social
40+
links, and `nav`. Do not remove a default feature merely because the old
41+
MkDocs site did not use it.
42+
43+
## Inspect before changing
44+
45+
Inventory the existing repository and record:
46+
47+
1. Local guidance, branch state, and documentation build commands.
48+
2. `.github/mkdocs.yml`, any `mkdocs.yml`, and any existing Zensical config.
49+
3. The Markdown content root, includes/snippets, templates, media, and assets.
50+
4. `theme`, `theme.custom_dir`, `extra_css`, `extra_javascript`, `plugins`,
51+
`markdown_extensions`, `nav`, `extra`, and `watch` settings.
52+
5. Links, anchors, generated API/help pages, redirects, and CI publishing steps.
53+
6. Existing custom CSS, JavaScript, templates, logos, favicons, and fonts.
54+
55+
Do not assume every consumer has a `docs/` tree. If documentation is absent,
56+
create it only when the requested scope includes documentation migration. If
57+
the repository already uses Zensical, compare it with the Process-PSModule
58+
baseline and make only the required alignment changes.
59+
60+
## Target layout
61+
62+
For the Process-PSModule documentation contract, use:
63+
64+
```text
65+
docs/
66+
├── content/
67+
├── overrides/
68+
│ └── assets/
69+
│ ├── javascripts/
70+
│ └── stylesheets/
71+
└── zensical.toml
72+
```
73+
74+
Keep existing content under `docs/content/`, custom templates under
75+
`docs/overrides/`, and theme assets under `docs/overrides/assets/`. A separate
76+
`docs/assets/` directory is optional for static content assets. Do not create a
77+
parallel MkDocs theme or leave two active site configurations.
78+
79+
The current `PSModule/Template-PSModule` repository historically stores a
80+
starter `.github/zensical.toml` and may not contain a `docs/` tree. When the
81+
consumer upgrade explicitly requires the Process-PSModule `docs/` contract,
82+
move the template settings and custom assets into `docs/` and remove the
83+
obsolete active configuration only after the site builds. When that contract
84+
is not in scope, preserve a working template layout and report the difference
85+
instead of moving files speculatively.
86+
87+
## MkDocs-to-Zensical mapping
88+
89+
Translate behavior, not just filenames:
90+
91+
| MkDocs | Zensical |
92+
| --- | --- |
93+
| `site_name`, `site_url` | `[project]` metadata |
94+
| `docs_dir` | `[project].docs_dir` |
95+
| `repo_name`, `repo_url`, `edit_uri` | `[project]` metadata |
96+
| `nav` | `nav = [...]` TOML entries |
97+
| `theme.name` | `[project.theme]` settings |
98+
| `theme.custom_dir` | `[project.theme].custom_dir` |
99+
| `theme.logo`, `theme.favicon` | `[project.theme]` paths |
100+
| `theme.features` | `[project.theme].features` |
101+
| `theme.palette` | `[[project.theme.palette]]` tables |
102+
| `extra_css`, `extra_javascript` | `[project]` arrays |
103+
| `markdown_extensions` | `[project.markdown_extensions.*]` tables |
104+
| `plugins: search` | `[project.plugins.search]` |
105+
| `extra.social` | `[[project.extra.social]]` |
106+
| `watch` | `[project].watch` |
107+
108+
Preserve Markdown semantics while checking extensions that affect formatting:
109+
admonitions, fenced code, tables, task lists, definition lists, attributes,
110+
snippets, Mermaid, and anchor/permalink behavior. Fix only documented
111+
Zensical incompatibilities; do not silently change headings or links to hide
112+
build failures.
113+
114+
## Content and link migration
115+
116+
- Preserve page paths and navigation labels where possible.
117+
- Keep explicit `nav` entries for important landing pages and references.
118+
- Resolve relative links from the new `docs/content/` root.
119+
- Recheck fragment anchors because heading and permalink behavior can differ.
120+
- Move includes/snippets to the configured Zensical location and update every
121+
reference.
122+
- Keep generated API/help inputs in their framework-owned locations.
123+
- Preserve images and downloads; update paths rather than deleting assets.
124+
- Keep custom templates only when they are still required by the migrated site.
125+
126+
## Validation
127+
128+
Run repository-native checks and the smallest targeted site checks first:
129+
130+
1. Parse the new `docs/zensical.toml` and verify all configured paths exist.
131+
2. Confirm no active `mkdocs.yml` or MkDocs workflow remains.
132+
3. Check every navigation target, image, download, include, and fragment link.
133+
4. Run the existing documentation lint and link checks.
134+
5. Build the site:
135+
136+
```powershell
137+
Push-Location docs
138+
zensical build --clean
139+
Pop-Location
140+
```
141+
142+
6. Review the generated site for navigation, search, palette toggles, fonts,
143+
logo/favicon, custom navigation behavior, code blocks, Mermaid, and social
144+
links.
145+
7. Run the repository's existing Process-PSModule workflow validation when the
146+
documentation is part of that pipeline.
147+
148+
Do not claim success if the site builds while links, assets, navigation, or
149+
publishing behavior are broken. Report intentionally deferred pages,
150+
unsupported extensions, and unrelated pre-existing failures.
151+
152+
## References
153+
154+
- [Process-PSModule Zensical configuration](https://github.com/PSModule/Process-PSModule/blob/main/docs/zensical.toml)
155+
- [Process-PSModule documentation overrides](https://github.com/PSModule/Process-PSModule/tree/main/docs/overrides)
156+
- [Process-PSModule override assets](https://github.com/PSModule/Process-PSModule/tree/main/docs/overrides/assets)
157+
- [PSModule repository standard](https://github.com/PSModule/Process-PSModule/blob/main/docs/content/reference/repository-standard.md)
158+
- [PSModule documentation model](https://github.com/PSModule/Process-PSModule/blob/main/docs/content/guides/structuring-your-module.md)
159+
- [Zensical setup basics](https://zensical.org/docs/setup/basics/)

0 commit comments

Comments
 (0)