From esdb
Write events to an EventSourcingDB instance. Use when the user wants to store, append, or publish events, optionally with preconditions such as optimistic locking or subject constraints.
npx claudepluginhub thenativeweb/claude-plugins --plugin esdbThis skill is limited to using the following tools:
Write one or more events to an EventSourcingDB instance.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Conducts multi-round deep research on GitHub repos via API and web searches, generating markdown reports with executive summaries, timelines, metrics, and Mermaid diagrams.
Dynamically discovers and combines enabled skills into cohesive, unexpected delightful experiences like interactive HTML or themed artifacts. Activates on 'surprise me', inspiration, or boredom cues.
Write one or more events to an EventSourcingDB instance.
Read configuration from environment variables:
echo "ESDB_URL: ${ESDB_URL:-http://localhost:3000}"
echo "ESDB_API_TOKEN: ${ESDB_API_TOKEN:-(not set)}"
ESDB_URL if set, otherwise default to http://localhost:3000.ESDB_API_TOKEN is not set, use AskUserQuestion to ask the user for the API token.curl -s -i -X POST \
-H "authorization: Bearer ${ESDB_API_TOKEN}" \
-H "content-type: application/json" \
-d '<REQUEST_BODY>' \
"${ESDB_URL:-http://localhost:3000}/api/v1/write-events"
{
"events": [
{
"source": "<source-url>",
"subject": "/<subject-path>",
"type": "<reverse.domain.event-type>",
"data": { ... }
}
],
"preconditions": [
{
"type": "<precondition-type>",
"payload": { ... }
}
]
}
The preconditions field is optional. Available precondition types:
isSubjectPristine – Subject must have no events yet.
{ "type": "isSubjectPristine", "payload": { "subject": "/books/42" } }
isSubjectPopulated – Subject must already have events.
{ "type": "isSubjectPopulated", "payload": { "subject": "/books/42" } }
isSubjectOnEventId – Optimistic locking: last event must match given ID.
{ "type": "isSubjectOnEventId", "payload": { "subject": "/books/42", "eventId": "0" } }
isEventQlQueryTrue – Custom condition via EventQL query.
{ "type": "isEventQlQueryTrue", "payload": { "query": "FROM e IN events WHERE e.data.title == 'Some Title' PROJECT INTO COUNT() == 0" } }
curl -s -i -X POST \
-H "authorization: Bearer ${ESDB_API_TOKEN}" \
-H "content-type: application/json" \
-d "{
\"events\": [
{
\"source\": \"https://example.com\",
\"subject\": \"/books/42\",
\"type\": \"io.example.book-acquired\",
\"data\": {
\"title\": \"2001 - A Space Odyssey\",
\"author\": \"Arthur C. Clarke\"
}
}
]
}" \
"${ESDB_URL:-http://localhost:3000}/api/v1/write-events"
The response is JSON containing an array of stored events.
A precondition failure returns HTTP 409 Conflict.
/ (e.g., /books/42, /readers/23).io.eventsourcingdb.library.book-acquired)."0", "42").