Skip to content

Commit 3d2cace

Browse files
Reconcile PR 61 standards deltas onto main docs structure
1 parent 88c92d8 commit 3d2cace

3 files changed

Lines changed: 103 additions & 71 deletions

File tree

src/docs/Modules/Module-Types.md

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Module types
22

33
Most PSModule modules fall into one of a few archetypes. The general rules in
4-
[PowerShell module standard](Standards.md) and [PowerShell Standards](../PowerShell/Standard/index.md) always apply; this
4+
[PowerShell module standard](Standards.md) and the [PowerShell style guide](../Style-Guides/PowerShell.md) always apply; this
55
page adds the conventions that are specific to a module's type so that modules of the same kind feel
66
the same to use.
77

@@ -32,40 +32,28 @@ the HTTP method or the endpoint path. Map REST methods to verbs:
3232
| `DELETE` | `Remove-` | `Remove-GitHubRepository` |
3333
| Non-CRUD action | Approved verb for the intent | `Invoke-`, `Start-`, `Stop-`, `Enable-`, ... |
3434

35-
Prefix the noun with the service's term of art (`GitHubRepository`, not `Repository`).
35+
Prefix the noun with the service's term of art (`GitHubRepository`, not `Repository`). See the
36+
[PowerShell style guide](../Style-Guides/PowerShell.md) for naming guidance.
3637

37-
### Transport abstraction
38+
### Transport stays private
3839

39-
Lower-level helpers own the concrete `Invoke-RestMethod` / GraphQL / HTTP calls. How you expose
40-
or hide this abstraction is a design choice:
41-
42-
- **Private transport** (common): Keep REST, GraphQL, and HTTP helpers private. Public functions
43-
accept resolved inputs and typed objects. This follows the Dependency Inversion rule from
44-
[Standards](Standards.md#solid-applied) applied to the network boundary.
45-
- **Public transport**: Expose REST or GraphQL functions publicly for power users or module
46-
composition.
47-
- **Public Context**: Expose the `Context` module as public so users can configure and manage
48-
module state, secrets, and settings directly.
49-
50-
Choose the strategy that best serves your module's audience.
40+
Public functions accept resolved inputs and typed objects; private helpers own the concrete
41+
`Invoke-RestMethod` / GraphQL / HTTP calls. This is the Dependency Inversion rule from
42+
[Standards](Standards.md#solid-applied) applied to the network boundary.
5143

5244
### Use Context for user and module settings
5345

5446
Integration modules persist state with the [`Context`](https://github.com/PSModule/Context) module
55-
rather than inventing bespoke storage. Context provides on-disk storage for user data and secrets,
56-
organized by context and environment. Two kinds of state are both standard:
47+
rather than inventing bespoke storage. Two kinds of state are both standard:
5748

58-
- **User settings and secrets**: accounts, tokens, sessions, and per-user configuration. Store these
49+
- **User settings and secrets** accounts, tokens, sessions, and per-user configuration. Store these
5950
in a per-user context. `Context` encrypts secrets at rest (via `Sodium`), so a user can resume work
6051
without reconfiguring or logging in again when the service supports session refresh.
61-
- **Module settings**: module-wide defaults, endpoints, and feature flags that are not tied to a
52+
- **Module settings** module-wide defaults, endpoints, and feature flags that are not tied to a
6253
single user. Store these in a module-scoped context.
6354

64-
Your module must expose functions and object types so users can target specific contexts and
65-
environments. Users need to be able to read from, write to, and manage contexts programmatically,
66-
selecting which environment or context their functions operate against. Persisting both through
67-
`Context` gives every integration module the same, discoverable settings model and keeps secrets
68-
out of source, logs, and plain files.
55+
Persisting both through `Context` gives every integration module the same, discoverable settings
56+
model, and keeps secrets out of source, logs, and plain files.
6957

7058
## Data modules
7159

@@ -80,14 +68,14 @@ format-specific representation into an object; `ConvertTo-<Format>` renders an o
8068
format. Converting through the object as a common pivot means any format interoperates with any
8169
other, instead of writing a direct converter for every pair.
8270

83-
Always ship both directions so data can round-trip between the format and the object model.
71+
Always ship **both** directions so data can round-trip between the format and the object model.
8472

8573
### Verb vocabulary
8674

8775
| Verb pattern | Purpose |
8876
| ------------ | ------- |
8977
| `ConvertFrom-<Format>` | Format-specific text/representation → `[PSCustomObject]` / `[hashtable]` |
90-
| `ConvertTo-<Format>` | `[PSCustomObject]` / `[hashtable]` → format-specific text/representation |
78+
| `ConvertTo-<Format>` | Object → format-specific text/representation |
9179
| `Import-<Noun>` | Read from a file or store into objects |
9280
| `Export-<Noun>` | Write objects to a file or store |
9381
| `Format-<Noun>` | Produce a normalized or pretty rendering |
@@ -98,9 +86,10 @@ Always ship both directions so data can round-trip between the format and the ob
9886

9987
The `Hashtable` module demonstrates the full set: `ConvertFrom-Hashtable`, `ConvertTo-Hashtable`,
10088
`Import-Hashtable`, `Export-Hashtable`, `Format-Hashtable`, `Merge-Hashtable`, and
101-
`Remove-HashtableEntry`.
89+
`Remove-HashtableEntry`. See the [PowerShell style guide](../Style-Guides/PowerShell.md) for naming guidance.
10290

10391
## Where this connects
10492

105-
- [PowerShell module standard](Standards.md): layout, private functions, and the mandatory context parameter.
106-
- [Repository Defaults](Repository-Defaults.md): repository files, README shape, and agent onboarding.
93+
- [PowerShell style guide](../Style-Guides/PowerShell.md) — the concrete verb rules for both types.
94+
- [PowerShell module standard](Standards.md) — layout, private functions, and the mandatory context parameter.
95+
- [Repository Defaults](Repository-Defaults.md) — repository files, README shape, and agent onboarding.

src/docs/Modules/Repository-Defaults.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Module repositories use the PSModule framework layout:
6868
| `SECURITY.md` | Security support policy and private vulnerability reporting instructions. |
6969
| `SUPPORT.md` | Support expectations and where users ask for help. |
7070
| `CODE_OF_CONDUCT.md` | Community conduct expectations. |
71-
| `AGENTS.md` | Agent onboarding entry point. Points agents to the canonical guidance in `PSModule/docs`. |
71+
| `AGENTS.md` | Agent onboarding entry point. Points agents to the PSModule and MSX documentation for the why, how, and what. |
7272
| `CLAUDE.md` | Claude Code entry point. Imports `AGENTS.md` so Claude reads the same instructions. |
7373
| `.github/copilot-instructions.md` | VS Code and GitHub Copilot repository instructions. Points to the same documentation. |
7474
| `.github/PSModule.yml` | Module workflow configuration overrides. |
@@ -111,7 +111,7 @@ Required baseline files for module repositories:
111111
| `SECURITY.md` | Private vulnerability reporting and latest-version support policy. |
112112
| `SUPPORT.md` | Support channel and issue-routing expectations. |
113113
| `CODE_OF_CONDUCT.md` | Community participation rules. |
114-
| `AGENTS.md` | Cross-tool agent instructions pointing to the canonical guidance in `PSModule/docs`. |
114+
| `AGENTS.md` | Cross-tool agent instructions pointing to the PSModule and MSX documentation. |
115115
| `CLAUDE.md` | Claude Code entry point that imports `AGENTS.md`. |
116116
| `.github/copilot-instructions.md` | VS Code and GitHub Copilot repository instructions pointing to the documentation. |
117117
| `.github/dependabot.yml` | Supply-chain maintenance for GitHub Actions and PowerShell dependencies. |
@@ -130,11 +130,11 @@ Each repository must stand on its own. It carries its own copy of every file abo
130130

131131
## Agent onboarding files
132132

133-
Every repository must be usable by an agent that has never seen it before, without special configuration. Each repository carries its own agent entry points that point to the authoritative documentation instead of restating it:
133+
Every repository must be usable by an agent that has never seen it before, without special configuration. Each repository carries its own agent entry points that *point to* the authoritative documentation instead of restating it:
134134

135-
- `AGENTS.md`: the cross-tool entry point, read by the GitHub Copilot coding agent, VS Code, and other AGENTS.md-aware tools. It names what the repository is in a line or two and points to the canonical agent guidance in [`PSModule/docs`](https://github.com/PSModule/docs).
136-
- `CLAUDE.md`: a thin file that imports `AGENTS.md` with `@AGENTS.md` so Claude Code reads the same instructions. Claude-specific notes, if any, go below the import.
137-
- `.github/copilot-instructions.md`: repository instructions for VS Code and GitHub Copilot that point to the same documentation.
135+
- `AGENTS.md`the cross-tool entry point, read by the GitHub Copilot coding agent, VS Code, and other AGENTS.md-aware tools. It names what the repository is in a line or two and points to the PSModule documentation (`https://psmodule.io`, source in [`PSModule/docs`](https://github.com/PSModule/docs)) for the module's why/how/what, and to the MSX documentation (`https://msxorg.github.io/docs`, source in [`MSXOrg/docs`](https://github.com/MSXOrg/docs)) for organization-level principles and ways of working.
136+
- `CLAUDE.md` a thin file that imports `AGENTS.md` with `@AGENTS.md` so Claude Code reads the same instructions. Claude-specific notes, if any, go below the import.
137+
- `.github/copilot-instructions.md` repository instructions for VS Code and GitHub Copilot that point to the same documentation.
138138

139139
These files are the agent equivalent of the README: pointers, not copies. Keep them short so the linked documentation stays the single source of truth. Like the other governance files, they live in the repository itself so it can stand on its own.
140140

@@ -199,7 +199,7 @@ Dependabot PRs still go through normal review. Automated dependency updates are
199199
200200
A module README is a start page, not the command reference or full manual. It brings a reader in, answers the first questions, and sends them to the right documentation surface.
201201
202-
Making the README shorter must not delete unique information. The README is published as the module's landing page on the documentation site (for example `psmodule.io/<ModuleName>`); the per-command reference is generated separately from comment-based help. So the README is often the only published home for prerequisites, platform and dependency notes, authentication and setup guidance, operational behavior such as caching, state, or update and versioning semantics, and upstream attribution. Trimming the README must preserve that content: keep it on the landing page, or move it only to another surface that also publishes (a command group's overview page under `src/functions/public/<Group>/<Group>.md`, comment-based help, or published documentation in `docs/`). Only remove content that is genuinely duplicated by the generated command reference.
202+
Making the README shorter must not delete unique information. The README is published as the module's landing page on the documentation site (for example `psmodule.io/<ModuleName>`); the per-command reference is generated separately from comment-based help. So the README is often the only published home for prerequisites, platform and dependency notes, authentication and setup guidance, operational behavior such as caching, state, or update and versioning semantics, and upstream attribution. Trimming the README must preserve that content: keep it on the landing page, or move it only to another surface that also publishes (a command group's overview page under `src/functions/public/<Group>/<Group>.md`, or comment-based help). Only remove content that is genuinely duplicated by the generated command reference.
203203

204204
The README answers these questions, in this order:
205205

@@ -208,7 +208,7 @@ The README answers these questions, in this order:
208208
| What is it? | Name the module and define its scope in one short paragraph. |
209209
| Why should I care? | State the value or kind of task the module makes easier. |
210210
| How do I get it? | Show the PowerShell Gallery install and import commands. |
211-
| How does it work? | Show one to three representative capabilities or usage examples. |
211+
| How does it work? | Show one to three representative usage examples. |
212212
| How do I get more info? | Link to generated module documentation and PowerShell help. |
213213

214214
Module installation examples must use PSResourceGet:
@@ -235,11 +235,11 @@ Install-PSResource -Name <ModuleName>
235235
Import-Module -Name <ModuleName>
236236
```
237237

238-
## Capabilities
238+
## Usage
239239

240-
Use this section as a short showcase and introduction to how the module works. Show the most important things the module makes possible with one to three realistic examples.
240+
Use this section as a short showcase and introduction to how the module works. Show the most important things the module makes possible with one to three realistic examples; `### Example: <scenario>` subsections are fine when you have more than one.
241241

242-
The goal is discovery and marketing, not exhaustive command documentation. A reader should understand why the module exists and what kind of tasks it helps with.
242+
The goal is discovery, not exhaustive command documentation. A reader should understand why the module exists and what kind of tasks it helps with.
243243

244244
```powershell
245245
# Replace this with a real example that demonstrates the module's value.
@@ -260,19 +260,19 @@ Get-Help -Name <Command> -Examples
260260

261261
In the documentation examples, replace `<Command>` with a real command exported by the module, for example `Get-Help -Name Get-GitHubRepository -Examples`, so the snippet runs as written. Do not ship placeholder tokens such as `'CommandName'` or `<CommandName>` as if they were runnable commands.
262262

263-
Implemented modules must include the capabilities or usage showcase before the documentation link. Keep it focused on discovery: show one to three representative outcomes, not every command, parameter, or edge case. A landing page with only an installation snippet and a documentation link is not enough for a module that has working commands.
263+
Implemented modules must include the `## Usage` showcase before the documentation link. Keep it focused on discovery: show one to three representative outcomes, not every command, parameter, or edge case. A landing page with only an installation snippet and a documentation link is not enough for a module that has working commands. Do not title this section `## Capabilities`; use `## Usage` (or `## Examples`).
264264

265265
Keep, trim, or relocate content — do not delete it:
266266

267-
- **Keep on the landing page:** the overview, prerequisites and requirements (PowerShell version, supported platforms, module or native dependencies), installation, the capabilities showcase, and the short operational notes a reader needs before first use.
267+
- **Keep on the landing page:** the overview, prerequisites and requirements (PowerShell version, supported platforms, module or native dependencies), installation, the usage showcase, and the short operational notes a reader needs before first use.
268268
- **Trim:** exhaustive command inventories, parameter tables, and repetitive examples that differ only by a parameter. These come from comment-based help — point to `Get-Help` and the documentation site instead of restating them.
269-
- **Relocate only to a published home — never drop:** long-form guides and unique conceptual content (authentication and setup walkthroughs, deep operational detail, end-to-end scenarios) may move out of the README only into a surface that is actually published: a command group's overview page under `src/functions/public/<Group>/<Group>.md`, comment-based help, or published documentation in `docs/` or `examples/`. Only relocate to unpublished areas if there is no published home for it yet; keep the full content in the README to ensure it reaches users. A longer landing page is acceptable and expected for feature-rich modules; do not shorten by deleting.
269+
- **Relocate only to a published home — never drop:** long-form guides and unique conceptual content (authentication and setup walkthroughs, deep operational detail, end-to-end scenarios) may move out of the README only into a surface that is actually published: a command group's overview page under `src/functions/public/<Group>/<Group>.md`, or comment-based help. A bare top-level `docs/` folder is not published by the current docs build, so moving content there drops it from the site. When there is no published home for it yet, keep the full content in the README. A longer landing page is acceptable and expected for feature-rich modules; do not shorten by deleting.
270270

271271
Retain upstream attribution and licensing context. Credit, acknowledgements, donation notes, and third-party license notices for wrapped or bundled work must stay in the README, or move to a clearly linked place. The rule below about community and policy sections does not apply to attribution the project is expected to carry.
272272

273273
README pages should not duplicate generated command documentation. Do not add full command inventories, parameter tables, or long reference sections when those details are already produced from comment-based help.
274274

275-
Do not add a community-file or policy link section by default. Readers can find standard repository files such as `LICENSE`, `CONTRIBUTING.md`, `SECURITY.md`, and `CODE_OF_CONDUCT.md` through GitHub conventions and the repository file tree. Link them only when the module has an unusual rule the user must know before using it, or when it carries required upstream attribution.
275+
Do not add a community-file, policy, or Contributing link section to the README by default, and do not add a `## Contributing` section. Each repository carries its own `CONTRIBUTING.md`, `SECURITY.md`, `SUPPORT.md`, and `CODE_OF_CONDUCT.md`; readers and tools find them through the repository file tree and GitHub renders them in its UI. The README links or restates them only when the module has an unusual rule the user must know before using it, or when it carries required upstream attribution.
276276

277277
## Placeholder and in-progress repositories
278278

@@ -307,15 +307,15 @@ Before opening a README-only PR, check that the README follows the default and d
307307
```powershell
308308
Select-String -Path README.md -SimpleMatch -Pattern 'Greet-Entity', 'PSModuleTemplate', 'YourModuleName'
309309
Select-String -Path README.md -SimpleMatch -Pattern '{{ NAME }}', '{{ DESCRIPTION }}'
310-
Select-String -Path README.md -SimpleMatch -Pattern '<Command>', '<CommandName>', "-Name 'CommandName'"
310+
Select-String -Path README.md -SimpleMatch -Pattern "-Name 'CommandName'", '<CommandName>'
311311
Select-String -Path README.md -Pattern '^## (Commands|Capabilities)$'
312312
Select-String -Path README.md -Pattern '^Install-Module\b'
313313
git diff --check -- README.md
314314
```
315315

316316
`Template-PSModule` is the exception: it intentionally keeps `{{ NAME }}` and `{{ DESCRIPTION }}` tokens because those are template inputs.
317317

318-
For an implemented module, also confirm the README keeps a capabilities or usage showcase and that any unique content removed from the previous version — prerequisites, setup or authentication guidance, operational notes, or upstream attribution — was relocated to `docs/`, `examples/`, or comment-based help rather than deleted.
318+
For an implemented module, also confirm the README keeps a `## Usage` showcase and that any unique content removed from the previous version — prerequisites, setup or authentication guidance, operational notes, or upstream attribution — was kept on the landing page or relocated to a published home (`src/functions/public/<Group>/<Group>.md` or comment-based help) rather than deleted. Repository-only locations such as `examples/` are not published on their own, so content moved there must still be linked from the README.
319319

320320
## Documentation ownership
321321

0 commit comments

Comments
 (0)