|
| 1 | +--- |
| 2 | +title: Module Build Validation |
| 3 | +description: PSModule-specific validation checks that extend the shared MSXOrg Build/Implement workflow step before a draft pull request is marked ready. |
| 4 | +--- |
| 5 | + |
| 6 | +# Module Build Validation |
| 7 | + |
| 8 | +Use this page after scaffolding a module change or implementing a function and before you finish self-review or mark a draft pull request ready. It extends the shared MSXOrg [Workflow Build step](https://msxorg.github.io/docs/Ways-of-Working/Workflow/#build) and [Implement guidance](https://msxorg.github.io/docs/Agents/implement/) with the PSModule-specific validation checks that module repositories must pass. |
| 9 | + |
| 10 | +Do not repeat the shared workflow here. Follow the shared branch → draft PR → implement → test → self-review loop first, then run this PSModule pass to confirm the change still fits the module's design, documentation, and PowerShell standards. |
| 11 | + |
| 12 | +## Validation sequence |
| 13 | + |
| 14 | +1. **Module design alignment** |
| 15 | + |
| 16 | + Confirm that the change fits the module's archetype and the module-specific design rules before reviewing individual files. |
| 17 | + |
| 18 | + Check: |
| 19 | + |
| 20 | + - the module still follows the right archetype from [Module types](../Module-Types.md) |
| 21 | + - the change respects the layout, private-helper boundaries, context rules, and SOLID guidance in [PowerShell module standard](../Standards.md) |
| 22 | + - the function belongs in this module instead of a different module, a shared helper, or a follow-up issue |
| 23 | + |
| 24 | + A human contributor or agent should be able to explain why this change belongs in this module, in this shape, without inventing new local rules. |
| 25 | + |
| 26 | +2. **Module documentation** |
| 27 | + |
| 28 | + Confirm that the repository-level and group-level documentation still matches the delivered behavior. |
| 29 | + |
| 30 | + Check: |
| 31 | + |
| 32 | + - `README.md` still answers the start-page questions and reflects any user-visible behavior, prerequisites, or setup changes from [Repository Defaults](../Repository-Defaults.md#readme-default) |
| 33 | + - the relevant public command-group overview page (`src/functions/public/<Group>/<Group>.md`) exists or is updated when the change affects that group's purpose or usage, per [PowerShell module standard](../Standards.md#repository-layout) |
| 34 | + - any module-level documentation under `docs/` or other published surfaces is updated when the change adds or changes guidance that should not live only in comment-based help |
| 35 | + |
| 36 | + If the change teaches the user something new, confirm that the user can discover it from the published documentation surfaces, not only from the diff. |
| 37 | + |
| 38 | +3. **Function structure** |
| 39 | + |
| 40 | + Confirm that each changed function still follows the expected repository anatomy. |
| 41 | + |
| 42 | + Check: |
| 43 | + |
| 44 | + - public functions live under `src/functions/public/<Group>/` and private helpers live under `src/functions/private/<Group>/` |
| 45 | + - file placement, grouping, and exported surface match [Module Anatomy](module-anatomy.md) and the layout rules in [PowerShell module standard](../Standards.md#repository-layout) |
| 46 | + - there are no nested helper functions, multi-function files, or naming shortcuts that break the "one declaration per file" rule |
| 47 | + |
| 48 | + This step is about shape, not behavior: the goal is that a reader or tool can find the module surface and its helpers exactly where PSModule expects them. |
| 49 | + |
| 50 | +4. **Function documentation** |
| 51 | + |
| 52 | + Confirm that every changed function carries complete comment-based help and that the help matches the implementation contract. |
| 53 | + |
| 54 | + Check: |
| 55 | + |
| 56 | + - comment-based help is present for every changed function, including private helpers |
| 57 | + - help sections, examples, `.INPUTS`, `.OUTPUTS`, and parameter documentation match the function contract from [MSX PowerShell Functions](https://msxorg.github.io/docs/Coding-Standards/PowerShell/Functions/) |
| 58 | + - public-function links and usage examples are current enough that generated documentation will stay accurate |
| 59 | + |
| 60 | + Do not treat help as optional cleanup. In PSModule repositories, the function help is part of the delivered behavior. |
| 61 | + |
| 62 | +5. **PowerShell best practices** |
| 63 | + |
| 64 | + Confirm that the implementation still reads like idiomatic PowerShell after the mechanical checks pass. |
| 65 | + |
| 66 | + Check: |
| 67 | + |
| 68 | + - advanced-function structure, parameter typing and validation, `ShouldProcess`, output behavior, and error handling align with [MSX PowerShell](https://msxorg.github.io/docs/Coding-Standards/PowerShell/) and [MSX PowerShell Functions](https://msxorg.github.io/docs/Coding-Standards/PowerShell/Functions/) |
| 69 | + - the code also satisfies the PSModule-specific conventions in [PowerShell module standard](../Standards.md), especially around private helpers, context handling, and repository layout |
| 70 | + - PSScriptAnalyzer warnings are addressed or intentionally justified, but review does not stop there; also look for awkward parameter design, leaky transport details, non-idiomatic output, or code that technically passes lint but is not good PowerShell |
| 71 | + |
| 72 | + PSScriptAnalyzer is part of the validation loop, not the whole loop. |
| 73 | + |
| 74 | +6. **Coding standards alignment** |
| 75 | + |
| 76 | + Run one final cross-check against the shared MSX coding standards before leaving self-review. |
| 77 | + |
| 78 | + Check: |
| 79 | + |
| 80 | + - naming, documentation, error handling, testing expectations, and security posture align with the relevant pages under [MSX Coding Standards](https://msxorg.github.io/docs/Coding-Standards/) |
| 81 | + - the change follows the shared "written once, referenced everywhere" rule by linking canonical guidance instead of copying it into local docs or code comments, as described in [Agentic Development](https://msxorg.github.io/docs/Ways-of-Working/Agentic-Development/) |
| 82 | + - the draft PR description, issue progress, and any follow-up issues reflect what actually shipped and what still belongs out of scope |
| 83 | + |
| 84 | + This is the last author-side gate before a PSModule draft PR is ready for independent review. |
| 85 | + |
| 86 | +## Where this connects |
| 87 | + |
| 88 | +- [MSX Workflow Build step](https://msxorg.github.io/docs/Ways-of-Working/Workflow/#build) |
| 89 | +- [MSX Implement guidance](https://msxorg.github.io/docs/Agents/implement/) |
| 90 | +- [PowerShell module standard](../Standards.md) |
| 91 | +- [Module types](../Module-Types.md) |
| 92 | +- [Module Anatomy](module-anatomy.md) |
| 93 | +- [Repository Defaults](../Repository-Defaults.md) |
| 94 | +- [MSX Coding Standards](https://msxorg.github.io/docs/Coding-Standards/) |
0 commit comments