agentleFS
Sorcha-PlatformSorcha-Platform/Sorcha/.github/copilot-instructions.md

Sorcha

Copilot instructions2 starsChanged 10 months agoMITView on GitHub

Purpose: Give AI coding agents the minimal, actionable knowledge to be productive in this repo.

The file

Show its rules and text

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

14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Run locally (recommended): use Aspire AppHost to start all services and Redis integration.

    line 6
  2. Distinctive:

    If running services individually: prefer the AppHost for correctness, but individual services can be started with:

    line 12
  3. Very specific:

    Use the Sorcha.ServiceDefaults extension methods.

    line 20
  4. Very specific:

    Use SchemaLibraryService and ISchemaRepository for schema lookups.

    line 42
  5. Very specific:

    Keep cross-cutting changes confined to Sorcha.ServiceDefaults when possible.

    line 50
  6. Distinctive:

    Prefer extension methods and DI registration over scattering configuration across projects.

    line 51
  7. Very specific:

    Add health checks to new services at /health and /alive for Aspire to aggregate.

    line 52
  8. Distinctive:

    When adding HTTP endpoints follow minimal APIs style and register OpenAPI metadata.

    line 53
  9. Very specific:

    Use xUnit, Moq, and FluentAssertions.

    line 65
  10. Distinctive:

    Don't assume ports are fixed — AppHost or project launchSettings may override ports.

    line 72
  11. Very specific:

    Keep PRs focused and limited to one area (engine, schemas, designer).

    line 77
  12. Very specific:

    Run dotnet test and verify no regressions in unit tests for modified projects.

    line 78
  13. Very specific:

    Run dotnet format before committing.

    line 79
  14. Distinctive:

    If anything here is unclear or you'd like more examples (e.g., exact DI registration snippets or test harness examples), tell me which …

    line 81

≈ “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 / AI Agent Instructions for Sorcha

Purpose: Give AI coding agents the minimal, actionable knowledge to be productive in this repo.

  • Project Type: .NET 10 microservice platform using .NET Aspire for local orchestration. Key layers: src/Apps, src/Common, src/Core, src/Services.
  • Run locally (recommended): use Aspire AppHost to start all services and Redis integration.

    • Command: dotnet run --project src/Apps/Sorcha.AppHost
    • Aspire dashboard: http://localhost:15888
    • Common endpoints: API Gateway https://localhost:7082, Designer https://localhost:7083, Engine (varies)
  • If running services individually: prefer the AppHost for correctness, but individual services can be started with:
    • dotnet run --project src/Services/Sorcha.ApiGateway
    • dotnet run --project src/Services/Sorcha.Blueprint.Service
    • dotnet run --project src/Services/Sorcha.Peer.Service
  • Health endpoints: services expose /health and /alive. Use these for liveness checks and Aspire health aggregation.
  • Shared configuration / conventions:
    • Use the Sorcha.ServiceDefaults extension methods. See src/Common/Sorcha.ServiceDefaults/Extensions.cs for how services are wired (OpenTelemetry, health, resilience).
    • Map service endpoints with MapDefaultEndpoints(WebApplication) where appropriate.
    • OpenTelemetry and resilience policies are configured centrally; avoid duplicating configuration.
  • Blueprint domain & code patterns:
    • Domain models live in src/Common/Sorcha.Blueprint.Models/ (Blueprint, Action, Participant, Disclosure).
    • Fluent builders are in src/Core/Sorcha.Blueprint.Fluent/ — prefer using builders for generating blueprints in tests and examples. Example:

      var blueprint = BlueprintBuilder.Create()
        .WithTitle("Purchase Order")
        .AddParticipant("buyer", p => p.Named("Buyer"))
        .AddAction(0, a => a
          .WithTitle("Submit Order")
          .SentBy("buyer")
          .RequiresData(d => d.AddProperty("itemName","string"))
        )
        .Build();
  • Schema handling:
    • Schema services are under src/Core/Sorcha.Blueprint.Schemas.Client/.
    • Use SchemaLibraryService and ISchemaRepository for schema lookups; client caches schemas in local storage (LocalStorageSchemaCacheService) in the Designer.
  • Tests & CI:
    • Tests live under tests/ (unit, integration, E2E, performance). Run dotnet test at solution root or target a specific test project.
    • Integration tests require Docker (Redis). Ensure Docker Desktop is running for Sorcha.Gateway.Integration.Tests and any tests that rely on Redis.
    • Formatting and checks: dotnet format, dotnet list package --vulnerable, dotnet list package --outdated.
  • Conventions for changes:
    • Keep cross-cutting changes confined to Sorcha.ServiceDefaults when possible.
    • Prefer extension methods and DI registration over scattering configuration across projects.
    • Add health checks to new services at /health and /alive for Aspire to aggregate.
    • When adding HTTP endpoints follow minimal APIs style and register OpenAPI metadata.
  • Where to look for common tasks:
    • Service orchestration: src/Apps/Sorcha.AppHost/AppHost.cs
    • Service defaults & telemetry: src/Common/Sorcha.ServiceDefaults/ (extension methods, MapDefaultEndpoints)
    • Blueprint models: src/Common/Sorcha.Blueprint.Models/
    • Fluent builders: src/Core/Sorcha.Blueprint.Fluent/
    • Schema library: src/Core/Sorcha.Blueprint.Schemas.Client/
    • API Gateway (YARP): src/Services/Sorcha.ApiGateway/
  • Test naming and patterns:
    • Unit tests follow MethodName_Scenario_ExpectedBehavior (see docs/architecture.md Test Naming Convention).
    • Use xUnit, Moq, and FluentAssertions.
  • Integration & E2E specifics:
    • E2E Playwright tests live in tests/Sorcha.UI.E2E.Tests/; follow Playwright setup in the README for headless/headed runs.
    • Performance tests (NBomber) are in tests/Sorcha.Performance.Tests/ and produce reports in performance-reports/.
  • Common pitfalls (discoverable from repo):
    • Don't assume ports are fixed — AppHost or project launchSettings may override ports. Verify console output or Aspire dashboard URLs.
    • Redis-based features require Docker; skip or mock when Docker is unavailable.
    • Peer service is work-in-progress; changes may be incomplete — check peer-service-design.md and peer-service-implementation-plan.md.
  • PR guidance for AI agents:
    • Keep PRs focused and limited to one area (engine, schemas, designer). Update docs/ for behavioral changes.
    • Run dotnet test and verify no regressions in unit tests for modified projects.
    • Run dotnet format before committing.

If anything here is unclear or you'd like more examples (e.g., exact DI registration snippets or test harness examples), tell me which areas to expand and I will update this file accordingly.

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.