agentleFS
Microsoft AzureKnown publisherAzure/bicep/.github/copilot-instructions.md

bicep

Copilot instructions3.6k starsChanged 2 months agoMITView on GitHub

Bicep is a DSL for Azure ARM templates. The compiler pipeline is: Lexer → Parser → Binder → Type Checking / Linting → Emitter (ARM JSON). Key classes: Compilation → SemanticModel → TypeManager, Binder, TemplateEmitter. All use lazy evaluation and caching—the language server recreates state per keystroke, so only compute what's requested. .NET SDK version is pinned in global.json (currently .NET 10). Use VS Code tasks (defined in .vscode/tasks.json) for common operations. Integration test datasets live in src/Bicep.Core.Samples/Files/baselines/. Each dataset…

Trending

Quiet since March.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the Azure/bicep repository that our weekly crawl found: only 8 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about Azure/bicep

The biggest 5 of 8 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 8

Talked about on GitHub, Hacker News and Bluesky (8 times).

On GitHub · 6

1 more on GitHub

On Bluesky · 1

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Prefer collection expressions ([a, b]) over .ToList() / new List<T>{}

    line 25
  2. Very specific:

    DI in tests: Use ServiceBuilder for composable test setup: new ServiceBuilder().WithRegistration(...).Build()

    line 51
  3. Very specific:

    Update baselines: run VS Code task "Update Baselines" or dotnet test -- --filter TestCategory=Baseline --test-parameter SetBaseLine=true

    line 59
  4. Distinctive:

    Always inspect baseline diffs: before committing—unexplained changes block PRs

    line 60

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

Bicep Project Guidelines

Architecture

Bicep is a DSL for Azure ARM templates. The compiler pipeline is: Lexer → Parser → Binder → Type Checking / Linting → Emitter (ARM JSON).

ProjectRole
Bicep.CoreCompiler library (parser, binder, type system, emitter, linter)
Bicep.CliCLI (bicep build, bicep decompile, etc.)
Bicep.LangServerOmniSharp-based LSP server
Bicep.McpServerModel Context Protocol server for AI tooling
Bicep.DecompilerARM JSON → Bicep decompilation
vscode-bicepVS Code extension (TypeScript)

Key classes: Compilation → SemanticModel → TypeManager, Binder, TemplateEmitter. All use lazy evaluation and caching—the language server recreates state per keystroke, so only compute what's requested.

Code Style

  • C#: 4-space indent, braces always required, nullable enabled, TreatWarningsAsErrors=true
  • File header required: // Copyright (c) Microsoft Corporation. + // Licensed under the MIT License.
  • Null-forgiving ! operator is banned in product code (allowed in tests)
  • Console.Write/Console.WriteLine are banned—use proper logging
  • Syntax trees and data structures are immutable by default
  • Prefer collection expressions ([a, b]) over .ToList() / new List<T>{}
  • Line endings: LF (configured in .editorconfig)
  • TypeScript/JSON: 2-space indent

Build and Test

# Build
dotnet build Bicep.slnx

# Run all tests
dotnet test

# Build VS Code extension (requires Node.js 22+)
cd src/vscode-bicep && npm ci && npm run build

# Build vscode-bicep-ui
cd src/vscode-bicep-ui && npm ci && npm run build

.NET SDK version is pinned in global.json (currently .NET 10). Use VS Code tasks (defined in .vscode/tasks.json) for common operations.

Test Conventions

  • Framework: MSTest ([TestClass], [TestMethod]), FluentAssertions for assertions, Moq for mocking
  • Naming: Bicep.Foo.UnitTests, Bicep.Foo.IntegrationTests, Bicep.Foo.E2eTests
  • DI in tests: Use ServiceBuilder for composable test setup: new ServiceBuilder().WithRegistration(...).Build()
  • Vitest for VS Code extension tests
  • Vitest for vscode-bicep-ui tests

Baseline Tests (Critical Pattern)

Integration test datasets live in src/Bicep.Core.Samples/Files/baselines/. Each dataset has main.bicep plus assertion files (.diagnostics, .formatted, .symbols, .syntax, .tokens, .ir, main.json, etc.).

  • Update baselines: run VS Code task "Update Baselines" or dotnet test -- --filter TestCategory=Baseline --test-parameter SetBaseLine=true
  • Always inspect baseline diffs before committing—unexplained changes block PRs
  • Folders prefixed with Invalid expect compilation failure

Key Patterns

Diagnostics

Diagnostics are defined centrally in DiagnosticBuilder.DiagnosticBuilderInternal. Pattern:

DiagnosticBuilder.ForPosition(span).SomeError(args)

Visitor Pattern

Layered hierarchy: SyntaxVisitor → CstVisitor (tokens/trivia) → AstVisitor (semantic nodes) → SyntaxRewriteVisitor (immutable transforms). Extend AstVisitor for most analysis tasks.

Linter Rules

Extend LinterRuleBase in Bicep.Core/Analyzers/Linter/Rules/. Rules are configurable via bicepconfig.json.

Dependency Injection

Core services registered via AddBicepCore() extension method. MCP server uses AddBicepMcpServer(). MCP tools use [McpServerToolType]/[McpServerTool] attributes.

Project Conventions

  • Link issues in PRs (Fixes #NNN)
  • Design proposals required for significant changes
  • Snippet templates live in src/Bicep.LangServer/Files/SnippetTemplates/
  • Central package management enabled (src/Directory.Packages.props)—add package versions there, not in individual .csproj files

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.