docs: add script authoring guidelines to copilot-instructions - #2950
Merged
Tom Meschter (tmeschter) merged 2 commits intoJul 27, 2026
Merged
Conversation
Distill recurring PR review feedback from the azure-validate and azure-diagnostics script-ification PRs (2854, 2855, 2856, 2862, 2932, 2933, 2934, 2935, 2936) into a new "Authoring Scripts in Skills" section covering cross-platform parity, PowerShell/bash pitfalls, deterministic CLI parsing, markdown references, and eval conventions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6926cbae-8d68-4845-9bbc-1c9086968b6d
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “Authoring Scripts in Skills” section to .github/copilot-instructions.md to codify cross-platform script authoring and documentation guidance (bash + PowerShell), aiming to reduce recurring review feedback loops on script-related skill updates.
Changes:
- Introduces cross-platform parity rules (paired
.sh/.ps1, consistent options/output/exit codes, and dry-run fidelity). - Adds PowerShell- and Bash-specific implementation guidelines (non-interactive behavior, compatibility targets, safer parsing/error handling).
- Documents expectations for deterministic CLI parsing, script references in markdown, and eval tagging/early termination guidance.
Show a summary per file
| File | Description |
|---|---|
| .github/copilot-instructions.md | Adds a new section documenting recommended patterns and pitfalls when adding helper scripts to skills. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Low
- Simplify intro and rename section to "General Guidelines" - Fix shebang example to include leading '#' - Reword pipefail note (bash -c is a new process, not a subshell) - Drop npm run references parenthetical - Remove the Evals for Scripted Behavior subsection Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6926cbae-8d68-4845-9bbc-1c9086968b6d
JasonYeMSFT (JasonYeMSFT)
approved these changes
Jul 24, 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.
Summary
Adds a new "Authoring Scripts in Skills" section to
.github/copilot-instructions.md, based on recurring review feedback from the recent script-ification PRs inazure-validateandazure-diagnostics(#2854, #2855, #2856, #2862, #2932, #2933, #2934, #2935, #2936).The goal is to help future changes that add or update helper scripts in skills avoid repeating the same review round-trips.
Guidelines added
.sh/.ps1, keep behavior/options/exit codes in sync, document exit codes (0/1/2), match dry-run output to what runs, single source of truth for results, never silently misclassify errors.$ErrorActionPreference='Stop'(and no redundant='Continue'); check$LASTEXITCODEafter native commands; avoid[Parameter(Mandatory)]; stay Windows PowerShell 5.1-compatible; preferWrite-Error.declare -A/mapfile); noeval; command- not process-substitution underset -e;grep -F+ handle exit 2; guard arg parsing (missing values, unknown options, type validation);--helpexits 0; re-declarepipefailin a new Bash process; temp-file large output; strip shebang from--help; no|| trueon critical steps.--query ... -o tsvover grep/sed; standard install-hint call form.Docs-only change.