Agent skill · software engineering · sickn33
azure-cosmos-db-py
Build production-grade Azure Cosmos DB NoSQL services following clean code, security best practices, and TDD principles.
Why this skill is useful
Provides specific implementation patterns and authentication methods for Azure Cosmos DB that the AI wouldn't reliably generate on its own.
What it needs
Requires azure-cosmos, azure-identity installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 44,571 stars on the source repository.
What this skill does
Bundled upstream support Supporting files are included at skill-relative paths. See UPSTREAM-NOTICE.md for their pinned sources, licenses, hashes, and import changes. Restored helper safety The integration fixture in assets/conftesttemplate.py connects to the configured Cosmos endpoint; cleanuptestdocs deletes records explicitly added to its tracking list. Use only an isolated disposable test container with test-only records, never production data. Copying the template does not connect to Cosmos. Cosmos DB Service Implementation Build production-grade Azure Cosmos DB NoSQL services following clean code, security best practices, and TDD principles. Installation Environment Variables Authentication DefaultAzureCredential (preferred): Emulator (local development): Architecture Overview Quick Start 1. Client Module Setup Create a singleton Cosmos client with dual authentication: Full implementation: See references/client-setup.md 2. Pydantic Model Hierarchy Use five-tier model pattern for clean separation: 3. Service Layer Pattern Full patterns: See references/service-layer.md Core Principles Security Requirements 1. RBAC Authentication: Use DefaultAzureCredential in Azure — never store keys in code 2. Emulator-Only Keys: Hardcode the well-known emulator key only for local development 3. Parameterized Queries: Always use @parameter syntax — never string concatenation 4. Partition Key Validation: Validate partition key access matches user authorization Clean Code Conventions 1. Single Responsibility: Client module handles connection; services handle business logic 2. Graceful Degradation: Services return None/[] when Cosmos unavailable 3. Consistent Naming: doctomodel(), modeltodoc(), usecosmos() 4. Type Hints: Full typing on all public methods 5. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills sickn33/azure-cosmos-db-py--07b5e4