@cratis/pi 7.37.0 → 7.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/corpus/harnesses/copilot/instructions/ai-distribution.instructions.md +109 -0
- package/package/corpus/harnesses/copilot/instructions/application-profile.instructions.md +81 -0
- package/package/corpus/harnesses/copilot/instructions/capability-is-not-authority.instructions.md +45 -0
- package/package/corpus/harnesses/copilot/instructions/code-quality.csharp.instructions.md +92 -0
- package/package/corpus/harnesses/copilot/instructions/code-quality.instructions.md +83 -0
- package/package/corpus/harnesses/copilot/instructions/code-quality.typescript.instructions.md +90 -0
- package/package/corpus/harnesses/copilot/instructions/components.instructions.md +300 -0
- package/package/corpus/harnesses/copilot/instructions/concepts.instructions.md +138 -0
- package/package/corpus/harnesses/copilot/instructions/cratis-folder-is-configuration.instructions.md +29 -0
- package/package/corpus/harnesses/copilot/instructions/csharp.instructions.md +357 -0
- package/package/corpus/harnesses/copilot/instructions/dialogs.instructions.md +278 -0
- package/package/corpus/harnesses/copilot/instructions/documentation-structure-and-formatting.instructions.md +162 -0
- package/package/corpus/harnesses/copilot/instructions/documentation.instructions.md +90 -0
- package/package/corpus/harnesses/copilot/instructions/editing-cratis-docs.instructions.md +74 -0
- package/package/corpus/harnesses/copilot/instructions/efcore.instructions.md +84 -0
- package/package/corpus/harnesses/copilot/instructions/efcore.specs.instructions.md +45 -0
- package/package/corpus/harnesses/copilot/instructions/elixir.instructions.md +50 -0
- package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +34 -0
- package/package/corpus/harnesses/copilot/instructions/framework.instructions.md +55 -0
- package/package/corpus/harnesses/copilot/instructions/frontend-quality.instructions.md +60 -0
- package/package/corpus/harnesses/copilot/instructions/frontend-testing.instructions.md +127 -0
- package/package/corpus/harnesses/copilot/instructions/git-commits.instructions.md +139 -0
- package/package/corpus/harnesses/copilot/instructions/github-actions.instructions.md +87 -0
- package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +63 -0
- package/package/corpus/harnesses/copilot/instructions/go-engineering.instructions.md +61 -0
- package/package/corpus/harnesses/copilot/instructions/go.instructions.md +116 -0
- package/package/corpus/harnesses/copilot/instructions/guards-and-fuses.instructions.md +61 -0
- package/package/corpus/harnesses/copilot/instructions/java.instructions.md +138 -0
- package/package/corpus/harnesses/copilot/instructions/kotlin.instructions.md +175 -0
- package/package/corpus/harnesses/copilot/instructions/local-work-artifacts.instructions.md +56 -0
- package/package/corpus/harnesses/copilot/instructions/new-repository-intake.instructions.md +35 -0
- package/package/corpus/harnesses/copilot/instructions/orleans.instructions.md +97 -0
- package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +403 -0
- package/package/corpus/harnesses/copilot/instructions/pull-requests.instructions.md +176 -0
- package/package/corpus/harnesses/copilot/instructions/react.instructions.md +203 -0
- package/package/corpus/harnesses/copilot/instructions/reactors.instructions.md +336 -0
- package/package/corpus/harnesses/copilot/instructions/rtk.instructions.md +48 -0
- package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +147 -0
- package/package/corpus/harnesses/copilot/instructions/specs.instructions.md +133 -0
- package/package/corpus/harnesses/copilot/instructions/specs.scenarios.csharp.instructions.md +281 -0
- package/package/corpus/harnesses/copilot/instructions/specs.typescript.instructions.md +141 -0
- package/package/corpus/harnesses/copilot/instructions/storybook.instructions.md +85 -0
- package/package/corpus/harnesses/copilot/instructions/typescript.instructions.md +151 -0
- package/package/corpus/harnesses/copilot/instructions/verification-discipline.instructions.md +27 -0
- package/package/corpus/harnesses/copilot/instructions/vertical-slices.instructions.md +414 -0
- package/package/corpus/harnesses/copilot/instructions/web-fetching.instructions.md +12 -0
- package/package/corpus/harnesses/copilot/instructions/writing-correct-examples.instructions.md +57 -0
- package/package/corpus/harnesses/copilot/instructions/writing-cratis-docs.instructions.md +72 -0
- package/package/corpus/product-sync.json +2 -2
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +11 -6
- package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +9 -5
- package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +1 -1
- package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +28 -4
- package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +2 -1
- package/package/corpus/skills/cratis-screenplay-discovery/verification.json +5 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +23 -29
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +15 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/model-notes.md +208 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +20 -1
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +19 -36
- package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +26 -0
- package/package/corpus/skills/cratis-screenplay-model-review/verification.json +7 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +14 -16
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/core-rules-digest.md +8 -3
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +5 -2
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/intake.md +21 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/reasoning-notes.md +10 -6
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +32 -1
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +5 -2
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +5 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +4 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +1716 -183
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +40 -4
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "**/*.cs"
|
|
3
|
+
profile: framework
|
|
4
|
+
paths:
|
|
5
|
+
- "**/*.cs"
|
|
6
|
+
---
|
|
7
|
+
<!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
|
|
8
|
+
|
|
9
|
+
# Orleans Conventions
|
|
10
|
+
|
|
11
|
+
> **⚠️ APPLIES ONLY TO PROJECTS USING MICROSOFT ORLEANS**
|
|
12
|
+
> If your project does not reference `Microsoft.Orleans` or any Orleans packages, **ignore this entire file**. These rules are irrelevant outside of Orleans contexts.
|
|
13
|
+
|
|
14
|
+
In the Cratis organization, Orleans is the Chronicle kernel's actor runtime (`Source/Kernel/`). The kernel conventions below are verified against `Cratis/Chronicle` **v19.50.0**. Shared hosting and jobs come from `Cratis/Orleans` **v1.16.3**; use its setup for other services that co-host a silo.
|
|
15
|
+
|
|
16
|
+
## General
|
|
17
|
+
|
|
18
|
+
- Do **not** split grain interfaces into a separate project. Grain interfaces and their implementations live together in `Kernel/Core`; the `Contracts` project holds the gRPC contracts, not grain interfaces.
|
|
19
|
+
- Clustering is chosen by the host, not the grain code: the server uses `UseLocalhostClustering(siloPort, gatewayPort, serviceId, clusterId)` for local development and the MongoDB storage integration switches on `UseMongoDBClustering` (`MongoDBMembershipStrategy.Multiple`) when clustering is enabled. A silo pointed at non-local shared storage while still on localhost clustering is logged as a **warning** at startup (each such node forms its own single-node cluster over the same data); `Cratis__Chronicle__Clustering__Type=MongoDB` on every node is what joins them.
|
|
20
|
+
- Do **not** add `[Alias]` to grain interfaces or grain methods — rely on the default alias Orleans generates. `[Alias(nameof(Type))]` is used only on `[GenerateSerializer]` **state and definition records** in `Kernel/Concepts` (`ReadModelDefinition`, `IndexDefinition`, `ReadModelChangeContext`, `ProjectionFuture`, `ClearPartitionQuarantineResult`), where a stable serialization alias must survive a rename.
|
|
21
|
+
|
|
22
|
+
## Grain storage providers
|
|
23
|
+
|
|
24
|
+
- Storage provider names are constants in `WellKnownGrainStorageProviders` (`Kernel/Core`), **one name per concern** — 23 of them at v19.50.0 (`Namespaces`, `EventSequences`, `ObserverDefinitions`, `ObserverState`, `FailedPartitions`, `Recommendations`, `Projections`, `ProjectionsManager`, `ProjectionFutures`, `Reactors`, `Reducers`, `ReducersManager`, `ReadModels`, `ReadModelsManager`, `ReadModelReplayManager`, `Constraints`, `EventStoreSubscriptionsManager`, `EventSeeding`, `Webhooks`, `WebhooksManager`, `DataProtectionKeys`, `PatchManager`, `System`). Reference a provider only through its constant — never a magic string, and there is no "default" provider.
|
|
25
|
+
- Each concern has its own `IGrainStorage` implementation (`EventSequencesStorageProvider`, `NamespacesStateStorageProvider`, …) taking the kernel's `IStorage` abstraction — **not** a MongoDB collection. The storage backend (MongoDB, SQL, in-memory) is selected behind `IStorage`, so a grain storage provider never references a database driver.
|
|
26
|
+
- Every provider is registered once, in `StorageProviderExtensions.AddStorageProviders(this ISiloBuilder)`, as a keyed singleton wrapped in `ResilientGrainStorage` (a Polly resilience pipeline configured from `Chronicle:ResilientStorage`). A new concern adds a constant, an `IGrainStorage` over `IStorage`, and one `AddKeyedSingleton(WellKnownGrainStorageProviders.<Name>, CreateResilientStorageFor<…>)` line there — nothing else.
|
|
27
|
+
- Grains declare their state with `[PersistentState(nameof(<StateType>), WellKnownGrainStorageProviders.<Name>)]`.
|
|
28
|
+
|
|
29
|
+
Registration excerpt inside Chronicle's `StorageProviderExtensions`; the provider
|
|
30
|
+
is `Cratis.Chronicle.EventSequences.EventSequencesStorageProvider(IStorage)`:
|
|
31
|
+
|
|
32
|
+
```csharp
|
|
33
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
34
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
35
|
+
|
|
36
|
+
services.AddKeyedSingleton(WellKnownGrainStorageProviders.EventSequences, CreateResilientStorageFor<Cratis.Chronicle.EventSequences.EventSequencesStorageProvider>);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Jobs are the exception to the kernel's `IStorage` shape: `JobGrainStorageProvider`
|
|
40
|
+
and `JobStepGrainStorageProvider` live in `Cratis.Orleans.Jobs` and take
|
|
41
|
+
`Cratis.Orleans.Storage.IJobsStorage`. Chronicle registers them under
|
|
42
|
+
`Cratis.Orleans.WellKnownGrainStorageProviders.Jobs` and `.JobSteps`, still wrapped
|
|
43
|
+
in its resilient storage pipeline.
|
|
44
|
+
|
|
45
|
+
## Co-host a silo with Cratis.Orleans
|
|
46
|
+
|
|
47
|
+
For job/step authoring, stage barriers, recovery, storage scopes and state-machine
|
|
48
|
+
APIs, load **cratis-orleans-jobs** from `cratis/engineering/csharp`. These APIs are
|
|
49
|
+
framework/service guidance; they do not impose application slice architecture.
|
|
50
|
+
|
|
51
|
+
For service authors, `Cratis.Orleans` supplies hosting, grain serializers, and the
|
|
52
|
+
shared job system without requiring Chronicle. With `Cratis.Orleans` and
|
|
53
|
+
`Cratis.Orleans.Storage.MongoDB` 1.16.3, this host uses durable MongoDB membership
|
|
54
|
+
and jobs storage (a local MongoDB server is required):
|
|
55
|
+
|
|
56
|
+
```csharp
|
|
57
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
58
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
59
|
+
|
|
60
|
+
using Cratis.Orleans.Hosting;
|
|
61
|
+
using Cratis.Orleans.Setup;
|
|
62
|
+
using Microsoft.AspNetCore.Builder;
|
|
63
|
+
using MongoDB.Driver;
|
|
64
|
+
|
|
65
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
66
|
+
const string connectionString = "mongodb://localhost:27017";
|
|
67
|
+
builder.AddCratisOrleans(new CratisOrleansOptions
|
|
68
|
+
{
|
|
69
|
+
ClusterId = "my-service",
|
|
70
|
+
ServiceId = "my-service",
|
|
71
|
+
Clustering = ClusteringMode.MongoDB,
|
|
72
|
+
DatabaseName = "my-service-orleans",
|
|
73
|
+
ConnectionString = connectionString
|
|
74
|
+
});
|
|
75
|
+
builder.Services.AddCratisOrleansMongoDBJobsStorage(new MongoClient(connectionString));
|
|
76
|
+
|
|
77
|
+
var app = builder.Build();
|
|
78
|
+
app.Run();
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- Register jobs storage separately: `AddCratisOrleansMongoDBJobsStorage`,
|
|
82
|
+
`AddCratisOrleansSqlJobsStorage` (`Cratis.Orleans.Setup`), or
|
|
83
|
+
`AddCratisOrleansInMemoryJobsStorage` (`Cratis.Orleans.Storage`).
|
|
84
|
+
- Give grain implementations a unique `[GrainType("unique-name")]`. Orleans'
|
|
85
|
+
default type name derives from the class name alone; a collision across
|
|
86
|
+
assemblies prevents silo startup.
|
|
87
|
+
- Reminders deliberately use Orleans' in-memory service in both clustering
|
|
88
|
+
modes; they do not survive a full restart. Jobs rehydrate from durable jobs
|
|
89
|
+
storage and do not use reminders. Do not switch to the incompatible MongoDB
|
|
90
|
+
reminder table merely because clustering uses MongoDB.
|
|
91
|
+
- `AddCratisOrleans` enables activity propagation itself. If a host keeps an
|
|
92
|
+
explicit `AddActivityPropagation()` call, it must be **before**, never after,
|
|
93
|
+
`AddCratisOrleans`, to avoid duplicate Orleans propagation filters/spans.
|
|
94
|
+
- Keep Orleans package versions aligned: the Release-build guard rejects a
|
|
95
|
+
`Microsoft.Orleans.Reminders`/`Microsoft.Orleans.Server` version mismatch.
|
|
96
|
+
- `Enabled = false` makes `AddCratisOrleans` a no-op for specification hosts;
|
|
97
|
+
it does not register the silo or its collaborators.
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "**/.cratis/**"
|
|
3
|
+
paths:
|
|
4
|
+
- "**/.cratis/**"
|
|
5
|
+
---
|
|
6
|
+
<!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
|
|
7
|
+
|
|
8
|
+
# AI Corpus Profiles
|
|
9
|
+
|
|
10
|
+
Profiles determine which rules and skills apply to your work. They define the scope of the AI corpus and which documentation, conventions, and skills are available.
|
|
11
|
+
|
|
12
|
+
## Two Main Profile Types
|
|
13
|
+
|
|
14
|
+
### Application Profile
|
|
15
|
+
|
|
16
|
+
**Use when:** You are building an application on Cratis.
|
|
17
|
+
|
|
18
|
+
**What it includes:**
|
|
19
|
+
- Event-sourced CQRS with **Cratis Chronicle** + **Cratis Arc**
|
|
20
|
+
- Vertical slices (commands, events, projections, read models)
|
|
21
|
+
- React + Cratis Components (PrimeReact) frontend in MVVM
|
|
22
|
+
- MongoDB or EF Core for read models
|
|
23
|
+
- Full-stack type safety from C# to TypeScript
|
|
24
|
+
|
|
25
|
+
**Key rules:**
|
|
26
|
+
- [vertical-slices.md](./vertical-slices.instructions.md) - slice anatomy and structure
|
|
27
|
+
- [react.md](./react.instructions.md) - React + Arc + Cratis Components
|
|
28
|
+
- [components.md](./components.instructions.md) - component structure and styling
|
|
29
|
+
- [dialogs.md](./dialogs.instructions.md) - dialog patterns
|
|
30
|
+
- [specs.scenarios.csharp.md](./specs.scenarios.csharp.instructions.md) - in-process scenario family
|
|
31
|
+
|
|
32
|
+
### Framework Profile
|
|
33
|
+
|
|
34
|
+
**Use when:** You are contributing to a Cratis framework repository itself (Arc, Chronicle, Fundamentals, Components, Specifications).
|
|
35
|
+
|
|
36
|
+
**What it includes:**
|
|
37
|
+
- Library development (not applications)
|
|
38
|
+
- Source generators, the Chronicle kernel (Orleans grains + storage), client SDKs, React component library
|
|
39
|
+
- No vertical slices, no model-bound `[Command]`/`[ReadModel]` artifacts
|
|
40
|
+
- No projections/read-models, no MVVM app components
|
|
41
|
+
|
|
42
|
+
**Key rules:**
|
|
43
|
+
- [framework.md](./framework.instructions.md) - repo structure and library/API design
|
|
44
|
+
- [orleans.md](./orleans.instructions.md) - Orleans grain conventions
|
|
45
|
+
- [specs.csharp.md](./specs.csharp.instructions.md) - universal `Specification` base + NSubstitute
|
|
46
|
+
|
|
47
|
+
## Profile Catalog
|
|
48
|
+
|
|
49
|
+
The complete list of available profiles is defined in [profile-catalog.json](../../../profile-catalog.json). This catalog includes:
|
|
50
|
+
|
|
51
|
+
### Application Profiles
|
|
52
|
+
|
|
53
|
+
| Profile ID | Description | Automatically Includes |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `cratis/application` | Full application stack (C# + React + TypeScript) | `cratis/application/csharp`, `cratis/application/elixir`, `cratis/application/java`, `cratis/application/kotlin`, `cratis/application/typescript`, `cratis/arc/core`, `cratis/arc/react`, `cratis/chronicle/core`, `cratis/components`, `cratis/fundamentals`, `cratis/specifications/dotnet`, `cratis/specifications/typescript` |
|
|
56
|
+
| `cratis/application/csharp` | C# backend with Arc + Chronicle | `cratis/arc`, `cratis/arc/react`, `cratis/chronicle`, `cratis/components`, `cratis/fundamentals`, `cratis/language/csharp`, `cratis/screenplay`, `cratis/specifications/dotnet`, `cratis/specifications/typescript` |
|
|
57
|
+
| `cratis/application/react` | React frontend with Cratis Components | `cratis/arc/core`, `cratis/arc/react`, `cratis/components`, `cratis/fundamentals`, `cratis/specifications/dotnet`, `cratis/specifications/typescript` |
|
|
58
|
+
| `cratis/application/typescript` | TypeScript client for Chronicle | `cratis/chronicle/client-typescript`, `cratis/language/typescript`, `cratis/screenplay`, `cratis/specifications/typescript` |
|
|
59
|
+
| `cratis/application/arc-chronicle` | Arc + Chronicle integration | `cratis/arc/core`, `cratis/chronicle/core`, `cratis/fundamentals`, `cratis/screenplay`, `cratis/specifications/dotnet` |
|
|
60
|
+
| `cratis/application/arc-only` | Arc without Chronicle | `cratis/arc/core`, `cratis/fundamentals`, `cratis/screenplay`, `cratis/specifications/dotnet` |
|
|
61
|
+
| `cratis/application/chronicle-dotnet` | Chronicle .NET client | `cratis/chronicle/client-dotnet`, `cratis/chronicle/core`, `cratis/fundamentals`, `cratis/screenplay`, `cratis/specifications/dotnet` |
|
|
62
|
+
| `cratis/application/elixir` | Elixir Chronicle client | `cratis/chronicle/client-elixir`, `cratis/language/elixir`, `cratis/screenplay` |
|
|
63
|
+
| `cratis/application/kotlin` | Kotlin Arc + Chronicle application | `cratis/arc/client-kotlin`, `cratis/chronicle/client-kotlin`, `cratis/language/kotlin`, `cratis/screenplay` |
|
|
64
|
+
| `cratis/application/java` | Java Arc + Chronicle application | `cratis/arc/client-kotlin`, `cratis/chronicle/client-java`, `cratis/language/java`, `cratis/screenplay` |
|
|
65
|
+
|
|
66
|
+
`cratis/application` inherits `cratis/screenplay` through its language-specific
|
|
67
|
+
children. Backend-bearing application profiles include the method skills and MCP
|
|
68
|
+
declaration, not `cratis/stage`; the frontend-only `cratis/application/react`
|
|
69
|
+
profile includes neither Screenplay nor Stage.
|
|
70
|
+
|
|
71
|
+
### Framework Profiles
|
|
72
|
+
|
|
73
|
+
| Profile ID | Description | Automatically Includes |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| `cratis/arc` | Arc CQRS framework | `cratis/arc/csharp`, `cratis/arc/java`, `cratis/arc/kotlin` |
|
|
76
|
+
| `cratis/chronicle` | Chronicle event sourcing engine (does not compose `cratis/chronicle/mcp`) | `cratis/chronicle/compliance`, `cratis/chronicle/csharp`, `cratis/chronicle/elixir`, `cratis/chronicle/java`, `cratis/chronicle/kotlin`, `cratis/chronicle/multi-tenancy`, `cratis/chronicle/typescript`, `cratis/chronicle/web-workbench` |
|
|
77
|
+
| `cratis/components` | React component library, including `cratis-components-common-controls` and `cratis-components-data-surfaces` | (no child profiles) |
|
|
78
|
+
| `cratis/fundamentals` | Core primitives and generated .NET telemetry (`cratis-fundamentals-telemetry`) | (no child profiles) |
|
|
79
|
+
| `cratis/arc/go` | Experimental Arc.Go HTTP CQRS (root module) | `cratis/language/go`, `cratis/fundamentals/go` |
|
|
80
|
+
| `cratis/chronicle/client-go` | Experimental standalone Chronicle.Go client | `cratis/language/go`, `cratis/fundamentals/go` |
|
|
81
|
+
| `cratis/fundamentals/go` | Fundamentals.Go named scalar concepts and codecs | `cratis/language/go` |
|
|
82
|
+
| `cratis/specifications` | Specification framework | (no child profiles) |
|
|
83
|
+
| `cratis/specifications/dotnet` | C# specifications and application slice conformance (`cratis-application-slice-conformance`), alongside slice specifications | `cratis/specifications` |
|
|
84
|
+
|
|
85
|
+
### Engineering Profiles
|
|
86
|
+
|
|
87
|
+
| Profile ID | Description | Automatically Includes |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| `cratis/engineering` | Engineering conventions and workflows | `cratis/engineering/core`, `cratis/engineering/csharp`, `cratis/engineering/elixir`, `cratis/engineering/go`, `cratis/engineering/kotlin`, `cratis/engineering/react`, `cratis/engineering/typescript` |
|
|
90
|
+
| `cratis/engineering/csharp` | C# engineering conventions and framework Orleans jobs (`cratis-orleans-jobs`, alongside `orleans.md`) | `cratis/engineering/core` |
|
|
91
|
+
| `cratis/engineering/go` | Go framework parity and immutable module releases | `cratis/engineering/core`, `cratis/language/go` |
|
|
92
|
+
| `cratis/engineering/typescript` | TypeScript engineering conventions | `cratis/engineering/core` |
|
|
93
|
+
| `cratis/engineering/react` | React engineering conventions | `cratis/engineering/core` |
|
|
94
|
+
|
|
95
|
+
### Language Profiles
|
|
96
|
+
|
|
97
|
+
| Profile ID | Description |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `cratis/language/csharp` | C# language conventions |
|
|
100
|
+
| `cratis/language/typescript` | TypeScript language conventions |
|
|
101
|
+
| `cratis/language/elixir` | Elixir language conventions |
|
|
102
|
+
| `cratis/language/go` | Go conventions for source, go.mod and go.sum |
|
|
103
|
+
| `cratis/language/kotlin` | Kotlin language conventions |
|
|
104
|
+
| `cratis/language/java` | Java language conventions |
|
|
105
|
+
|
|
106
|
+
### Arc and Chronicle on the JVM (Kotlin and Java)
|
|
107
|
+
|
|
108
|
+
Arc.Kotlin (`io.cratis:arc`) and its optional Chronicle integration
|
|
109
|
+
(`io.cratis:cratis`, the all-in-one event-sourced application artifact, or
|
|
110
|
+
`io.cratis:arc-chronicle-spring-boot-starter`) bring the same command/query
|
|
111
|
+
model-bound shape to the JVM that Arc .NET brings to C#, for both Kotlin and
|
|
112
|
+
Java application code. `cratis/arc/client-kotlin` carries the skills for both
|
|
113
|
+
languages — Java application code still needs Kotlin and KSP on the build,
|
|
114
|
+
since Arc generates Kotlin adapters for Java declarations.
|
|
115
|
+
|
|
116
|
+
| Skill | Covers |
|
|
117
|
+
| --- | --- |
|
|
118
|
+
| `cratis-arc-command-kotlin` | `@Command`, `handle()`/`provide()`, Chronicle event responses, command authorization, TypeScript proxy generation |
|
|
119
|
+
| `cratis-arc-query-kotlin` | `@ReadModel` queries, GET vs RFC QUERY, observable queries (`Flow`, `Flow.Publisher`, RxJava 3) over SSE/WebSocket |
|
|
120
|
+
| `cratis-arc-validation-kotlin` | `FluentModelValidator` shared rules, `CommandValidator`/`QueryValidator`/`ConceptValidator`/`ModelValidator`, Jakarta constraints |
|
|
121
|
+
| `cratis-arc-testing-kotlin` | Real in-process command/query scenarios, bounded observable collection, read-model pins and Chronicle append assertions |
|
|
122
|
+
| `cratis-arc-identity-and-tenancy-kotlin` | Authentication handlers, identity details, tenant resolution and propagation, opt-in trusted platform headers |
|
|
123
|
+
| `cratis-arc-spring-data-kotlin` | JPA/Mongo repositories, paging, observations, concept converters, tenant storage and transaction boundaries |
|
|
124
|
+
|
|
125
|
+
Standalone Chronicle client usage (no Arc) for Kotlin and Java is
|
|
126
|
+
`cratis-chronicle-client-kotlin`, reused by `cratis/chronicle/client-java`.
|
|
127
|
+
JVM language conventions are `kotlin.md` and `java.md`.
|
|
128
|
+
|
|
129
|
+
### Arc for TypeScript on Node.js
|
|
130
|
+
|
|
131
|
+
Arc for TypeScript (`@cratis/arc.core` with the Express, Fastify, Hono,
|
|
132
|
+
MongoDB, Drizzle, testing and experimental Chronicle packages, plus
|
|
133
|
+
`@cratis/arc.proxygenerator`, `@cratis/eslint-plugin-arc-core` and experimental
|
|
134
|
+
`@cratis/cratis`) brings the same model-bound command/query shape to a Node.js
|
|
135
|
+
server. Verified at GitHub pre-release **v0.57.2**: its packages are a source
|
|
136
|
+
preview and are not published to npm. It is separate from `@cratis/arc`, the
|
|
137
|
+
published client runtime that generated proxies import in a frontend.
|
|
138
|
+
`cratis/arc/server-typescript` carries the skills; `cratis/arc/typescript` adds
|
|
139
|
+
the TypeScript language conventions, and `cratis/full/typescript` composes it.
|
|
140
|
+
The server skills are opt-in: `cratis/arc`, `cratis/application` and
|
|
141
|
+
`cratis/application/typescript` do not load them, because they target a
|
|
142
|
+
Node.js server and a C# or React-frontend project has no use for them. Select
|
|
143
|
+
`cratis/arc/typescript` (or `cratis/full/typescript`) for a Node.js Arc server.
|
|
144
|
+
|
|
145
|
+
| Skill | Covers |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
| `cratis-arc-command-typescript` | Project setup from the source preview, `ArcApplication.createBuilder()`, `@command()` with `handle()`/`provide()`, outcomes, authorization, returned Chronicle events, generated metadata and proxies, hosts, `CommandScenario` |
|
|
148
|
+
| `cratis-arc-query-typescript` | `@readModel()` with static `@query()` methods, argument binding, GET and HTTP `QUERY`, paging, RxJS observable queries, MongoDB/Drizzle/Chronicle read models, `QueryScenario`/`ObservableQueryScenario` |
|
|
149
|
+
| `cratis-arc-validation-typescript` | `CommandValidator`/`QueryValidator`/`ConceptValidator`/`ModelValidator`, `readModelForValidation`, `validation()` with `rejected`/`denied`, severity filtering |
|
|
150
|
+
|
|
151
|
+
Standalone Chronicle client usage (no Arc) in TypeScript is
|
|
152
|
+
`cratis-chronicle-client-typescript`.
|
|
153
|
+
|
|
154
|
+
### Experimental Go modules
|
|
155
|
+
|
|
156
|
+
Select `cratis/language/go` for a Go repository without importing any HTTP or
|
|
157
|
+
Chronicle guidance. `cratis/engineering/go` adds contributor parity and release
|
|
158
|
+
policy through [go-engineering.md](./go-engineering.instructions.md), composing rather than
|
|
159
|
+
duplicating [go.md](./go.instructions.md). Set `languages: ["go"]` in `.cratis/ai.json` so
|
|
160
|
+
language-filtered composition selects the Go children. The catalog/manifest
|
|
161
|
+
register `go`; there is no separate extension-based detection registry in the
|
|
162
|
+
corpus's harness setup or Pi package.
|
|
163
|
+
|
|
164
|
+
| Profile | Skill | Verified experimental version |
|
|
165
|
+
| --- | --- | --- |
|
|
166
|
+
| `cratis/chronicle/client-go` | `cratis-chronicle-client-go` | Chronicle.Go v0.9.1 (Chronicle kernel 19.32.3 profile) |
|
|
167
|
+
| `cratis/arc/go` | `cratis-arc-go` | Arc.Go v0.1.1 |
|
|
168
|
+
| `cratis/fundamentals/go` | `cratis-fundamentals-concept-go` | Fundamentals.Go v0.3.2 |
|
|
169
|
+
|
|
170
|
+
Arc and Chronicle profiles compose language and Go concepts, **not each other**
|
|
171
|
+
or C# client/HTTP skills. These profiles are explicit opt-ins; existing aggregate
|
|
172
|
+
Arc/Chronicle and application profiles are unchanged. Only the Arc.Go root module
|
|
173
|
+
is released; Chronicle/MongoDB integrations and Go generator tools remain source
|
|
174
|
+
previews. `cratis/application/go` and Go scaffolding are deferred; do not prescribe
|
|
175
|
+
`dotnet new` as a Go template. Each module currently requires Go 1.26, but generic
|
|
176
|
+
language policy always follows the consuming repository's `go.mod` minimum.
|
|
177
|
+
|
|
178
|
+
### Specialized Profiles
|
|
179
|
+
|
|
180
|
+
| Profile ID | Description |
|
|
181
|
+
|---|---|
|
|
182
|
+
| `cratis/documentation` | Reader-centered product docs, technical examples, release notes, and voice review |
|
|
183
|
+
| `cratis/content` | Release notes, social feed posts, voice review, content length, and developer marketing and distribution |
|
|
184
|
+
| `cratis/review` | Code review, performance, security |
|
|
185
|
+
| `cratis/codescene` | Opt-in CodeScene Code Health change gates, refactoring, debt prioritization and risk-based testing; requires an account and available MCP tools; each user registers the MCP server (see below) |
|
|
186
|
+
| `cratis/studio` | Studio MCP safety guidance |
|
|
187
|
+
| `cratis/cli` | CLI operations |
|
|
188
|
+
| `cratis/cli/terminal-workbench` | Human-operated terminal Workbench |
|
|
189
|
+
| `cratis/chronicle/mcp` | Chronicle MCP inspection and exact tool-effect guidance |
|
|
190
|
+
| `cratis/lens` | Lens browser extension |
|
|
191
|
+
| `cratis/screenplay` | Model-first event modeling: lifecycle, phase skills, toolchain, review, render and gap-fill, plus the whole `.play` language |
|
|
192
|
+
| `cratis/stage` | Stage rendering and sandbox |
|
|
193
|
+
| `cratis/modeling/screenplay-stage` | Screenplay + Stage together |
|
|
194
|
+
|
|
195
|
+
### Code Health with CodeScene
|
|
196
|
+
|
|
197
|
+
Select `cratis/codescene` explicitly to load the four upstream CodeScene skills:
|
|
198
|
+
`safeguarding-ai-generated-code`, `guiding-refactoring-with-code-health`,
|
|
199
|
+
`prioritizing-technical-debt` and `risk-based-testing-with-code-health`.
|
|
200
|
+
The [CodeScene policy](../../../rules/codescene.md) overrides those skills where they differ.
|
|
201
|
+
No other profile, including `cratis` and `cratis/full`, composes it.
|
|
202
|
+
|
|
203
|
+
The profile selects the `codescene` stdio server (`cs-mcp`, no arguments) from
|
|
204
|
+
`mcp-servers.json`, but neither the Cratis CLI nor any harness registers it,
|
|
205
|
+
because it needs a per-user CodeScene account and a locally installed binary.
|
|
206
|
+
Each user registers it in their own user-level MCP configuration, never in
|
|
207
|
+
committed project files: `cs-mcp` over stdio (`brew install cs-mcp`), or
|
|
208
|
+
`npx -y @codescene/codehealth-mcp`.
|
|
209
|
+
CodeScene needs an account and OAuth `login`; without an account or available
|
|
210
|
+
CodeScene tools, skip its steps and say so rather than blocking contributors.
|
|
211
|
+
The MCP catalog has no install-hints field and does not install the executable.
|
|
212
|
+
|
|
213
|
+
### Event modeling with Screenplay
|
|
214
|
+
|
|
215
|
+
**Model first.** A repository is opted in only when its model root (where the project's
|
|
216
|
+
`.play` files live: normally under `Source/` or `src/`, else `Screenplay/`) holds a committed `.play` file (`git ls-tree -r --name-only HEAD` lists a `.play` file there, narrowed to `-- <root>` when a root is configured) or the project explicitly set
|
|
217
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install output, an
|
|
218
|
+
installed profile or skill, a `.play` file outside the root or an untracked or uncommitted draft is not
|
|
219
|
+
opt-in. An accepted model under the root covering the scope is the contract and the source
|
|
220
|
+
of truth for behavior. Change the model, verify and independently review it, then render
|
|
221
|
+
or gap-fill from its contract; never edit Stage-managed output or weaken protection.
|
|
222
|
+
Otherwise stay code-first; only the entry-point session may propose a model, at most once
|
|
223
|
+
per session. Master definition: `cratis-screenplay-modeling-lifecycle`. Framework and non-opted-in brownfield work remain
|
|
224
|
+
code-first; infrastructure, clients, adapters and code attachments stay in code.
|
|
225
|
+
Backend-bearing application profiles automatically compose `cratis/screenplay`;
|
|
226
|
+
installing its skills or registering its MCP server is not model-first opt-in.
|
|
227
|
+
|
|
228
|
+
`cratis/screenplay` carries the **method** and the **language**. Load the lifecycle
|
|
229
|
+
and one phase skill, then the construct skill needed for syntax.
|
|
230
|
+
|
|
231
|
+
#### Method
|
|
232
|
+
|
|
233
|
+
| Skill | Covers |
|
|
234
|
+
| --- | --- |
|
|
235
|
+
| `cratis-screenplay-event-modeling` | Entry point, model-first routing, four slice types and nine-step map |
|
|
236
|
+
| `cratis-screenplay-modeling-lifecycle` | Decision rule, P0–P9 phases, V1–V5 evidence, identity ownership and handoffs |
|
|
237
|
+
| `cratis-screenplay-discovery` | Personas, domain discovery, event timeline and rules register |
|
|
238
|
+
| `cratis-screenplay-slice-design` | Commands, refusals, views, field lineage and slice boundaries |
|
|
239
|
+
| `cratis-screenplay-streams-and-consistency` | Business identities, atomic invariants, concurrency, evolution and ownership |
|
|
240
|
+
| `cratis-screenplay-automations-and-translations` | Follow-up work, external data to our facts, recovery and deduplication |
|
|
241
|
+
| `cratis-screenplay-scenario-coverage` | Coverage matrix, rejection, denial, lifecycle and external-failure scenarios |
|
|
242
|
+
| `cratis-screenplay-model-review` | Independent critique, evidence checklist and business-question explanation |
|
|
243
|
+
| `cratis-screenplay-legacy-extraction` | Evidence-led extraction, expert verification and loss report |
|
|
244
|
+
| `cratis-screenplay-toolchain` | Compiler and CLI versions, verdict commands, diagnostics and executable subsets |
|
|
245
|
+
| `cratis-screenplay-render-and-gap-fill` | Admission, publication, target verification and contract-led hand-written delivery |
|
|
246
|
+
| `cratis-screenplay-delivery-planning` | Slice counts by type, dependency waves, issue tracking and estimates from the team's own history |
|
|
247
|
+
|
|
248
|
+
#### Language
|
|
249
|
+
|
|
250
|
+
| Skill | Covers |
|
|
251
|
+
| --- | --- |
|
|
252
|
+
| `cratis-screenplay-command-surface` | `command`, `event`, `validate`, `authorize`, `produces`, `concurrency`, `constraint`, `concept`, `$context` |
|
|
253
|
+
| `cratis-screenplay-projections` | The Projection Declaration Language and the `reducer` escape hatch |
|
|
254
|
+
| `cratis-screenplay-read-surface` | `readmodel`, `query`, `screen`, name resolution |
|
|
255
|
+
| `cratis-screenplay-ui-composition` | `layout`, templates, `form`, `contribute`, `ui profile`, `theme`, `$strings`, `file` |
|
|
256
|
+
| `cratis-screenplay-captures-and-reactions` | The Change Data Capture Language, `reaction`, `trigger` |
|
|
257
|
+
| `cratis-screenplay-specifications` | Given/when/then and the reference execution |
|
|
258
|
+
| `cratis-screenplay-model-authoring` | Typed MCP authoring, model navigation/refactoring, compiler diagnostics, and source-versus-executable readiness |
|
|
259
|
+
|
|
260
|
+
The canonical agents are **Screenplay Modeler** (`screenplay-modeler.md`) for
|
|
261
|
+
modeling and legacy extraction, **Screenplay Reviewer** (`screenplay-reviewer.md`)
|
|
262
|
+
for read-only critique or explanation, and **Screenplay Renderer**
|
|
263
|
+
(`screenplay-renderer.md`) for render probes and gap-fill handoffs. Hand-written
|
|
264
|
+
scope uses `cratis-application-slice-conformance`, available wherever
|
|
265
|
+
`cratis-application-slice-specifications` is selected through
|
|
266
|
+
`cratis/specifications/dotnet`, to check code against the model and its specs.
|
|
267
|
+
|
|
268
|
+
The profile also selects the corpus-owned Screenplay MCP declaration from
|
|
269
|
+
`mcp-servers.json`. The Cratis CLI hosts the server as `cratis screenplay mcp`
|
|
270
|
+
and registers a scoped entry for supported clients without replacing their other
|
|
271
|
+
servers. Inspect install/status results for adapter support or configuration
|
|
272
|
+
conflicts. The model is wherever the project keeps its `.play` files, else under `Source/` or
|
|
273
|
+
`src/`, else in a `Screenplay/` folder at the repository root; never under `.cratis/`.
|
|
274
|
+
Project-owned configuration can name a root explicitly.
|
|
275
|
+
|
|
276
|
+
**No-model startup requires Cratis CLI 3.46.1 or later.** With
|
|
277
|
+
`cratis screenplay mcp --project-root <project>`, that version resolves the root
|
|
278
|
+
without creating it; discovery, startup and proposals leave no model folder, and
|
|
279
|
+
the first `apply` write creates it. `cratis ai install` also creates no model
|
|
280
|
+
folder unless the project configured a root. Older CLIs create the resolved model root at
|
|
281
|
+
server startup (`Screenplay/` when no `.play` files, `Source/` or `src/` exist); upgrade before using the automatically selected MCP server in a
|
|
282
|
+
repository without a model. In Pi, when every selected path to Screenplay goes through an application profile and no root is configured, a missing, older or unavailable CLI leaves its MCP tools inactive with one informational UI notice (none in headless mode); an independent non-application path to Screenplay or a configured root still surfaces startup errors. See the toolchain skill's
|
|
283
|
+
[version reference](../../../skills/cratis-screenplay-toolchain/references/versions.md).
|
|
284
|
+
|
|
285
|
+
## How to Use Profiles
|
|
286
|
+
|
|
287
|
+
### 1. Select Your Profile
|
|
288
|
+
|
|
289
|
+
Choose the profile that matches your current work:
|
|
290
|
+
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"schemaVersion": "1.0.0",
|
|
294
|
+
"profiles": [
|
|
295
|
+
"cratis/application/csharp",
|
|
296
|
+
"cratis/engineering/csharp"
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### 2. Profile Composition
|
|
302
|
+
|
|
303
|
+
Profiles can compose other profiles. When you select a parent profile, all child profiles are automatically included.
|
|
304
|
+
|
|
305
|
+
**How composition works:**
|
|
306
|
+
- Selecting `cratis/application` automatically includes all its child profiles (listed in the "Automatically Includes" column above)
|
|
307
|
+
- Selecting `cratis/full` includes all full-stack capabilities across C#, TypeScript, Elixir, and Kotlin
|
|
308
|
+
- Selecting `cratis/engineering` automatically includes all engineering convention profiles
|
|
309
|
+
|
|
310
|
+
**Examples:**
|
|
311
|
+
|
|
312
|
+
```json
|
|
313
|
+
{
|
|
314
|
+
"schemaVersion": "1.0.0",
|
|
315
|
+
"profiles": [
|
|
316
|
+
"cratis/application" // Automatically includes all child profiles
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
```json
|
|
322
|
+
{
|
|
323
|
+
"schemaVersion": "1.0.0",
|
|
324
|
+
"profiles": [
|
|
325
|
+
"cratis/application/csharp" // Includes: arc, arc/react, chronicle, components, fundamentals, language/csharp, screenplay, specifications/dotnet, specifications/typescript
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
```json
|
|
331
|
+
{
|
|
332
|
+
"schemaVersion": "1.0.0",
|
|
333
|
+
"profiles": [
|
|
334
|
+
"cratis/full" // Includes all full-stack capabilities
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**Note:** The profile-catalog.json file defines the complete composition tree. When you select a parent profile, the system automatically resolves and includes all child profiles listed in the `composes` array.
|
|
340
|
+
|
|
341
|
+
### 3. Multi-Profile Work
|
|
342
|
+
|
|
343
|
+
You can work with multiple profiles simultaneously:
|
|
344
|
+
|
|
345
|
+
```json
|
|
346
|
+
{
|
|
347
|
+
"profiles": [
|
|
348
|
+
"cratis/application/csharp", // Backend development
|
|
349
|
+
"cratis/application/react", // Frontend development
|
|
350
|
+
"cratis/engineering/csharp" // Engineering conventions
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### 4. Language-Specific Profiles
|
|
356
|
+
|
|
357
|
+
Select language profiles when working with specific languages:
|
|
358
|
+
|
|
359
|
+
```json
|
|
360
|
+
{
|
|
361
|
+
"profiles": [
|
|
362
|
+
"cratis/language/csharp",
|
|
363
|
+
"cratis/language/typescript"
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### 5. Skills in agent harnesses
|
|
369
|
+
|
|
370
|
+
The canonical skills live in `.cratis/ai/skills/`. Supported harnesses expose
|
|
371
|
+
that tree through generated links or package integration; marketplace plugins
|
|
372
|
+
may point their `skills` field at `./skills`. Edit the canonical skill and its
|
|
373
|
+
profile-catalog entry in this repository, not a consuming repository's managed
|
|
374
|
+
copy or a generated harness adapter. Check reachability through the selected
|
|
375
|
+
profiles as well as plugin discovery, which can expose the whole skill tree.
|
|
376
|
+
|
|
377
|
+
## Profile-Specific Rules
|
|
378
|
+
|
|
379
|
+
Every rule file declares its profile in the frontmatter:
|
|
380
|
+
|
|
381
|
+
```markdown
|
|
382
|
+
---
|
|
383
|
+
profile: application
|
|
384
|
+
---
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
- **`profile: application`** - Rules for building applications on Cratis
|
|
388
|
+
- **`profile: framework`** - Rules for contributing to Cratis framework repos
|
|
389
|
+
- **No profile tag** - Universal rules that apply to both profiles
|
|
390
|
+
|
|
391
|
+
## Finding Profile Information
|
|
392
|
+
|
|
393
|
+
- **Full catalog:** [profile-catalog.json](../../../profile-catalog.json)
|
|
394
|
+
- **Application rules:** [general.md](../../../rules/general.md) (Application profile section)
|
|
395
|
+
- **Framework rules:** [framework.md](./framework.instructions.md)
|
|
396
|
+
- **Engineering conventions:** [csharp.md](./csharp.instructions.md), [typescript.md](./typescript.instructions.md), [go.md](./go.instructions.md), [go-engineering.md](./go-engineering.instructions.md)
|
|
397
|
+
|
|
398
|
+
## See Also
|
|
399
|
+
|
|
400
|
+
- [general.md](../../../rules/general.md) - Project instructions and profile overview
|
|
401
|
+
- [vertical-slices.md](./vertical-slices.instructions.md) - Application profile architecture
|
|
402
|
+
- [framework.md](./framework.instructions.md) - Framework profile architecture
|
|
403
|
+
- [profile-catalog.json](../../../profile-catalog.json) - Complete profile definitions
|