From db-cosmosdb
Use when writing or reviewing Azure Cosmos DB code — enforces partition key design, document modeling, RU estimation, TTL, change feed patterns, stored procedures (JavaScript), and cross-partition query avoidance
How this skill is triggered — by the user, by Claude, or both
Slash command
/db-cosmosdb:cosmosdb-codingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```json
// Multiple entity types in one container, discriminated by "type"
{ "id": "order-001", "type": "order", "customerId": "c1", "total": 100.00 }
{ "id": "item-001", "type": "orderItem", "orderId": "order-001", "customerId": "c1", "productName": "Widget" }
| Operation | Approximate RU Cost |
|---|---|
| Point read (1KB doc) | ~1 RU |
| Point read (10KB doc) | ~10 RU |
| Query (single partition, 10 results) | ~5-10 RU |
| Query (cross-partition, 10 results) | ~50-100 RU |
| Create (1KB doc) | ~5 RU |
| Replace (1KB doc) | ~10 RU |
| Delete (1KB doc) | ~5 RU |
// Container-level TTL (seconds)
{ "defaultTtl": 86400 }
// Document-level TTL override
{ "id": "session-001", "ttl": 3600 }
// Disable TTL for specific document
{ "id": "important-001", "ttl": -1 }
// Use change feed for:
// - Materialized views (denormalized read models)
// - Event-driven processing
// - Real-time analytics
// - Cross-container data synchronization
function bulkCreateItems(items) {
var context = getContext();
var container = context.getCollection();
var response = context.getResponse();
var created = 0;
if (!items || items.length === 0) {
response.setBody({ created: 0 });
return;
}
createNext(0);
function createNext(index) {
if (index >= items.length) {
response.setBody({ created: created });
return;
}
var accepted = container.createDocument(
container.getSelfLink(), items[index],
function(err, doc) {
if (err) throw new Error("Error: " + err.message);
created++;
createNext(index + 1);
});
if (!accepted) {
response.setBody({ created: created, continuation: true });
}
}
}
// Multi-level partition key for multi-tenant scenarios
var containerProperties = new ContainerProperties
{
Id = "orders",
PartitionKeyPaths = new Collection<string> { "/tenantId", "/customerId" }
};
try
{
var response = await container.ReplaceItemAsync(
order, order.Id,
new PartitionKey(order.CustomerId),
new ItemRequestOptions { IfMatchEtag = order.ETag });
}
catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.PreconditionFailed)
{
// Document was modified by another process — handle conflict
}
Guides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
npx claudepluginhub gagandeepp/software-agent-teams --plugin db-cosmosdb