agentleFS
dprakash2101dprakash2101/dotnet-production-agent-skills/skills/google-cloud-pubsub-dotnet/SKILL.md

google-cloud-pubsub-dotnet

Skill4 starsChanged 51 days agoMITView on GitHub

Use when implementing, modifying, reviewing, or troubleshooting Google Cloud Pub/Sub publishers, subscribers, pull workers, acknowledgements, concurrency, flow control, dead-letter handling, ordering, or BackgroundService integration in .NET.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Follow the repository's integration abstractions and the installed Google.Cloud.PubSub.V1 version.

    line 8
  2. Very specific:

    Use platform/client retry behavior unless the application has an explicit, idempotent retry policy.

    line 19
  3. Distinctive:

    Use structured logs and traces with message ID, ordering key, subscription, attempt/outcome, and correlation identifiers where safe.

    line 28
  4. Distinctive:

    Use Application Default Credentials or workload/service identities in deployed environments.

    line 29
  5. Distinctive:

    Test publish completion/failure, bounded producer flow, shutdown flushing, successful ack, retryable nack/redelivery, duplicate delivery, …

    line 31
  6. Distinctive:

    Read references/client-patterns.md when choosing client type, configuring a hosted subscriber, or tuning publisher/subscriber flow control …

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Google Cloud Pub/Sub for .NET

Follow the repository's integration abstractions and the installed Google.Cloud.PubSub.V1 version. Use PublisherClient/SubscriberClient for continuous high-throughput processing and lower-level service clients only when the hosting model or required control justifies them. Reuse expensive clients at the appropriate lifetime.

Bind project, topic, subscription, emulator, flow-control, and shutdown settings through the repository's configuration pattern. Validate required names and operational bounds at startup where practical; do not silently fall back to a production resource or accept unbounded defaults because configuration is missing.

Assume messages can be delivered more than once. Make handlers idempotent where repeated side effects matter, using a stable message/business key and durable deduplication when required. Do not rely on an in-memory flag across instances.

Publishers

  • Await and observe publish completion; a queued client-side publish is not yet durable success. Handle failed publishes and ambiguous outcomes without assuming a retry cannot duplicate a message.
  • Configure batching, publisher flow control, and ordering keys from latency, memory, ordering, and downstream requirements. Bound producer pressure rather than allowing unbounded queued work.
  • On graceful shutdown, stop accepting new messages and allow a bounded flush/disposal period. Surface messages that could not be published; do not report success before completion.
  • Use platform/client retry behavior unless the application has an explicit, idempotent retry policy. Do not wrap PublishAsync in an arbitrary retry loop.

Subscribers

  • Return Ack only after the operation has reached the intended durable success state. Return Nack or allow redelivery for retryable incomplete processing; distinguish permanent poison messages and configured dead-letter behavior.
  • Let the client manage acknowledgement deadline extension within deliberate bounds. Align maximum processing/extension and shutdown timeouts with actual work; do not acknowledge early merely to avoid redelivery.
  • Bound concurrency and outstanding bytes/messages using flow control based on downstream capacity. Do not create arbitrary application retry loops around semantics already supplied by Pub/Sub or its client.
  • In BackgroundService, keep the receive task observed, propagate shutdown, stop intake, allow bounded in-flight completion, and use a scope per unit of scoped work. Treat forced shutdown as potentially leaving unacknowledged work.
  • Classify transient dependency failures separately from invalid messages and permanent business outcomes. Ensure any explicit retries are bounded, cancelable, observable, and safe for duplicate execution.
  • Use structured logs and traces with message ID, ordering key, subscription, attempt/outcome, and correlation identifiers where safe. Do not log payloads, attributes containing secrets, or customer data by default.
  • Use Application Default Credentials or workload/service identities in deployed environments. Do not embed or commit service-account keys; preserve emulator and repository configuration conventions.

Test publish completion/failure, bounded producer flow, shutdown flushing, successful ack, retryable nack/redelivery, duplicate delivery, idempotency, cancellation, subscriber flow-control limits, and dead-letter/poison behavior as applicable.

Read references/client-patterns.md when choosing client type, configuring a hosted subscriber, or tuning publisher/subscriber flow control and shutdown.

Exercise crash boundaries around durable work and acknowledgment, and verify graceful shutdown with outstanding messages. Use an emulator or isolated test environment where appropriate.

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.