Skip to content

Commit c9162bc

Browse files
📖 [Docs]: Contribution and PowerShell guidance made consistent (#75)
Contributors can follow the repository, agent setup, worktree, issue-planning, and PowerShell example guidance without choosing between contradictory instructions. ## Changed: Contribution guidance now agrees - Repository standards use the canonical pull request body sequence: summary, user-facing sections, optional technical details, then related issues last. - Worktree and root agent setup guidance keep concise local folder names while using the required `<type>/<issue>-<slug>` branch names. - Implementation plans organize tests alongside each behavior and explicitly preserve test-first execution. - PowerShell help guidance now identifies the generated `psmodule.io/<Module>/Functions[/<Group>]/<Function>` URL used by PSModule framework commands. ## Fixed: The FunctionCount skip example follows every remaining rule Every displayed function now includes complete comment-based help, matching `[OutputType()]` and `.OUTPUTS` metadata, typed and validated parameters, implicit output, and a `.LINK` to the public function's generated online reference page. Only the intentionally named `FunctionCount` framework test is exempted. ## Technical Details - Updated the canonical, agent, and example guidance identified by #74 without changing unrelated content. - Implementation plan progress: every task in #74 is complete. - Documentation index verification, link validation, and a clean Zensical build are complete. <details> <summary>Related issues</summary> - Fixes #74 </details> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 4c84b31 commit c9162bc

6 files changed

Lines changed: 130 additions & 28 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If you find a problem, fix it if it's small; otherwise, register it as an issue
1111
2. Clone the ecosystem locally:
1212
1. <https://github.com/MSXOrg/docs> — requires PRs to be updated.
1313
- Clone as bare and use worktrees.
14-
- Create a worktree for all branches - worktree = name of the branch.
14+
- Create a worktree for every branch. Use a concise `<issue>-<slug>` worktree folder for a topic branch named `<type>/<issue>-<slug>`.
1515
2. <https://github.com/MSXOrg/memory/> — work directly towards main.
1616
- Simple clone, only main.
1717

‎src/docs/Coding-Standards/PowerShell/Functions.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ Send each kind of message to the stream built for it, so a caller can capture, r
115115

116116
Every function carries comment-based help — including internal and private helpers, not only the public surface. It is what lets a reader or an agent understand what the function does and how to call it without reading its body, and a private helper needs that as much as a public command does. Put it first inside the body, with sections in this order: `.SYNOPSIS` (one imperative sentence), `.DESCRIPTION`, at least one `.EXAMPLE` per behaviour, then `.INPUTS`, `.OUTPUTS` (matching `[OutputType()]`), `.NOTES`, `.LINK`. Document each parameter with an inline comment above it rather than a `.PARAMETER` block, and let comments explain *why*, not *what*.
117117

118+
Functions in modules built with the PSModule framework use the generated online reference URL in `.LINK`: `https://psmodule.io/<ModuleName>/Functions/<Function-Name>` or, for a grouped command, `https://psmodule.io/<ModuleName>/Functions/<Group>/<Function-Name>`. A private helper links to the published public function it supports.
119+
118120
### `.INPUTS` and `.OUTPUTS`
119121

120122
**`.INPUTS`** documents **pipeline input only** — types accepted via `ValueFromPipeline` or `ValueFromPipelineByPropertyName` parameters. It does not document ordinary parameters.

‎src/docs/Frameworks/Process-PSModule/skipping-framework-tests.md‎

Lines changed: 103 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,38 +58,135 @@ Here's an example of a function file that skips the `FunctionCount` test because
5858
function Get-ComplexData {
5959
<#
6060
.SYNOPSIS
61-
Retrieves complex data using helper functions.
61+
Get formatted data from a file.
62+
63+
.DESCRIPTION
64+
Read data from a file and format it as a structured object.
65+
66+
.EXAMPLE
67+
Get-ComplexData -Path '.\data.txt'
68+
69+
Get the file content and its character count.
70+
71+
.INPUTS
72+
None
73+
74+
You can't pipe objects to Get-ComplexData.
75+
76+
.OUTPUTS
77+
System.Management.Automation.PSCustomObject
78+
79+
The formatted file data.
80+
81+
.NOTES
82+
This file intentionally skips only the FunctionCount framework test.
83+
84+
.LINK
85+
https://psmodule.io/<ModuleName>/Functions/Get-ComplexData
6286
#>
87+
[OutputType([PSCustomObject])]
6388
[CmdletBinding()]
6489
param(
90+
# The path to the data file.
6591
[Parameter(Mandatory)]
92+
[ValidateNotNullOrEmpty()]
6693
[string] $Path
6794
)
6895
6996
$data = Get-RawData -Path $Path
70-
$processed = Format-ComplexData -Data $data
71-
return $processed
97+
Format-ComplexData -Data $data
7298
}
7399
74100
function Get-RawData {
101+
<#
102+
.SYNOPSIS
103+
Get unformatted data from a file.
104+
105+
.DESCRIPTION
106+
Read the complete content of a data file as one string.
107+
108+
.EXAMPLE
109+
Get-RawData -Path '.\data.txt'
110+
111+
Get the complete content of the data file.
112+
113+
.INPUTS
114+
None
115+
116+
You can't pipe objects to Get-RawData.
117+
118+
.OUTPUTS
119+
System.String
120+
121+
The unformatted file content.
122+
123+
.NOTES
124+
This function is a private helper for Get-ComplexData.
125+
126+
.LINK
127+
https://psmodule.io/<ModuleName>/Functions/Get-ComplexData
128+
#>
129+
[OutputType([string])]
75130
[CmdletBinding()]
76131
param(
132+
# The path to the data file.
77133
[Parameter(Mandatory)]
134+
[ValidateNotNullOrEmpty()]
78135
[string] $Path
79136
)
80-
# Helper function implementation
137+
138+
Get-Content -LiteralPath $Path -Raw
81139
}
82140
83141
function Format-ComplexData {
142+
<#
143+
.SYNOPSIS
144+
Format raw data as a structured object.
145+
146+
.DESCRIPTION
147+
Add useful metadata to raw data while preserving its content.
148+
149+
.EXAMPLE
150+
Format-ComplexData -Data 'example'
151+
152+
Format the string and include its character count.
153+
154+
.INPUTS
155+
None
156+
157+
You can't pipe objects to Format-ComplexData.
158+
159+
.OUTPUTS
160+
System.Management.Automation.PSCustomObject
161+
162+
The formatted data and its character count.
163+
164+
.NOTES
165+
This function is a private helper for Get-ComplexData.
166+
167+
.LINK
168+
https://psmodule.io/<ModuleName>/Functions/Get-ComplexData
169+
#>
170+
[OutputType([PSCustomObject])]
84171
[CmdletBinding()]
85172
param(
173+
# The raw content to format.
86174
[Parameter(Mandatory)]
87-
$Data
175+
[ValidateNotNullOrEmpty()]
176+
[string] $Data
88177
)
89-
# Helper function implementation
178+
179+
[PSCustomObject] @{
180+
Content = $Data
181+
CharacterCount = $Data.Length
182+
}
90183
}
91184
```
92185

186+
Replace `<ModuleName>` with the module's published name. If the public function belongs to a group, insert `<Group>/` between `Functions/` and `Get-ComplexData`.
187+
188+
The skip exempts only `FunctionCount`. Every function in the file must still follow the [PowerShell function standard](../../Coding-Standards/PowerShell/Functions.md), including complete comment-based help, matching `[OutputType()]` and `.OUTPUTS` metadata, typed parameters, and implicit output.
189+
93190
## Best Practices
94191

95192
- **Use skip comments sparingly**: Framework tests exist to maintain code quality and consistency. Only skip tests when absolutely necessary.

‎src/docs/Ways-of-Working/Git-Worktrees.md‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ In a single ordinary clone the opposite is forced: one branch checked out at a t
3535
├── .bare/ # bare git data (the actual repository)
3636
├── .git # file containing: gitdir: ./.bare
3737
├── <default>/ # worktree: default branch (always clean, never worked in directly)
38-
├── 42-add-pagination/ # worktree: issue #42 in progress
39-
└── 99-fix-null-ref/ # worktree: issue #99 in progress
38+
├── 42-add-pagination/ # worktree folder; branch: feat/42-add-pagination
39+
└── 99-null-ref/ # worktree folder; branch: fix/99-null-ref
4040
```
4141

4242
- **`.bare/`** — the shared git object store. All worktrees share this.
4343
- **`.git`** — a file (not a directory) that points git tooling to `.bare/`.
4444
- **`<default>/`** — the default branch worktree (e.g. `main` or `master`). Kept as a clean reference. Used for diffing, reading docs, running comparisons. Never directly committed to.
45-
- **`<N>-<slug>/`** — one worktree per issue in flight. Named by issue number and a short slug. Branch name matches the folder name.
45+
- **`<N>-<slug>/`** — one worktree folder per issue in flight, named by issue number and a short slug. The folder is a concise local path; its branch uses the required `<type>/<issue>-<slug>` name, so the two names do not need to match.
4646

4747
## Remotes
4848

@@ -105,14 +105,16 @@ git -C .bare config "branch.$defaultBranch.merge" "refs/heads/$defaultBranch"
105105
```powershell
106106
# From the repo root (where .bare/ lives)
107107
$defaultBranch = git -C .bare symbolic-ref HEAD | ForEach-Object { $_ -replace 'refs/heads/', '' }
108-
git -C .bare worktree add ../42-add-pagination -b 42-add-pagination $defaultBranch
108+
$worktreeName = '42-add-pagination'
109+
$branchName = 'feat/42-add-pagination'
110+
git -C .bare worktree add "../$worktreeName" -b $branchName $defaultBranch
109111
110112
# Set upstream tracking (prevents "Publish Branch" prompt in VS Code)
111-
git -C .bare config branch.42-add-pagination.remote origin
112-
git -C .bare config branch.42-add-pagination.merge refs/heads/42-add-pagination
113+
git -C .bare config "branch.$branchName.remote" origin
114+
git -C .bare config "branch.$branchName.merge" "refs/heads/$branchName"
113115
114116
# Open in VS Code
115-
code 42-add-pagination
117+
code $worktreeName
116118
```
117119

118120
Then follow the normal Implement flow: initial commit → push → draft PR → build → finalize.
@@ -124,7 +126,7 @@ Then follow the normal Implement flow: initial commit → push → draft PR →
124126
git -C .bare worktree remove 42-add-pagination
125127
126128
# Delete the local branch ref
127-
git -C .bare branch -D 42-add-pagination
129+
git -C .bare branch -D feat/42-add-pagination
128130
129131
# Prune if needed (removes stale worktree references)
130132
git -C .bare worktree prune

‎src/docs/Ways-of-Working/Issue-Format.md‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,11 @@ The task-level roadmap. Implementers track progress here; reviewers use it to un
229229
Structure:
230230

231231
- Every discrete piece of work is a checkbox: `- [ ]`.
232-
- Tasks are grouped under subheadings when work spans multiple areas (files, components, tests).
232+
- Tasks are grouped under subheadings when work spans multiple behaviors or dependencies. Keep each behavior's tests with its implementation tasks.
233233
- Each task is specific and actionable — file paths, function names, modules.
234234
- All tasks start unchecked. Checking happens during implementation.
235-
- Tasks are ordered logically — dependencies first, tests last.
235+
- Order groups and tasks so scope and dependencies are clear; the checklist layout is not a mandatory execution sequence.
236+
- Follow [test-first development](../Coding-Standards/Testing.md#test-first): define and run a behavior's test before implementing that behavior, regardless of how its checkboxes are organized.
236237

237238
For PBIs and Epics, Section 3 is **a list of links to child issues**, not inline tasks. See [Issue Hierarchy](Issue-Hierarchy.md).
238239

@@ -243,17 +244,17 @@ For PBIs and Epics, Section 3 is **a list of links to child issues**, not inline
243244

244245
## Implementation plan
245246

246-
### Core changes
247+
### Paged responses
247248

249+
- [ ] Add unit test for single-page response
250+
- [ ] Add unit test for multi-page response
248251
- [ ] Add a paged-request helper in `src/lib/`
249252
- [ ] Update the `repo list` command to call the paged variant in `src/commands/repository/`
250-
- [ ] Add a `--limit` option with integer type and validation
251253

252-
### Tests
254+
### Result limiting
253255

254-
- [ ] Add unit test for single-page response
255-
- [ ] Add unit test for multi-page response
256256
- [ ] Add unit test for `--limit` option limiting results
257+
- [ ] Add a `--limit` option with integer type and validation
257258

258259
### Documentation
259260

@@ -375,17 +376,17 @@ multi-page, and `--limit` limiting.
375376

376377
## Implementation plan
377378

378-
### Core changes
379+
### Paged responses
379380

381+
- [ ] Add unit test for single-page response
382+
- [ ] Add unit test for multi-page response
380383
- [ ] Add a paged-request helper in `src/lib/`
381384
- [ ] Update the `repo list` command to call the paged variant in `src/commands/repository/`
382-
- [ ] Add a `--limit` option with integer type and validation
383385

384-
### Tests
386+
### Result limiting
385387

386-
- [ ] Add unit test for single-page response
387-
- [ ] Add unit test for multi-page response
388388
- [ ] Add unit test for `--limit` option limiting results
389+
- [ ] Add a `--limit` option with integer type and validation
389390

390391
### Documentation
391392

‎src/docs/Ways-of-Working/Repository-Standard.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Default title pattern:
110110
<Icon> [<Change type>]: <User-facing outcome>
111111
```
112112

113-
The description should lead with user-facing impact, then issue links when available, then user-facing change sections, with technical details at the bottom.
113+
The description should lead with user-facing impact, continue with user-facing change sections, include optional technical details after those sections, and end with the related-issues block.
114114

115115
Repository templates may be simpler than the full PR Manager body, but they must gather enough information to reconstruct it.
116116

0 commit comments

Comments
 (0)