Skip to content

Commit 7f05419

Browse files
committed
feat(#194): strengthen agentic scaffold guidance
Clarify Agentic Copilot starter guidance so generated projects stay on Nova workflows, generated dist output, PlatyPS help, source-mirrored tests, and strict ScriptAnalyzer behavior.
1 parent 5c2f01a commit 7f05419

20 files changed

Lines changed: 50 additions & 21 deletions

File tree

.github/agents/reviewer.agent.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Review changes for correctness, maintainability, test coverage, workflow safety,
2020
- Check that Nova projects still use generated `dist/` module files instead of hand-written source `.psm1` or module `.psd1` files.
2121
- Check that public commands/classes have matching PlatyPS-compatible help and that new source files have source-mirrored tests.
2222
- Flag broad catch-all test files when focused source-mirrored tests would make ownership clearer.
23+
- Flag any PSScriptAnalyzer rule excludes or suppressions; the code should be fixed instead.
2324

2425
## Inputs to inspect
2526

.github/copilot-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ For new or not-yet-scoped work, start with `.github/agents/architect.agent.md` a
4141
- Treat `project.json` as the source of truth for project metadata, build output, package settings, and release settings.
4242
- Use Nova commands and repository wrappers for build, test, package, and release workflows; do not replace them with ad hoc PowerShell module build scripts.
4343
- Do not create or maintain hand-written module `.psm1` or module `.psd1` files in source; Nova generates the built module root and manifest under `dist/<ProjectName>/` from `project.json` and `src/**/*.ps1`.
44+
- Do not exclude or suppress PSScriptAnalyzer rules in repository analyzer helpers; fix the code that violates analyzer rules instead.
45+
- Keep `run.ps1` as the local quality loop: run ScriptAnalyzer first, then `Invoke-NovaBuild`, then `Test-NovaBuild`.
4446
- Review `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, and `RELEASE_NOTE.md` after every meaningful change.
4547
- Update tests when behavior changes.
4648
- Prefer existing helpers and support files over ad hoc duplication.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Use this file when changing `src/public/`, `src/private/`, or PowerShell build/r
2828
- Prefer clear, structured Nova errors over silent fallback behavior.
2929
- Preserve existing warning semantics; do not rename warning opt-ins to a generic `-Force` pattern.
3030
- Keep CLI spellings and PowerShell spellings distinct in messages and docs.
31+
- Do not add PSScriptAnalyzer `ExcludeRule`, `ExcludeRules`, suppression attributes, or generated settings that hide analyzer findings. Fix the rule violation instead.
32+
- Keep local quality wrappers ordered as ScriptAnalyzer first, then `Invoke-NovaBuild`, then `Test-NovaBuild`.
3133

3234
## Formatting rules
3335

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ Implement the issue in the NovaModuleTools repository using the repository-local
1818
`scripts/build/ci/*.ps1` files.
1919
5. Preserve the Nova build model: use `project.json` and Nova commands for build/test/package/release behavior, and do not create hand-written source `.psm1` or module `.psd1` files.
2020
6. Implement the smallest maintainable fix.
21-
7. 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.
22-
8. Add or update PlatyPS-compatible help under `docs/<ProjectName>/en-US/` when public commands or public classes change.
23-
9. Review `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, `RELEASE_NOTE.md`, help docs, and `docs/*.html` as applicable.
24-
10. If a commit message is requested, derive it from `$GIT_BRANCH_NAME` and the implemented change using the repository's Conventional Commit rules.
25-
11. Run the relevant validation, then summarize what changed, why, and how it was verified.
26-
12. If that summary is returned as Markdown or copy-ready UI output, format it according to the `markdown-authoring`
21+
7. Do not add PSScriptAnalyzer excluded rules or suppressions; fix analyzer findings in the code.
22+
8. 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+
9. Add or update PlatyPS-compatible help under `docs/<ProjectName>/en-US/` when public commands or public classes change.
24+
10. Review `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, `RELEASE_NOTE.md`, help docs, and `docs/*.html` as applicable.
25+
11. If a commit message is requested, derive it from `$GIT_BRANCH_NAME` and the implemented change using the repository's Conventional Commit rules.
26+
12. Run the relevant validation, then summarize what changed, why, and how it was verified.
27+
13. If that summary is returned as Markdown or copy-ready UI output, format it according to the `markdown-authoring`
2728
skill (`.github/skills/markdown-authoring/SKILL.md`).
2829

2930
## Repository-specific reminders

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Use this skill when changing public commands, private helpers, CLI routing suppo
3030
- Preserve native PowerShell semantics and Nova naming patterns.
3131
- Reuse existing workflow-context helpers and shared adapters.
3232
- Follow the repository's PowerShell style rules: 4-space indentation, same-line opening braces, restrained blank lines, full cmdlet names, and readable operator spacing.
33+
- Keep ScriptAnalyzer strict: do not add excluded rules, suppression attributes, or settings that hide analyzer findings.
34+
- Keep `run.ps1`-style local checks ordered as ScriptAnalyzer first, then `Invoke-NovaBuild`, then `Test-NovaBuild`.
3335
- Add or update PlatyPS-compatible help under `docs/<ProjectName>/en-US/` when public commands or public classes change.
3436
- Add or update the source-mirrored Pester test file for every changed `src/**/*.ps1` file.
3537

@@ -40,6 +42,7 @@ Use this skill when changing public commands, private helpers, CLI routing suppo
4042
- Calling `git`, `Invoke-WebRequest`, `Update-Module`, or `$env:` from the wrong layer
4143
- Replacing explicit warning opt-ins with generic force semantics
4244
- Creating a root module `.psm1` or module manifest `.psd1` by hand instead of letting Nova generate them from `project.json`
45+
- Excluding PSScriptAnalyzer rules instead of fixing the code that violates them
4346

4447
## Verification
4548

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1414
- The starter tree is now generated from a filtered mirror of Nova's own agentic `.github/` files, with a dedicated sync script and drift test so future scaffolds and `dist` stay aligned with the maintained source guidance.
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, and expects one focused source-mirrored test file for every new or changed `src/**/*.ps1` file.
17+
- 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 instead of excluding or suppressing rules.
1718

1819
### Changed
1920

RELEASE_NOTE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ changes will be included in the next **stable** release!
1212
- The starter package follows a filtered mirror of Nova's maintained agentic guidance so newly scaffolded projects receive a broader Nova-style agentic baseline without Nova-specific CodeScene or docs-site surfaces.
1313
- 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.
1414
- Generated implementation/test guidance now keeps projects on Nova build/test/package workflows, treats `.psm1` / `.psd1` files as generated output, and calls out PlatyPS help plus one focused source-mirrored test file for every new or changed `src/**/*.ps1` file.
15+
- Generated quality-loop guidance now keeps ScriptAnalyzer first and tells agents to fix ScriptAnalyzer findings instead of excluding or suppressing rules.
1516

1617
### Changed
1718

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ 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. The Agentic package follows Nova's maintained agentic guidance through a filtered starter mirror, including Nova build/test/package expectations, generated `dist` module files, command-help ownership, and source-mirrored test guidance. 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. The Agentic package follows Nova's maintained agentic guidance through a filtered starter mirror, including Nova build/test/package expectations, strict ScriptAnalyzer guidance without excluded rules, generated `dist` module files, command-help ownership, and source-mirrored test guidance. For the standard scaffold, the interactive flow also includes optional basic Pester support.
3131

3232
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.
3333

@@ -136,7 +136,7 @@ This cmdlet does not emit an output object.
136136
137137
## NOTES
138138
139-
Generated projects start with NovaModuleTools defaults for recursive discovery, source markers, and duplicate-function validation. The packaged example scaffold keeps its bundled example source and tests, while still updating prompt-driven metadata such as project name, description, version, author, and PowerShell host version. The optional Agentic Copilot starter package adds repository-local Copilot workflow files under the project root and `.github/` that tell agents to keep build/test/package workflows on Nova, leave `.psm1` / `.psd1` files to generated `dist` output, maintain PlatyPS-compatible help, and mirror new tests to source files.
139+
Generated projects start with NovaModuleTools defaults for recursive discovery, source markers, and duplicate-function validation. The packaged example scaffold keeps its bundled example source and tests, while still updating prompt-driven metadata such as project name, description, version, author, and PowerShell host version. The optional Agentic Copilot starter package adds repository-local Copilot workflow files under the project root and `.github/` that tell agents to keep build/test/package workflows on Nova, run ScriptAnalyzer before build/test without excluding rules, leave `.psm1` / `.psd1` files to generated `dist` output, maintain PlatyPS-compatible help, and mirror new tests to source files.
140140

141141
`Initialize-NovaModule` uses `SupportsShouldProcess`, so `Get-Help Initialize-NovaModule -Full` surfaces native
142142
`-WhatIf` and

docs/commands.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ <h3>Start a new project</h3>
177177
<p>Create the minimal scaffold or the example scaffold for a new module project. Both interactive
178178
flows can also add the optional Agentic Copilot starter package, which follows Nova's
179179
maintained agentic guidance through a filtered starter mirror, including Nova build/test
180-
expectations, generated <code>dist</code> module files, command-help ownership, and
181-
source-mirrored test guidance.</p>
180+
expectations, strict ScriptAnalyzer guidance without excluded rules, generated
181+
<code>dist</code> module files, command-help ownership, and source-mirrored test guidance.
182+
</p>
182183
<ul class="plain-list">
183184
<li><strong>Use when:</strong> you are creating a fresh NovaModuleTools project</li>
184185
<li data-command-visibility="command-line" hidden><strong>Remember:</strong> pass the target path

docs/core-workflows.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ <h2>Create the project</h2>
126126
<p>Both scaffold styles ask the same core project questions, and both now offer an optional Agentic
127127
Copilot starter package after the Git prompt. The Agentic prompt defaults to <code>No</code>, and
128128
the package follows Nova's maintained agentic guidance through a filtered starter mirror, including
129-
Nova build/test/package expectations, generated <code>dist</code> module files, command-help
130-
ownership, and source-mirrored test guidance.</p>
129+
Nova build/test/package expectations, strict ScriptAnalyzer guidance without excluded rules,
130+
generated <code>dist</code> module files, command-help ownership, and source-mirrored test
131+
guidance.</p>
131132
<p>Use the example scaffold when you want the shortest path to understanding a real project layout, test
132133
suite, and package configuration. Use the minimal scaffold when you already know the structure you
133134
want.</p>

0 commit comments

Comments
 (0)