agentleFS
mag1artmag1art/skills/dotnet-messaging/SKILL.md

dotnet-messaging

Skill1 starsChanged 3 months agoApache-2.0View on GitHub

Use for reliable asynchronous messaging and RabbitMQ integration in C#/.NET microservices.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use for RabbitMQ publishers, consumers, background workers, retries, dead-letter queues, delivery guarantees, and message-driven …

    line 26
  2. Distinctive:

    Do not claim exactly-once delivery without proving complete system semantics.

    line 30
  3. Distinctive:

    Use bounded prefetch and bounded local concurrency.

    line 41
  4. Distinctive:

    Add cancellation and graceful shutdown.

    line 42
  5. Distinctive:

    Use an outbox when database and publication must be consistent.

    line 49
  6. Distinctive:

    Test duplicate delivery, ordering assumptions, cancellation, broker reconnect, publish confirmation, nack/requeue, dead-lettering, schema …

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

.NET Messaging

When to Use

Use for RabbitMQ publishers, consumers, background workers, retries, dead-letter queues, delivery guarantees, and message-driven microservices.

When Not to Use

Do not claim exactly-once delivery without proving complete system semantics. Do not acknowledge before durable processing succeeds.

Delivery Model

Assume at-least-once delivery. Design handlers to be idempotent using a message ID, business key, inbox table, or equivalent deduplication mechanism.

Consumer Rules

  • Use explicit acknowledgements.
  • Ack only after the business side effect and required persistence complete.
  • Nack transient failures for controlled requeue; dead-letter poison messages.
  • Use bounded prefetch and bounded local concurrency.
  • Add cancellation and graceful shutdown.
  • Propagate correlation and causation IDs in message headers.
  • Make retry count and dead-letter routing observable.
  • Version schemas and preserve backward compatibility.

Reliability Patterns

Use an outbox when database and publication must be consistent. Use an inbox/idempotency record when duplicate delivery can repeat side effects. Make retries finite, delayed, and distinguish transient from permanent errors.

Quality Gate

Test duplicate delivery, ordering assumptions, cancellation, broker reconnect, publish confirmation, nack/requeue, dead-lettering, schema evolution, and shutdown.

Example: Ack After the Side Effect

await foreach (var delivery in consumer.ReadAllAsync(ct))
{
    try
    {
        if (await inbox.IsProcessedAsync(delivery.MessageId, ct))
        {
            await consumer.AckAsync(delivery, ct);
            continue;
        }

        await handler.HandleAsync(delivery.Payload, ct);
        await inbox.MarkProcessedAsync(delivery.MessageId, ct);
        await consumer.AckAsync(delivery, ct);
    }
    catch (TransientMessageException) when (!ct.IsCancellationRequested)
    {
        await consumer.NackAsync(delivery, requeue: true, ct);
    }
    catch (Exception ex) when (!ct.IsCancellationRequested)
    {
        logger.LogError(ex, "Message processing failed {MessageId}", delivery.MessageId);
        await consumer.DeadLetterAsync(delivery, ct);
    }
}

The abstraction hides RabbitMQ client details, but the ordering is intentional: idempotency check, business side effect, processed marker, then acknowledgement. Make the inbox/outbox transaction strategy explicit for the selected database.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.