agentleFS
Microsoft AzureKnown publisherAzure/azure-policy-linter/.github/copilot-instructions.md

azure-policy-linter

Copilot instructions25 starsChanged 5 months agoMITView on GitHub

This repo is the Azure Policy Linter - a tool that inspects policy definitions for quality issues. Start here: - README.md - what the linter is, install, CLI usage. - CONTRIBUTING.md - how to engage with the project (issues, feedback, code of conduct). For deeper divers: - docs/linter-rule-design.md - what a good linter rule should be (scope, severity, naming, description). Read first when working on any rule. - docs/linter-architecture.md - engineer-facing reference for the linter's code. For rule work, use…

The file

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

9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before submitting a PR, run tests and verify diff coverage on your changes:

    line 25
  2. Very specific:

    Never use emojis. Use plain ASCII punctuation in files: a hyphen (-) instead of en/em dashes, -> instead of arrow characters, and straight …

    line 37
  3. Distinctive:

    When writing documentation, ask who the audience is.

    line 38
  4. Distinctive:

    Don't simply agree. If a request doesn't make sense, push back.

    line 41
  5. Distinctive:

    Ask for clarification before making non-trivial changes.

    line 42
  6. Distinctive:

    If you're unsure about a pattern or convention, find more examples before writing.

    line 46
  7. Distinctive:

    No trailing whitespace, including on blank lines.

    line 53
  8. Distinctive:

    When calling a method, explicitly specify the argument names.

    line 60
  9. Distinctive:

    Prefer arrays over lists for return values and intermediate LINQ results.

    line 67

≈ “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

GitHub Copilot Instructions for Policy Linter

Project Overview

This repo is the Azure Policy Linter - a tool that inspects policy definitions for quality issues.

Start here:

  • README.md - what the linter is, install, CLI usage.
  • CONTRIBUTING.md - how to engage with the project (issues, feedback, code of conduct).

For deeper divers:

  • docs/linter-rule-design.md - what a good linter rule should be (scope, severity, naming, description). Read first when working on any rule.
  • docs/linter-architecture.md - engineer-facing reference for the linter's code.

For rule work, use the skills under .github/skills/:

  • triage-linter-rule - interactive: turn a fuzzy idea into a concrete spec.
  • implement-linter-rule - interactive: implement a rule from a spec.
  • review-linter-rule - interactive: review a proposed rule against the design conventions.
  • sanity-check-linter - run the CLI against a temporary policy to confirm a change behaves as expected.

Working in this repo

Testing and coverage

Before submitting a PR, run tests and verify diff coverage on your changes:

dotnet test src/Tests/PolicyLinter.Tests.csproj --collect:"XPlat Code Coverage" --results-directory ./TestResults
diff-cover TestResults/**/coverage.cobertura.xml --compare-branch origin/main

Diff coverage must be at least 90% (aim for 100%). If diff-cover reports uncovered lines in your changes, add tests before submitting.

Communication

  • Be concise and matter-of-fact. State what you know, don't editorialize.
  • Separate fact from inference. When inferring, guessing, recalling from training, or offering an opinion, mark it explicitly ("I think", "in my opinion").
  • Never use emojis. Use plain ASCII punctuation in files: a hyphen (-) instead of en/em dashes, -> instead of arrow characters, and straight quotes instead of curly quotes.
  • When writing documentation, ask who the audience is. For docs aimed at engineers in this repo: concise, accurate, no padding.

Engagement

  • Don't simply agree. If a request doesn't make sense, push back.
  • Ask for clarification before making non-trivial changes.

Fit the codebase

  • Consistency with the existing codebase matters more than your personal preferences. Changes should feel like they belong.
  • If you're unsure about a pattern or convention, find more examples before writing.
  • Reinventing helpers or utilities that already exist is a common review finding. When the work spans multiple modules, scan for prior art first.

Basic C# code style hints

Layout

  • using statements go inside the namespace block.
  • No trailing whitespace, including on blank lines.

Documentation and comments

  • Public methods, properties, and classes need XML documentation.
  • Comment why, not what. Add comments only when context is needed or when the code isn't trivial to follow.

Naming and member access

  • When calling a method, explicitly specify the argument names.
  • Non-static method calls: this.MethodName().
  • Static method calls: ClassName.MethodName().
  • Static field or property access: ClassName.MemberName.

LINQ

  • End .Select(...) chains with .ToArray().
  • Prefer arrays over lists for return values and intermediate LINQ results. Use lists only when the size is genuinely unknown or the collection is expected to grow.

Chained method calls

Break long fluent chains across lines. For small arg counts, one method per line:

this
    .Method1(argName: argValue)
    .Method2(argName: argValue)
    .ConfigureAwait(false);

For methods with many args, break each arg onto its own line:

this
    .Method1(
        argName: argValue,
        ...)
    .Method2(
        argName: argValue,
        ...)
    .ConfigureAwait(false);

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.