Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/agents/psresourceget-bugfix.agent.md
Original file line number Diff line number Diff line change
@@ -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.
24 changes: 24 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -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/`.
13 changes: 13 additions & 0 deletions .github/instructions/psresourceget.instructions.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 21 additions & 0 deletions .github/prompts/psresourceget-fix.prompt.md
Original file line number Diff line number Diff line change
@@ -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.