Skip to content

Add Copilot custom instructions (code review standards)#519

Closed
bwateratmsft wants to merge 4 commits into
mainfrom
copilot-review-instructions
Closed

Add Copilot custom instructions (code review standards)#519
bwateratmsft wants to merge 4 commits into
mainfrom
copilot-review-instructions

Conversation

@bwateratmsft

Copy link
Copy Markdown
Collaborator

Summary

Adds Copilot custom instructions for this repository, with a strong emphasis on code review standards. These files are read by Copilot code review, the Copilot coding agent, and Copilot Chat.

Files

  • .github/copilot-instructions.md (repo-wide) — project overview, tech stack, build/lint/test commands, coding conventions, and a detailed Code review standards section.
  • .github/instructions/generated-and-curated-files.instructions.md (path-scoped via applyTo) — do not hand-edit or review-comment on NOTICE.html, package-lock.json, and CHANGELOG.md, plus monotonic-versioning rules.

How it was developed

Grounded in the existing code/conventions and recurring feedback on recent PRs (e.g. #443, #444, #447, #452, #454, #458, #471, #473, #483, #491, #492, #518). Notable review themes captured:

  • Async I/O + size guards instead of blocking the extension host.
  • Falsy-coercion bugs (x || null on 0/''), semver.coerce returning null / stripping prerelease.
  • Shared/aliased mutable object leaks (e.g. headers).
  • VS Code API semantics (end-exclusive ranges, scoped MarkdownString.isTrusted).
  • Windows correctness (PATHEXT, ensuring dirs exist).
  • Reuse of platform helpers (processutils, docker-extensibility image parser, AzureWizard).
  • Localize strings; use command-registration wrappers; lazy imports; MIT headers; literal ... not .
  • Treat NOTICE.html / package-lock.json as generated and CHANGELOG.md as curated; monotonic version bumps.

Opened as a draft so the wording can be reviewed and adjusted before merge. Happy to split, trim, or add more path-scoped rule files (e.g. for src/test, scaffolding, or tasks) as desired.

Add repo-wide `.github/copilot-instructions.md` and a path-scoped
`.github/instructions/generated-and-curated-files.instructions.md`.

The guidance is grounded in the existing code/conventions (TypeScript +
esbuild, azext platform packages, l10n, command wrappers, lazy imports,
MIT headers) and in recurring review feedback on recent PRs (async I/O
with size guards, falsy-coercion and semver.coerce pitfalls, shared
mutable object leaks, VS Code API semantics, Windows correctness, reuse
of existing helpers, and not hand-editing/reviewing generated or curated
files such as NOTICE.html, package-lock.json, and CHANGELOG.md).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread .github/instructions/generated-and-curated-files.instructions.md Outdated
bwateratmsft and others added 3 commits July 9, 2026 09:54
Fold recurring, high-signal review patterns mined from top-commented PRs in
both microsoft/vscode-docker and microsoft/vscode-containers into
.github/copilot-instructions.md:

- Add "Review scope & avoiding false positives" (verify API claims before
  flagging, don't repeat rejected points, respect intentional TODO/pre-release/
  type-assertion decisions, keep diffs focused, fix root cause over new
  eslint-disable).
- Correctness: locale-independent casing, handle-every-case, concurrency-safe
  stack caching + cheap config lookups, stream lifecycle, array membership.
- Types: precise unions over string; define types before use.
- New sections: Naming & constants, Code locality/coupling, Extension
  activation & performance, package.json contributions & settings, Scaffolding.
- Conventions: composeArgs/withArg builders + parseDockerLikeImageName, zod for
  external tool output, override/polymorphism, non-obvious-code comments.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Address review feedback: in-repo package.json / package-lock.json versions are
decreased frequently between releases without publishing, so a blanket "flag any
version decrease" rule produces false positives. Clarify in both instruction
files that only published marketplace versions must increase monotonically, and
that an in-repo version decrease should not be flagged on its own.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Self-review corrections to .github/copilot-instructions.md:
- Drop nonexistent setting containers.oci.jsonDetectionMaxSizeMB; generalize to a reasonable size guard.
- Remove @microsoft/vscode-docker-extensibility (not a dependency); attribute registry data providers to @microsoft/vscode-docker-registries.
- Correct arg-builder helpers to composeArgs/withArg/withQuotedArg from @microsoft/vscode-processutils (not vscode-container-client); drop withNamedArg/withFlagArg/withDockerBuildArg examples not used here.
- Generalize image-name parsing guidance (no parseDockerLikeImageName in src); prefer the container client's structured fields.
- Broaden command-wrapper location to src/commands/ since registerLocalCommand and registerWorkspaceCommand live in their own files.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bwateratmsft

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #533

@bwateratmsft
bwateratmsft deleted the copilot-review-instructions branch July 17, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant