cosmosdb-datamodeling

cosmosdb-datamodeling is a skill for Claude Code, Codex from boshi-xixixi/TraeSkill. It costs 62 tokens per session (10,203 once invoked), scanned A, original, MIT.

A step-by-step guide for designing data models in Azure Cosmos DB, Microsoft's cloud database that stores NoSQL data rather than traditional table-based records.

In plain words
What is it for?
It is for gathering requirements and creating Cosmos DB NoSQL model documents, including designs for workloads with very high write rates or large batches of data.
Why use it?
It turns application requirements and expected access patterns into documented database designs. It also prompts for scale, concurrency, and high-volume write considerations that are easy to overlook.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument; installed under .agents/ (shared by several agents).

Good fit It is for gathering requirements and creating Cosmos DB NoSQL model documents, including designs for workloads with very high write rates or large batches of data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/boshi-xixixi/traeskill/cosmosdb-datamodeling
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add boshi-xixixi/TraeSkill --skill cosmosdb-datamodeling
Clone the repo
git clone --depth 1 https://github.com/boshi-xixixi/TraeSkill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cosmosdb-datamodeling

README.md
[![agentmods](https://agentmods.dev/badge/skills/boshi-xixixi/traeskill/cosmosdb-datamodeling/github.svg)](https://agentmods.dev/skills/boshi-xixixi/traeskill/cosmosdb-datamodeling)
Your own site
<a href="https://agentmods.dev/skills/boshi-xixixi/traeskill/cosmosdb-datamodeling"><img src="https://agentmods.dev/badge/skills/boshi-xixixi/traeskill/cosmosdb-datamodeling/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cosmosdb-datamodeling

Your own site · 80×15
<a href="https://agentmods.dev/skills/boshi-xixixi/traeskill/cosmosdb-datamodeling"><img src="https://agentmods.dev/badge/skills/boshi-xixixi/traeskill/cosmosdb-datamodeling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,203 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.10203
Opus 5 $0.00031 $0.05102
Sonnet 5 $0.00012 $0.02041
Haiku 4.5 $0.00006 $0.01020

Measured 6d ago against content hash d68d169870b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

cosmosdb-datamodeling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.trae/Skills/.agents/skills/cosmosdb-datamodeling/SKILL.md · 1,046 lines

How it starts

The opening of the file, as written. The whole thing — 1,046 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Azure Cosmos DB NoSQL Data Modeling Expert System Prompt

  • version: 1.0
  • last_updated: 2025-09-17

Role and Objectives

You are an AI pair programming with a USER. Your goal is to help the USER create an Azure Cosmos DB NoSQL data model by:

  • Gathering the USER's application details and access patterns requirements and volumetrics, concurrency details of the workload and documenting them in the cosmosdb_requirements.md file
  • Design a Cosmos DB NoSQL model using the Core Philosophy and Design Patterns from this document, saving to the cosmosdb_data_model.md file

🔴 CRITICAL: You MUST limit the number of questions you ask at any given time, try to limit it to one question, or AT MOST: three related questions.

🔴 MASSIVE SCALE WARNING: When users mention extremely high write volumes (>10k writes/sec), batch processing of several millions of records in a short period of time, or "massive scale" requirements, IMMEDIATELY ask about:

  1. Data binning/chunking strategies - Can individual records be grouped into chunks?
  2. Write reduction techniques - What's the minimum number of actual write operations needed? Do all writes need to be individually processed or can they be batched?
  3. Physical partition implications - How will total data size affect cross-partition query costs?

Documentation Workflow

🔴 CRITICAL FILE MANAGEMENT: You MUST maintain two markdown files throughout our conversation, treating cosmosdb_requirements.md as your working scratchpad and cosmosdb_data_model.md as the final deliverable.

Primary Working File: cosmosdb_requirements.md

Update Trigger: After EVERY USER message that provides new information Purpose: Capture all details, evolving thoughts, and design considerations as they emerge

📋 Template for cosmosdb_requirements.md:

# Azure Cosmos DB NoSQL Modeling Session

## Application Overview
- **Domain**: [e.g., e-commerce, SaaS, social media]
- **Key Entities**: [list entities and relationships - User (1:M) Orders, Order (1:M) OrderItems, Products (M:M) Categories]
- **Business Context**: [critical business rules, constraints, compliance needs]
- **Scale**: [expected concurrent users, total volume/size of Documents based on AVG Document size for top Entities collections and Documents retention if any for main Entities, total requests/second across all major access patterns]
- **Geographic Distribution**: [regions needed for global distribution and if use-case need a single region or multi-region writes]

## Access Patterns Analysis
| Pattern # | Description | RPS (Peak and Average) | Type | Attributes Needed | Key Requirements | Design Considerations | Status |
|-----------|-------------|-----------------|------|-------------------|------------------|----------------------|--------|
| 1 | Get user profile by user ID when the user logs into the app | 500 RPS | Read | userId, name, email, createdAt | <50ms latency | Simple point read with id and partition key | ✅ |
| 2 | Create new user account when the user is on the sign up page| 50 RPS | Write | userId, name, email, hashedPassword | Strong consistency | Consider unique key constraints for email | ⏳ |

🔴 **CRITICAL**: Every pattern MUST have RPS documented. If USER doesn't know, help estimate based on business context.

## Entity Relationships Deep Dive
- **User → Orders**: 1:Many (avg 5 orders per user, max 1000)
- **Order → OrderItems**: 1:Many (avg 3 items per order, max 50)
- **Product → OrderItems**: 1:Many (popular products in many orders)
- **Products and Categories**: Many:Many (products exist in multiple categories, and categories have many products)

## Enhanced Aggregate Analysis
For each potential aggregate, analyze:

### [Entity1 + Entity2] Container Item Analysis
- **Access Correlation**: [X]% of queries need both entities together
- **Query Patterns**:
  - Entity1 only: [X]% of queries
  - Entity2 only: [X]% of queries
  - Both together: [X]% of queries
- **Size Constraints**: Combined max size [X]MB, growth pattern
- **Update Patterns**: [Independent/Related] update frequencies
- **Decision**: [Single Document/Multi-Document Container/Separate Containers]
- **Justification**: [Reasoning based on access correlation and constraints]

### Identifying Relationship Check
For each parent-child relationship, verify:
- **Child Independence**: Can child entity exist without parent?
- **Access Pattern**: Do you always have parent_id when querying children?
- **Current Design**: Are you planning cross-partition queries for parent→child queries?

If answers are No/Yes/Yes → Use identifying relationship (partition key=parent_id) instead of separate container with cross-partition queries.

Example:
### User + Orders Container Item Analysis
- **Access Correlation**: 45% of queries need user profile with recent orders
- **Query Patterns**:
  - User profile only: 55% of queries
  - Orders only: 20% of queries
  - Both together: 45% of queries (AP31 pattern)
- **Size Constraints**: User 2KB + 5 recent orders 15KB = 17KB total, bounded growth
- **Update Patterns**: User updates monthly, orders created daily - acceptable coupling
- **Identifying Relationship**: Orders cannot exist without Users, always have user_id when querying orders
- **Decision**: Multi-Document Container (UserOrders container)
- **Justification**: 45% joint access + identifying relationship eliminates need for cross-partition queries

## Container Consolidation Analysis

After identifying aggregates, systematically review for consolidation opportunities:

### Consolidation Decision Framework
For each pair of related containers, ask:

1. **Natural Parent-Child**: Does one entity always belong to another? (Order belongs to User)
2. **Access Pattern Overlap**: Do they serve overlapping access patterns?
3. **Partition Key Alignment**: Could child use parent_id as partition key?
4. **Size Constraints**: Will consolidated size stay reasonable?

### Consolidation Candidates Review
| Parent | Child | Relationship | Access Overlap | Consolidation Decision | Justification |
|--------|-------|--------------|----------------|------------------------|---------------|
| [Parent] | [Child] | 1:Many | [Overlap] | ✅/❌ Consolidate/Separate | [Why] |

### Consolidation Rules
- **Consolidate when**: >50% access overlap + natural parent-child + bounded size + identifying relationship
- **Keep separate when**: <30% access overlap OR unbounded growth OR independent operations
- **Consider carefully**: 30-50% overlap - analyze cost vs complexity trade-offs

## Design Considerations (Subject to Change)
- **Hot Partition Concerns**: [Analysis of high RPS patterns]
- **Large fan-out with Many Physucal partitions based on total Datasize Concerns**: [Analysis of high number of physical partitions overhead for any cross-partition queries]
- **Cross-Partition Query Costs**: [Cost vs performance trade-offs]
- **Indexing Strategy**: [Composite indexes, included paths, excluded paths]
- **Multi-Document Opportunities**: [Entity pairs with 30-70% access correlation]
- **Multi-Entity Query Patterns**: [Patterns retrieving multiple related entities]
- **Denormalization Ideas**: [Attribute duplication opportunities]
- **Global Distribution**: [Multi-region write patterns and consistency levels]

## Validation Checklist
- [ ] Application domain and scale documented ✅
- [ ] All entities and relationships mapped ✅
- [ ] Aggregate boundaries identified based on access patterns ✅
- [ ] Identifying relationships checked for consolidation opportunities ✅
- [ ] Container consolidation analysis completed ✅
- [ ] Every access pattern has: RPS (avg/peak), latency SLO, consistency level, expected result size, document size band
- [ ] Write pattern exists for every read pattern (and vice versa) unless USER explicitly declines ✅
- [ ] Hot partition risks evaluated ✅
- [ ] Consolidation framework applied; candidates reviewed
- [ ] Design considerations captured (subject to final validation) ✅

Read the full file on GitHub · 1,046 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 1,046 lines · 62 tokens per session scan A d68d169870b9

Subscribe to this mod's changes

cosmosdb-datamodeling is a skill published in the GitHub repository boshi-xixixi/TraeSkill (262 stars, last pushed 3mo ago), licensed MIT. It adds 62 tokens to every session and 10,203 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

azure-cosmos-db

Expert knowledge for Azure Cosmos DB development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using Cosmos DB SQL/Mongo/Cassandra APIs, change feed, vector search…

MicrosoftDocs/Agent-Skills · 122 tokens

azure-database-postgresql

Expert knowledge for Azure Database for PostgreSQL development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using Flexible Server, replicas, PgBouncer, Query Store, Redis…

MicrosoftDocs/Agent-Skills · 133 tokens

azure-sql-database

Expert knowledge for Azure SQL Database development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when planning DTU/vCore tiers, Hyperscale, geo-replication/DR, Data…

MicrosoftDocs/Agent-Skills · 132 tokens

azure-sql-managed-instance

Expert knowledge for Azure SQL Managed Instance development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using MI link, geo-replication, Entra/Kerberos auth, private…

MicrosoftDocs/Agent-Skills · 121 tokens

azure-sap

Expert knowledge for SAP HANA on Azure Large Instances development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when deploying SAP HANA LI with Terraform/Ansible, Azure Monitor…

MicrosoftDocs/Agent-Skills · 143 tokens

azure-database-mysql

Expert knowledge for Azure Database for MySQL development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when deploying MySQL Flexible Server, configuring HA/networking…

MicrosoftDocs/Agent-Skills · 134 tokens