/acc:create-correlation-contextfrom acc
Generates Correlation ID propagation components for PHP 8.4 including PSR-15 middleware, Monolog processor, and message bus stamps for distributed tracing.
Ships in acc. 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.
Read when SKILL.md points to them.
Creates Correlation ID propagation infrastructure for distributed PHP applications.
| Component | Layer | Path | Purpose |
|---|---|---|---|
CorrelationId | Domain/Shared | src/Domain/Shared/Correlation/CorrelationId.php | UUID-based Value Object |
CorrelationContext | Domain/Shared | src/Domain/Shared/Correlation/CorrelationContext.php | Immutable context holder |
CorrelationContextMiddleware | Presentation | src/Presentation/Middleware/CorrelationContextMiddleware.php | PSR-15 middleware |
CorrelationLogProcessor | Infrastructure | src/Infrastructure/Logging/CorrelationLogProcessor.php | Monolog processor |
CorrelationMessageStamp | Infrastructure | src/Infrastructure/Messaging/CorrelationMessageStamp.php | Message bus stamp |
| Unit tests | Tests | tests/Unit/... | Tests for all components |
final readonly class in Domain layergenerate()Stringable and JsonSerializableequals() methodcorrelationId, causationId, optional userIdcreate() generates new correlation IDfromRequest() extracts from PSR-7 request headerswithCausationId(), withUserId()X-Correlation-ID header from incoming request (or generates new UUID)X-Causation-ID if presentCorrelationContext as request attributeX-Correlation-ID to response headersProcessorInterfacecorrelation_id, causation_id to every log record extra fieldCorrelationContextHolder (request-scoped)StampInterface (or custom stamp interface)correlationId and causationId through message busPath: src/Domain/Shared/Correlation/
CorrelationId.php -- UUID-based Value ObjectCorrelationContext.php -- Immutable context holderUse templates from references/templates.md (Domain section).
Path: src/Presentation/Middleware/
CorrelationContextMiddleware.php -- PSR-15 middlewareUse templates from references/templates.md (Presentation section).
Path: src/Infrastructure/Logging/ and src/Infrastructure/Messaging/
CorrelationLogProcessor.php -- Monolog processorCorrelationMessageStamp.php -- Message bus stampUse templates from references/templates.md (Infrastructure section).
Path: tests/Unit/Domain/Shared/Correlation/ and tests/Unit/Presentation/Middleware/ and tests/Unit/Infrastructure/
CorrelationIdTest.phpCorrelationContextTest.phpCorrelationContextMiddlewareTest.phpCorrelationLogProcessorTest.phpUse templates from references/templates.md (Tests section).
| Component | Default Path |
|---|---|
| CorrelationId | src/Domain/Shared/Correlation/CorrelationId.php |
| CorrelationContext | src/Domain/Shared/Correlation/CorrelationContext.php |
| Middleware | src/Presentation/Middleware/CorrelationContextMiddleware.php |
| Log Processor | src/Infrastructure/Logging/CorrelationLogProcessor.php |
| Message Stamp | src/Infrastructure/Messaging/CorrelationMessageStamp.php |
| Tests | tests/Unit/{layer}/...Test.php |
Adapt paths to match existing project structure detected via:
Glob: src/Domain/**/*.php
Glob: src/Presentation/**/*.php
Glob: src/Infrastructure/**/*.php
final readonly class CorrelationId implements \Stringable, \JsonSerializable
{
public function __construct(public string $value) {}
public static function generate(): self { /* UUID v4 */ }
public function equals(self $other): bool { /* comparison */ }
}
final readonly class CorrelationContext
{
public function __construct(
public CorrelationId $correlationId,
public ?string $causationId = null,
public ?string $userId = null,
) {}
public static function create(): self { /* new with generated ID */ }
public static function fromRequest(ServerRequestInterface $request): self { /* extract headers */ }
}
final readonly class CorrelationContextMiddleware implements MiddlewareInterface
{
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$context = CorrelationContext::fromRequest($request);
$request = $request->withAttribute(CorrelationContext::class, $context);
$response = $handler->handle($request);
return $response->withHeader('X-Correlation-ID', $context->correlationId->value);
}
}
See references/templates.md for complete implementations and references/examples.md for integration examples.
$app->add(new CorrelationContextMiddleware());
return [
CorrelationContextMiddleware::class => autowire(),
CorrelationLogProcessor::class => autowire(),
];
$context = $request->getAttribute(CorrelationContext::class);
$this->logger->info('Processing order', ['orderId' => $orderId]);
// Log automatically includes correlation_id via processor
See references/examples.md for Symfony, Laravel, and message bus integration.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub dykyi-roman/awesome-claude-code --plugin acc283 skills in this plugin
/access-control-knowledgeAccess Control knowledge base. Provides ACL, RBAC, ABAC, ReBAC models, multi-tenancy patterns, and PHP implementations (Symfony Voters, Laravel Gates) for security audits and generation./adr-knowledgeAction-Domain-Responder pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for ADR (web-specific MVC alternative) audits./adr-templateGenerates Architecture Decision Records (ADR) for PHP projects. Creates structured decision documentation with context, decision, and consequences./analyze-ci-configAnalyzes existing CI/CD configurations. Detects issues in GitHub Actions and GitLab CI files, checks for best practices, caching efficiency, and security concerns./analyze-ci-logsAnalyzes CI/CD pipeline logs to identify failure causes. Parses error messages, detects common failure patterns, and provides fix recommendations./analyze-coupling-cohesionAnalyzes coupling and cohesion metrics in PHP codebases. Calculates Afferent/Efferent coupling (Ca/Ce), LCOM metrics, instability index, and abstractness. Identifies highly coupled modules and low cohesion classes.Other plugins' skills for the same job