From superpowers-laravel
Wraps multi-write operations in Laravel DB transactions; applies dispatchAfterCommit, idempotency, and lockForUpdate for atomicity and consistency. Useful for safe retries and coordinated updates.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-laravel:transactions-and-consistencyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Ensure multi-step changes are atomic; make retries safe.
Ensure multi-step changes are atomic; make retries safe.
DB::transaction(function () use ($order, $payload) {
$order->update([...]);
$order->items()->createMany($payload['items']);
OrderUpdated::dispatch($order); // or flag for after-commit
});
// Listener queued after commit
class SendInvoice implements ShouldQueue {
public $afterCommit = true;
}
DB::transaction to wrap write sequences and related side-effects$afterCommit or dispatchAfterCommit() for events / jobslockForUpdate() for row-level coordination when needednpx claudepluginhub jpcaparas/superpowers-laravel --plugin superpowers-laravelProvides Laravel queue best practices: job structure, dispatch patterns, middleware, chaining, batching, retries, and error handling. Useful for reliable async task processing.
Executes atomic database operations with Prisma $transaction, including sequential, interactive, nested writes, isolation levels, and timeouts.
Provides knowledge base on consistency patterns including strong vs eventual consistency, idempotency keys, optimistic/pessimistic locking, conflict resolution, and sagas for auditing distributed PHP applications.