Skip to content

Commit 3ac7599

Browse files
committed
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
1 parent 09d5e63 commit 3ac7599

45 files changed

Lines changed: 824 additions & 418 deletions

Some content is hidden

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

.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/release-manager.agent.md

Lines changed: 1 addition & 0 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

.github/agents/reviewer.agent.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ 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.
@@ -42,7 +43,7 @@ Review changes for correctness, maintainability, test coverage, workflow safety,
4243
- `/codescene-quality`
4344
- `/safeguarding-ai-generated-code`
4445
- `/building-maintainable-code`
45-
- `/docs-site-html`
46+
- `/docs-site`
4647
- `/markdown-authoring`
4748
- `/pester-testing`
4849
- `/release-and-changelog`

.github/copilot-instructions.md

Lines changed: 47 additions & 111 deletions
Large diffs are not rendered by default.

.github/instructions/code-quality-matrix.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ applyTo: "src/**/*.ps1,scripts/**/*.ps1,run.ps1,reload.ps1"
88

99
Use this file as the maintainability guidance for PowerShell source and helper scripts in this repository.
1010

11-
It frames ten established software maintainability guidelines in PowerShell terms with concrete thresholds, naming, and language constructs.
11+
It frames ten widely recognized maintainability dimensions in PowerShell terms: unit size, unit complexity, duplication, interface width, separation of concerns, coupling, component balance, codebase size, automated tests, and clean code. Each guideline below covers one dimension with concrete PowerShell thresholds.
1212

1313
This file tells Agentic Copilot how to shape source code from the start. Test-specific guidance lives in `.github/instructions/testing-policy.instructions.md` and the `pester-testing` skill. The matching operational workflow for these ten rules lives in the `building-maintainable-code` skill.
1414

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
applyTo: "**"
3+
---
4+
5+
# Repository conventions
6+
7+
## Purpose
8+
9+
Canonical rule source for cross-cutting NovaModuleTools conventions that apply to every change. Topic-specific rules live in the other `.instructions.md` files; this file owns the rules that do not belong to one topic.
10+
11+
## Project layering
12+
13+
- Treat `project.json` as the source of truth for project metadata, build output, package settings, and release settings.
14+
- Treat `project.json` `Manifest.PowerShellHostVersion` as the compatibility target for PowerShell code, tests, and examples. If a project targets `5.1`, do not introduce PowerShell 7.x-only syntax, cmdlets, parameters, or APIs unless the work explicitly adds guarded compatibility handling.
15+
- Use Nova commands and repository wrappers for build, test, package, and release workflows; do not replace them with ad hoc PowerShell module build scripts.
16+
- 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/NovaModuleTools/` from `project.json` and `src/**/*.ps1`.
17+
- Preserve the distinction between PowerShell cmdlet UX and `nova` CLI UX.
18+
19+
## File ownership
20+
21+
- `src/public/` files own exactly one top-level function each. The file name matches the function name.
22+
- `src/private/` files expose at most one externally called function per file. Additional helpers may stay as sibling top-level functions in the same file when they belong to that entry function. The file name matches the externally called function.
23+
- PowerShell functions must not declare nested functions inside their bodies.
24+
- Prefer existing helpers and support files over ad hoc duplication.
25+
- Do not add raw infrastructure calls in public commands when an adapter/helper layer already exists.
26+
27+
## Validation expectations
28+
29+
Use the smallest validation set that proves the change, then run the repository quality loop before finishing code work:
30+
31+
- local quality loop: `pwsh -NoLogo -NoProfile -File ./run.ps1`
32+
- test validation: `Test-NovaBuild`
33+
- analyzer only: `./scripts/build/Invoke-ScriptAnalyzerCI.ps1`
34+
- CI-parity coverage flow: `./scripts/build/ci/Invoke-NovaModuleToolsCI.ps1 -OutputDirectory ./artifacts`
35+
36+
If `run.ps1` or `./scripts/build/Invoke-ScriptAnalyzerCI.ps1` reports findings, fix them before review, handoff, or commit. Do not treat a failing local quality loop as an acceptable stopping point.
37+
38+
When CodeScene tooling is available:
39+
40+
- run the pre-commit safeguard on AI-touched changes before suggesting a commit
41+
- run a branch/change-set analysis before suggesting a PR or declaring a larger change ready
42+
- if CodeScene reports a regression, refactor instead of treating the work as done
43+
44+
If CodeScene tooling is unavailable locally, continue with the normal repository validation flow; pull requests and CI remain the effective gate.
45+
46+
For documentation-only changes, executable validation may be skipped if no code path or workflow behavior changed.
47+
48+
## Documentation review
49+
50+
- Review `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, and `RELEASE_NOTE.md` after every meaningful change.
51+
- Update tests when behavior changes.
52+
53+
## File formatting rule
54+
55+
- 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.
56+
- Do not leave any edited file with extra blank lines at the end, even if the functional code change is already complete.
57+
- Do not alter internal whitespace just to enforce the trailing newline rule.
58+
59+
## Safety constraints
60+
61+
- Do not publish packages, create tags, or push changes unless explicitly requested.
62+
- Do not modify GitHub Actions release automation casually; `Publish.yml` mutates `main` and `develop`.
63+
- Do not bypass warnings or guards silently; Nova uses explicit `-OverrideWarning` / `--override-warning`.
64+
65+
## Commit message guidance
66+
67+
- When you are asked to suggest or prepare a commit message, answer in English.
68+
- Use Conventional Commit format.
69+
- Extract the ticket number from `$GIT_BRANCH_NAME` and render it as `(#<number>)` immediately after the type when one is available.
70+
- If `$GIT_BRANCH_NAME` starts with `hotfix/` or `bug/`, use `fix` as the type even when the implementation looks more like a feature. Use `fix!` if that branch change is also breaking.
71+
- Otherwise estimate the type from the actual change:
72+
- `feat` for feature work
73+
- `fix` for bug fixes
74+
- `feat!` for breaking feature work
75+
- `fix!` for breaking fixes
76+
- Keep the subject short, specific, and free of unnecessary detail.
77+
- If you provide multiple commit message suggestions or summarize multiple change options, use bullet points.
78+
- Do not invent a ticket number when `$GIT_BRANCH_NAME` does not contain one.
79+
80+
## Markdown output
81+
82+
When the output is intended to be copied as Markdown from the UI or written to a Markdown file, follow the `markdown-authoring` skill (`.github/skills/markdown-authoring/SKILL.md`). Apply that rule especially to release summaries, review summaries, contributor-facing Markdown docs, prompt output, and PR-template-shaped text.

.github/prompts/design-change.prompt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Design a NovaModuleTools change
22

3+
> Invoke with `@.github/prompts/design-change.prompt.md`. Delegates to the `architect` agent.
4+
35
Use this prompt with `architect.agent.md` when a change still needs analysis, scoping, and issue drafting before anyone starts editing files.
46

57
This is a discussion-first prompt. The default behavior is to hold a short design conversation with the user before producing a final scoped solution, implementation handoff, or GitHub issue draft.

.github/prompts/fix-ci-failure.prompt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Fix NovaModuleTools CI failure
22

3+
> Invoke with `@.github/prompts/fix-ci-failure.prompt.md`. Delegates to the `powershell-developer` or `test-engineer` agent depending on the failing area.
4+
35
Investigate and fix a failing NovaModuleTools CI or workflow issue.
46

57
## Required inputs

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Implement NovaModuleTools issue
22

3+
> Invoke with `@.github/prompts/implement-issue.prompt.md`. Delegates to the `powershell-developer` agent.
4+
35
Implement the issue in the NovaModuleTools repository using the repository-local instructions and skills.
46

57
## Required inputs

.github/prompts/improve-test-coverage.prompt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Improve NovaModuleTools test coverage
22

3+
> Invoke with `@.github/prompts/improve-test-coverage.prompt.md`. Delegates to the `test-engineer` agent.
4+
35
Improve changed-code coverage in NovaModuleTools without lowering maintainability.
46

57
## Required process

0 commit comments

Comments
 (0)