Skip to content

Commit 8b434bb

Browse files
authored
Feature/194 optional agentic copilot scaffold for initialize novamodule nova init (#209)
* feat(#194): add optional Agentic Copilot starter package to NovaModule initialization - Introduced an optional Agentic Copilot setup during module initialization. - Updated documentation to reflect the new starter package options. - Enhanced interactive prompts to include Agentic Copilot configuration. * feat(#194): add Agentic Copilot scaffold files for NovaModule initialization - Implement Get-NovaModuleAgenticCopilotTemplateRoot function - Create AGENTS.md for Agentic Copilot workflow documentation - Add CHANGELOG.md and RELEASE_NOTE.md for version tracking - Introduce initial test coverage for Agentic Copilot scaffold sync * fix(#194): update release policy documentation for clarity * fix(#194): update Sync-AgenticCopilotScaffold.psd1 and testing-policy.instructions.md - remove outdated command from Sync-AgenticCopilotScaffold.psd1 - clarify testing policy instructions for script invocation * fix(#194): standardize catch block formatting across multiple scripts - Adjusted catch blocks to maintain consistent formatting - Improved readability by aligning else statements * fix(#194): standardize formatting of try-catch-finally blocks across multiple scripts * fix(#194): keep agentic scaffold guidance provider-neutral Update generated architect/design guidance to use provider-neutral issue/work item wording and rely on the markdown-authoring skill instead of duplicating copy-safe fence rules. * feat(#194): enhance Nova project guidance and testing expectations - Add documentation for Nova-managed project expectations in starter guidance - Update contributing guidelines to reflect Nova build model and testing practices - Improve README with Nova project expectations and testing structure * 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. * feat(#194): honor PowerShellHostVersion in agentic guidance Require Agentic Copilot guidance and the generated starter scaffold to treat project.json Manifest.PowerShellHostVersion as the compatibility target for PowerShell code, tests, and examples. * feat(#194): add short-name prompt for agentic scaffolds Prompt for a project short name when Agentic Copilot is enabled so generated scaffold guidance can replace placeholders such as Invoke-<ShortName>*. * feat(#194): update guidance and documentation for agentic scaffolds - Refine conversational flow for architect and design change prompts. - Clarify instructions for handling unresolved questions in design packages. - Adjust release notes and changelog formatting for consistency. * feat(#194): refine documentation for agentic scaffolds - Clarify conversational flow for new or not-yet-scoped work - Improve instructions for handling unresolved questions - Streamline guidance on implementing issues and design packages * feat(#194): update documentation and constraints for agentic scaffolds - Add `/github-actions` to the list of directories - Clarify distinction between public PowerShell cmdlets and `% nova` CLI behavior * feat(#194): enhance documentation and guidance for ScriptAnalyzer findings - add instructions to fix ScriptAnalyzer findings before review or handoff - update README and contributing guidelines to reflect new requirements - clarify quality loop expectations in various documentation files * 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. * feat(#194): enhance agentic guidance and documentation - Add reviewer agent content to improve review processes - Include implement prompt content for better implementation guidance - Update coding standards to clarify file and function ownership rules * feat(#194): remove deprecated thresholds from code health rules - cleared all threshold definitions for improved clarity * feat(#194): add code quality matrix for src and tests - Introduce a best-effort code quality matrix for source and test files. - Define warning and alert thresholds to guide maintainability. - Provide authoring guidance to help shape code quality from the start. * feat(#194): update documentation and guidance for PlatyPS help generation - Remove deprecated placeholders in command help paths - Enhance instructions for generating valid PlatyPS help - Clarify requirements for command help structure and validation * feat(#194): enhance PSScriptAnalyzer workflow guidance - Add detailed instructions for using PSScriptAnalyzer in the repository - Specify preferred entry points for analyzer runs - Emphasize the importance of fixing analyzer findings before handoff * feat(#194): update command help paths and instructions for NovaModuleTools - Adjust command help source paths in documentation and tests to reflect NovaModuleTools - Ensure consistency in PlatyPS help generation instructions * feat(#194): update pull request template to remove CLI behavior checkbox * feat(#194): update guidance for PlatyPS help generation - Require matching help files for every new public entry point in the same change - Enhance instructions for generating valid PlatyPS help - Update documentation to reflect changes in help file requirements * feat(#194): update guidance for Test-NovaBuild usage - Add documentation for using Test-NovaBuild as the authoritative test entrypoint - Update instructions to prohibit direct Invoke-Pester calls in Nova-managed projects - Revise various documentation files to reflect the new testing policy * feat(#194): update application paths for code quality and help generation - include scripts/**/*.ps1 in code quality matrix - refine PlatyPS help application path to docs/NovaModuleTools/**/*.md - add PSScriptAnalyzer module version to project.json * feat(#194): update versioning to 0.1.0-preview across multiple files - Change default version from 0.0.1 to 0.1.0-preview in project files - Update expected version checks in tests to reflect new versioning * feat(#194): update versioning to 0.1.0-preview across multiple files - Change default version from 0.0.1 to 0.1.0-preview in project files - Update expected version checks in tests to reflect new versioning * feat(#194): update guidance for source/helper-script maintainability and test design - Refactor maintainability guidance to emphasize source/helper-script quality - Update test design instructions to enhance clarity and coverage expectations * feat(#194): enhance Nova scaffolding with .gitignore management - create or update default .gitignore in generated project root when Git is enabled - append missing Nova-managed artifact entries without overwriting existing rules - update documentation to reflect .gitignore functionality in scaffold flows * feat(#194): clean up whitespace in UpdateNovaGitIgnore scripts * feat(#194): enhance coding standards and guidance documentation - Add new coding standards for private helper naming conventions - Update guidance to clarify public command naming and file structure rules - Refine generated guidance for project scaffolding and maintainability * feat(#194): update coding standards in documentation - Clarify rules for function declarations in PowerShell files - Specify that private helpers should not declare nested functions - Enhance guidance on file/function ownership and support helpers * feat(#194): enhance NovaModule initialization with update notifications - Add non-blocking update warning for newer NovaModuleTools releases before interactive scaffold questions - Ensure existing .gitignore rules are preserved while adding Nova-managed entries - Update documentation to reflect new behavior in initialization workflows * feat(#194): update coding standards in documentation - Refine private helper naming guidance to avoid public-style names - Clarify implementation-focused naming for private helpers * feat(#194): enhance text file formatting rules and add guardrails - update documentation to specify newline and blank line requirements - introduce Test-TextFileFormatting script to enforce formatting rules - add tests to validate text file formatting compliance * feat(#194): enhance NovaModule test workflow with code coverage validation - Add coverage target checks in Invoke-NovaTestWorkflow - Introduce functions for retrieving coverage settings from project configuration - Update project templates to include default Pester code coverage settings * feat(#194): improve NovaModule test workflow context with enhanced configuration - Refactor variable assignments for consistency - Update Pester configuration to ensure code coverage targets are applied correctly * feat(#194): frame ten PowerShell maintainability guidelines and add building-maintainable-code skill * fix(#194): slim agentic Copilot workflow and add wire-up integrity test - Move cross-cutting rules into .github/instructions/repository-conventions.instructions.md and slim copilot-instructions.md to a thin index with a task → prompt → agent → skills → instructions table - Generate AGENTS.md from copilot-instructions.md via Sync-AgenticCopilotScaffold.ps1 with a do-not-edit banner; remove AGENTS.md from scaffold-owned paths - Make scaffold TextReplacements code-fence-aware (skip fenced blocks and inline backticks) via new Split-AgenticContentByCodeFence and Invoke-AgenticInlineCodeAwareReplace helpers - Rename .github/skills/docs-site-html → docs-site to match the agent name and update references - Delete .github/prompts/markdown.prompt.md and fold its wrapper rules and example into the markdown-authoring skill - Normalize prompt headers and add an explicit "Invoke with @.github/prompts/<name>.prompt.md" line that names the delegated agent - Add "When unclear, ask before proceeding" clause to reviewer and release-manager agents - Replace the anchorless one-liner in code-quality-matrix.instructions.md with the ten concrete maintainability dimensions - Add tests/AgenticCopilotWiring.Tests.ps1 asserting /skill references, prompt → agent references, instruction applyTo: globs, and skill name/folder parity - Update scaffold-sync tests for the slim structure (new RepositoryConventions field, AGENTS.md banner assertion) and drop markdown.prompt.md from CoverageGaps expectations * fix(#194): slim agentic Copilot workflow and add wire-up integrity test - Move cross-cutting rules into .github/instructions/repository-conventions.instructions.md and slim copilot-instructions.md to a thin index with a task → prompt → agent → skills → instructions table - Generate AGENTS.md from copilot-instructions.md via Sync-AgenticCopilotScaffold.ps1 with a do-not-edit banner; remove AGENTS.md from scaffold-owned paths - Make scaffold TextReplacements code-fence-aware (skip fenced blocks and inline backticks) via new Split-AgenticContentByCodeFence and Invoke-AgenticInlineCodeAwareReplace helpers - Rename .github/skills/docs-site-html → docs-site to match the agent name and update references - Delete .github/prompts/markdown.prompt.md and fold its wrapper rules and example into the markdown-authoring skill - Normalize prompt headers and add an explicit "Invoke with @.github/prompts/<name>.prompt.md" line that names the delegated agent - Add "When unclear, ask before proceeding" clause to reviewer and release-manager agents - Replace the anchorless one-liner in code-quality-matrix.instructions.md with the ten concrete maintainability dimensions - Add tests/AgenticCopilotWiring.Tests.ps1 asserting /skill references, prompt → agent references, instruction applyTo: globs, and skill name/folder parity - Update scaffold-sync tests for the slim structure (new RepositoryConventions field, AGENTS.md banner assertion) and drop markdown.prompt.md from CoverageGaps expectations * #194 fix: Update release notes. * feat(#194): enhance agentic Copilot scaffold with identifier replacements and documentation updates - Update design and review prompts for consistency in section naming - Introduce identifier replacement lists in scaffold content functions - Adjust documentation references to use project-specific naming conventions * feat(#194): update documentation for clarity and consistency - Refine instructions for step-by-step refactoring of unhealthy files - Remove redundant references to skills in various sections - Simplify language for better understanding in the guidelines * feat(#194): update help documentation for PlatyPS compatibility - Clarify workflow for generating help files by emphasizing the need to build and import the dist module first. - Update instructions to ensure correct metadata fields are populated in help files. - Add guidance on maintaining consistent naming conventions for external help files. * feat(#194): enhance Nova testing workflow and coverage configuration - Suppress progress output during Pester runs for cleaner logs - Update CodeCoverage settings in project.json for improved reporting - Refactor coverage configuration logic in GetNovaTestWorkflowContext * feat(#194): update code coverage target and improve test configuration - increase coverage percent target from 75 to 80 - streamline parameter usage in test configuration * feat(#194): update code coverage target and improve test cases - change coverage percent target from 80 to 75 - refactor test cases for clarity and consistency * feat(#194): update code coverage target and improve test cases - change coverage percent target from 80 to 75 - refactor test cases for clarity and consistency * feat(#194): update code coverage target to 80% * feat(#194): simplify CI to single test run with JaCoCo coverage upload - Remove second Invoke-Pester run from Invoke-NovaModuleToolsCI.ps1; Test-NovaBuild now runs once and produces artifacts/coverage.xml - Remove Cobertura conversion helpers, SetSourcePath guard, and Get-CiPesterConfiguration/Get-CiTestPath functions from CI script - Update Invoke-CodeSceneAnalysis.ps1 to resolve artifacts/coverage.xml as the default JaCoCo coverage path instead of *.cobertura.xml - Upload coverage twice: --format jacoco --metric line-coverage and --metric branch-coverage - Add --format jacoco to cs-coverage check in check-coverage action - Update Tests.yml coverage-files glob to **/coverage.xml - Update CodeSceneAnalysis tests for JaCoCo double-upload behaviour - Update testing-policy instructions to document single-run JaCoCo flow * #194 fix: update message. * feat(#194): refactor Invoke-NovaTestWorkflow tests and improve README clarity - Simplify test setup in InvokeNovaTestWorkflow.Tests.ps1 - Enhance error reporting for coverage target failures - Update README to clarify purpose of NovaModuleTools - Refactor AgenticCopilot scaffold functions for better readability
1 parent 38fd14c commit 8b434bb

194 files changed

Lines changed: 7037 additions & 1316 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codescene/code-health-rules.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"usage": "Persist this file inside your repositories as .codescene/code-health-rules.json Keep the rules you want to override, remove the rest for simplicity and an easy overview.Override the code health rules by changing the default 1.0 value to a lower relative weight. A value of 0.0 disables the rule. A value of 0.5 still implies a code health hit but only at 50% of the default impact. Note that you can specify multiple rule sets and use the matching-content-path to control to which parts or languages the rules apply. This makes it possible to differentiate between test vs application code, or tailor rules to specific languages. In case multiple rule sets match a piece of content, then we prioritize the first mathcing set of rules.",
2+
"usage": "Keep the rules you want to override, remove the rest for simplicity and an easy overview. Override the code health rules by changing the default 1.0 value to a lower relative weight. A value of 0.0 disables the rule. A value of 0.5 still implies a code health hit but only at 50% of the default impact. Note that you can specify multiple rule sets and use the matching-content-path to control to which parts or languages the rules apply. This makes it possible to differentiate between test vs application code, or tailor rules to specific languages. In case multiple rule sets match a piece of content, then we prioritize the first matching set of rules.",
33
"rule_sets": [
44
{
55
"thresholds": [

.github/actions/check-coverage/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ runs:
3030
CS_ACCESS_TOKEN: ${{ inputs.access-token }}
3131
run: |
3232
set -euo pipefail
33-
find "$(pwd)" -name '*.cobertura.xml' -print
33+
find "$(pwd)" -name 'coverage.xml' -print
3434
"$(pwd)/cs-coverage" check --verbose --coverage-files "${{ inputs.coverage-files }}"

.github/agents/architect.agent.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ Design or reshape changes that cross public commands, private helper boundaries,
3737
## Skills to use
3838

3939
- `/powershell-module-development`
40-
- `/github-actions`
4140
- `/release-and-changelog`
41+
- `/markdown-authoring`
42+
- `/building-maintainable-code`
43+
- `/github-actions`
4244
- `/codescene-quality`
4345
- `/guiding-refactoring-with-code-health`
44-
- `/markdown-authoring`
4546

4647
## Constraints
4748

@@ -62,6 +63,7 @@ Design or reshape changes that cross public commands, private helper boundaries,
6263
- If the user chooses full finalization, a GitHub issue draft is ready to paste or create from the final output.
6364
- If the user chooses design-package-only finalization, the output is clearly resumable later from an `Open questions /
6465
resume here` section.
66+
- Finalization output is copy-ready Markdown that applies the project `markdown-authoring` skill.
6567

6668
## Must not do
6769

@@ -71,4 +73,5 @@ Design or reshape changes that cross public commands, private helper boundaries,
7173
- Must not create or edit repository files when the task is still in design mode.
7274
- Must not return a full implementation plan or finished issue draft in the first reply when the user is clearly asking for a design discussion.
7375
- Must not leave the user guessing whether the final output is a handoff document, paste-ready issue text, or both.
76+
- Must not return finalization Markdown that skips the project `markdown-authoring` guidance.
7477
- Must not decide on its own that requested work is out of scope and then finalize the design without the user's confirmation.

.github/agents/docs-site.agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Keep the GitHub Pages documentation under `docs/*.html` accurate, user-focused,
2727

2828
## Skills to use
2929

30-
- `/docs-site-html`
30+
- `/docs-site`
3131
- `/markdown-authoring`
3232
- `/powershell-module-development`
3333
- `/release-and-changelog`

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,27 @@ Implement PowerShell command and helper changes in the NovaModuleTools style.
1313

1414
- Change the relevant public command and private helper flow.
1515
- Keep public files delegating and internal helpers domain-aligned.
16-
- Add or update tests and documentation for the changed behavior.
16+
- Preserve Nova's `project.json`-driven build model; do not add hand-written source `.psm1` or module `.psd1` files.
17+
- Read `project.json` `Manifest.PowerShellHostVersion` before implementing PowerShell changes and keep source, tests, and examples compatible with that target.
18+
- 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, and PowerShell functions must not declare nested functions inside their bodies.
19+
- Use `.github/instructions/code-quality-matrix.instructions.md` as the best-effort source-code maintainability guidance while shaping `src/**/*.ps1`.
20+
- Use `.github/instructions/psscriptanalyzer.instructions.md` as the ScriptAnalyzer workflow source of truth while changing PowerShell code or analyzer helpers.
21+
- Add or update source-mirrored tests and valid PlatyPS-compatible help docs for the changed behavior, using the Microsoft.PowerShell.PlatyPS cmdlets instead of hand-written help structure.
22+
- Every new public entry point must add its matching help file in the same change.
23+
- 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.
1724

1825
## Inputs to inspect
1926

2027
- The relevant file in `src/public/`
21-
- Matching helpers in `src/private/build|cli|package|quality|release|scaffold|shared|update/`
28+
- Matching helpers in `src/private/`
2229
- Matching test files in `tests/`
2330
- `project.json`
2431

2532
## Skills to use
2633

2734
- `/powershell-module-development`
2835
- `/pester-testing`
36+
- `/building-maintainable-code`
2937
- `/codescene-quality`
3038
- `/guiding-refactoring-with-code-health`
3139
- `/safeguarding-ai-generated-code`
@@ -36,10 +44,20 @@ Implement PowerShell command and helper changes in the NovaModuleTools style.
3644
- Keep `ShouldProcess` behavior where the command already supports it.
3745
- Keep raw infrastructure calls behind approved adapters.
3846
- Preserve existing command names, warning semantics, and output shape.
47+
- Keep new or heavily changed source functions aligned with `.github/instructions/code-quality-matrix.instructions.md`: short, single-purpose, low-duplication, and split by clear responsibility unless the scope explicitly justifies otherwise.
48+
- Prefer `./scripts/build/Invoke-ScriptAnalyzerCI.ps1` and `./run.ps1` for normal analyzer loops; use direct `Invoke-ScriptAnalyzer` only for focused local checks that reuse the repository-approved settings.
49+
- Validate Nova-managed project tests through `Test-NovaBuild`; do not call `Invoke-Pester` directly.
50+
- When help files change, keep `docs/NovaModuleTools/en-US/*.md` valid for `Import-MarkdownCommandHelp`: build and import the dist module first (`Import-Module ./dist/NovaModuleTools/NovaModuleTools.psd1 -Force`), then use `New-MarkdownCommandHelp` for new files, `Update-MarkdownCommandHelp` after command-surface changes, and `Test-MarkdownCommandHelp` before handoff. Generating help without the module imported causes `external help file` to default to the command name instead of the module name, producing per-command XML files that the manifest cannot find. A new public `src/public/*.ps1` file is not done until its matching help file exists.
3951

4052
## Definition of done
4153

4254
- Production code and tests both reflect the intended behavior.
55+
- Build output still comes from Nova-generated `dist/` files, not hand-authored module files in `src/`.
56+
- Public/private file ownership still follows the one externally called function per file rule, with private helpers kept as sibling top-level functions instead of nested function declarations.
57+
- Every new public entry point has its matching help file.
58+
- Project test validation ran through `Test-NovaBuild`.
59+
- Any ScriptAnalyzer findings reported by `run.ps1` or `Invoke-ScriptAnalyzerCI.ps1` are resolved.
60+
- Every changed or generated text file has been checked and ends with exactly one trailing newline and no extra blank lines at the bottom.
4361
- Docs/changelog review is complete.
4462
- The relevant validation commands have been run.
4563

@@ -48,3 +66,4 @@ Implement PowerShell command and helper changes in the NovaModuleTools style.
4866
- Must not mix PowerShell cmdlet UX and `nova` CLI UX.
4967
- Must not add silent fallbacks for invalid or risky behavior.
5068
- Must not duplicate helpers that already exist elsewhere in the repo.
69+
- Must not introduce PowerShell 7.x-only constructs into a `5.1` project unless guarded multi-version support is explicitly part of the change.

.github/agents/release-manager.agent.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Handle versioning, changelog shaping, release-flow documentation, and publish au
1515
- Keep `CHANGELOG.md` accurate and release-ready.
1616
- Review workflow, docs, and versioning implications together.
1717
- Produce a release-ready summary that follows `.github/pull_request_template.md` when a release preparation summary is requested.
18+
- When the release scope is unclear (for example whether the change targets a stable bump, a prerelease, or both), ask one clarifying question before proceeding instead of guessing.
1819

1920
## Inputs to inspect
2021

@@ -29,20 +30,18 @@ Handle versioning, changelog shaping, release-flow documentation, and publish au
2930

3031
- `/release-and-changelog`
3132
- `/markdown-authoring`
32-
- `/github-actions`
3333
- `/pester-testing`
34+
- `/github-actions`
3435

3536
## Constraints
3637

3738
- Treat release automation as high-risk.
3839
- Keep Keep a Changelog structure intact.
39-
- Use only the official Keep a Changelog section types in `CHANGELOG.md` and `RELEASE_NOTE.md`: `Added`, `Changed`,
40-
`Deprecated`, `Removed`, `Fixed`, and `Security`.
40+
- Use only the official Keep a Changelog section types in `CHANGELOG.md` and `RELEASE_NOTE.md`: `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, and `Security`.
4141
- Do not invent extra changelog section headings such as `Documentation`; place documentation-related release notes under the official type that best matches the actual impact.
4242
- Distinguish contributor docs from end-user docs.
4343
- Treat `.github/pull_request_template.md` as the authoritative format for structured release summaries.
44-
- When the release summary is returned as Markdown or copy-ready UI output, it must follow the `markdown-authoring`
45-
skill (`.github/skills/markdown-authoring/SKILL.md`).
44+
- When the release summary is returned as Markdown or copy-ready UI output, it must follow the `markdown-authoring` skill (`.github/skills/markdown-authoring/SKILL.md`).
4645

4746
## Definition of done
4847

.github/agents/reviewer.agent.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,23 @@ Review changes for correctness, maintainability, test coverage, workflow safety,
1414
- Start with the highest-risk workflow or public behavior surface.
1515
- Check for missing tests, doc drift, changelog gaps, and CI/release side effects.
1616
- Use the PR template categories as the review frame.
17+
- When the review scope is genuinely ambiguous (for example which subset of files to focus on, or whether a borderline behavior change is intentional), ask one clarifying question before proceeding instead of guessing.
1718
- Treat CodeScene maintainability and changed-code coverage results as release-blocking signals unless risk is accepted explicitly.
1819
- If local CodeScene tooling is unavailable, continue the review with normal validation and rely on PR/CI as the effective CodeScene gate.
1920
- Check whether website docs preserve the CLI-vs-cmdlet separation when `docs/*.html` or help markdown changed.
21+
- Check that Nova projects still use generated `dist/` module files instead of hand-written source `.psm1` or module `.psd1` files.
22+
- Check changed PowerShell code, tests, and examples against `project.json` `Manifest.PowerShellHostVersion`; flag PowerShell 7.x-only constructs in projects that target `5.1` unless the change explicitly adds guarded compatibility handling.
23+
- Check that public commands/classes have matching valid PlatyPS-compatible help and that new source files have source-mirrored tests. Flag help files under `docs/NovaModuleTools/en-US/` that look like plain Markdown, break the required PlatyPS section order, or would fail `Test-MarkdownCommandHelp` / `Import-MarkdownCommandHelp`.
24+
- Flag any new public entry point that does not add its matching help file in the same change.
25+
- Flag help files where `external help file` contains a command name instead of the module name. The correct value is `NovaModuleTools-Help.xml`; a per-command name like `Get-Something-Help.xml` means the help was generated without the built module imported.
26+
- Check analyzer changes and PowerShell validation flow against `.github/instructions/psscriptanalyzer.instructions.md`. Flag direct `Invoke-ScriptAnalyzer` usage that bypasses repository-approved settings or wrapper semantics without a clear reason.
27+
- Review changed `src/**/*.ps1` against `.github/instructions/code-quality-matrix.instructions.md` and `tests/**/*.ps1` against `.github/instructions/testing-policy.instructions.md`; flag new or heavily changed code that ignores those maintainability rules without a clear, explicit reason.
28+
- Flag public files that do not keep exactly one top-level function, and flag private files that group multiple externally called functions instead of limiting extra functions to related same-file top-level support helpers. Also flag file/function name mismatches for public commands or externally called private helpers, and flag nested function declarations inside PowerShell functions.
29+
- Flag broad catch-all test files when focused source-mirrored tests would make ownership clearer.
30+
- Flag Nova-managed validation that bypasses `Test-NovaBuild` with direct `Invoke-Pester`.
31+
- Flag any PSScriptAnalyzer rule excludes or suppressions; the code should be fixed instead.
32+
- Flag unresolved ScriptAnalyzer findings from `run.ps1` or `Invoke-ScriptAnalyzerCI.ps1`; they should be fixed instead of deferred.
33+
- Flag every changed or generated text file if they do not exactly have one trailing newline with no extra blank lines at the bottom.
2034

2135
## Inputs to inspect
2236

@@ -29,11 +43,12 @@ Review changes for correctness, maintainability, test coverage, workflow safety,
2943

3044
- `/codescene-quality`
3145
- `/safeguarding-ai-generated-code`
32-
- `/docs-site-html`
46+
- `/building-maintainable-code`
47+
- `/docs-site`
3348
- `/markdown-authoring`
3449
- `/pester-testing`
35-
- `/github-actions`
3650
- `/release-and-changelog`
51+
- `/github-actions`
3752

3853
## Constraints
3954

.github/agents/test-engineer.agent.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ Improve or maintain the repository's Pester coverage, coverage-gate behavior, an
1313

1414
- Add missing Pester coverage for changed behavior.
1515
- Refactor brittle or duplicated tests into reusable support patterns.
16+
- Enforce a source-mirrored test layout for new projects and newly added or changed source files.
17+
- Keep test files and helpers compatible with the project's `project.json` `Manifest.PowerShellHostVersion` target.
18+
- Use `.github/instructions/testing-policy.instructions.md` as the test-design source of truth while shaping `tests/**/*.ps1`.
19+
- Use `.github/instructions/psscriptanalyzer.instructions.md` when changing tests, test helpers, or analyzer/CI helpers so the repo-standard analyzer workflow stays intact.
1620
- Keep CI coverage output compatible with the CodeScene workflow.
21+
- 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.
22+
1723

1824
## Inputs to inspect
1925

@@ -27,21 +33,29 @@ Improve or maintain the repository's Pester coverage, coverage-gate behavior, an
2733

2834
- `/pester-testing`
2935
- `/codescene-quality`
36+
- `/building-maintainable-code`
3037
- `/github-actions`
3138
- `/guiding-refactoring-with-code-health`
3239
- `/safeguarding-ai-generated-code`
3340

3441
## Constraints
3542

36-
- Prefer targeted tests first, then the full repo quality loop.
43+
- Prefer the smallest `Test-NovaBuild` scope the project already supports, then the full repo quality loop.
3744
- Keep test files maintainable; passing tests are not enough if Code Health degrades.
3845
- Reuse existing fixture and support patterns before adding new ones.
46+
- Do not group unrelated source files into one broad test file when mirrored `tests/public`, `tests/private`, or `tests/classes` ownership is possible.
47+
- Do not introduce PowerShell 7.x-only test syntax or APIs into a project that targets `5.1` unless compatibility coverage is explicitly part of the scope.
3948
- If CodeScene flags a regression, refactor the tests or helpers instead of suppressing the finding.
49+
- Keep new or heavily changed tests focused, isolated, and easy to scan; split setup or assertion helpers when a test stops being readable.
50+
- Use `./scripts/build/Invoke-ScriptAnalyzerCI.ps1` as the normal analyzer entrypoint for changed test/helpers, and only fall back to direct `Invoke-ScriptAnalyzer` for focused local investigation with the repository-approved settings.
51+
- Use `Test-NovaBuild` as the test entrypoint for Nova-managed projects; do not validate with direct `Invoke-Pester`.
4052

4153
## Definition of done
4254

4355
- The changed behavior is covered.
56+
- Each new or changed `src/**/*.ps1` file has a matching source-mirrored test, or the cross-cutting owner test is named explicitly.
4457
- The touched tests are readable and low-duplication.
58+
- Validation uses `Test-NovaBuild` for project test execution.
4559
- Validation and CodeScene implications are addressed.
4660
- The pre-commit CodeScene safeguard is clean before the work is treated as commit-ready when local CodeScene tooling is available.
4761

0 commit comments

Comments
 (0)