Skip to content

Commit 5850fe0

Browse files
committed
feat(#194): enhance guidance for file formatting and review processes
- Update documentation to require every changed or generated text file to end with exactly one trailing newline and no extra blank lines at the bottom. - Add instructions for reviewing file endings before handoff in multiple documentation files.
1 parent adbc046 commit 5850fe0

21 files changed

Lines changed: 54 additions & 27 deletions

.github/agents/powershell-developer.agent.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Implement PowerShell command and helper changes in the NovaModuleTools style.
1616
- Preserve Nova's `project.json`-driven build model; do not add hand-written source `.psm1` or module `.psd1` files.
1717
- Read `project.json` `Manifest.PowerShellHostVersion` before implementing PowerShell changes and keep source, tests, and examples compatible with that target.
1818
- Add or update source-mirrored tests and PlatyPS-compatible help docs for the changed behavior.
19+
- Before handoff, review every changed or generated text file and normalize it to exactly one trailing newline with no extra blank lines at the bottom.
1920

2021
## Inputs to inspect
2122

@@ -44,6 +45,7 @@ Implement PowerShell command and helper changes in the NovaModuleTools style.
4445
- Production code and tests both reflect the intended behavior.
4546
- Build output still comes from Nova-generated `dist/` files, not hand-authored module files in `src/`.
4647
- Any ScriptAnalyzer findings reported by `run.ps1` or `Invoke-ScriptAnalyzerCI.ps1` are resolved.
48+
- Every changed or generated text file has been checked and ends with exactly one trailing newline and no extra blank lines at the bottom.
4749
- Docs/changelog review is complete.
4850
- The relevant validation commands have been run.
4951

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ For documentation-only changes, executable validation may be skipped if no code
9898

9999
## File formatting rule
100100

101-
- Modified or created text files must end with exactly one trailing newline.
102-
- Do not leave multiple blank lines at the end of edited files.
101+
- Before handoff, review every changed or created text file and ensure it ends with exactly one trailing newline and no extra blank lines at the bottom.
102+
- Do not leave any edited file with extra blank lines at the end, even if the functional code change is already complete.
103103
- Do not alter internal whitespace just to enforce the trailing newline rule.
104104

105105
## Safety constraints

.github/instructions/powershell-coding-standards.instructions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Use this file when changing `src/public/`, `src/private/`, or PowerShell build/r
6767
- Do not stack multiple blank lines.
6868
- Avoid decorative blank lines inside short blocks.
6969
- Keep one blank line between top-level declarations when a file contains more than one declaration.
70-
- Modified or created text files, including `.ps1` files, must end with exactly one trailing newline and no extra blank lines after the final statement.
70+
- Every changed or generated text file, including `.ps1` files, must end with exactly one trailing newline and no extra blank lines at the bottom.
7171

7272
## Maintainability rules
7373

@@ -81,3 +81,4 @@ Use this file when changing `src/public/`, `src/private/`, or PowerShell build/r
8181
- Recheck `tests/ArchitectureGuardrails.Tests.ps1` when changing layering or helper placement.
8282
- Run `./run.ps1` before considering a code change complete.
8383
- Resolve any ScriptAnalyzer findings that `./run.ps1` reports before handoff.
84+
- Before handoff, review the changed/generated text files and normalize any file endings that violate the single-trailing-newline rule.

.github/prompts/implement-issue.prompt.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ Implement the issue in the NovaModuleTools repository using the repository-local
1919
7. Implement the smallest maintainable fix.
2020
8. Do not add PSScriptAnalyzer excluded rules or suppressions; fix analyzer findings in the code.
2121
9. If `run.ps1` or `Invoke-ScriptAnalyzerCI.ps1` reports ScriptAnalyzer findings, fix them before handoff instead of only reporting the failure.
22-
10. Add or update the matching source-mirrored Pester file for every changed `src/**/*.ps1` file; if the behavior is genuinely cross-cutting, document which integration/guardrail test owns it and why a mirrored unit test is not practical.
23-
11. Add or update PlatyPS-compatible help under `docs/<ProjectName>/en-US/` when public commands or public classes change.
24-
12. Review `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, `RELEASE_NOTE.md`, help docs, and `docs/*.html` as applicable.
25-
13. If a commit message is requested, derive it from `$GIT_BRANCH_NAME` and the implemented change using the repository's Conventional Commit rules.
26-
14. Run the relevant validation, then summarize what changed, why, and how it was verified.
27-
15. If that summary is returned as Markdown or copy-ready UI output, format it according to the `markdown-authoring` skill (`.github/skills/markdown-authoring/SKILL.md`).
22+
10. Before handoff, review every changed or generated text file and normalize it to exactly one trailing newline with no extra blank lines at the bottom.
23+
11. Add or update the matching source-mirrored Pester file for every changed `src/**/*.ps1` file; if the behavior is genuinely cross-cutting, document which integration/guardrail test owns it and why a mirrored unit test is not practical.
24+
12. Add or update PlatyPS-compatible help under `docs/<ProjectName>/en-US/` when public commands or public classes change.
25+
13. Review `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, `RELEASE_NOTE.md`, help docs, and `docs/*.html` as applicable.
26+
14. If a commit message is requested, derive it from `$GIT_BRANCH_NAME` and the implemented change using the repository's Conventional Commit rules.
27+
15. Run the relevant validation, then summarize what changed, why, and how it was verified.
28+
16. If that summary is returned as Markdown or copy-ready UI output, format it according to the `markdown-authoring` skill (`.github/skills/markdown-authoring/SKILL.md`).
2829

2930
## Repository-specific reminders
3031

.github/skills/powershell-module-development/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Use this skill when changing public commands, private helpers, CLI routing suppo
3434
- Keep ScriptAnalyzer strict: do not add excluded rules, suppression attributes, or settings that hide analyzer findings.
3535
- Keep `run.ps1`-style local checks ordered as ScriptAnalyzer first, then `Invoke-NovaBuild`, then `Test-NovaBuild`.
3636
- If `run.ps1` or `Invoke-ScriptAnalyzerCI.ps1` reports ScriptAnalyzer findings, fix them before handoff instead of just reporting the failure.
37+
- Before handoff, review every changed or generated text file and normalize it to exactly one trailing newline with no extra blank lines at the end.
3738
- Add or update PlatyPS-compatible help under `docs/<ProjectName>/en-US/` when public commands or public classes change.
3839
- Add or update the source-mirrored Pester test file for every changed `src/**/*.ps1` file.
3940

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1515
- The generated architect/design prompt now requires final design packages and issue/work item drafts to be returned as copy-ready Markdown using the project Markdown authoring guidance.
1616
- The generated guidance now explicitly keeps Agentic Copilot projects on the Nova build model, treats `.psm1` / `.psd1` files as generated `dist` output, requires PlatyPS-compatible help for public commands/classes, expects one focused source-mirrored test file for every new or changed `src/**/*.ps1` file, tells agents to honor `project.json` `Manifest.PowerShellHostVersion` when writing PowerShell code and tests, and now asks for a short project name so placeholders such as `Invoke-<ShortName>*` can be replaced in the generated starter files.
1717
- The generated guidance now keeps local `run.ps1` quality loops ordered as ScriptAnalyzer, `Invoke-NovaBuild`, then `Test-NovaBuild`, and tells agents to fix ScriptAnalyzer findings reported by `run.ps1` instead of excluding, suppressing, or handing them off unresolved.
18+
- The generated PowerShell guidance now requires agents to review every changed or generated text file before handoff and normalize the file ending to exactly one trailing newline with no extra blank lines at the bottom.
1819

1920
### Changed
2021

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ Packaged resources that ship with the module, including:
506506
- the packaged example project under `src/resources/example/`
507507
- the Agentic Copilot starter package under `src/resources/agentic-copilot/`
508508

509-
The example project is both a shipped resource and a maintained working reference. The Agentic Copilot starter package is generated from Nova's repository-local agentic guidance, including Nova build/test/package expectations, `project.json` `Manifest.PowerShellHostVersion` compatibility guidance, generated `dist` module files, command-help ownership, source-mirrored test guidance, and guidance that ScriptAnalyzer findings reported by `run.ps1` must be fixed before handoff. When the init flow adds that starter package, it also asks for a short project name so scaffolded guidance can replace placeholders such as `Invoke-<ShortName>*`. Run
509+
The example project is both a shipped resource and a maintained working reference. The Agentic Copilot starter package is generated from Nova's repository-local agentic guidance, including Nova build/test/package expectations, `project.json` `Manifest.PowerShellHostVersion` compatibility guidance, generated `dist` module files, command-help ownership, source-mirrored test guidance, guidance that ScriptAnalyzer findings reported by `run.ps1` must be fixed before handoff, and a strict file-ending rule for changed or generated text files. When the init flow adds that starter package, it also asks for a short project name so scaffolded guidance can replace placeholders such as `Invoke-<ShortName>*`. Run
510510
`./scripts/build/Sync-AgenticCopilotScaffold.ps1` after changing `.github/agents/`, `.github/instructions/`,
511511
`.github/skills/`, `.github/prompts/`, or `.github/copilot-instructions.md` so future scaffolds and `dist` stay in sync.
512512

RELEASE_NOTE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This file summarizes public cmdlet, CLI, configuration, and migration changes fo
1212
- Generated architect/design guidance now requires final design packages and issue/work item drafts to be returned as copy-ready Markdown using the project Markdown authoring guidance.
1313
- Generated implementation/test guidance now keeps projects on Nova build/test/package workflows, treats `.psm1` / `.psd1` files as generated output, calls out PlatyPS help plus one focused source-mirrored test file for every new or changed `src/**/*.ps1` file, tells agents to honor `project.json` `Manifest.PowerShellHostVersion` when writing PowerShell code and tests, and now asks for a short project name so placeholders such as `Invoke-<ShortName>*` can be replaced in the generated starter files.
1414
- Generated quality-loop guidance now keeps ScriptAnalyzer first and tells agents to fix ScriptAnalyzer findings reported by `run.ps1` instead of excluding, suppressing, or handing them off unresolved.
15+
- Generated PowerShell guidance now requires agents to review every changed or generated text file before handoff and normalize the file ending to exactly one trailing newline with no extra blank lines at the bottom.
1516

1617
### Changed
1718

docs/NovaModuleTools/en-US/Initialize-NovaModule.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ PS> Initialize-NovaModule [-Path <string>] [-Example] [-WhatIf] [-Confirm] [<Com
2727

2828
`Initialize-NovaModule` creates a new project folder, the standard `src/` layout, and a starter `project.json` file.
2929

30-
The command collects project details interactively, including the module name, description, version, author, minimum PowerShell version, Git initialization, and an optional Agentic Copilot starter package. When you enable the Agentic package, Nova also asks for a project short name used in generated guidance placeholders such as `Invoke-<ShortName>*`; for NovaModuleTools the short name is `Nova`, but it could also have been `NMT`. The Agentic package follows Nova's maintained agentic guidance through a filtered starter mirror, including Nova build/test/package expectations, `project.json` `Manifest.PowerShellHostVersion` compatibility guidance, strict ScriptAnalyzer guidance without excluded rules, generated `dist` module files, command-help ownership, source-mirrored test guidance, and guidance that ScriptAnalyzer findings reported by `run.ps1` must be fixed before handoff. For the standard scaffold, the interactive flow also includes optional basic Pester support.
30+
The command collects project details interactively, including the module name, description, version, author, minimum PowerShell version, Git initialization, and an optional Agentic Copilot starter package. When you enable the Agentic package, Nova also asks for a project short name used in generated guidance placeholders such as `Invoke-<ShortName>*`; for NovaModuleTools the short name is `Nova`, but it could also have been `NMT`. The Agentic package follows Nova's maintained agentic guidance through a filtered starter mirror, including Nova build/test/package expectations, `project.json` `Manifest.PowerShellHostVersion` compatibility guidance, strict ScriptAnalyzer guidance without excluded rules, generated `dist` module files, command-help ownership, source-mirrored test guidance, guidance that ScriptAnalyzer findings reported by
31+
`run.ps1` must be fixed before handoff, and a strict file-ending rule for changed or generated text files. For the standard scaffold, the interactive flow also includes optional basic Pester support.
3132

3233
If you enter an invalid answer during the interactive flow, `Initialize-NovaModule` reports the validation problem immediately and retries that prompt before it continues to the next question.
3334

docs/commands.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ <h3>Start a new project</h3>
179179
maintained agentic guidance through a filtered starter mirror, including Nova build/test
180180
expectations, <code>project.json</code> <code>Manifest.PowerShellHostVersion</code>
181181
compatibility guidance, strict ScriptAnalyzer guidance without excluded rules, generated
182-
<code>dist</code> module files, command-help ownership, source-mirrored test guidance, and
182+
<code>dist</code> module files, command-help ownership, source-mirrored test guidance,
183183
instructions to fix ScriptAnalyzer findings reported by <code>run.ps1</code> before
184-
handoff.
184+
handoff, and a strict file-ending rule for changed or generated text files.
185185
</p>
186186
<p>If you enable the Agentic package, Nova also asks for a short project name used in generated
187187
guidance placeholders such as <code>Invoke-&lt;ShortName&gt;*</code>. For NovaModuleTools the

0 commit comments

Comments
 (0)