Skip to content

Commit 6f183fd

Browse files
committed
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>*.
1 parent 3e6ebcf commit 6f183fd

20 files changed

Lines changed: 363 additions & 25 deletions

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
- Example scaffolds now merge the existing example README with the Agentic starter README instead of flattening the example guide into the generic starter file.
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.
16-
- 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, and tells agents to honor `project.json` `Manifest.PowerShellHostVersion` when writing PowerShell code and tests.
16+
- 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 instead of excluding or suppressing rules.
1818

1919
### Changed

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, and source-mirrored test guidance. 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, and source-mirrored test guidance. 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ changes will be included in the next **stable** release!
1111
- `Initialize-NovaModule` and `% nova init` now offer an optional Agentic Copilot starter package in both the minimal and example interactive scaffold flows.
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.
14-
- 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, and tells agents to honor `project.json` `Manifest.PowerShellHostVersion` when writing PowerShell code and tests.
14+
- 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.
1515
- Generated quality-loop guidance now keeps ScriptAnalyzer first and tells agents to fix ScriptAnalyzer findings instead of excluding or suppressing rules.
1616

1717
### Changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ 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, `project.json` `Manifest.PowerShellHostVersion` compatibility guidance, 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.
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, 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

3434
Use this command when you want to start a new module in the NovaModuleTools structure without hand-creating the project layout.
3535

3636
Use `-Path` when you want to create the project under a specific base directory. Positional path syntax is no longer supported.
3737

38-
Use `-Example` when you want the scaffold to start from the packaged example project instead of the minimal default layout. The example flow keeps the example source, resource, and test files, skips the Pester enable/disable question, and applies the interactive metadata values to the copied `project.json`. The standard and example flows share the same inline validation and retry behavior for interactive answers, including the optional Agentic Copilot setup prompt after the Git question. When you answer `Yes`, Nova adds the same starter package to either scaffold style and merges the example README instead of replacing it with the generic starter README outright.
38+
Use `-Example` when you want the scaffold to start from the packaged example project instead of the minimal default layout. The example flow keeps the example source, resource, and test files, skips the Pester enable/disable question, and applies the interactive metadata values to the copied `project.json`. The standard and example flows share the same inline validation and retry behavior for interactive answers, including the optional Agentic Copilot setup prompt after the Git question. When you answer `Yes`, Nova asks for the short project name, adds the same starter package to either scaffold style, and merges the example README instead of replacing it with the generic starter README outright.
3939

4040
This command supports `-WhatIf` and `-Confirm` through PowerShell `SupportsShouldProcess`. Use `-WhatIf` to preview the scaffold target after the interactive answers have been collected, without creating folders, writing `project.json`, or initializing Git.
4141

docs/commands.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ <h3>Start a new project</h3>
181181
compatibility guidance, strict ScriptAnalyzer guidance without excluded rules, generated
182182
<code>dist</code> module files, command-help ownership, and source-mirrored test guidance.
183183
</p>
184+
<p>If you enable the Agentic package, Nova also asks for a short project name used in generated
185+
guidance placeholders such as <code>Invoke-&lt;ShortName&gt;*</code>. For NovaModuleTools the
186+
short name is <code>Nova</code>, but it could also have been <code>NMT</code>.</p>
184187
<ul class="plain-list">
185188
<li><strong>Use when:</strong> you are creating a fresh NovaModuleTools project</li>
186189
<li data-command-visibility="command-line" hidden><strong>Remember:</strong> pass the target path

docs/core-workflows.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ <h2>Create the project</h2>
130130
<code>Manifest.PowerShellHostVersion</code> compatibility guidance, strict ScriptAnalyzer guidance
131131
without excluded rules, generated <code>dist</code> module files, command-help ownership, and
132132
source-mirrored test guidance.</p>
133+
<p>When you answer <code>Yes</code>, Nova also asks for a short project name used in generated guidance
134+
placeholders such as <code>Invoke-&lt;ShortName&gt;*</code>. For NovaModuleTools the short name is
135+
<code>Nova</code>, but it could also have been <code>NMT</code>.</p>
133136
<p>Use the example scaffold when you want the shortest path to understanding a real project layout, test
134137
suite, and package configuration. Use the minimal scaffold when you already know the structure you
135138
want.</p>

docs/getting-started.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ <h2>4. Scaffold the packaged example</h2>
201201
without excluded rules, generated <code>dist</code> module files, command-help ownership, and
202202
source-mirrored test guidance.
203203
Nova then creates a project folder under the path you selected.</p>
204+
<p>If you enable the Agentic package, Nova also asks for a short project name used in generated guidance
205+
placeholders such as <code>Invoke-&lt;ShortName&gt;*</code>. For NovaModuleTools the short name is
206+
<code>Nova</code>, but it could also have been <code>NMT</code>.</p>
204207
<div class="notice" data-command-visibility="command-line" hidden>
205208
<strong>CLI caveat:</strong>
206209
<p>Use <code>% nova init --path ~/Work</code> or <code>% nova init -p ~/Work</code>, not positional
@@ -311,8 +314,9 @@ <h2>7. Start from the minimal scaffold instead</h2>
311314
</div>
312315
</div>
313316
<p>The minimal scaffold still asks for the same core project metadata, including the optional Agentic
314-
Copilot setup question, but it gives you a smaller starter layout than the example project. When
315-
enabled, the Agentic package uses the same filtered starter mirror as the example scaffold.</p>
317+
Copilot setup question and the follow-up short-name prompt when you answer Yes, but it gives you a
318+
smaller starter layout than the example project. When enabled, the Agentic package uses the same
319+
filtered starter mirror as the example scaffold.</p>
316320
<p>Use the example scaffold when you want the fastest learning path. Use the minimal scaffold when you
317321
want the leanest new project.</p>
318322
</section>

scripts/build/Sync-AgenticCopilotScaffold.psd1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
}
6565
@{
6666
Old = '- Keep `docs/*.html`, `docs/NovaModuleTools/en-US/*.md`, and contributor docs clearly separated by audience and syntax.'
67-
New = '- Keep command help, contributor docs, and release history clearly separated by audience and syntax.'
67+
New = '- Keep command help `docs/{{ProjectName}}/en-US/*.md`, contributor docs, and release history clearly separated by audience and syntax.'
6868
}
6969
@{
7070
Old = '- CI-parity coverage flow: `./scripts/build/ci/Invoke-NovaModuleToolsCI.ps1 -OutputDirectory ./artifacts`'
@@ -116,11 +116,11 @@
116116
}
117117
@{
118118
Old = '- `docs/NovaModuleTools/en-US/` - command help source'
119-
New = '- `docs/<ProjectName>/en-US/` - command help source, when present'
119+
New = '- `docs/{{ProjectName}}/en-US/` - command help source'
120120
}
121121
@{
122122
Old = '- `project docs` - end-user GitHub Pages content'
123-
New = '- `docs/` - project documentation, when present'
123+
New = '- `docs/` - project documentation'
124124
}
125125
@{
126126
Old = '- `.github/instructions/documentation.instructions.md`'
@@ -232,7 +232,7 @@
232232
}
233233
@{
234234
Old = '- project docs - end-user GitHub Pages content'
235-
New = '- `docs/` - project documentation, when present'
235+
New = '- `docs/` - project documentation'
236236
}
237237
@{
238238
Old = 'applyTo: "tests/**/*.ps1,scripts/build/**/*.ps1,"'
@@ -252,7 +252,7 @@
252252
}
253253
@{
254254
Old = '-Nova*'
255-
New = '-<function>*'
255+
New = '-{{ShortName}}*'
256256
}
257257
@{
258258
Old = ', and the `nova` CLI routing model.'

src/private/scaffold/GetNovaModuleQuestions.ps1

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
1-
function Get-NovaModuleProjectNameValidation {
1+
function Get-NovaModuleSingleWordValidation {
2+
[CmdletBinding()]
3+
param(
4+
[Parameter(Mandatory)][string]$Pattern,
5+
[Parameter(Mandatory)][string]$Message,
6+
[Parameter(Mandatory)][string]$ErrorId
7+
)
8+
9+
$validationPattern = $Pattern
10+
211
return @{
3-
Test = {
12+
Test = ({
413
param($Value)
514

6-
return $Value -match '^[A-Za-z][A-Za-z0-9_.]*$'
7-
}
8-
Message = 'Module name is invalid. Use a single word that starts with a letter and contains only letters, numbers, underscores, or periods.'
9-
ErrorId = 'Nova.Validation.ScaffoldProjectNameInvalid'
15+
return $Value -match $validationPattern
16+
}).GetNewClosure()
17+
Message = $Message
18+
ErrorId = $ErrorId
1019
Category = [System.Management.Automation.ErrorCategory]::InvalidData
1120
}
1221
}
1322

23+
function Get-NovaModuleProjectNameValidation {
24+
return Get-NovaModuleSingleWordValidation -Pattern '^[A-Za-z][A-Za-z0-9_.]*$' -Message 'Module name is invalid. Use a single word that starts with a letter and contains only letters, numbers, underscores, or periods.' -ErrorId 'Nova.Validation.ScaffoldProjectNameInvalid'
25+
}
26+
27+
function Get-NovaModuleProjectShortNameValidation {
28+
return Get-NovaModuleSingleWordValidation -Pattern '^[A-Za-z][A-Za-z0-9]*$' -Message 'Project short name is invalid. Use a short word that starts with a letter and contains only letters or numbers.' -ErrorId 'Nova.Validation.ScaffoldProjectShortNameInvalid'
29+
}
30+
1431
function Get-NovaModuleBaseQuestionSet {
1532
return [ordered]@{
1633
ProjectName = @{
@@ -83,6 +100,21 @@ function Get-NovaModuleAgenticCopilotQuestion {
83100
}
84101
}
85102

103+
function Get-NovaModuleAgenticCopilotProjectShortNameQuestion {
104+
return @{
105+
Caption = 'Project short name'
106+
Message = 'Enter a short project name for generated guidance placeholders such as Invoke-<ShortName>*. For NovaModuleTools the short name is Nova, but it could also have been NMT.'
107+
Prompt = 'ProjectShortName'
108+
Default = 'MANDATORY'
109+
Validation = Get-NovaModuleProjectShortNameValidation
110+
Condition = {
111+
param([System.Collections.IDictionary]$Answer)
112+
113+
return $Answer.Contains('EnableAgenticCopilot') -and $Answer['EnableAgenticCopilot'] -eq 'Yes'
114+
}
115+
}
116+
}
117+
86118
function Get-NovaModuleQuestionSet {
87119
[CmdletBinding()]
88120
param(
@@ -91,6 +123,7 @@ function Get-NovaModuleQuestionSet {
91123

92124
$questions = Get-NovaModuleBaseQuestionSet
93125
$questions.EnableAgenticCopilot = Get-NovaModuleAgenticCopilotQuestion
126+
$questions.ProjectShortName = Get-NovaModuleAgenticCopilotProjectShortNameQuestion
94127

95128
if (-not $Example) {
96129
$questions.EnablePester = Get-NovaModulePesterQuestion

src/private/scaffold/InitializeNovaModuleAgenticCopilotScaffold.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
function Get-NovaModuleAgenticCopilotProjectShortName {
2+
[CmdletBinding()]
3+
param(
4+
[Parameter(Mandatory)][hashtable]$Answer
5+
)
6+
7+
if (-not $Answer.ContainsKey('ProjectShortName') -or [string]::IsNullOrWhiteSpace($Answer.ProjectShortName)) {
8+
Stop-NovaOperation -Message 'Project short name is required when Agentic Copilot setup is enabled.' -ErrorId 'Nova.Validation.AgenticCopilotProjectShortNameMissing' -Category InvalidData -TargetObject 'ProjectShortName'
9+
}
10+
11+
return $Answer.ProjectShortName
12+
}
13+
114
function Get-NovaModuleAgenticCopilotTemplateTokenMap {
215
[CmdletBinding()]
316
param(
@@ -12,6 +25,7 @@ function Get-NovaModuleAgenticCopilotTemplateTokenMap {
1225

1326
return [ordered]@{
1427
'{{ProjectName}}' = $Answer.ProjectName
28+
'{{ShortName}}' = Get-NovaModuleAgenticCopilotProjectShortName -Answer $Answer
1529
'{{ProjectDescription}}' = $description
1630
'{{StartHereBody}}' = @'
1731
Use this repository as the starting point for your module.

0 commit comments

Comments
 (0)