You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/PowerShell/Modules/Repository-Defaults.md
+104-4Lines changed: 104 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# PowerShell module repository defaults
2
2
3
-
This page defines the default repository contract for PowerShell module repositories in the PSModule organization. It describes what a newly created or maintained module repository should look like before module-specific code, tests, and documentation are considered.
3
+
This page defines the default repository contract for PowerShell module repositories in the PSModule organization. It describes what a newly created or maintained module repository should look like before module-specific code, tests, documentation, and managed repository files are considered.
4
4
5
-
The implementation standard still lives in [PowerShell module standard](Standards.md). This page covers repository defaults: files, metadata, README shape, release integration, and placeholder handling.
5
+
The implementation standard still lives in [PowerShell module standard](Standards.md). This page covers repository defaults: files, metadata, README shape, release integration, placeholder handling, shared community files, and managed-file distribution.
6
6
7
7
## Scope
8
8
@@ -26,8 +26,9 @@ After creating the repository:
26
26
1. Replace template tokens such as `{{ NAME }}` and `{{ DESCRIPTION }}`.
27
27
2. Remove scaffold functions, tests, and examples that do not represent the module.
28
28
3. Set repository metadata and custom properties.
29
-
4. Confirm the README reflects the module's actual status.
30
-
5. Confirm `.github/PSModule.yml` only overrides defaults when the module needs different behavior.
29
+
4. Confirm the README reflects the module's actual status and uses `Install-PSResource` for installation.
30
+
5. Confirm required common files are present.
31
+
6. Confirm `.github/PSModule.yml` only overrides defaults when the module needs different behavior.
31
32
32
33
## Required repository metadata
33
34
@@ -60,8 +61,18 @@ Module repositories use the PSModule framework layout:
60
61
| Path | Default purpose |
61
62
| ---- | --------------- |
62
63
|`README.md`| Concise landing page for the repository. |
64
+
|`LICENSE`| Repository license. PSModule module repositories default to MIT unless a different license is explicitly decided. |
65
+
|`CONTRIBUTING.md`| Contribution workflow or a repository-level pointer to the organization contribution guide. |
66
+
|`SECURITY.md`| Security support policy and private vulnerability reporting instructions. |
67
+
|`SUPPORT.md`| Support expectations and where users ask for help. |
68
+
|`CODE_OF_CONDUCT.md`| Community conduct expectations. |
|`.gitattributes`| Git line-ending and file handling defaults. |
75
+
|`.gitignore`| Shared ignore rules. |
65
76
|`src/`| Module source compiled into the shipped artifact. |
66
77
|`src/functions/public/`| Exported commands, grouped by domain. |
67
78
|`src/functions/private/`| Internal helper commands, grouped by domain. |
@@ -74,10 +85,99 @@ Module repositories use the PSModule framework layout:
74
85
75
86
Detailed source layout rules live in [PowerShell module standard](Standards.md#repository-layout).
76
87
88
+
## Required common files
89
+
90
+
Every module repository must carry the same baseline community, governance, and automation files. GitHub's organization-level `.github` community-file fallback is useful for display defaults, but it is not enough as the long-term PSModule standard because:
91
+
92
+
- agents and humans need the files in the repository they are changing, not only inherited through GitHub UI behavior;
93
+
- tools such as Dependabot, linters, CODEOWNERS, and release automation read repository-local files;
94
+
- reviews need diffs against the actual managed file in the target repository;
95
+
- repository-local files make the standard portable to other initiatives such as MSXOrg, where each initiative should define its own standards and managed files;
96
+
- central fallback files in `PSModule/.github` do not provide a reliable enforcement or update workflow across all repositories.
97
+
98
+
Required baseline files for module repositories:
99
+
100
+
| File | Why it is required |
101
+
| ---- | ------------------ |
102
+
|`README.md`| Repository landing page and evergreen context for humans and agents. |
103
+
|`LICENSE`| Clear legal terms for reuse, packaging, and redistribution. |
104
+
|`CONTRIBUTING.md`| Shared contribution workflow and expectations. |
105
+
|`SECURITY.md`| Private vulnerability reporting and latest-version support policy. |
106
+
|`SUPPORT.md`| Support channel and issue-routing expectations. |
107
+
|`CODE_OF_CONDUCT.md`| Community participation rules. |
108
+
|`.github/dependabot.yml`| Supply-chain maintenance for GitHub Actions and PowerShell dependencies. |
109
+
|`.github/CODEOWNERS`| Review routing for source, docs, and GitHub workflow files. |
110
+
|`.github/pull_request_template.md`| Consistent PR Manager-style PR descriptions and change classification. |
111
+
|`.github/release.yml`| Release-note and changelog categorization where the repository creates GitHub releases. |
112
+
|`.github/PSModule.yml`| Module workflow defaults and overrides. |
Repositories can add local files, but they should not remove these baseline files unless the repository is explicitly outside the module standard.
119
+
120
+
## Managed file distribution
121
+
122
+
Shared files should be treated as managed files. The current distribution service is [`PSModule/Distributor`](https://github.com/PSModule/Distributor). It keeps source file sets under `Repos/{Type}/{Selection}/` and syncs those files into repositories through pull requests.
123
+
124
+
The current Distributor model is subscription-based:
125
+
126
+
-`Type` is an organization repository custom property that maps a repository to a type folder such as `Module` or `Action`.
127
+
-`SubscribeTo` is an organization repository custom property that selects file sets such as `dependabot.yml`, `Linter Settings`, `PSModule Settings`, `CODEOWNERS`, `License`, `.gitattributes`, and `.gitignore`.
128
+
- Sync changes are delivered through a `managed-files/update` branch and a `⚙️ [Maintenance]: Sync managed files` pull request.
129
+
- Managed files are overwritten by the source file set. Local edits to managed files should be made in Distributor, not directly in the receiving repository.
130
+
- Removing a file from a Distributor file set does not delete the previously distributed file from target repositories; cleanup is explicit.
131
+
132
+
Two follow-up Distributor capabilities define the desired direction:
133
+
134
+
-**Global file sets** should allow common file sets such as `.gitattributes`, `.gitignore`, and `License` to be defined once and made available to all repository types while still requiring subscription.
135
+
-**Mandatory file sets** should allow organization-critical files such as `SECURITY.md`, `CODE_OF_CONDUCT.md`, `CONTRIBUTING.md`, and supply-chain configuration to be pushed to applicable repositories without each repository having to subscribe manually.
136
+
137
+
Until mandatory file sets exist, repository owners are still responsible for ensuring the required common files exist. Distributor is the preferred implementation mechanism; this document is the standard that says what must exist and why.
138
+
139
+
## Supply-chain defaults
140
+
141
+
Every module repository must include `.github/dependabot.yml`. Dependabot is part of the repository supply-chain control, not an optional convenience.
142
+
143
+
Module repositories should configure at least:
144
+
145
+
```yaml
146
+
version: 2
147
+
updates:
148
+
- package-ecosystem: "github-actions"
149
+
directory: "/"
150
+
schedule:
151
+
interval: "weekly"
152
+
labels:
153
+
- "dependencies"
154
+
- "github-actions"
155
+
156
+
- package-ecosystem: "powershell"
157
+
directory: "/"
158
+
schedule:
159
+
interval: "weekly"
160
+
labels:
161
+
- "dependencies"
162
+
- "powershell"
163
+
```
164
+
165
+
The GitHub Actions ecosystem keeps pinned actions current. The PowerShell ecosystem keeps PowerShell dependency declarations current where Dependabot supports them. Repositories with additional package ecosystems should add them explicitly rather than replacing these defaults.
166
+
167
+
Dependabot PRs still go through normal review. Automated dependency updates are not a substitute for reviewing release notes, changed permissions, pinned SHAs, or generated lock files.
168
+
77
169
## README default
78
170
79
171
A module README is a landing page, not the command reference. It should help a user identify the module, install it, and find generated documentation.
80
172
173
+
Module installation examples must use PSResourceGet:
174
+
175
+
```powershell
176
+
Install-PSResource -Name <ModuleName>
177
+
```
178
+
179
+
Do not use `Install-Module` in new module repository documentation. `Install-Module` belongs only in legacy/historical context where changing it would misrepresent the referenced system.
0 commit comments