cratis/ai.distribution/cross-cutting-properties

Claude Code and agent skill by cratis/ai.distribution

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Attach audit/correlation metadata to every appended Cratis event without polluting event types — via ICanProvideAdditionalEventInformation, plus event tags and the built-in EventContext fields. Use for correlation IDs, tenant/actor context, and other cross-cutting concerns that should travel with events but are not domain payload.

Install

npx vskill@latest install cratis/ai.distribution/cross-cutting-properties

SKILL.md

The same SKILL.md was published earlier as cratis/ai.distribution/cross-cutting-properties.

Cross-Cutting Event Properties

Some information must travel with every event — correlation/causation ids, the authenticated actor, tenant context — but adding it as a property to every [EventType] would pollute the schemas. Chronicle solves this with ICanProvideAdditionalEventInformation (metadata-envelope providers) and event tags.

First, check the built-in EventContext

Before implementing a provider, see whether what you need is already there (available in reactors/reducers):

PropertyDescription
EventSourceIdthe event source appended to
SequenceNumberordinal within the sequence
Occurredwall-clock time at append
CorrelationIdpropagated from the request (or generated)
Causationupstream event references
CausedByactor identity (from the configured identity provider)

You don't need a custom provider for actor identity alone — CausedBy already captures it. Reach for a provider only for additional fields.

ICanProvideAdditionalEventInformation

csharp
using System.Text.Json.Nodes;
public class TenantMetadataProvider(IHttpContextAccessor http) : ICanProvideAdditionalEventInformation
{
// ProvideFor receives the event as a JsonObject and mutates it in place; it returns Task.
public Task ProvideFor(JsonObject @event)
{
@event["tenantId"] = http.HttpContext?.Request.Headers["x-tenant-id"].FirstOrDefault() ?? "Default";
return Task.CompletedTask;
}
}

Chronicle discovers providers from DI — register as scoped/singleton. Multiple providers merge; key collisions = last-registered wins. Place the class at a cross-cutting infrastructure location, not inside a slice. The properties land in the event's metadata envelope, not the event record — they are not surfaced in EventContext on reactive handlers. If a value must influence a projection/reducer, it belongs on the event type (or a dedicated audit event), not in cross-cutting metadata.

Tags vs filtering — easy to confuse

AttributeWhereWhat it does
[Tag("analytics", "user-action")]on an [EventType]merges static tags into every occurrence at append time; available in EventContext.Tags. Does not filter.
[FilterEventsByTag("tag")]on a reactor/reducer classrestricts which events reach the handler (multiple = OR; combined with [EventSourceType]/[EventStreamType] = AND).
[Tag] / [Tags]on a reactor/reducer classadmin-UI label only — no effect on delivery.

Tags are also used for concurrency scoping. To filter by tag you need [FilterEventsByTag], not [Tag].

Common pitfalls

PitfallWhy
Adding correlation/tenant id to every [EventType]pollutes schemas — use a provider
Injecting scoped services into a singleton providerregister the provider scoped, or use IServiceScopeFactory
Expecting envelope properties to appear in EventContext on handlersthey don't — they're metadata only
Using a provider for data a projection needsif the projection needs it, it belongs on the event type

Quality gate

  • [ ] Build is clean; provider is registered in DI (not just implemented).
  • [ ] No domain data hidden in cross-cutting properties — infrastructure metadata only.

See also

  • vertical-slices.md — event types, EventContext in reactors/reducers.
  • multi-tenancy — namespace-per-tenant isolation (a different mechanism from a tenant tag).

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/cratis/ai.distribution/cross-cutting-properties/badge)](https://verified-skill.com/skills/cratis/ai.distribution/cross-cutting-properties)

Something wrong with this skill or its page? Tell us.