diff --git a/.github/agents/psresourceget-bugfix.agent.md b/.github/agents/psresourceget-bugfix.agent.md new file mode 100644 index 000000000..81191bd5b --- /dev/null +++ b/.github/agents/psresourceget-bugfix.agent.md @@ -0,0 +1,22 @@ +--- +description: "Repository-aware bug-fix mode for PSResourceGet." +model: GPT-4.1 +--- + +# PSResourceGet bug-fix mode + +You are working in the PSResourceGet repository. + +Follow these rules: +- Start by identifying the exact files and tests involved in the bug. +- Prefer minimal scope and root-cause fixes over broad refactors. +- Validate the relevant build or Pester tests before finishing. +- Preserve PowerShell compatibility and current module behavior. +- Keep the change aligned with the project patterns in `src/`, `test/`, and the build scripts. + +When a fix is required: +1. Investigate the root cause. +2. Add or update the smallest appropriate test. +3. Implement the fix. +4. Run the narrowest relevant validation command. +5. Report the result with evidence. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..6ff063002 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,24 @@ +# Copilot instructions for PSResourceGet + +## Project context +- This repository contains `Microsoft.PowerShell.PSResourceGet`, a PowerShell module for discovering, installing, updating, and publishing PowerShell resources. +- Source code lives under `src/code` and the compiled module is packaged from `src/Microsoft.PowerShell.PSResourceGet.psm1` and related assets. +- Tests live under `test/` and are typically PowerShell-based Pester tests. + +## Build and validation +- Build the .NET project with: + - `dotnet build src/code /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary` +- For repo-local builds, prefer the existing build scripts: `build.ps1` for quick builds or `doBuild.ps1` for comprehensive builds. +- Run focused validation with PowerShell/Pester for the relevant test area before claiming a fix is complete. +- If a change affects packaging or module behavior, validate the relevant Pester files in `test/` and ensure the build still succeeds. + +## Coding guidance +- Keep changes aligned with the existing PowerShell module and .NET project conventions. +- Favor small, targeted fixes with clear names and minimal scope. +- Preserve compatibility with supported PowerShell versions and the current public module behavior. +- Prefer existing helper patterns and repository conventions over introducing new abstractions. + +## Scope for agent work +- When asked to fix a bug, first identify the relevant files and tests, then implement the minimum fix that addresses the root cause. +- When adding or modifying behavior, make sure the corresponding tests reflect the change and remain realistic. +- When working on release or package concerns, respect repository build scripts and the module packaging expectations under `src/`. diff --git a/.github/instructions/psresourceget.instructions.md b/.github/instructions/psresourceget.instructions.md new file mode 100644 index 000000000..d846bd6bf --- /dev/null +++ b/.github/instructions/psresourceget.instructions.md @@ -0,0 +1,13 @@ +--- +applyTo: "src/**/*.cs,src/**/*.ps1,test/**/*.ps1,**/*.psm1,**/*.psd1,**/*.md" +--- + +# PSResourceGet repository instructions + +- Treat this repo as the PowerShell module `Microsoft.PowerShell.PSResourceGet`. +- Favor small, targeted fixes that match the existing module and .NET conventions. +- Preserve compatibility with supported PowerShell versions and public behavior. +- Prefer repo-local build and validation commands before introducing new workflows. +- When fixing issues, identify the root cause, add or update the relevant test, and validate the narrowest scope possible. +- Keep changes limited to the issue being addressed; avoid unrelated refactors. +- For packaging or module behavior changes, validate the relevant Pester files under `test/` and ensure the project still builds. diff --git a/.github/prompts/psresourceget-fix.prompt.md b/.github/prompts/psresourceget-fix.prompt.md new file mode 100644 index 000000000..b2fc2c55b --- /dev/null +++ b/.github/prompts/psresourceget-fix.prompt.md @@ -0,0 +1,21 @@ +--- +mode: agent +description: "Fix a PSResourceGet issue using the repository's build, test, and module conventions." +--- + +# PSResourceGet fix workflow + +Use this workflow when fixing a bug, regression, or issue in `Microsoft.PowerShell.PSResourceGet`. + +1. Locate the relevant code and tests in `src/` and `test/`. +2. Identify the root cause and confirm which behavior is currently failing. +3. Add or update the smallest realistic test that captures the issue. +4. Implement the minimal code fix that addresses the root cause. +5. Validate with the focused build or test command for the affected area. +6. Summarize the change and evidence. + +Repository-specific expectations: +- Prefer `dotnet build src/code /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary` for the .NET build. +- Use PowerShell/Pester tests in `test/` for behavioral validation where relevant. +- Keep the fix aligned with the existing module conventions and public contract. +- Avoid broad refactors or unrelated cleanup while the bug is being fixed.