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

iotedge

Copilot instructions1.5k starsChanged 7 months agoMITView on GitHub

Azure IoT Edge is a dual-language (C# and Rust) system with three main components: Shared C# utilities live in edge-util/ (Option type, Preconditions, storage abstractions, RocksDB bindings). Solution: Microsoft.Azure.Devices.Edge.sln Test framework: xUnit with Moq. Tests use trait-based categories: [Unit], [Integration], [Bvt]. Workspace root: edgelet/Cargo.toml The api-proxy-module is a separate Rust project at edge-modules/api-proxy-module/. CI enforces both rustfmt and clippy. Run before submitting: StyleCop.Analyzers runs on Release/CheckInBuild configurations. Warnings are treated as errors (TreatWarningsAsErrors=True). CI uses Azure Pipelines (not GitHub Actions).…

Trending

Quiet since July.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the Azure/iotedge repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about Azure/iotedge

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

See all 15

Talked about on GitHub and Hacker News (15 times).

On GitHub · 11

6 more on GitHub

The file

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

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Test framework: xUnit with Moq.

    line 35
  2. Very specific:

    Async naming: All async methods must end with Async suffix (enforced by .editorconfig)

    line 87

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

Repository Overview

Azure IoT Edge is a dual-language (C# and Rust) system with three main components:

  • Edge Agent (edge-agent/) — C# service that manages module lifecycle, deployments, and desired-state reconciliation via IoT Hub twin
  • Edge Hub (edge-hub/) — C# service acting as a local gateway for MQTT, AMQP, and HTTP protocols with message routing between modules and the cloud
  • IoT Edge Security Daemon (edgelet/) — Rust daemon (aziot-edged) providing workload and management APIs, module provisioning, and integration with the Azure IoT Identity Service
  • Edge Modules (edge-modules/) — Standalone modules including api-proxy-module (Rust), metrics-collector (C#), and SimulatedTemperatureSensor (C#)
  • MQTT library (mqtt/) — Rust MQTT3 client library and edgelet-client used by api-proxy-module

Shared C# utilities live in edge-util/ (Option type, Preconditions, storage abstractions, RocksDB bindings).

Build and Test

C# (.NET 8.0)

Solution: Microsoft.Azure.Devices.Edge.sln

# Build everything (Linux)
scripts/linux/buildBranch.sh -c Release --no-rocksdb-bin --skip-quickstart

# Run all unit tests
dotnet test --configuration Release --filter 'Category=Unit' --logger trx

# Run a single test by fully qualified name
dotnet test --filter "FullyQualifiedName~MyNamespace.MyClass.MyMethod" --logger trx --no-build

# Run integration tests (requires Azure KeyVault cert; see doc/devguide.md)
scripts/linux/runTests.sh "Category=Integration" "Release"

Test framework: xUnit with Moq. Tests use trait-based categories: [Unit], [Integration], [Bvt].

Rust (toolchain 1.73)

Workspace root: edgelet/Cargo.toml

# Build the daemon and CLI
cd edgelet && cargo build -p aziot-edged -p iotedge

# Run all Rust tests
cd edgelet && cargo test --all

# Run tests for a single crate
cd edgelet && cargo test -p edgelet-core

# Run a single test by name
cd edgelet && cargo test -p edgelet-core -- test_name

The api-proxy-module is a separate Rust project at edge-modules/api-proxy-module/.

Rust Linting

CI enforces both rustfmt and clippy. Run before submitting:

cd edgelet && cargo fmt --all -- --check
cd edgelet && cargo clippy --all && cargo clippy --all --tests

C# Linting

StyleCop.Analyzers runs on Release/CheckInBuild configurations. Warnings are treated as errors (TreatWarningsAsErrors=True).

CI Pipelines

CI uses Azure Pipelines (not GitHub Actions). Separate pipelines run based on which files changed:

PipelineTrigger conditionWhat it checks
builds/checkin/dotnet.yamlChanges outside edgelet/, doc/, mqtt/C# unit tests, 58% code coverage
builds/checkin/edgelet.yamlChanges in edgelet/ or builds/Rust build + test (amd64, arm32, arm64), rustfmt, clippy, 30% coverage
builds/checkin/api-proxy.yamlChanges in edge-modules/api-proxy-module/ or mqtt/edgelet-client/API proxy Rust build + test

Architecture Patterns

C# Conventions

  • Dependency Injection: Autofac with module registration pattern. DI modules live in */Service/modules/ directories (e.g., EdgeletModule.cs, RoutingModule.cs)
  • Custom Option<T> type: Defined in edge-util/src/Microsoft.Azure.Devices.Edge.Util/Option.cs. Used pervasively instead of nullable references. Supports ForEachAsync, Map, OrDefault, Exists — treat it like a Rust/Scala Option
  • Preconditions class: Guard methods (CheckNotNull, CheckRange, etc.) in edge-util/. All constructor parameters are validated with Preconditions.CheckNotNull(param, nameof(param))
  • Async naming: All async methods must end with Async suffix (enforced by .editorconfig)
  • this. qualifier: Required for all field, property, method, and event references
  • Event-based logging: Domain events (e.g., Events.AgentCreated()) rather than direct logger calls in core logic. Uses Serilog via Microsoft.Extensions.Logging
  • Exception filtering: catch (Exception ex) when (!ex.IsFatal()) pattern for non-fatal error handling

Rust Conventions

  • Lint attributes on every crate: #![deny(rust_2018_idioms, warnings)] and #![deny(clippy::all, clippy::pedantic)] with specific #![allow(...)] exceptions
  • Async runtime: Tokio
  • Error handling: Mix of anyhow (in modules like api-proxy) and custom error types
  • API definitions: OpenAPI/Swagger YAML specs in edgelet/api/ — some Rust code is generated from these via a modified swagger-codegen
  • Cargo registry: Uses a private Azure DevOps Cargo feed (iotedge_PublicPackages) as a mirror of crates.io, configured in edgelet/.cargo/config.toml

Docker

Both Edge Agent and Edge Hub use mcr.microsoft.com/dotnet/aspnet:8.0-alpine as base image. They bundle librocksdb.so and support multi-platform builds (amd64, arm32v7, arm64v8). Edge Hub exposes ports 1883, 8883 (MQTT), 5671 (AMQP), and 443 (HTTPS).

Key Files

  • netcoreappVersion.props — Sets .NET target framework and enables package lock files for all C# projects
  • rust-toolchain.toml — Pins the Rust toolchain version
  • edgelet/.cargo/config.toml — Cargo registry configuration (private feed mirror)
  • versionInfo.json — Product version (build system replaces BUILDNUMBER and COMMITID placeholders)
  • doc/devguide.md — C# development guide
  • edgelet/doc/devguide.md — Rust development guide (includes local daemon setup instructions)

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.