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.
In this repository37 other files it gives its agents.
- global-instructions/AGENTS.mdAGENTS.md
- api-contract-safetySkill
- api-endpoint-deprecationSkill
- aspnet-core-api-developmentSkill
- background-services-dotnetSkill
- bug-investigationSkill
- code-qualitySkill
- code-reviewSkill
- context-resetSkill
- dependency-managementSkill
- deployment-readiness-dotnetSkill
- diff-reviewSkill
- distributed-workflowsSkill
- dotnet-architectureSkill
- dotnet-implementationSkill
- dotnet-securitySkill
- ef-core-safetySkill
- exception-handlingSkill
- git-workflowSkill
- google-bigquery-dotnetSkill
- google-firestore-dotnetSkill
- http-client-integrationsSkill
- integration-testing-dotnetSkill
- observability-dotnetSkill
- performance-diagnostics-dotnetSkill
- poc-developmentSkill
- production-debuggingSkill
- production-hotfixSkill
- production-loggingSkill
- redis-dotnetSkill
- relational-database-dotnetSkill
- retry-resilienceSkill
- safe-terminalSkill
- shared-code-impactSkill
- targeted-validationSkill
- task-routerSkill
- unit-testingSkill
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
- Very specific: line 8
Follow the repository's integration abstractions and the installed Google.Cloud.PubSub.V1 version.
- Very specific: line 19
Use platform/client retry behavior unless the application has an explicit, idempotent retry policy.
- Distinctive: line 28
Use structured logs and traces with message ID, ordering key, subscription, attempt/outcome, and correlation identifiers where safe.
- Distinctive: line 29
Use Application Default Credentials or workload/service identities in deployed environments.
- Distinctive: line 31
Test publish completion/failure, bounded producer flow, shutdown flushing, successful ack, retryable nack/redelivery, duplicate delivery, …
- Distinctive: line 33
Read references/client-patterns.md when choosing client type, configuring a hosted subscriber, or tuning publisher/subscriber flow control …
≈ “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.
Files
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
PublishAsyncin an arbitrary retry loop.
Subscribers
- Return
Ackonly after the operation has reached the intended durable success state. ReturnNackor 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.
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
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.

