agentleFS
MicrosoftKnown publishermicrosoft/vscode-azureresourcegroups/.github/copilot-instructions.md

vscode-azureresourcegroups

Copilot instructions80 starsChanged 12 days agoMITView on GitHub

This repository implements Azure Resources, not just resource-group CRUD. It hosts shared resource trees, account/subscription selection, APIs consumed by other Azure extensions, Cloud Shell, and Create New Project with Copilot (Copilot on Rails). Use AGENTS.md to locate owners and entry points. Read the matching .github/instructions/*.instructions.md before changing a subsystem. The existing Copilot on Rails documentation and artifact-security instructions remain applicable alongside the newer guides. - Trace the affected contribution in package.json through registration in src/extension.ts or src/commands/registerCommands.ts to its handler,…

  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,336 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this copilot-instructions.md into the rules it gives an agent

12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Use AGENTS.md to locate owners and entry points.

    line 7
  2. Distinctive:

    Keep command IDs, menu/context expressions, settings, view IDs, and activation events in sync with handlers.

    line 22
  3. Very specific:

    Use Azure Tools action contexts, registerCommand, callWithTelemetryAndErrorHandling, AzureWizard, subscription-selection helpers, and …

    line 25
  4. Very specific:

    Keep TypeScript strict. Narrow untrusted values and optional API fields rather than adding any, unchecked casts, non-null assertions, or …

    line 35
  5. Very specific:

    Follow the surrounding localization mechanism: src/utils/localize.ts for existing vscode-nls callers, vscode.l10n.t where already used, and …

    line 37
  6. Very specific:

    Use vscode.Uri and workspace.fs for workspace resources where appropriate.

    line 40
  7. Distinctive:

    Treat credentials, access tokens, connection strings, user project contents, and sensitive resource data as private.

    line 43
  8. Distinctive:

    Use existing masking/context helpers and record safe metadata rather than raw payloads.

    line 45
  9. Very specific:

    Run commands from the repository root unless a different directory is stated.

    line 51
  10. Very specific:

    Run checks relevant to the change, not npm run all by default: that script also installs, packages, and runs the full extension tests.

    line 74
  11. Very specific:

    Do not hand-edit generated dist/out files or bundles.

    line 77
  12. Distinctive:

    If no concrete defect is established, say so without inventing findings.

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Azure Resources extension guidance

This repository implements Azure Resources, not just resource-group CRUD. It hosts shared resource trees, account/subscription selection, APIs consumed by other Azure extensions, Cloud Shell, and Create New Project with Copilot (Copilot on Rails).

Use AGENTS.md to locate owners and entry points. Read the matching .github/instructions/*.instructions.md before changing a subsystem. The existing Copilot on Rails documentation and artifact-security instructions remain applicable alongside the newer guides.

Implementation and bug fixes

  • Trace the affected contribution in package.json through registration in src/extension.ts or src/commands/registerCommands.ts to its handler, provider, and refresh/output path. Check callers in api/src and compatibility adapters before changing shared behavior.
  • Make the smallest complete fix at the responsible layer. Preserve unrelated work and avoid opportunistic cleanup, new frameworks, and speculative abstractions. Reuse an existing helper before introducing another implementation.
  • Establish the concrete trigger and expected behavior before editing. Add a focused regression covering the failing case and a nearby preserved behavior; test through the public boundary when the bug is in registration, selection, wrapping, or compatibility.
  • Keep command IDs, menu/context expressions, settings, view IDs, and activation events in sync with handlers. A context menu working is not enough if the same command can run from the command palette with no selected node.
  • Use Azure Tools action contexts, registerCommand, callWithTelemetryAndErrorHandling, AzureWizard, subscription-selection helpers, and activity helpers where that flow already uses them. Preserve cancellation and error propagation; do not convert failures into successful empty results or add duplicate notifications.
  • Azure Resources owns the shared Azure authentication/subscription integration for consuming extensions: its provider delegates to @microsoft/vscode-azext-azureauth, which uses vscode.authentication and VS Code's built-in Microsoft Authentication provider. Preserve account, tenant, cloud, scope, and silent-versus-interactive session behavior; follow the authentication flow rather than substituting Azure CLI login or a new credential chain.
  • Keep TypeScript strict. Narrow untrusted values and optional API fields rather than adding any, unchecked casts, non-null assertions, or compiler/linter exemptions to hide a problem.
  • Follow the surrounding localization mechanism: src/utils/localize.ts for existing vscode-nls callers, vscode.l10n.t where already used, and package.nls.json for manifest strings.
  • Preserve Windows, macOS, Linux, remote-workspace, and supported VS Code web/Cloud Shell paths. Use vscode.Uri and workspace.fs for workspace resources where appropriate; do not turn a URI into a local path without establishing that it is a local file. Keep platform-specific process, shell, and IPC handling at existing boundaries.
  • Treat credentials, access tokens, connection strings, user project contents, and sensitive resource data as private. Do not put them in telemetry, diagnostic exports, output, or errors. Use existing masking/context helpers and record safe metadata rather than raw payloads.
  • Own and dispose new event listeners, watchers, providers, and output channels. Avoid adding blocking network work to activation; preserve intentional lazy imports and provider activation.

Commands and validation

Run commands from the repository root unless a different directory is stated. .nvmrc selects Node 22.18; api and evals have separate manifests and lockfiles.

PurposeExisting command / behavior
Bundle and extension type-checknpm run build runs build:esbuild then build:check
Extension type-check onlynpm run build:check uses tsgo --noEmit
Lint and agent driftnpm run lint runs ESLint with zero warnings, then eval:drift
Extension testsnpm test invokes vscode-test; .vscode-test.mjs delegates to the Azure Tools engineering configuration
Package extensionnpm run package invokes vsce package --githubBranch main
Generate API declarationsnpm run api-extractor delegates to the api package
Agent asset contractsnpm run eval:drift
  • Build before running extension tests. Prefer the smallest relevant test selection supported by the installed VS Code test runner; do not assume these tests run under standalone Mocha or Node. test/global.test.ts initializes the extension and TestUserInput.
  • Reuse test/api/mockServiceFactory.ts, MockAzureSubscriptionProvider, and the test API accessed through test/utils/testApiAccess.ts. Restore changed settings, environment variables, and overrides. Do not turn ordinary regression tests into live Azure calls.
  • Live tests under test/nightly are gated by the setup in test/global.test.ts; they can require credentials and create resources. Do not enable them implicitly.
  • The root TypeScript project excludes evals and the Copilot on Rails React views. A passing build:check does not prove either is type-correct; use their scoped validation guidance.
  • Run checks relevant to the change, not npm run all by default: that script also installs, packages, and runs the full extension tests. For prose-only edits, inspect links, paths, command names, instruction scopes, and the diff; no extension build is needed.
  • Do not hand-edit generated dist/out files or bundles. Edit source and use the owning generator. API documentation snapshots and the agent asset lock have explicit update procedures in their scoped guides; dependency-lock changes should accompany intentional dependency changes.

Pull request review

  • Report actionable defects introduced by the change, not style preferences or hypothetical improvements. Trace each finding to a real caller, supported configuration, or reproducible input.
  • For each finding, give severity (P0 critical, P1 high, P2 normal, P3 low), the smallest useful changed file/line range, the triggering condition, observable impact, and the smallest viable correction. Explain why existing guards or tests do not prevent it.
  • Prioritize wrong-account/subscription operations, API/client compatibility breaks, missing destructive-action confirmation, credential disclosure, stale or misidentified tree nodes, broken reload/resume behavior, and untrusted artifact-to-command/HTML/path flows.
  • Distinguish a confirmed bug from uncertainty. Do not claim tests ran when only source was read. If no concrete defect is established, say so without inventing findings.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.