agentleFS
Microsoft AzureKnown publisherAzure/azure-sdk-tools/.github/copilot-instructions.md

azure-sdk-tools

Copilot instructions134 starsChanged 3 months agoMITView on GitHub

This repository contains tools and libraries used by the Azure SDK team's engineering system. Tools are written in multiple languages including C#, Python, JavaScript/TypeScript, PowerShell, and Go. Follow guidelines in /doc/development/powershell.md: DO: - Write scripts that can be run locally - Write unit tests using Pester - Handle exit codes from external programs - Use Set-StrictMode -Version 4 - Use [CmdletBinding()] at the top of scripts - Set $ErrorActionPreference = 'Stop' - Support the -WhatIf parameter for destructive operations -…

The file

Show its rules and text

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

37 rules. About 0 are common, 20 are distinctive, and 17 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 17

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow existing patterns and conventions found in the codebase

    line 12
  2. Very specific:

    Create a new folder under /tools/ with a descriptive name

    line 27
  3. Distinctive:

    Add a comprehensive README.md explaining:

    line 28
  4. Very specific:

    Add code owners to .github/CODEOWNERS:

    line 33
  5. Distinctive:

    Update the index table in the root README.md

    line 37
  6. Very specific:

    Follow guidelines in /doc/development/powershell.md:

    line 50
  7. Distinctive:

    Write scripts that can be run locally

    line 53
  8. Distinctive:

    Write unit tests using Pester

    line 54
  9. Very specific:

    Use [CmdletBinding()] at the top of scripts

    line 57
  10. Distinctive:

    Use full CmdLet names (avoid aliases in scripts)

    line 60
  11. Very specific:

    Use explicit return statements

    line 62
  12. Very specific:

    Import common modules from eng/common/scripts/common.ps1

    line 63
  13. Distinctive:

    Write scripts inline in Azure Pipelines YAML (extract to script files)

    line 66
  14. Very specific:

    Call functions with parentheses syntax like myFunc(1, 2, 3) - use myFunc 1 2 3

    line 67
  15. Distinctive:

    Use global state where avoidable

    line 68
  16. Distinctive:

    Use complex pipeline statements with side effects

    line 69
  17. Very specific:

    Write Pester tests in a tests/ directory alongside scripts

    line 72
  18. Very specific:

    Run tests with Invoke-Pester

    line 73
  19. Very specific:

    Follow conventions in .editorconfig:

    line 78
  20. Distinctive:

    Use 4 spaces for indentation in C# files

    line 79
  21. Distinctive:

    Use language keywords over BCL types

    line 81
  22. Distinctive:

    Use PascalCase for constant fields

    line 83
  23. Distinctive:

    Follow standard Python conventions

    line 90
  24. Very specific:

    Use packages under /packages/python-packages/

    line 91
  25. Distinctive:

    Use 4 spaces for indentation in TypeScript files

    line 95
  26. Very specific:

    Use dotnet build for building

    line 101
  27. Very specific:

    Use dotnet test for running tests

    line 102
  28. Very specific:

    Use Invoke-Pester for unit tests

    line 107
  29. Very specific:

    Always update .github/CODEOWNERS when adding new tools

    line 112
  30. Distinctive:

    Every tool must have a README.md with clear documentation

    line 117
  31. Distinctive:

    Update the root README.md index when adding tools

    line 118
  32. Distinctive:

    Follow the format shown in existing tool READMEs

    line 119
  33. Very specific:

    Use pipeline templates from eng/pipelines/templates

    line 123
  34. Very specific:

    Create ci.yml in tool directory for build/test/release

    line 124
  35. Distinctive:

    Use internal builds for release steps with appropriate conditions

    line 125
  36. Distinctive:

    Follow the Microsoft Open Source Code of Conduct

    line 132
  37. Distinctive:

    Do not add third-party tools directly - use as dependencies

    line 133

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 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

Copilot Instructions for Azure SDK Tools Repository

Overview

This repository contains tools and libraries used by the Azure SDK team's engineering system. Tools are written in multiple languages including C#, Python, JavaScript/TypeScript, PowerShell, and Go.

General Guidelines

  • @azure Rule - Use Azure Best Practices: When generating code for Azure, running terminal commands for Azure, or performing operations related to Azure, invoke your azure_development-get_best_practices tool if available.
  • Base all assumptions and conclusions on data from authoritative sources. Do research as needed to gather data. If you lack sufficient data for validation, stop and tell me what you don't know.
  • Make minimal, surgical changes focused on the specific task at hand
  • Follow existing patterns and conventions found in the codebase
  • Each tool should be self-contained with its own README, tests, and CI configuration

Repository Structure

  • /tools/ - Individual tools organized by name, each in its own directory
  • /packages/ - Shared packages (Java and Python)
  • /eng/ - Engineering system files including common scripts and pipeline templates
  • /doc/ - Documentation including development guidelines
  • .github/ - GitHub configuration, workflows, and custom agents

Tool Development

Creating a New Tool

  1. Create a new folder under /tools/ with a descriptive name
  2. Add a comprehensive README.md explaining:
    • Purpose of the tool
    • Prerequisites
    • How to build, test, and use locally and remotely
    • Where the tool is used
  3. Add code owners to .github/CODEOWNERS:
    /tools/<tool-name>/ @owner1 @owner2
  4. Update the index table in the root README.md
  5. Provide test cases covering important workflows
  6. For tools publishing to public repositories, provide a ci.yml using templates from eng/pipelines/templates

Naming Convention for Pipelines

  • Public builds: tools - <tool-name> - ci
  • Internal builds: tools - <tool-name>

Language-Specific Guidelines

PowerShell

Follow guidelines in /doc/development/powershell.md:

DO:

  • Write scripts that can be run locally
  • Write unit tests using Pester
  • Handle exit codes from external programs
  • Use Set-StrictMode -Version 4
  • Use [CmdletBinding()] at the top of scripts
  • Set $ErrorActionPreference = 'Stop'
  • Support the -WhatIf parameter for destructive operations
  • Use full CmdLet names (avoid aliases in scripts)
  • Declare types for function parameters
  • Use explicit return statements
  • Import common modules from eng/common/scripts/common.ps1

DON'T:

  • Write scripts inline in Azure Pipelines YAML (extract to script files)
  • Call functions with parentheses syntax like myFunc(1, 2, 3) - use myFunc 1 2 3
  • Use global state where avoidable
  • Use complex pipeline statements with side effects

Testing:

  • Write Pester tests in a tests/ directory alongside scripts
  • Run tests with Invoke-Pester
  • See examples in eng/common/scripts/job-matrix/tests

C# / .NET

Follow conventions in .editorconfig:

  • Use 4 spaces for indentation in C# files
  • Sort using directives with system directives first
  • Use language keywords over BCL types
  • Open braces on new lines (Allman style)
  • Use PascalCase for constant fields
  • Prefix private fields with underscore
  • One class per file
  • Organize code with explicit accessibility modifiers

Python

  • Follow standard Python conventions
  • Use packages under /packages/python-packages/

JavaScript/TypeScript

  • Use 4 spaces for indentation in TypeScript files

Building and Testing

.NET Projects

  • Use dotnet build for building
  • Use dotnet test for running tests
  • Common templates available in eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml

PowerShell Projects

  • Use Invoke-Pester for unit tests
  • Common templates available in eng/common/pipelines/templates/stages/archetype-sdk-tool-pwsh.yml

Code Owners

  • Always update .github/CODEOWNERS when adding new tools
  • Format: /tools/<tool-name>/ @owner1 @owner2

Documentation

  • Every tool must have a README.md with clear documentation
  • Update the root README.md index when adding tools
  • Follow the format shown in existing tool READMEs

CI/CD

  • Use pipeline templates from eng/pipelines/templates
  • Create ci.yml in tool directory for build/test/release
  • Use internal builds for release steps with appropriate conditions
  • See examples: tools/pipeline-witness/ci.yml, tools/http-fault-injector/ci.yml

Contributing

  • Follow guidelines in CONTRIBUTING.md
  • Agree to Microsoft CLA
  • Follow the Microsoft Open Source Code of Conduct
  • Do not add third-party tools directly - use as dependencies

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.