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
- Very specific: line 26
Do not add Durable Task package references directly to DurableSDK.
- Very specific: line 27
Keep the default/custom ALC boundary limited to SDK-owned types and framework types whose identity is shared with the worker, such as …
- Distinctive: line 28
Do not return, cast, store in framework collections, or deserialize custom-ALC Durable Task objects in default-ALC code.
- Very specific: line 30
Treat Newtonsoft.Json carefully at the boundary.
- Very specific: line 31
If a new dependency is needed by orchestration internals, add it to DurableEngine and confirm build.ps1 places it under Dependencies/.
- Distinctive: line 32
Do not broaden the default ALC resolver to load all dependencies unless the isolation design is intentionally being replaced and fully …
- Very specific: line 38
Use dotnet build .\src\DurableSDK.sln --configuration Release for a fast compile check.
- Very specific: line 39
Use .\build.ps1 -Configuration Release to validate the actual module layout.
- Very specific: line 40
Run focused xUnit tests with dotnet test …
- Very specific: line 41
Run .\test\E2E\Start-E2ETest.ps1 -NoBuild after packaging for changes affecting orchestration, module loading, dependency resolution, or …
- Distinctive: line 43
Keep changes compatible with both legacy Durable extension payloads and current type-preserving payloads unless a deliberate breaking …
≈ “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.
Files
Copilot instructions
Repository structure
src/DurableSDK/buildsAzureFunctions.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/buildsDurableEngine.dll, which contains orchestration replay, Durable Task integration, models, and other implementation that depends on Durable Task assemblies.src/AzureFunctions.PowerShell.Durable.SDK.psm1contains the script-based public commands.src/AzureFunctions.PowerShell.Durable.SDK.psd1is 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.ps1publishes the module into itsModules/directory.build.ps1is the authoritative packaging path. It publishes both C# projects, placesDurableEngine.dlland its dependencies underDependencies/, 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:
AzureFunctions.PowerShell.Durable.SDK.dllloads in the default ALC as a nested PowerShell module.- Its
ModuleInitializerregisters a default-ALC resolver forDurableEngineonly. DurableEngine.dllloads inDependencyAssemblyLoadContext.- That custom ALC resolves assemblies from the packaged
Dependencies/directory, includingDurableTask.Coreand the Microsoft Durable Task worker/client libraries.
Preserve these contracts:
- Code that directly references Durable Task implementation types, including
DurableTask.Core.*, belongs inDurableEngine, notDurableSDK. - 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.*andSystem.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
$typemetadata 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
DurableEngineand confirmbuild.ps1places it underDependencies/. - 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 Releasefor a fast compile check. - Use
.\build.ps1 -Configuration Releaseto 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 -NoBuildafter 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.
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
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.

