AI Skills for Coding Assistants
180 curated rules across 15+ categories
Teaching your AI pair programmer expert-level
Azure Cosmos DB best practices
Loading presentation... Click "Next" or press → to begin
Principal Product Manager @ Microsoft
13+ years in software — 4 years in Product Management, 9 years as a developer specializing in cloud platforms & databases.
🏆 Community Contributions:
🔗 Connect: sajeetharan.dev | @kokkisajee | github.com/sajeetharan
In the Agent-First world, your AI coding assistant isn't just autocomplete — it's an intelligent agent that can be extended with knowledge and tools:
| Extension Type | What It Does | Example |
|---|---|---|
| 🧠 Skills | Teach domain knowledge & best practices — auto-activates when relevant | Cosmos DB Agent Kit, security rules |
| 🔌 MCP Servers | Give agents access to external tools & data sources via Model Context Protocol | Query a database, call an API, read docs |
| 🧩 Plugins / Extensions | Add capabilities to the IDE or agent runtime | GitHub Copilot Extensions, VS Code extensions |
| 📋 Custom Instructions | Static rules loaded every time (the old way) | .cursorrules, CLAUDE.md, copilot-instructions.md |
💡 Why Skills Win:
agentskills install🔌 MCP + Skills = Supercharged Agents
MCP gives agents hands (tools to act). Skills give agents brains (knowledge to decide). Together, your AI assistant knows what to do AND how to do it right.
How we went from sharing config files to teaching AI agents with skills:
We shared .editorconfig, eslint.json, tsconfig.json — static rules that told tools what format to enforce, but never why or when.
Best practices lived in docs nobody read. "Follow this pattern for partition keys" — but your IDE never surfaced it at the right moment.
We stuffed rules into CLAUDE.md or .cursorrules — a giant blob of text loaded every time, whether relevant or not.
Modular, auto-activating knowledge packs. Skills load only when relevant. They teach your AI assistant domain expertise — just like hiring a specialist on demand.
💡 What are Skills?
From Anthropic's official docs: "Skills extend what Claude can do. Create a SKILL.md file with instructions, and Claude adds it to its toolkit. Claude uses skills when relevant, or you can invoke one directly."
Skills follow the open Agent Skills standard — works across GitHub Copilot, Claude Code, Cursor, Gemini CLI, and more!
👇 Audience Quiz! Look at this Cosmos DB code. What's wrong? (Raise your hand when you know!)
// Creating a container for an e-commerce app
const container = await database.containers.createIfNotExists({
id: "orders",
partitionKey: { paths: ["/id"] } // 🤔 Hmm...
});
// Querying all orders for a customer
const query = `SELECT * FROM c WHERE c.customerId = '${customerId}'`;
// Cross-partition query! 💸 Costs 10x more RUs
Let's address the elephant in the room — common misconceptions and real pain points:
🗣️ What developers say on Twitter/Reddit:
🔍 The Real Problem — It's Not Cosmos DB, It's the Configuration:
| Pain Point | Root Cause | Agent Kit Fix |
|---|---|---|
| 💸 High RU costs | Cross-partition queries, bad indexing | Rules catch these at code-time |
| 🐌 Slow queries | Missing composite indexes, full scans | Auto-suggests optimal indexes |
| 🔥 Hot partitions | Low-cardinality partition keys | Warns about poor key choices |
| 📈 Unpredictable scaling | Manual throughput, no autoscale | Recommends autoscale patterns |
| 🤯 Steep learning curve | Too many knobs to tune | 180 rules = instant expertise |
✅ The Truth: Cosmos DB is incredibly powerful — but only if configured right. The Agent Kit ensures your AI assistant guides you to the optimal setup from day one.
💡 Most "expensive" Cosmos DB deployments are just misconfigured ones.
180 curated rules across 15+ categories, each prioritized by real-world impact:
| Category | Priority | Focus Area |
|---|---|---|
| Data Modeling | Critical | Document structure & relationships |
| Partition Key Design | Critical | Effective partition key selection |
| Query Optimization | High | Reduce RU consumption |
| SDK Best Practices | High | Client init, retry logic, error handling |
| Design Patterns | High | LangGraph, change-feed, materialized views |
| Vector Search | High | Embeddings, index types, similarity queries |
| Full-Text Search | High | FTS indexing, BM25 ranking, hybrid search |
| Security | High | Secure access patterns |
| Indexing Strategies | Medium-High | Efficient index policies |
| Throughput & Scaling | Medium | Autoscale & capacity planning |
| Global Distribution | Medium | Multi-region writes & consistency |
| Developer Tooling | Medium | Build validation & emulator config |
| Monitoring & Diagnostics | Low-Medium | Logging, metrics, troubleshooting |
Install with a single command — that's it!
C:\COSMOS> npx skills add AzureCosmosDB/cosmosdb-agent-kit Installing Azure Cosmos DB Agent Kit... ✓ Downloaded 180 rules across 15+ categories ✓ Skill installed successfully ✓ Auto-activation enabled Ready! Your AI assistant now knows Cosmos DB best practices.
Prerequisites:
💡 Per-agent plugins also available:
| Claude Code | .claude-plugin/plugin.json |
| OpenAI Codex | .codex-plugin/plugin.json |
| Cursor | .cursor-plugin/plugin.json |
| Gemini CLI | gemini-extension.json |
| GitHub Copilot | SKILL.md (auto-detected) |
Skills activate automatically when relevant tasks are detected. Just ask naturally:
> Review my Cosmos DB data model for performance issues > Help me choose a partition key for my orders collection > Optimize this query that's consuming too many RUs > What's wrong with my Cosmos DB connection code?
📁 Skill Structure:
skills/cosmosdb-best-practices/ ├── SKILL.md # Triggers activation ├── AGENTS.md # Compiled rules (what agents read) ├── rules/ # Individual rule files │ ├── data-modeling.md │ ├── partition-keys.md │ ├── query-optimization.md │ ├── vector-search/ │ ├── full-text-search/ │ ├── design-patterns/ │ └── ... └── metadata.json # Version and metadata
💡 Key insight: The AI agent automatically loads relevant rules and applies them to your context. No manual configuration needed!
The Agent Kit identifies 4 critical issues in this common code pattern:
❌ Before (common anti-patterns):
// Creating new client on every request ← ANTI-PATTERN!
async function getProducts(category) {
const client = new CosmosClient({ endpoint, key });
// Using SELECT * pulls all properties ← WASTEFUL!
const query = `SELECT * FROM c WHERE c.category = '${category}'`;
// String concatenation ← INJECTION RISK!
const { resources } = await container.items.query(query).fetchAll();
return resources; // No error handling ← FRAGILE!
}
🛡️ Issues Detected:
✅ After (Agent Kit guided fix):
// Singleton client with retry policy
const client = new CosmosClient({
endpoint, key,
connectionPolicy: { retryOptions: { maxRetryAttemptCount: 5 } }
});
async function getProducts(category) {
const query = {
query: `SELECT c.id, c.name, c.price FROM c
WHERE c.category = @category`,
parameters: [{ name: '@category', value: category }]
};
try {
const { resources, requestCharge } = await container.items
.query(query).fetchAll();
console.log(`Query consumed ${requestCharge} RUs`);
return resources;
} catch (error) {
if (error.code === 429) { /* handle rate limiting */ }
throw error;
}
}
Built on the Agent Skills format — works with all major AI coding assistants:
| AI Assistant | Platform | Status |
|---|---|---|
| GitHub Copilot | VS Code, Visual Studio, JetBrains | ✅ Supported |
| Claude Code | Anthropic's coding assistant | ✅ Supported |
| Cursor | AI-first editor | ✅ Supported |
| Gemini CLI | Google's CLI assistant | ✅ Supported |
| OpenAI Codex | OpenAI's coding agent | ✅ Supported |
🔌 Any Agent Skills-compatible tool can use the kit — the format is open and extensible!
Let's see how the Cosmos DB Agent Kit works live in a real coding session:
// Developer writes this code...
const container = database.container("users");
const { resources } = await container.items
.query("SELECT * FROM c")
.fetchAll();
// 🤖 Agent Kit activates automatically...
// ⚠️ Rule: "Avoid SELECT * — specify only needed fields"
// ⚠️ Rule: "Use .fetchNext() with pagination for large datasets"
// ⚠️ Rule: "Always handle continuation tokens"
// ✅ Suggested fix provided inline...
🎯 What to watch for in the demo:
💡 Demo scenarios:
The Agent Kit is open source and actively maintained. Recent updates:
🤝 How to Contribute:
🔗 github.com/AzureCosmosDB/cosmosdb-agent-kit
⭐ Star us | 🍴 Fork | 📝 Contribute