Sorcha
Sorcha-Platform/Sorcha/.github/copilot-instructions.md
Purpose: Give AI coding agents the minimal, actionable knowledge to be productive in this repo.
Copilot instructions2 starsChanged 8 months ago
What's in it
- Copilot / AI Agent Instructions for Sorcha
# 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:
```csharp
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.
More agent context in Sorcha-Platform/Sorcha
79 other files this repository gives its agents, the first 60 shown.
AGENTS.md
CLAUDE.md
llms.txt
Skill
- aspire.claude/skills/aspire/SKILL.md
- aspnet-core.claude/skills/aspnet-core/SKILL.md
- blazor.claude/skills/blazor/SKILL.md
- blueprint-builder.claude/skills/blueprint-builder/SKILL.md
- configuring-opentelemetry-dotnet.claude/skills/configuring-opentelemetry-dotnet/SKILL.md
- coverage-analysis.claude/skills/coverage-analysis/SKILL.md
- coverlet.claude/skills/coverlet/SKILL.md
- cryptography.claude/skills/cryptography/SKILL.md
- database-expert.claude/skills/database-expert/SKILL.md
- docker.claude/skills/docker/SKILL.md
- dotnet.claude/skills/dotnet/SKILL.md
- entity-framework-core.claude/skills/entity-framework-core/SKILL.md
- entity-framework.claude/skills/entity-framework/SKILL.md
- fluent-assertions.claude/skills/fluent-assertions/SKILL.md
- frontend-design.claude/skills/frontend-design/SKILL.md
- grpc.claude/skills/grpc/SKILL.md
- jwt.claude/skills/jwt/SKILL.md
- mcp.claude/skills/mcp/SKILL.md
- microsoft-extensions.claude/skills/microsoft-extensions/SKILL.md
- migrate-xunit-to-xunit-v3.claude/skills/migrate-xunit-to-xunit-v3/SKILL.md
- minimal-api-file-upload.claude/skills/minimal-api-file-upload/SKILL.md
- minimal-apis.claude/skills/minimal-apis/SKILL.md
- mongodb.claude/skills/mongodb/SKILL.md
- moq.claude/skills/moq/SKILL.md
- nbitcoin.claude/skills/nbitcoin/SKILL.md
- network-bootstrap.claude/skills/network-bootstrap/SKILL.md
- nunit.claude/skills/nunit/SKILL.md
- optimizing-ef-core-queries.claude/skills/optimizing-ef-core-queries/SKILL.md
- playwright.claude/skills/playwright/SKILL.md
- postgresql.claude/skills/postgresql/SKILL.md
- prodexec.claude/skills/prodexec/SKILL.md
- redis.claude/skills/redis/SKILL.md
- scalar.claude/skills/scalar/SKILL.md
- signalr.claude/skills/signalr/SKILL.md
- sorcha-app.claude/skills/sorcha-app/SKILL.md
- sorcha-architecture.claude/skills/sorcha-architecture/SKILL.md
- sorcha-cli.claude/skills/sorcha-cli/SKILL.md
- sorcha-ui.claude/skills/sorcha-ui/SKILL.md
- speckit-agent-context-update.claude/skills/speckit-agent-context-update/SKILL.md
- speckit-analyze.claude/skills/speckit-analyze/SKILL.md
- speckit-checklist.claude/skills/speckit-checklist/SKILL.md
- speckit-clarify.claude/skills/speckit-clarify/SKILL.md
- speckit-constitution.claude/skills/speckit-constitution/SKILL.md
- speckit-git-commit.claude/skills/speckit-git-commit/SKILL.md
- speckit-git-feature.claude/skills/speckit-git-feature/SKILL.md
- speckit-git-initialize.claude/skills/speckit-git-initialize/SKILL.md
- speckit-git-remote.claude/skills/speckit-git-remote/SKILL.md
- speckit-git-validate.claude/skills/speckit-git-validate/SKILL.md
- speckit-implement.claude/skills/speckit-implement/SKILL.md
- speckit-plan.claude/skills/speckit-plan/SKILL.md
- speckit-specify.claude/skills/speckit-specify/SKILL.md
- speckit-tasks.claude/skills/speckit-tasks/SKILL.md
- speckit-taskstoissues.claude/skills/speckit-taskstoissues/SKILL.md
- verifiable-credentials.claude/skills/verifiable-credentials/SKILL.md
- walkthrough-builder.claude/skills/walkthrough-builder/SKILL.md
- worker-services.claude/skills/worker-services/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

