Agent skill

Outbox Pattern Knowledge

by dykyi-roman in dykyi-roman/awesome-claude-code

Outbox Pattern knowledge base. An agent skill from dykyi-roman/awesome-claude-code.

MITAuto-check passedKnowledge Management

Install Outbox Pattern Knowledge

skills CLI
$ npx skills add dykyi-roman/awesome-claude-code --skill outbox-pattern-knowledge -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dykyi-roman/awesome-claude-code outbox-pattern-knowledge --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/outbox-pattern-knowledge .claude/skills/outbox-pattern-knowledge && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
outbox-pattern-knowledge
GitHub stars
103
Token cost
~2.9k tokens
SKILL.md length
292 words
Files
5 (incl. references, assets)
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Outbox Pattern knowledge base. An agent skill from dykyi-roman/awesome-claude-code.

  • Tasks that involve Knowledge bases
  • SKILL.md covers Core Principles, Quick Checklists, PHP 8.4 Outbox Patterns and Common Violations Quick…, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Outbox Pattern Knowledge is an agent skill from dykyi-roman/awesome-claude-code. Outbox Pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for transactional outbox, polling publisher, and reliable messaging audits.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files and assets (for example `assets/report-template.md`, `references/antipatterns.md` and `references/outbox-patterns.md`).

It sits in Knowledge Management, covering Knowledge bases. It works with PHP. The repository describes itself as: PHP Architecture Toolkit for Claude Code (DDD, CQRS, Event Sourcing, Hexagonal, Clean Architecture, SOLID, GRASP, PSR, Design Patterns, Testing, Documentation, Code Review). The licence is MIT.

When your agent uses it

  • Tasks that involve Knowledge bases

Example prompts

  • “/outbox-pattern-knowledge”

What it can do on your machine

Read from SKILL.md and the folder at commit 7e1fea8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are php, bash and sql).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Outbox Pattern Knowledge loads about 2.9k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 48 tokens; SKILL.md has 292 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dykyi-roman/awesome-claude-code at commit 7e1fea8, republished under its MIT licence (© dykyi-roman). 292 words, ~2,924 tokens.

Download SKILL.mdSave it as .claude/skills/outbox-pattern-knowledge/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
outbox-pattern-knowledge
description
Outbox Pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for transactional outbox, polling publisher, and reliable messaging audits.

Outbox Pattern Knowledge Base

Quick reference for Transactional Outbox pattern and PHP implementation guidelines.

Core Principles

Transactional Outbox Overview
┌─────────────────────────────────────────────────────────────────────────┐
│                    TRANSACTIONAL OUTBOX PATTERN                          │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│   ┌──────────────────────────────────────────────────────────────────┐  │
│   │                    SINGLE TRANSACTION                             │  │
│   │  ┌──────────┐      ┌───────────────┐      ┌────────────────┐     │  │
│   │  │ Business │─────▶│ Domain Table  │      │ Outbox Table   │     │  │
│   │  │  Logic   │      │  (orders)     │      │ (outbox_msgs)  │     │  │
│   │  └──────────┘      └───────────────┘      └────────────────┘     │  │
│   │       │                   ▲                       ▲              │  │
│   │       └───────────────────┴───────────────────────┘              │  │
│   │                    COMMIT/ROLLBACK                               │  │
│   └──────────────────────────────────────────────────────────────────┘  │
│                                                                          │
│   ┌──────────────────┐                    ┌──────────────────────────┐  │
│   │ Message Relay    │───────────────────▶│ Message Broker           │  │
│   │ (Polling/CDC)    │   publish events   │ (RabbitMQ/Kafka)         │  │
│   └──────────────────┘                    └──────────────────────────┘  │
│           │                                                              │
│           ▼                                                              │
│   Marks messages as processed                                           │
│                                                                          │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│   Publishing Strategies:                                                 │
│   • Polling Publisher  - Periodic poll for unprocessed messages          │
│   • Transaction Log Tailing (CDC) - Debezium, Maxwell                   │
│   • Event Sourcing + Projections - Events = Outbox                      │
│                                                                          │
│   Guarantees:                                                            │
│   • At-least-once delivery                                              │
│   • No message loss on service crash                                    │
│   • Transactional consistency between data and events                   │
│                                                                          │
└─────────────────────────────────────────────────────────────────────────┘
Key Concepts
ConceptDescription
Outbox TableDatabase table storing pending messages within same transaction
Message RelayBackground process that publishes messages from outbox
Polling PublisherPeriodically queries outbox for unpublished messages
CDC (Change Data Capture)Streams database changes to message broker
Idempotency KeyUnique identifier for message deduplication
At-least-onceMessages delivered at least once (consumers must be idempotent)

Quick Checklists

Outbox Table Checklist
  • Messages inserted in same transaction as domain changes
  • Unique message ID for deduplication
  • Event type/name for routing
  • Payload serialized as JSON
  • Created timestamp
  • Processed/Published flag or timestamp
  • Aggregate ID for correlation
  • Retry count for failure tracking
Message Relay Checklist
  • Runs as separate process/cron
  • Polls with configurable interval
  • Batch processing for efficiency
  • Marks messages as processed after publish
  • Handles publish failures with retry
  • Dead letter handling for poison messages
  • Ordering guarantees per aggregate (if needed)
Consumer Checklist
  • Idempotent processing (check message ID)
  • Handles duplicate messages gracefully
  • Stores processed message IDs
  • Acknowledges only after successful processing

PHP 8.4 Outbox Patterns

OutboxMessage Entity
php
<?php

declare(strict_types=1);

namespace Domain\Shared\Outbox;

final readonly class OutboxMessage
{
    public function __construct(
        public string $id,
        public string $aggregateType,
        public string $aggregateId,
        public string $eventType,
        public string $payload,
        public \DateTimeImmutable $createdAt,
        public ?string $correlationId = null,
        public ?\DateTimeImmutable $processedAt = null,
        public int $retryCount = 0
    ) {}

    public function isProcessed(): bool
    {
        return $this->processedAt !== null;
    }

    public function withProcessed(\DateTimeImmutable $at): self
    {
        return new self(
            $this->id,
            $this->aggregateType,
            $this->aggregateId,
            $this->eventType,
            $this->payload,
            $this->createdAt,
            $this->correlationId,
            $at,
            $this->retryCount
        );
    }

    public function withRetry(): self
    {
        return new self(
            $this->id,
            $this->aggregateType,
            $this->aggregateId,
            $this->eventType,
            $this->payload,
            $this->createdAt,
            $this->correlationId,
            $this->processedAt,
            $this->retryCount + 1
        );
    }
}
OutboxRepository Interface (Domain)
php
<?php

declare(strict_types=1);

namespace Domain\Shared\Outbox;

interface OutboxRepositoryInterface
{
    public function save(OutboxMessage $message): void;

    /** @param array<OutboxMessage> $messages */
    public function saveAll(array $messages): void;

    /** @return array<OutboxMessage> */
    public function findUnprocessed(int $limit = 100): array;

    public function markAsProcessed(string $id, \DateTimeImmutable $at): void;

    public function incrementRetry(string $id): void;

    public function delete(string $id): void;
}
Outbox Publisher Service
php
<?php

declare(strict_types=1);

namespace Application\Shared\Outbox;

use Domain\Shared\Outbox\OutboxMessage;
use Domain\Shared\Outbox\OutboxRepositoryInterface;

final readonly class OutboxPublisher
{
    public function __construct(
        private OutboxRepositoryInterface $outbox,
        private EventPublisherInterface $publisher,
        private int $maxRetries = 3
    ) {}

    public function processOutbox(int $batchSize = 100): int
    {
        $messages = $this->outbox->findUnprocessed($batchSize);
        $processed = 0;

        foreach ($messages as $message) {
            try {
                $this->publisher->publish(
                    $message->eventType,
                    $message->payload,
                    $message->correlationId
                );
                $this->outbox->markAsProcessed(
                    $message->id,
                    new \DateTimeImmutable()
                );
                $processed++;
            } catch (\Throwable $e) {
                $this->handleFailure($message, $e);
            }
        }

        return $processed;
    }

    private function handleFailure(OutboxMessage $message, \Throwable $e): void
    {
        if ($message->retryCount >= $this->maxRetries) {
            // Move to dead letter / log critical
            $this->outbox->delete($message->id);
            return;
        }
        $this->outbox->incrementRetry($message->id);
    }
}
Transactional Event Dispatch
php
<?php

declare(strict_types=1);

namespace Application\Order\UseCase;

use Domain\Order\OrderRepositoryInterface;
use Domain\Shared\Outbox\OutboxRepositoryInterface;
use Domain\Shared\Outbox\OutboxMessage;

final readonly class PlaceOrderUseCase
{
    public function __construct(
        private OrderRepositoryInterface $orders,
        private OutboxRepositoryInterface $outbox,
        private TransactionInterface $transaction
    ) {}

    public function execute(PlaceOrderCommand $command): OrderId
    {
        return $this->transaction->execute(function () use ($command): OrderId {
            $order = Order::place(
                OrderId::generate(),
                CustomerId::fromString($command->customerId),
                $command->items
            );

            $this->orders->save($order);

            // Store event in outbox within same transaction
            foreach ($order->releaseEvents() as $event) {
                $this->outbox->save(new OutboxMessage(
                    id: $event->eventId,
                    aggregateType: 'Order',
                    aggregateId: $order->id()->toString(),
                    eventType: $event->eventName(),
                    payload: json_encode($event->toArray()),
                    createdAt: $event->occurredAt,
                    correlationId: $command->correlationId
                ));
            }

            return $order->id();
        });
    }
}

Common Violations Quick Reference

ViolationWhere to LookSeverity
Publish before commitEvent published without outboxCritical
No idempotency keyOutboxMessage without unique IDCritical
Two-phase commitDistributed transaction attemptCritical
Missing retry logicNo retry count in outboxWarning
No dead letter handlingFailed messages lostWarning
Unbounded pollingNo limit on batch sizeWarning
Synchronous publish in transactionHTTP call in DB transactionCritical

Detection Patterns

bash
# Find outbox implementations
Glob: **/Outbox/**/*.php
Glob: **/outbox*.php
Grep: "outbox|OutboxMessage|OutboxRepository" --glob "**/*.php"

# Check for proper transactional outbox
Grep: "->save.*->outbox|outbox.*transaction" --glob "**/UseCase/**/*.php"

# Detect anti-patterns: publishing in transaction
Grep: "transaction.*publish|->publish\(.*\)->commit" --glob "**/*.php"

# Find message relay/processor
Grep: "findUnprocessed|processOutbox|OutboxProcessor" --glob "**/*.php"

# Check for idempotency handling
Grep: "messageId|eventId|idempotencyKey" --glob "**/Consumer/**/*.php"

# Find Doctrine outbox table
Grep: "outbox_messages|OutboxMessage.*Entity" --glob "**/Infrastructure/**/*.php"

Database Schema Example

sql
CREATE TABLE outbox_messages (
    id UUID PRIMARY KEY,
    aggregate_type VARCHAR(255) NOT NULL,
    aggregate_id VARCHAR(255) NOT NULL,
    event_type VARCHAR(255) NOT NULL,
    payload JSONB NOT NULL,
    correlation_id VARCHAR(255),
    created_at TIMESTAMP NOT NULL DEFAULT NOW(),
    processed_at TIMESTAMP NULL,
    retry_count INT NOT NULL DEFAULT 0,
    INDEX idx_unprocessed (processed_at, created_at)
);

References

For detailed information, load these reference files:

  • references/outbox-patterns.md — Implementation strategies and patterns
  • references/antipatterns.md — Common violations with detection patterns
  • references/php-specific.md — PHP 8.4 specific implementations

Assets

  • assets/report-template.md — Structured audit report template

© dykyi-roman, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references, assets) in skills/outbox-pattern-knowledge of dykyi-roman/awesome-claude-code.

  • SKILL.md
  • assets/report-template.md
  • references/antipatterns.md
  • references/outbox-patterns.md
  • references/php-specific.md

Open the folder on GitHubat commit 7e1fea8

Compare with similar skills

Outbox Pattern Knowledge next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Outbox Pattern Knowledge compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Outbox Pattern Knowledge this skilldykyi-roman/awesome-claude-code103—~2.9kAutomated safety check: PassMIT
Capture Conversationoutline/outline41k—~474Automated safety check: PassCustom licence
Project CairniBlinkQ/project-cairn2352 repos~861Automated safety check: PassMIT
LLM Wiki Knowledge GraphEgonex-AI/Understand-Anything86k1 repos~1.5kAutomated safety check: PassMIT
Find And Citeoutline/outline41k—~537Automated safety check: PassCustom licence
Xhs Virtual Productchenjin-cmd/xhs-virtual-product727—~862Automated safety check: PassMIT

Similar skills

  • Capture Conversation

    outline/outline

    Save the current conversation, a decision, or a set of notes as a document in an Outline collection; use when the user wants to keep what was discussed in their knowledge base.

    41k GitHub stars~474 tokensUpdated today
    Knowledge ManagementAuto-check passed
  • Project Cairn

    iBlinkQ/project-cairn

    Standardize how an AI-collaboration project turns work into reusable knowledge.

    235 GitHub starsUsed in 2 repos~861 tokens
    Knowledge ManagementAuto-check passed
  • LLM Wiki Knowledge Graph

    Egonex-AI/Understand-Anything

    Detects a Karpathy-pattern LLM wiki and builds an interactive knowledge graph with entities, implicit relationships and topic clusters.

    86k GitHub starsUsed in 1 repo~1.5k tokens
    Knowledge ManagementAuto-check passed
  • Find And Cite

    outline/outline

    Answer questions from the Outline knowledge base with quotes and links to the source documents; use when the user asks what the team knows, documented, or decided about a topic.

    41k GitHub stars~537 tokensUpdated today
    Knowledge ManagementAuto-check passed
  • Xhs Virtual Product

    chenjin-cmd/xhs-virtual-product

    This skill helps plan, select, produce, and market Xiaohongshu (RED) virtual/digital products — templates, knowledge bases, test tools, study materials.

    727 GitHub stars~862 tokensUpdated 8 days ago
    Knowledge ManagementAuto-check passed
  • Openkb

    VectifyAI/OpenKB

    A skill your agent uses when the user asks about content in their OpenKB knowledge base — research topics, concepts compiled from their documents, cross-document synthesis — or mentions openkb, an…

    4.7k GitHub starsUsed in 1 repo~2k tokens
    Knowledge ManagementAuto-check: warnings

More from dykyi-roman/awesome-claude-code

All 11 skills in this repo
  • Grasp Knowledge

    dykyi-roman/awesome-claude-code

    GRASP principles knowledge base for PHP 8.4 projects. An agent skill from dykyi-roman/awesome-claude-code.

    103 GitHub stars~1.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Psr Autoloading Knowledge

    dykyi-roman/awesome-claude-code

    PSR-4 autoloading standard knowledge base for PHP 8.4 projects.

    103 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Psr Coding Style Knowledge

    dykyi-roman/awesome-claude-code

    PSR-1 and PSR-12 coding standards knowledge base for PHP 8.4 projects.

    103 GitHub stars~2.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Psr Overview Knowledge

    dykyi-roman/awesome-claude-code

    PHP Standards Recommendations (PSR) overview knowledge base.

    103 GitHub stars~2.7k tokensUpdated 1 mo ago
    Auto-check passed
  • Solid Knowledge

    dykyi-roman/awesome-claude-code

    SOLID principles knowledge base for PHP 8.4 projects. An agent skill from dykyi-roman/awesome-claude-code.

    103 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Claude Code Knowledge

    dykyi-roman/awesome-claude-code

    Comprehensive knowledge base for Claude Code formats, patterns, and configuration.

    103 GitHub stars~4k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Outbox Pattern Knowledge

What does Outbox Pattern Knowledge do?

Outbox Pattern knowledge base. An agent skill from dykyi-roman/awesome-claude-code. Outbox Pattern Knowledge is an agent skill from dykyi-roman/awesome-claude-code. Outbox Pattern knowledge base.

When should I use Outbox Pattern Knowledge?

Outbox Pattern Knowledge fits situations like: tasks that involve Knowledge bases.

How do I install Outbox Pattern Knowledge in Claude Code?

Run `npx skills add dykyi-roman/awesome-claude-code --skill outbox-pattern-knowledge -a claude-code`. Or copy the skill folder (skills/outbox-pattern-knowledge in dykyi-roman/awesome-claude-code) into .claude/skills/outbox-pattern-knowledge in your project. Claude Code loads it when a task matches its description.

How do I install Outbox Pattern Knowledge in Codex?

Run `npx skills add dykyi-roman/awesome-claude-code --skill outbox-pattern-knowledge -a codex`. Or copy the skill folder (skills/outbox-pattern-knowledge in dykyi-roman/awesome-claude-code) into .agents/skills/outbox-pattern-knowledge in your project. Codex loads it when a task matches its description.

Can I use Outbox Pattern Knowledge in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dykyi-roman/awesome-claude-code --skill outbox-pattern-knowledge -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/outbox-pattern-knowledge, .gemini/skills/outbox-pattern-knowledge, .github/skills/outbox-pattern-knowledge and .opencode/skills/outbox-pattern-knowledge in your project.

What does Outbox Pattern Knowledge need to run?

SKILL.md names no scripts, command-line tools or credentials: Outbox Pattern Knowledge is instructions for the agent only.

Does Outbox Pattern Knowledge access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Outbox Pattern Knowledge safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Outbox Pattern Knowledge use?

Outbox Pattern Knowledge is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Outbox Pattern Knowledge use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.2k tokens, read only when the agent opens those files.

What are the alternatives to Outbox Pattern Knowledge?

Skills that share tags, products or a category with Outbox Pattern Knowledge: Capture Conversation (outline/outline, 41k stars), Project Cairn (iBlinkQ/project-cairn, 235 stars), LLM Wiki Knowledge Graph (Egonex-AI/Understand-Anything, 86k stars) and Find And Cite (outline/outline, 41k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Outbox Pattern Knowledge?

dykyi-roman (a GitHub user) maintains it in dykyi-roman/awesome-claude-code, which has 103 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on August 16, 2026.

Source: dykyi-roman/awesome-claude-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.