/grain:grain-read-modelfrom grain
Defines keyed Grain projections with point lookups, indexes, and pagination. Supports event-driven reducers, routing, and versioned schema migrations.
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.
(require '[ai.obney.grain.read-model-processor-v2.interface :as rmp])
(rmp/defreadmodel :inventory items
{:events #{:inventory/item-renamed}
:version 1
:key :id
:state-schema [:map [:name :string]]
:indexes {:name (rmp/order-key [:name])}}
"Latest name per item."
[item event]
(assoc item :name (:name event)))
(rmp/value context :inventory/items id)
(rmp/page context :inventory/items {:index :name :page 1 :limit 25})
Supply exactly one of :key and :route. With :key, the reducer receives one
instance’s state and the event. Use :route to emit zero or more [id input]
pairs. The reducer then receives each routed input.
Pass :tenant-id, :event-store and a started :cache in the context. Use
read-session when related reads must share a snapshot. Consume reducibles
inside its callback. Bump :version when changing what the model folds, stores
or indexes, and update its subscribers. Keyed read API
What SKILL.md sets; muted values are Claude Code's defaults
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