agentleFS
Microsoft AzureKnown publisherAzure/azure-functions-durable-powershell/.github/copilot-instructions.md

azure-functions-durable-powershell

Copilot instructions9 starsChanged 3 months agoMITView on GitHub

The module intentionally separates its assemblies to avoid conflicts with assemblies already loaded by the PowerShell worker: Preserve these contracts: Unit tests that reference the projects directly run in a single test-process loading environment and do not prove packaged-module ALC correctness. Any change involving project references, assembly placement, JSON type metadata, or Durable Task types must also be tested through the packaged module and a real Functions host.

  • 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.

The file

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

11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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
  1. Very specific:

    Do not add Durable Task package references directly to DurableSDK.

    line 26
  2. Very specific:

    Keep the default/custom ALC boundary limited to SDK-owned types and framework types whose identity is shared with the worker, such as …

    line 27
  3. Distinctive:

    Do not return, cast, store in framework collections, or deserialize custom-ALC Durable Task objects in default-ALC code.

    line 28
  4. Very specific:

    Treat Newtonsoft.Json carefully at the boundary.

    line 30
  5. Very specific:

    If a new dependency is needed by orchestration internals, add it to DurableEngine and confirm build.ps1 places it under Dependencies/.

    line 31
  6. Distinctive:

    Do not broaden the default ALC resolver to load all dependencies unless the isolation design is intentionally being replaced and fully …

    line 32
  7. Very specific:

    Use dotnet build .\src\DurableSDK.sln --configuration Release for a fast compile check.

    line 38
  8. Very specific:

    Use .\build.ps1 -Configuration Release to validate the actual module layout.

    line 39
  9. Very specific:

    Run focused xUnit tests with dotnet test …

    line 40
  10. Very specific:

    Run .\test\E2E\Start-E2ETest.ps1 -NoBuild after packaging for changes affecting orchestration, module loading, dependency resolution, or …

    line 41
  11. Distinctive:

    Keep changes compatible with both legacy Durable extension payloads and current type-preserving payloads unless a deliberate breaking …

    line 43

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

Copilot instructions

Repository structure

  • src/DurableSDK/ builds AzureFunctions.PowerShell.Durable.SDK.dll, the binary PowerShell module loaded into the worker's default assembly load context (ALC). It contains exported cmdlets, module initialization, and the ALC bootstrap.
  • src/DurableEngine/ builds DurableEngine.dll, which contains orchestration replay, Durable Task integration, models, and other implementation that depends on Durable Task assemblies.
  • src/AzureFunctions.PowerShell.Durable.SDK.psm1 contains the script-based public commands.
  • src/AzureFunctions.PowerShell.Durable.SDK.psd1 is the module manifest and defines the exported commands, aliases, and minimum PowerShell version.
  • src/Help/ contains the source Markdown for generated external help.
  • test/E2E/AzureFunctions.PowerShell.Durable.SDK.E2E/ contains the xUnit test project. Most tests launch a real Functions host against the packaged module.
  • test/E2E/durableApp/ is the PowerShell Functions app used by E2E tests. build.ps1 publishes the module into its Modules/ directory.
  • build.ps1 is the authoritative packaging path. It publishes both C# projects, places DurableEngine.dll and its dependencies under Dependencies/, copies the top-level SDK assembly and module files, and generates external help.

Assembly load context and dependency isolation

The module intentionally separates its assemblies to avoid conflicts with assemblies already loaded by the PowerShell worker:

  1. AzureFunctions.PowerShell.Durable.SDK.dll loads in the default ALC as a nested PowerShell module.
  2. Its ModuleInitializer registers a default-ALC resolver for DurableEngine only.
  3. DurableEngine.dll loads in DependencyAssemblyLoadContext.
  4. That custom ALC resolves assemblies from the packaged Dependencies/ directory, including DurableTask.Core and the Microsoft Durable Task worker/client libraries.

Preserve these contracts:

  • Code that directly references Durable Task implementation types, including DurableTask.Core.*, belongs in DurableEngine, not DurableSDK.
  • Do not add Durable Task package references directly to DurableSDK.
  • Keep the default/custom ALC boundary limited to SDK-owned types and framework types whose identity is shared with the worker, such as System.* and System.Management.Automation.
  • Do not return, cast, store in framework collections, or deserialize custom-ALC Durable Task objects in default-ALC code. Type names can match while runtime type identity differs, causing missing-assembly, invalid-cast, or array-type-mismatch failures.
  • Perform creation, serialization, deserialization, and collection construction involving Durable Task types entirely inside DurableEngine. Expose an SDK-owned operation or result across the boundary instead of exposing Durable Task objects.
  • Treat Newtonsoft.Json carefully at the boundary. Type-preserving payloads can contain $type metadata for Durable Task classes; ensure those types are resolved and materialized in the same ALC as their destination model and collections.
  • If a new dependency is needed by orchestration internals, add it to DurableEngine and confirm build.ps1 places it under Dependencies/.
  • Do not broaden the default ALC resolver to load all dependencies unless the isolation design is intentionally being replaced and fully tested.

Unit tests that reference the projects directly run in a single test-process loading environment and do not prove packaged-module ALC correctness. Any change involving project references, assembly placement, JSON type metadata, or Durable Task types must also be tested through the packaged module and a real Functions host.

Build and test

  • Use dotnet build .\src\DurableSDK.sln --configuration Release for a fast compile check.
  • Use .\build.ps1 -Configuration Release to validate the actual module layout.
  • Run focused xUnit tests with dotnet test .\test\E2E\AzureFunctions.PowerShell.Durable.SDK.E2E\AzureFunctions.PowerShell.Durable.SDK.E2E.csproj --filter <filter>.
  • Run .\test\E2E\Start-E2ETest.ps1 -NoBuild after packaging for changes affecting orchestration, module loading, dependency resolution, or worker/extension payloads. Ensure Azurite is available and running.

Keep changes compatible with both legacy Durable extension payloads and current type-preserving payloads unless a deliberate breaking change is approved.

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.