{"id":12852,"date":"2026-09-21T00:00:11","date_gmt":"2026-09-21T07:00:11","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=12852"},"modified":"2026-09-16T06:46:38","modified_gmt":"2026-09-16T13:46:38","slug":"spec-driven-development-comes-to-azure-cosmos-db-the-first-database-extension-for-github-spec-kit","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/spec-driven-development-comes-to-azure-cosmos-db-the-first-database-extension-for-github-spec-kit\/","title":{"rendered":"Spec-Driven Development comes to Azure Cosmos DB: The First Database Extension for GitHub Spec Kit"},"content":{"rendered":"<p dir=\"auto\">AI coding agents can write much of an application&#8217;s code, but developers still need to review the decisions behind it. For a Cosmos DB application, that includes choosing partition keys, modeling access patterns, and configuring the client. Those decisions affect cost, performance, and reliability long after the code compiles.<\/p>\n<p dir=\"auto\">We&#8217;ve written before about how Azure Cosmos DB <a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/azure-cosmos-db-in-the-agentic-era-data-tools-for-developers-and-ai-agents\/\" rel=\"nofollow\">supports agents at query time<\/a>, with tools and guidance for exploring and querying data. Today we&#8217;re announcing the public preview of the <strong>Azure Cosmos DB extension for <a href=\"https:\/\/github.com\/github\/spec-kit\">GitHub Spec Kit<\/a><\/strong>, the first database extension in its ecosystem. It brings Cosmos DB guidance into <strong>spec-driven development<\/strong>, helping you and your coding agent work through application design before implementation.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<div class=\"markdown-heading\" dir=\"auto\"><\/div>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">What is spec-driven development?<\/h2>\n<\/div>\n<p dir=\"auto\">In spec-driven development (SDD), you work through requirements, design, and tasks before implementation. The agent produces a document at each stage that you can read, correct, and approve.<\/p>\n<p dir=\"auto\"><a href=\"https:\/\/github.com\/github\/spec-kit\">GitHub Spec Kit<\/a> is an open framework for this workflow, with commands for each stage:<\/p>\n<\/div>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/08\/sdd-loop.svg\"><img decoding=\"async\" class=\"alignnone wp-image-12854\" role=\"img\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/08\/sdd-loop.svg\" alt=\"Diagram showing the GitHub Spec Kit spec-driven development workflow: \/specify captures requirements, \/plan defines architecture and data modeling, \/tasks breaks the plan into actionable work, and \/implement generates code, with developers reviewing and refining each stage before moving forward.\" width=\"1200\" height=\"420\" \/><\/a><\/p>\n<ul dir=\"auto\">\n<li><strong><code>\/specify<\/code><\/strong>: capture what you&#8217;re building and why in a specification.<\/li>\n<li><strong><code>\/plan<\/code><\/strong>: turn the spec into an architecture and a data model. This is where database decisions get made.<\/li>\n<li><strong><code>\/tasks<\/code><\/strong>: break the plan into ordered, verifiable units of work.<\/li>\n<li><strong><code>\/implement<\/code><\/strong>: generate the code, task by task, against that plan.<\/li>\n<\/ul>\n<p dir=\"auto\">For example, you can check whether the proposed partition key supports your busiest queries while reviewing the plan. Changing it there is usually simpler than reworking the data layer after implementation. You decide when the plan is ready, then review the code and tests the agent produces.<\/p>\n<p dir=\"auto\">Spec Kit also supports extensions that add domain-specific commands and hooks to this workflow.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 dir=\"auto\" tabindex=\"-1\"><\/h2>\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">From general-purpose to Cosmos-aware<\/h2>\n<\/div>\n<p dir=\"auto\">Spec Kit is database-agnostic. Without an extension, its database recommendations depend on the model&#8217;s existing knowledge and the context you supply. The Cosmos DB extension adds guidance on partitioning, RU costs, point reads, indexing, and resilient client configuration.<\/p>\n<p dir=\"auto\">It complements the <a href=\"https:\/\/github.com\/AzureCosmosDB\/cosmosdb-agent-kit\">Cosmos DB Agent Kit skills<\/a> by making Cosmos DB guidance available through Spec Kit commands and implementation hooks.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/08\/extension-plug-in.svg\"><img decoding=\"async\" class=\"alignnone wp-image-12855 size-full\" role=\"img\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/08\/extension-plug-in.svg\" alt=\"Diagram titled \u201cWhere the extension plugs in\u201d showing an AI coding agent flowing through GitHub Spec Kit into the Azure Cosmos DB extension and then Azure Cosmos DB. The extension adds best-practice code generation, design guidance, and automated review, with support for agents including Copilot, Claude Code, Codex, Cursor, and Gemini. A footer highlights point reads, partition-aware queries, managed identity, and resilient clients as patterns generated by default.\" width=\"1200\" height=\"460\" \/><\/a><\/p>\n<p dir=\"auto\">The extension provides:<\/p>\n<ul dir=\"auto\">\n<li><strong>Code-generation commands<\/strong> for point reads, partition-aware and parameterized queries, managed-identity authentication, resilient clients, and other Cosmos DB patterns.<\/li>\n<li><strong>Data-modeling guidance<\/strong> to help you choose containers and partition keys based on how the application reads and writes data.<\/li>\n<li><strong>An advisor before implementation.<\/strong> The <code>before_implement<\/code> hook selects the relevant patterns and includes their best-practice rules directly in the implementation context.<\/li>\n<li><strong>A review after implementation.<\/strong> The <code>after_implement<\/code> hook instructs the agent to check the generated code against Cosmos DB guidance, fix the issues it identifies, and check again. You should still review and test the result.<\/li>\n<\/ul>\n<p dir=\"auto\">The extension works with compatible Spec Kit agents, including GitHub Copilot, Claude Code, Codex, Cursor, and Gemini CLI, and can be used alongside other extensions.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 dir=\"auto\" tabindex=\"-1\"><\/h2>\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">Make it your team&#8217;s own, with presets<\/h2>\n<\/div>\n<p dir=\"auto\">Your team may also have naming standards, preferred SDK patterns, security requirements, and review steps. Spec Kit&#8217;s <strong>presets<\/strong> let you add these conventions to the workflow without forking the Cosmos DB extension.<\/p>\n<p dir=\"auto\">See the <a href=\"https:\/\/github.com\/github\/spec-kit\/blob\/main\/docs\/reference\/presets.md\">Spec Kit preset guide<\/a> for installation instructions, template customization, and managing priorities when combining presets.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/08\/presets.svg\"><img decoding=\"async\" class=\"alignnone wp-image-12856 size-full\" role=\"img\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/08\/presets.svg\" alt=\"Diagram titled \u201cCustomize with a preset, without forking\u201d showing how an organization\u2019s preset layers on top of the Azure Cosmos DB extension. The preset can add or override naming rules, SDK patterns, security baselines, regions, and review gates while still receiving extension updates. On the right, the customized spec-driven development flow shows \/specify, \/plan, and \/implement, with team standards inherited automatically and human review at each gate.\" width=\"1200\" height=\"500\" \/><\/a><\/p>\n<p dir=\"auto\">With a preset you can:<\/p>\n<ul dir=\"auto\">\n<li><strong>Wrap or override command templates<\/strong> to include your team&#8217;s requirements in planning and implementation.<\/li>\n<li><strong>Customize a shared workflow<\/strong> that uses the Cosmos DB extension alongside other extensions.<\/li>\n<li><strong>Maintain your customizations separately from the extension<\/strong>, making it easier to adopt updates without maintaining a fork. Overrides still need review when the underlying commands change.<\/li>\n<\/ul>\n<p dir=\"auto\">A platform team could publish a preset that adds approved regions and authentication requirements to the planning template, for example. Developers who install that preset would have those requirements available when they run the command.<\/p>\n<p dir=\"auto\">The documents and code still need your review. A preset supplies shared instructions; it doesn&#8217;t enforce compliance with your team&#8217;s policies.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 dir=\"auto\" tabindex=\"-1\"><\/h2>\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">We measured it<\/h2>\n<\/div>\n<p dir=\"auto\">We evaluated both the generated code&#8217;s adherence to Cosmos DB best practices and the results of building complete applications.<\/p>\n<p dir=\"auto\"><strong>Best-practice checks.<\/strong> We compared code generated with and without the extension&#8217;s guidance across models, languages, and complexity levels. The checks covered client application-name configuration, point reads using an ID and partition key, handling a 404 as a missing item, parameterized and partition-scoped queries, ETags, transactional batches, keyless authentication, and partition-key design.<\/p>\n<ul dir=\"auto\">\n<li>With the guidance applied, the average pass rate improved by <strong>0.10<\/strong>, or about <strong>10 percentage points<\/strong>, with improvements in <strong>19 of 24<\/strong> test combinations. Results were also more consistent between runs.<\/li>\n<li>The largest gain was in setting the client application-name: <strong>+0.79<\/strong> in pass rate. Tests of individual best-practice commands showed gains of <strong>+0.14 to +0.37<\/strong>. Models that already followed the guidance had less room to improve.<\/li>\n<li>We also tuned the advisor&#8217;s command recommendations, improving precision from <strong>0.57 to 0.68<\/strong>.<\/li>\n<\/ul>\n<p dir=\"auto\">These tests show that supplying the guidance improved adherence to the best practices we checked. They don&#8217;t establish that every command produces correct code in every application.<\/p>\n<p dir=\"auto\"><strong>End-to-end application tests.<\/strong> When agents ran the full workflow autonomously, they often skipped the recommended Cosmos DB commands and wrote the data layer without that guidance. That finding led to the changes in <strong>v0.2.0<\/strong>: the advisor now includes the relevant rules directly in the implementation context, and both the advisor and review hooks are configured as non-optional. The review also instructs the agent to apply fixes and recheck the code.<\/p>\n<p dir=\"auto\">The updated extension scored modestly higher on average than the previous version for both models with usable results, although the uncertainty leaves room for no improvement. It performed roughly on par with Spec Kit alone and remained below the agent working without Spec Kit in those autonomous tests. A third model produced no usable scores because of agent runtime failures. These tests did not measure the effect of human review at each stage.<\/p>\n<p dir=\"auto\">The clearest measured benefit so far is improved <strong>best-practice conformance when the guidance is supplied<\/strong>. The application tests helped us improve how that guidance reaches the agent, but they don&#8217;t yet demonstrate a broader end-to-end advantage.<\/p>\n<p dir=\"auto\">See the <a href=\"https:\/\/github.com\/AzureCosmosDB\/spec-kit-cosmosdb\/blob\/main\/EFFICACY.md\">efficacy note<\/a> for the methodology, results, and limitations.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 dir=\"auto\" tabindex=\"-1\"><\/h2>\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">How it fits with other Cosmos DB tools<\/h2>\n<\/div>\n<p dir=\"auto\">The Spec Kit extension adds application planning and implementation guidance to the existing Cosmos DB tools for coding agents:<\/p>\n<ul dir=\"auto\">\n<li><strong>Tools and MCP integrations<\/strong>, through the <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/vscode-extension\/overview\" rel=\"nofollow\">Azure Cosmos DB extension for VS Code<\/a> and the optional MCP mode in <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/shell\/overview\" rel=\"nofollow\">Azure Cosmos DB Shell<\/a>, let agents explore and query data within the permissions you grant.<\/li>\n<li><strong><a href=\"https:\/\/github.com\/AzureCosmosDB\/cosmosdb-agent-kit\">Agent Kit skills<\/a><\/strong> provide Cosmos DB knowledge for everyday coding tasks.<\/li>\n<li><strong>The <a href=\"https:\/\/github.com\/AzureCosmosDB\/spec-kit-cosmosdb\">Spec Kit extension<\/a><\/strong> adds Cosmos DB commands and hooks to a workflow with specifications, plans, implementation tasks, and code review.<\/li>\n<\/ul>\n<p dir=\"auto\"><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/08\/maturity-ladder.svg\"><img decoding=\"async\" class=\"alignnone wp-image-12853 size-full\" role=\"img\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2026\/08\/maturity-ladder.svg\" alt=\"Diagram titled \u201cCosmos DB meets agents across the whole workflow\u201d showing three complementary ways Azure Cosmos DB supports AI agents: Explore &amp; query with the VS Code extension, tools, and MCP; Everyday coding knowledge with Agent Kit skills for modeling, partitioning, and RU-aware queries; and Design &amp; build whole apps with the Spec Kit extension for spec-driven development. A footer emphasizes using agents from query time through build time, with a human in the loop throughout.\" width=\"1200\" height=\"460\" \/><\/a><\/p>\n<p dir=\"auto\">You can use these together or choose the ones that fit your work. The extension is intended for projects where you want to document and review application design as part of the coding workflow.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 dir=\"auto\" tabindex=\"-1\"><\/h2>\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">Try it<\/h2>\n<\/div>\n<p dir=\"auto\">The extension is in <strong>public preview<\/strong> and installs in one line. From a project using Spec Kit&#8217;s <code>specify<\/code> CLI:<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\">\n<pre>specify extension add cosmosdb --from https:\/\/github.com\/AzureCosmosDB\/spec-kit-cosmosdb\/archive\/refs\/tags\/v0.2.0.zip<\/pre>\n<div class=\"zeroclipboard-container\"><\/div>\n<\/div>\n<p dir=\"auto\">Then work through the Spec Kit flow (<code>\/specify<\/code>, <code>\/plan<\/code>, <code>\/tasks<\/code>, <code>\/implement<\/code>), reviewing the proposed data model and the generated code along the way.<\/p>\n<ul dir=\"auto\">\n<li><strong>Repository:<\/strong> <a href=\"https:\/\/github.com\/AzureCosmosDB\/spec-kit-cosmosdb\">github.com\/AzureCosmosDB\/spec-kit-cosmosdb<\/a><\/li>\n<li><strong>GitHub Spec Kit:<\/strong> <a href=\"https:\/\/github.com\/github\/spec-kit\">github.com\/github\/spec-kit<\/a><\/li>\n<li><strong>Cosmos DB Agent Kit (best-practice skills for everyday coding):<\/strong> <a href=\"https:\/\/github.com\/AzureCosmosDB\/cosmosdb-agent-kit\">github.com\/AzureCosmosDB\/cosmosdb-agent-kit<\/a><\/li>\n<\/ul>\n<p dir=\"auto\">Command names and behavior may change during preview. Try it on a workload you know and <a href=\"https:\/\/github.com\/AzureCosmosDB\/spec-kit-cosmosdb\/issues\">open an issue<\/a> with examples of missing guidance, incorrect recommendations, or code that needed fixing. Include the agent and model you used so we can investigate.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 dir=\"auto\" tabindex=\"-1\"><\/h2>\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">About Azure Cosmos DB<\/h2>\n<\/div>\n<p dir=\"auto\">Azure Cosmos DB is a fully managed and serverless NoSQL and vector database for modern app development, including AI applications. With its SLA-backed speed and availability as well as instant dynamic scalability, it is ideal for real-time NoSQL and MongoDB applications that require high performance and global distribution.<\/p>\n<p dir=\"auto\">To stay in the loop on Azure Cosmos DB updates, follow us on <a href=\"https:\/\/twitter.com\/AzureCosmosDB\" rel=\"nofollow\">X<\/a>, <a href=\"https:\/\/aka.ms\/AzureCosmosDBYouTube\" rel=\"nofollow\">YouTube<\/a>, and <a href=\"https:\/\/www.linkedin.com\/company\/azure-cosmos-db\/\" rel=\"nofollow\">LinkedIn<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI coding agents can write much of an application&#8217;s code, but developers still need to review the decisions behind it. For a Cosmos DB application, that includes choosing partition keys, modeling access patterns, and configuring the client. Those decisions affect cost, performance, and reliability long after the code compiles. We&#8217;ve written before about how Azure [&hellip;]<\/p>\n","protected":false},"author":9387,"featured_media":12857,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14],"tags":[],"class_list":["post-12852","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-sql-api"],"acf":[],"blog_post_summary":"<p>AI coding agents can write much of an application&#8217;s code, but developers still need to review the decisions behind it. For a Cosmos DB application, that includes choosing partition keys, modeling access patterns, and configuring the client. Those decisions affect cost, performance, and reliability long after the code compiles. We&#8217;ve written before about how Azure [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/12852","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/9387"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=12852"}],"version-history":[{"count":3,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/12852\/revisions"}],"predecessor-version":[{"id":12967,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/12852\/revisions\/12967"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/12857"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=12852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=12852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=12852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}