/grain:grain-command-handlerfrom grain
Implements Grain command handlers with event emission and optimistic concurrency checks using defcommand, Cognitect anomalies, and CAS guards.
Ships in grain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use defcommand from ai.obney.grain.command-processor-v2.interface.
Put options before the docstring and [context]. Read inputs from :command and
pass the tenant-bearing context to read helpers. Supply :authorized? for HTTP
or Datastar access. Direct process-command calls bypass that predicate.
Return a Cognitect anomaly for a rejected command. Define each emitted type with
defevent. On success, return events built with ->event
in :command-result/events and caller-facing data in :command/result.
When concurrent commands could both pass admission, include a :command-result/cas
guard on the append. Select the event types and tags that determine the invariant.
Check the supplied events with a pure :predicate-fn using reduce. A false
predicate produces a conflict. Command example
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
grain, command-handler, event-sourcing, optimistic-concurrency
Generated from the plugin's indexed repository (obneyai/grain) — no native marketplace selected
npx claudepluginhub p/obneyai-grain18 skills in this plugin
/event-modelAuthor and validate Grain service topology, CQRS flows, registry declarations and links to Allium./event-model-distillRecover a Grain Event Model from existing code and live registries./event-model-elicitDiscover Grain service topology for a new feature or service area./event-model-propagateDerive Grain tests for registered topology, boot validation and Allium trace links./event-model-tendEdit an existing Grain Event Model when blocks, schemas, dependencies, flows or trace links change./event-model-weedDiagnose drift between a Grain Event Model, the live registries and linked Allium declarations.Other plugins' skills for the same job