Skip to content

Commit c830a6c

Browse files
committed
feat(#194): update coding standards in documentation
- Refine private helper naming guidance to avoid public-style names - Clarify implementation-focused naming for private helpers
1 parent 5e3e8ba commit c830a6c

6 files changed

Lines changed: 7 additions & 6 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Use this file when changing `src/public/`, `src/private/`, or PowerShell build/r
2424
- Additional functions in a private file are allowed only as related top-level support helpers called from that same file.
2525
- If two private functions are both called from outside their file, split them into separate same-named files.
2626
- Do not declare functions inside other functions. Keep private support helpers as sibling top-level functions in the file instead of nested function declarations.
27-
- Private helper names should stay clear and responsibility-focused; they do not need to mirror the public `Invoke-Nova*`, `Get-Nova*`, `Update-Nova*`, or `nova` CLI route naming conventions unless they are intentionally part of the public surface.
27+
- Private helper names should not use the public `Invoke-Nova*`, `Get-Nova*`, `Update-Nova*`, or `nova` CLI route naming conventions. Give private helpers clear implementation-focused names that describe what the helper does.
2828
- Reuse existing adapters and shared helpers before adding new infrastructure calls.
2929
- Keep direct environment access, Git execution, upload requests, and self-update execution in their approved helper locations. `tests/ArchitectureGuardrails.Tests.ps1` is authoritative.
3030
- Prefer explicit workflow-context objects (`[pscustomobject]` / ordered hashtables) for multi-step flows.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Use this skill when changing public commands, private helpers, CLI routing suppo
2828
- Treat `project.json` as the source of truth for Nova build, package, manifest, and release metadata.
2929
- Read `project.json` `Manifest.PowerShellHostVersion` before changing PowerShell code, tests, or examples, and keep new work compatible with that target. A `5.1` project must not receive PowerShell 7.x-only syntax, cmdlets, parameters, or APIs unless the change explicitly adds guarded compatibility handling.
3030
- Do not create or maintain hand-written module `.psm1` or module `.psd1` files in source; Nova generates those files under `dist/NovaModuleTools/`.
31-
- Preserve native PowerShell semantics and Nova naming patterns.
31+
- Preserve native PowerShell semantics. Keep Nova naming patterns on public commands, and give private helpers clear implementation-focused names instead of public-style `Invoke-Nova*`, `Get-Nova*`, or `Update-Nova*` naming.
3232
- Keep one externally called function per file and match the file name to that function. In `src/private/`, additional related functions may stay only as same-file top-level support helpers called by that file's entry function; do not declare functions inside functions.
3333
- Use `.github/instructions/code-quality-matrix.instructions.md` as the best-effort source-code maintainability guidance. Keep new or heavily changed code short, single-purpose, low-duplication, lightly nested, and split by clear responsibility; group related inputs instead of growing long parameter lists.
3434
- Reuse existing workflow-context helpers and shared adapters.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1313
- The generated guidance now explicitly keeps Agentic Copilot projects on the Nova build model, treats `.psm1` / `.psd1` files as generated `dist` output, requires project test validation to run through `Test-NovaBuild` instead of direct `Invoke-Pester`, 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.
1414
- 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.
1515
- The generated guidance now points agents to the documented PSScriptAnalyzer workflow, using `./scripts/build/Invoke-ScriptAnalyzerCI.ps1` and `./run.ps1` as the normal entrypoints and reserving direct `Invoke-ScriptAnalyzer` for focused local checks that reuse repo-approved settings.
16-
- The generated PowerShell guidance now requires public files to keep one top-level function per file, requires private files to keep at most one externally called function per file, keeps any extra private functions limited to related same-file top-level support helpers whose file names match the owning function, forbids nested function declarations inside PowerShell functions, and limits the `Invoke-<ShortName>*` / `Get-<ShortName>*` / `Update-<ShortName>*` naming guidance to public commands instead of private helpers.
16+
- The generated PowerShell guidance now requires public files to keep one top-level function per file, requires private files to keep at most one externally called function per file, keeps any extra private functions limited to related same-file top-level support helpers whose file names match the owning function, forbids nested function declarations inside PowerShell functions, limits the `Invoke-<ShortName>*` / `Get-<ShortName>*` / `Update-<ShortName>*` naming guidance to public commands, and tells private helpers to avoid those public-style names in favor of clear implementation-focused helper names.
1717
- The generated guidance now expresses PowerShell source/helper-script maintainability rules through `code-quality-matrix.instructions.md` and keeps test-specific design guidance in the testing instruction/skill files.
1818
- The generated guidance now requires `docs/<ProjectName>/en-US/*.md` to stay valid PlatyPS help with YAML metadata and build-compatible structure, tells agents to use the documented `New-MarkdownCommandHelp` / `Update-MarkdownCommandHelp` / `Test-MarkdownCommandHelp` workflow instead of replacing command help with plain Markdown that breaks `nova build`, and requires a matching help file for every new public entry point in the same change.
1919
- 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.

src/resources/agentic-copilot/.github/instructions/powershell-coding-standards.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Use this file when changing `src/public/`, `src/private/`, or PowerShell build/r
2424
- Additional functions in a private file are allowed only as related top-level support helpers called from that same file.
2525
- If two private functions are both called from outside their file, split them into separate same-named files.
2626
- Do not declare functions inside other functions. Keep private support helpers as sibling top-level functions in the file instead of nested function declarations.
27-
- Private helper names should stay clear and responsibility-focused; they do not need to mirror the public `Invoke-{{ShortName}}*`, `Get-{{ShortName}}*`, `Update-{{ShortName}}*`, or `nova` CLI route naming conventions unless they are intentionally part of the public surface.
27+
- Private helper names should not use the public `Invoke-{{ShortName}}*`, `Get-{{ShortName}}*`, `Update-{{ShortName}}*`, or `nova` CLI route naming conventions. Give private helpers clear implementation-focused names that describe what the helper does.
2828
- Reuse existing adapters and shared helpers before adding new infrastructure calls.
2929
- Keep direct environment access, Git execution, upload requests, and self-update execution in their approved helper locations. `tests/*Architecture*.Tests.ps1` is authoritative.
3030
- Prefer explicit workflow-context objects (`[pscustomobject]` / ordered hashtables) for multi-step flows.

src/resources/agentic-copilot/.github/skills/powershell-module-development/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Use this skill when changing public commands, private helpers, CLI routing suppo
2828
- Treat `project.json` as the source of truth for Nova build, package, manifest, and release metadata.
2929
- Read `project.json` `Manifest.PowerShellHostVersion` before changing PowerShell code, tests, or examples, and keep new work compatible with that target. A `5.1` project must not receive PowerShell 7.x-only syntax, cmdlets, parameters, or APIs unless the change explicitly adds guarded compatibility handling.
3030
- Do not create or maintain hand-written module `.psm1` or module `.psd1` files in source; Nova generates those files under `dist/{{ProjectName}}/`.
31-
- Preserve native PowerShell semantics and Nova naming patterns.
31+
- Preserve native PowerShell semantics. Keep Nova naming patterns on public commands, and give private helpers clear implementation-focused names instead of public-style `Invoke-{{ShortName}}*`, `Get-{{ShortName}}*`, or `Update-{{ShortName}}*` naming.
3232
- Keep one externally called function per file and match the file name to that function. In `src/private/`, additional related functions may stay only as same-file top-level support helpers called by that file's entry function; do not declare functions inside functions.
3333
- Use `.github/instructions/code-quality-matrix.instructions.md` as the best-effort source-code maintainability guidance. Keep new or heavily changed code short, single-purpose, low-duplication, lightly nested, and split by clear responsibility; group related inputs instead of growing long parameter lists.
3434
- Reuse existing workflow-context helpers and shared adapters.

tests/AgenticCopilotScaffoldSync.Tests.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Describe 'Agentic Copilot scaffold sync' {
8686
$content.CodingStandards | Should -Match 'In `src/private/`, keep at most one externally called function per file and match the file name to that entry function'
8787
$content.CodingStandards | Should -Match 'If two private functions are both called from outside their file, split them into separate same-named files'
8888
$content.CodingStandards | Should -Match 'Do not declare functions inside other functions'
89-
$content.CodingStandards | Should -Match 'Private helper names should stay clear and responsibility-focused; they do not need to mirror the public'
89+
$content.CodingStandards | Should -Match 'Private helper names should not use the public'
9090
$content.CodingStandards | Should -Match 'platyps-help\.instructions\.md'
9191
$content.CodingStandards | Should -Match 'New-MarkdownCommandHelp'
9292
$content.CodingStandards | Should -Match 'Every changed or generated text file, including `\.ps1` files, must end with exactly one trailing newline and no extra blank lines at the bottom'
@@ -121,6 +121,7 @@ Describe 'Agentic Copilot scaffold sync' {
121121
$content.DeveloperSkill | Should -Match 'Nova generates those files under `dist/(NovaModuleTools|\{\{ProjectName\}\})/`'
122122
$content.DeveloperSkill | Should -Match 'code-quality-matrix\.instructions\.md'
123123
$content.DeveloperSkill | Should -Match 'short, single-purpose, low-duplication, lightly nested'
124+
$content.DeveloperSkill | Should -Match 'Keep Nova naming patterns on public commands, and give private helpers clear implementation-focused names'
124125
$content.DeveloperSkill | Should -Match 'Keep one externally called function per file and match the file name to that function'
125126
$content.DeveloperSkill | Should -Match 'do not declare functions inside functions'
126127
$content.DeveloperSkill | Should -Match 'Grouping two externally called private helpers in one file'

0 commit comments

Comments
 (0)