Scripts.instructions
---
description: "PowerShell scripting standards for scripts/ — compatibility, error handling, output, and hook patterns."
applyTo: "scripts/**"
version: "1.0.0"
lastUpdated: "2026-04-23"
---
# PowerShell Script Standards
## Compatibility
Target **Windows PowerShell 5.1** as the baseline. Use `pwsh` (PowerShell Core 7+) only when a cross-platform shebang is needed (e.g., hook scripts invoked with `command:` key on Linux/macOS). Never use PowerShell 7-only syntax (ternary `?:`, `&&`/`||` pipeline chains, `ForEach-Object -Parallel`) without a version guard.
## Script Structure
Every script starts with:when to use it
Community prompt sourced from the open-source GitHub repo kennedym-ds/copilot_orchestrator (MIT). A "Scripts.instructions" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
codingcommunitydeveloper
source
kennedym-ds/copilot_orchestrator · MIT
more in Coding
Coding✓ tested
Senior code review (strict mode)
senior staff engineer running a merciless but fair review
Coding✓ tested
Debug by hypothesis, not by guessing
debugging partner who forms theories before touching code
Coding✓ tested
Generate tests from described behavior
test engineer who writes tests that would actually catch regressions