feat(instructions): add PowerShell coding standards, Pester testing conventions, and bash copyright headers#836
Merged
WilliamBerryiii merged 7 commits intomainfrom Mar 2, 2026
Conversation
…t headers - create PowerShell instructions file with 11 sections covering script structure, modules, naming, error handling, PSScriptAnalyzer compliance, and copyright headers - add copyright headers section to bash instructions and fix attribution from edge-ai to hve-core - update coding-standards and hve-core-all collection manifests with PowerShell entry - regenerate plugin outputs and update ai-artifacts-common.md documentation 📝 - Generated by Copilot
…ution convention - fix -Type to -Level and casing in CI Integration example - add Write-CIAnnotation call to Complete Script Example catch block - update ai-artifacts-common.md attribution to match prompt-builder convention 🔧 - Generated by Copilot
- add LASTEXITCODE and scriptblock to general-technical word list 📝 - Generated by Copilot
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
- add pester.instructions.md with Pester 5.x patterns for Copilot - register pester instructions in coding-standards and hve-core-all collections - regenerate plugin outputs for both collections 🧪 - Generated by Copilot
🔧 - Generated by Copilot
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #836 +/- ##
=======================================
Coverage 85.34% 85.34%
=======================================
Files 27 27
Lines 5076 5076
=======================================
Hits 4332 4332
Misses 744 744
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
0977ff2 to
2143c2f
Compare
This was referenced Mar 2, 2026
This was referenced Mar 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces comprehensive PowerShell coding standards and Pester testing conventions to the hve-core project and adds copyright header requirements to the existing bash instructions. It also standardizes attribution conventions across AI artifact documentation.
PowerShell Coding Standards
Added powershell.instructions.md establishing complete scripting standards for
.ps1,.psm1, and.psd1files. The instruction covers a 10-section script structure, module patterns, naming conventions, error handling, CI integration viaWrite-CIAnnotation, parameter validation, PSScriptAnalyzer compliance, and copyright headers. Two complete working examples — a script template and a module template — demonstrate the conventions in practice.Pester Testing Conventions
Added pester.instructions.md (245 lines) establishing Pester 5.x testing conventions for
.Tests.ps1files. The instruction covers test naming and location, file headers (#Requires, copyright), SUT imports via$PSScriptRoot-relative paths,Describe/Context/Itblock structure, mocking withMock/InModuleScope, assertions, tag conventions, output handling, and a complete annotated example template. Separated from powershell.instructions.md to keep each file focused and avoid excessive length.Bash Copyright Headers
Updated bash.instructions.md with a copyright header section matching the PowerShell format (2-line Microsoft/SPDX-MIT). Corrected the attribution from microsoft/edge-ai to microsoft/hve-core.
Attribution Convention
Updated ai-artifacts-common.md to standardize attribution: frontmatter
descriptionfield applies to all artifacts, while the blockquote footer is retained only for skill files (SKILL.md).Collection and Plugin Metadata
Registered the new PowerShell and Pester instructions across collection manifests and plugin outputs. Updated coding-standards.collection.md, coding-standards.collection.yml, and hve-core-all.collection.yml to include PowerShell and Pester in descriptions, tags, and item lists. Updated marketplace.json and plugin metadata to reflect the expanded language coverage. Added plugin symlinks for both coding-standards and hve-core-all plugins.
Related Issue(s)
Closes #308
Closes #316
Type of Change
Select all that apply:
Code & Documentation:
Infrastructure & Configuration:
AI Artifacts:
prompt-builderagent and addressed all feedback.github/instructions/*.instructions.md).github/prompts/*.prompt.md).github/agents/*.agent.md).github/skills/*/SKILL.md)Other:
.ps1,.sh,.py)Sample Prompts (for AI Artifact Contributions)
User Request:
"Write a PowerShell script that validates configuration files" or "Create a PowerShell module for log processing." The instructions activate automatically via the
applyToglob pattern (**/*.ps1,**/*.psm1,**/*.psd1) when editing PowerShell files. For test files, "Write Pester tests for the log processor module" activates pester.instructions.md via theapplyTopattern (**/*.Tests.ps1).Execution Flow:
.ps1,.psm1, or.psd1file in the workspace.applyTopattern match.#Requiresstatements,usingstatements, comment-based help,[CmdletBinding()]declaration, parameter block,begin/process/endblocks, and helper functions.try/catchwithWrite-CIAnnotation -Level Errorfor CI-aware output..psd1) and script module (.psm1) conventions.*.Tests.ps1files, pester.instructions.md activates and guides Pester 5.x test structure, SUT imports, mocking, and assertions.Output Artifacts:
Generated PowerShell scripts contain structured sections following the convention:
Generated Pester tests follow the convention:
Success Indicators:
PSScriptAnalyzervalidation (npm run lint:ps).try/catchpattern withWrite-CIAnnotationfor CI output.Describe/Context/Ithierarchy withBeforeAllSUT imports.npm run test:psexecution.Testing
Automated validation performed:
npm run lint:md): Passed (287 files, 0 errors)npm run spell-check): Passed (addedLASTEXITCODEandscriptblockto cspell dictionary)npm run lint:frontmatter): Passed (271 files, 0 errors, 0 warnings)npm run validate:skills): Passed (2 skills, 0 errors)npm run lint:md-links): Passed (12 pre-existing broken links in 7 unrelated files; 0 issues in PR files)npm run lint:ps): Passed (all scripts clean)npm run plugin:generate): Passed (11 plugins, 147 instructions, 330 symlink index entries)Security analysis: No sensitive data exposure, dependency vulnerabilities, or privilege escalation concerns identified. Changes strengthen code quality and licensing compliance.
Diff-based assessment: All changed files verified against commit history. No unintended modifications detected. Attribution correction (edge-ai → hve-core) confirmed consistent across bash instructions and plugin READMEs.
Manual testing was not performed.
Checklist
Required Checks
AI Artifact Contributions
/prompt-analyzeto review contributionprompt-builderreviewRequired Automated Checks
The following validation commands must pass before merging:
npm run lint:mdnpm run spell-checknpm run lint:frontmatternpm run validate:skillsnpm run lint:md-linksnpm run lint:psnpm run plugin:generateSecurity Considerations
GHCP Artifact Maturity
Additional Notes