go-cms-events-jobs

Implements domain events, transactional outbox, and background job processing for Go CMS.

Updated Jun 15, 2026
One-click install
npx skills add https://github.com/vernal96/go-cms --skill go-cms-events-jobs-vernal96
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: go-cms-events-jobs
Source: https://github.com/vernal96/go-cms/tree/main/.codex/skills/go-cms-events-jobs
Command: npx skills add https://github.com/vernal96/go-cms --skill go-cms-events-jobs-vernal96

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Business mutations in a Go CMS often need to trigger follow-up work like search reindexing, mail sending, or media processing, but publishing events directly after a database commit risks losing messages or publishing events for rolled-back transactions. ## Core Features & Use Cases - Transactional Outbox Pattern: Records event messages in the same database transaction as the business mutation so nothing is lost between commit and broker publish. - Event and Job Separation: Defines clear rules distinguishing immutable domain events from imperative background jobs, with stable lower-case event names and versioned payload DTOs. - Reliable Publisher Lifecycle: Specifies batch claiming with locking (e.g., PostgreSQL FOR UPDATE SKIP LOCKED), retry state persistence, idempotent at-least-once delivery, and clean worker shutdown. - Use Case: When a resource update must trigger search reindexing after commit, the mutation and outbox row commit atomically, a publisher delivers the event through the existing EventBus, and an idempotent consumer performs the reindex safely even on duplicate delivery. ## Quick Start Ask the AI to implement a transactional outbox with a resource.updated domain event and a retrying publisher for the Go CMS backend following this skill's rules.

Frequently Asked Questions about go-cms-events-jobs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a transactional outbox in Go with PostgreSQL?▼

Insert the outbox message row in the same database transaction as the business mutation so both commit or roll back together. A background publisher then claims batches using FOR UPDATE SKIP LOCKED, publishes through the event bus, and marks rows published only after broker success.

What is the difference between a domain event and a background job?▼

A domain event is an immutable past-tense fact like resource.updated that already happened, while a job is an imperative unit of work like search.reindex_resource to execute. Producers emit events without knowing consumers; handlers may translate events into concrete jobs.

Does the transactional outbox guarantee exactly-once delivery?▼

No, the outbox pattern provides at-least-once delivery across PostgreSQL and Kafka or RabbitMQ. Consumers and jobs with externally visible side effects must be idempotent or deduplicate by stable message ID to handle duplicate delivery safely.

Why should I not publish to the event bus before the database commit?▼

Publishing before commit risks the broker message becoming visible even if the database transaction later rolls back, creating inconsistent state. The outbox row must commit atomically with the mutation, and only the publisher sends it to the broker afterward.

When should CMS work stay synchronous instead of becoming a background job?▼

Keep work synchronous when its failure would leave the primary business state invalid, such as validation, persistence, and revision history. Only secondary work like search indexing, mail, webhooks, or media transformations belongs in asynchronous handlers after commit.