cratis-chronicle-event-constraints

cratis-chronicle-event-constraints is a skill for Claude Code, Codex from Cratis/AI. It costs 81 tokens per session (2,571 once invoked), scanned A, original, MIT.

A guide to enforcing uniqueness rules when events are appended to the Chronicle event store. The rule is checked inside the append operation, so competing requests cannot both pass a separate, possibly outdated pre-check.

In plain words
What is it for?
Use it for uniqueness or other state-dependent rules that must hold at event storage time. It also covers specifying the resulting constraint violation in a test.
Why use it?
A command-side check can become stale while another request is writing. An append-time constraint keeps the rule valid when requests race.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for uniqueness or other state-dependent rules that must hold at event storage time. It also covers specifying the resulting constraint violation in a test.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cratis/ai/cratis-chronicle-event-constraints
View source ↗ Cratis/AI
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Cratis/AI --skill cratis-chronicle-event-constraints
Clone the repo
git clone --depth 1 https://github.com/Cratis/AI

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cratis-chronicle-event-constraints

README.md
[![agentmods](https://agentmods.dev/badge/skills/cratis/ai/cratis-chronicle-event-constraints/github.svg)](https://agentmods.dev/skills/cratis/ai/cratis-chronicle-event-constraints)
Your own site
<a href="https://agentmods.dev/skills/cratis/ai/cratis-chronicle-event-constraints"><img src="https://agentmods.dev/badge/skills/cratis/ai/cratis-chronicle-event-constraints/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cratis-chronicle-event-constraints

Your own site · 80×15
<a href="https://agentmods.dev/skills/cratis/ai/cratis-chronicle-event-constraints"><img src="https://agentmods.dev/badge/skills/cratis/ai/cratis-chronicle-event-constraints.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,571 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.02571
Opus 5 $0.00041 $0.01286
Sonnet 5 $0.00016 $0.00514
Haiku 4.5 $0.00008 $0.00257

Measured yesterday against content hash a920ee671ba2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

cratis-chronicle-event-constraints scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/cratis-chronicle-event-constraints/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Chronicle event constraints

A constraint is an append-time invariant. Chronicle evaluates it inside the append, against the event store's own index — so it is the only mechanism that holds when two requests race. A command-side pre-check reads state that may already be stale by the time the append lands; a constraint cannot be.

Constraints are discovered automatically. There is no registration call.

Verified product sources

Package Version Purpose
Cratis.Chronicle (client) 16.45.2 [Unique], [RemoveConstraint], IConstraint, IConstraintBuilder, IUniqueConstraintBuilder, ConstraintViolation, IAppendResult
Cratis.Chronicle code analysis 16.45.2 CHR0017, CHR0018, CHR0020
Cratis.Chronicle.Testing 16.45.2 EventScenario and the IAppendResult Should* assertions

Reverify against the Chronicle repository before claiming support for another version. Never translate an attribute argument order or an assertion name from memory.

Route near misses

  • The rule rejects command input — a range, a format, a cross-field condition: use cratis-arc-command-validation.
  • The rule is state-dependent and belongs in the handler under concurrency (the DCB pattern): also cratis-arc-command-validation.
  • You are creating or changing a read model that the rule reads: use cratis-chronicle-read-model.
  • You are writing the specification and want the EventScenario mechanics in depth: use cratis-chronicle-event-specifications.

Step 1 — Pick the mechanism

Situation Use
One event of this type per event source class-level [Unique] on the event type
A property value unique across event sources property-level [Unique] on that property
Release a claimed value when something is removed [RemoveConstraint("name")] on the removal event
The same value must be unique across several event types IConstraint with one [Unique(name: …)] name, or a fluent Unique(…)
Case-insensitive matching, composite keys, or a scoped constraint IConstraint

Read the full file on GitHub · 228 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 228 lines · 81 tokens per session scan A a920ee671ba2

Subscribe to this mod's changes

cratis-chronicle-event-constraints is a skill published in the GitHub repository Cratis/AI (2 stars, last pushed yesterday), licensed MIT. It adds 81 tokens to every session and 2,571 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.

Related

Other skills, from other repositories

author-test

Generate a test given sample. Parameters: C# SDK repository root; Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; the sample to use as a starting point for the test.

Azure/azure-sdk-for-net · 68 tokens

crap-score

Calculates CRAP (Change Risk Anti-Patterns) for a named .NET method, class, or file. USE FOR: explicit CRAP calculation or coverage-and-complexity risk within that named target, including which tests to prioritize. DO NOT USE FOR: project-wide coverage/CRAP, plateaus, or project-wide blockers/priorities…

managedcode/dotnet-skills · 99 tokens

nunit

Write, run, or repair .NET tests that use NUnit. Use when a repo uses NUnit, [Test], [TestCase], [TestFixture], or NUnit3TestAdapter for VSTest or Microsoft.Testing.Platform execution. USE FOR: writing or reviewing NUnit tests; using [Test], [TestCase], [TestFixture], [SetUp], [TearDown] attributes; configuring…

managedcode/dotnet-skills · 146 tokens

maui-unit-testing

Add MAUI app tests around ViewModels, services, platform abstractions, and unit/integration/device boundaries. USE FOR: xUnit, avoiding MauiProgram.CreateMauiApp in unit tests, fakes/mocks, injectable Essentials interfaces, PlatformNotSupportedException, navigation/data services, AppProjectReference, device-test…

dotnet/maui-labs · 84 tokens

coverlet

Use the open-source free coverlet toolchain for .NET code coverage. Use when a repo needs line and branch coverage, collector versus MSBuild driver selection, or CI-safe coverage commands. USE FOR: coverlet setup; CI line or branch coverage; choosing between collector and MSBuild drivers. DO NOT USE FOR: coverage…

managedcode/dotnet-skills · 114 tokens

netarchtest

Use the open-source free NetArchTest.Rules library for architecture rules in .NET unit tests. Use when a repo wants lightweight, fluent architecture assertions for namespaces, dependencies, or layering. USE FOR: the repo uses or wants NetArchTest.Rules; architecture rules should be enforced in automated tests. DO NOT…

managedcode/dotnet-skills · 112 tokens